Go to the first, previous, next, last section, table of contents.

Example: different srcdir and objdir

The concept of different source and build directories comes from the practice of building the same toolkit for several different platforms, in a heterogeneous environment. It is often convenient to keep object files separate from the sources from which they were derived. For more discussion, see section Source and Build Directories.

This example shows different source and object directories only. The defaults for this example are as follows (the release is shown as `94q4'):

prefix       /usr/cygnus/progressive-94q4
exec-prefix  /usr/cygnus/progressive-94q4/H-hosttype
                 (we show the hosttype as `sparc-sun-sunos4.1.3')
target       nonexistent by default; cross example uses `m68k-coff'
srcdir       example shows `/usr/local/src'
objdir       example shows `/usr/local/obj/native' and
                                 `/usr/local/obj/m68k-coff'
release      shown on distribution tape (example uses `94q4')

The native and cross examples show a complete walk-through for each type of build. (The only difference is the use of the `--target' option to configure for a cross-development toolkit. We'll use `m68k-coff' as an example for building a cross-development toolkit.)

Note: The use of `--srcdir' is redundant, as the default source directory is the one in which configure itself resides. We show it here for the purposes of the example. Builds are shown independently; for an example of a simultaneous build, see section Multiple simultaneous builds. This option is only supported when you use GNU make.

Native: @let@nonarrowing=@comment

$ cd /usr/local/obj/native
$ /usr/local/src/configure --srcdir=/usr/local/src
Configuring for a sparc-sun-sunos4.1.3_U1 host.
...time passes...
$ make all info > ./make.log
...time passes...
$ su        (may need root priviledge to install in `/usr')
# mkdir /usr/cygnus/progressive-94q4
# make install install-info >> ./make.log
# ln -s /usr/cygnus/progressive-94q4 /usr/cygnus/progressive
# ln -s /usr/cygnus/progressive/H-sparc-sun-sunos4.1.3 /usr/progressive
# exit
$ ls /usr/progressive/bin
ar              gcov            objdump
as              gdb             patch
byacc           genclass        ranlib
c++             gperf           sdiff
c++filt         gprof           send-pr
cmp             info            size
diff            install-sid     sparc-sun-sunos4.1.3-gcc
diff3           ld              strings
flex            make            strip
g++             makeinfo        texi2dvi
gasp            nm              texindex
gcc             objcopy         

Cross:

$ cd /usr/local/obj/m68k-coff
$ /usr/local/src/configure --target=m68k-coff \
    --srcdir=/usr/local/src
Configuring for a sparc-sun-sunos4.1.3_U1 host.
...time passes...
$ make all info > ./make.log
...time passes...
$ su        (may need root priviledge to install in `/usr')
# mkdir /usr/cygnus/progressive-94q4
# make install install-info >> ./make.log
# ln -s /usr/cygnus/progressive-94q4 /usr/cygnus/progressive
# ln -s /usr/cygnus/progressive/H-sparc-sun-sunos4.1.3 /usr/progressive
# exit
$ ls /usr/progressive/bin
byacc     install-sid        m68k-coff-gdb      m68k-coff-strip
cmp       m68k-coff-ar       m68k-coff-ld       make
diff      m68k-coff-as       m68k-coff-nm       makeinfo
diff3     m68k-coff-c++      m68k-coff-objcopy  patch
flex      m68k-coff-c++filt  m68k-coff-objdump  sdiff
gcov      m68k-coff-g++      m68k-coff-ranlib   send-pr
genclass  m68k-coff-gasp     m68k-coff-size     texi2dvi
info      m68k-coff-gcc      m68k-coff-strings  texindex

@let@nonarrowing=@relax

In either of the above examples, you must set your PATH to include `/usr/progressive/bin' in order to access the tools easily.


Go to the first, previous, next, last section, table of contents.