Blame | Last modification | View Log | Download | RSS feed
This file is intended to be a short guide for getting AS compiled ona Unix-like operating system. If you are interested in a more in-depthdiscussion of the source code of AS, take a look in the appropriate chapterof the AS user's manual (german resp. english version located in the doc_DE/resp. doc_EN/ subdirectory). I highly recommend reading this chapter beforeyou make extensions or modifications to the source code.The installation process consists of the following steps:(1) see if there are additional README files for your platform(2) create a Makefile.def(3) compile(4) execute the test suite(5) build the documentation(6) install into the system directoriesStep (1):On some (especially non-Unix) platforms, some additional preliminariesare needed:--> If you do not have a C compiler conforming to the ANSI standard,take a look into 'README.KR'.--> For MS-DOS and OS/2 platforms, additionally read README.DOS resp.README.OS2Step (2):Settings that may vary from platform to platform are located in a filecalled 'Makefile.def'. Your task is either to select an approriate filefrom the 'Makefile.def-samples' directory, or to create an own one. I knowthis is a bit tedious process, and one day I will probably replace thisscheme with an autoconf-style configuration, but for now we will have tolive with it. A good starting point for a gcc-based, 'normal' Unix systemis the file 'Makefile.def.tmpl'. The settings to make include:- A couple of helper tools are created during the build process. To buildthem, the following variables must be set:- CC: The C compiler used to compile sources into objects- CFLAGS: Any additional flags to be passed to the compiler. This mayinclude optimization level or warning/error verbosity.- OBJDIR: If you like having objects and executables in a separatedirectory, specify it via this variable. A trailing slash is required,e.g. you have to write 'obj/' instead of 'obj'.- HOST_OBJEXTENSION: the file extension used for object files. On aUnix-like system, this is typically '.o', but non-Unix systems may useother extensions like '.obj'.- LD: The linker used to create executables form objects. On a Unixsystem, this is the same as $(CC).- LDFLAGS: Any libraries or flags possibly needed for the linker.- HOST_EXEXTENSION: the file extension used for executables. On a Unixsystem, this variable is typically left empty. Other systems mayrequire a settling like '.exe'.- There is another set of these variables: TARG_OBJDIR, TARG_CC, TARG_CFLAGS,TARG_OBJEXTENSION, TARG_LD, TARG_LDFLAGS, TARG_EXEXTENSION. They are usedto build the actual assembler and tool binaries. The distinction is neededbecause cross-builds are supported, i.e. you are on system X and want tobuild binaries for system Y. In case you do not want to cross-build, youmay set them to the same values as the 'host-related' variables. The fileMakefile.def.tmpl demonstrates how to do this.- There is another variable TARG_RUNCMD. If you are cross-building and thereis a way to run the built binaries on the host system (like an emulator),define it here as a command prefix. For instance, if you have built Windowsbinaries on a Linux system, set TARG_RUNCMD to 'wine' and you will be ableto run the 'make test' target.- BINDIR, INCDIR, MANDIR, LIBDIR, DOCDIR: directiories where AS should beplaced after compilation. LIBDIR is only needed if you are using external(loaded at runtim) MSG files, which is currently only the case for DOS.- TEX2DOC_FLAGS: in case you are cross-building, you may want to generatethe plaintext version of the manual in a character set appropriate for thetarget system. You may a '-codepage xxx' option in this variable to overridethe character set detected on the host system. xxx may be one of ascii,iso8859-1, iso8859-15, koi8-r, 437, 850, 866, 1251, 1252, or utf-8.Step (3):Compilation should be a simple matter of saying 'make' and waiting...depending on your machine, compliation time can be between a few minutes(a modern Pentium-based PC or a fast Alpha) and a day (VAXstation 2000).A few compilers (like newer egcs releases or Borland-C) are known togenerate a lot of warnings about ambigious statements or unused parameters.I will try to eliminate them when time permits, but I have no high priorityfor doing this since they are harmless.If you are compiling AS for a new platform, you will probably run intoan error message saying that you have to edit 'sysdefs.h'. This filecollects information about the anomalies and specialities of certainsystems. The include file detects a system by querying macros the compilerpredefines and makes the appropriate definitions. The file is sorted by1. processor architecture2. manufacturer3. operating systemFind out the preprocessor symbols your compiler defines, make a new sectionin 'sysdefs.h' and send it to me so I can include it in the next release ofAS!Step (4):Type 'make test' and the freshly compiled AS will be run on a couple oftest programs. For each program, the output is compared to a referencebinary included in the distribution. The binary output has to match*exactly*, i.e. there must not be any difference. Any failed test reportedby the script has to be investigated, even if it happens for a targetplatform you never intend to use!Step (5):The documentation of AS is distributed in LaTeX format. I chose this formatbecause TeX is available on about any platform suitable for AS I can thinkof. Other formats are created by typing 'make docs': simple ASCII, HTML,and Postscript. You need a TeX distribution including dvips for the latter,while converters to ASCII and HTML are included.Step (6):Type 'make install'. Depending on the target directories you chose in Step(1), you may have to acquire root privileges to install AS.Have fun!Alfred Arnold, alfred@ccac.rwth-aachen.de