autoconf: Multiple Architectures
1
1 16.3 Compiling For Multiple Architectures
1 =========================================
1
1 You can compile the package for more than one kind of computer at the
1 same time, by placing the object files for each architecture in their
1 own directory. To do this, you can use GNU `make'. `cd' to the
1 directory where you want the object files and executables to go and run
1 the `configure' script. `configure' automatically checks for the
1 source code in the directory that `configure' is in and in `..'. This
1 is known as a "VPATH" build.
1
1 With a non-GNU `make', it is safer to compile the package for one
1 architecture at a time in the source code directory. After you have
1 installed the package for one architecture, use `make distclean' before
1 reconfiguring for another architecture.
1
1 On MacOS X 10.5 and later systems, you can create libraries and
1 executables that work on multiple system types--known as "fat" or
1 "universal" binaries--by specifying multiple `-arch' options to the
1 compiler but only a single `-arch' option to the preprocessor. Like
1 this:
1
1 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
1 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
1 CPP="gcc -E" CXXCPP="g++ -E"
1
1 This is not guaranteed to produce working output in all cases, you
1 may have to build one architecture at a time and combine the results
1 using the `lipo' tool if you have problems.
1