diff --git a/tools/lib32/build32.sh b/tools/lib32/build32.sh index f6eed16efb24..b08a02051332 100644 --- a/tools/lib32/build32.sh +++ b/tools/lib32/build32.sh @@ -11,41 +11,63 @@ # XXX installation of includes. ie: it will re-install some files in # XXX /usr/include for you. -mkdir /lib32 -mkdir /usr/lib32 -mkdir /usr/local/lib32 -mkdir /usr/X11R6/lib32 +mkdir -p /lib32 +mkdir -p /usr/lib32 +mkdir -p /usr/local/lib32 +mkdir -p /usr/X11R6/lib32 + +export MAKEOBJDIRPREFIX=/tmp/i386 +mkdir -p $MAKEOBJDIRPREFIX # Set up an obj tree -chflags -R noschg /tmp/i386 -rm -rf /tmp/i386 +chflags -R noschg $MAKEOBJDIRPREFIX +rm -rf $MAKEOBJDIRPREFIX +mkdir -p $MAKEOBJDIRPREFIX CCARGS="-m32 -march=athlon-xp -msse2 -mfancy-math-387 -I/tmp/i386/root/usr/include -L/usr/lib32 -B/usr/lib32" CXXARGS="-m32 -march=athlon-xp -msse2 -mfancy-math-387 -I/tmp/i386/root/usr/include/c++/3.3 -I/tmp/i386/root/usr/include -L/usr/lib32 -B/usr/lib32" # and a place to put the alternate include tree into. -mkdir -p /tmp/i386/root -make -s MAKEOBJDIRPREFIX=/tmp/i386 DESTDIR=/tmp/i386/root MACHINE_ARCH=i386 hierarchy +mkdir -p $MAKEOBJDIRPREFIX/root + +export MACHINE_ARCH=i386 +export DESTDIR=$MAKEOBJDIRPREFIX/root + +make -s hierarchy # Now build includes -make -s MAKEOBJDIRPREFIX=/tmp/i386 DESTDIR=/tmp/i386/root MACHINE_ARCH=i386 obj -make -s MAKEOBJDIRPREFIX=/tmp/i386 DESTDIR=/tmp/i386/root MACHINE_ARCH=i386 includes +make -s obj +make -s includes + +unset MACHINE_ARCH +unset DESTDIR # libncurses needs a build-tools pass first. I wish build-tools was a recursive target. -(cd lib/libncurses; make -s MAKEOBJDIRPREFIX=/tmp/i386 build-tools) +(cd lib/libncurses; make -s build-tools) # Now the libraries. This doesn't work for gnuregex yet. hence -k. # libbind is just an internal target, ignore it. -make -s -DNO_BIND -DNOMAN -DNODOC -DNOINFO MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc $CCARGS" CXX="c++ $CXXARGS" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" -k libraries +export LIBDIR=/usr/lib32 +export SHLIBDIR=/usr/lib32 +export MACHINE_ARCH=i386 +export CC="cc $CCARGS" +export CXX="c++ $CXXARGS" +export LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" +make -s -DNO_BIND -DNOMAN -DNODOC -DNOINFO -k libraries # Hack to fix gnuregex which does hacks to the -I path based on $DESTDIR. But, we cannot # use DESTDIR during the libraries target, because we're just using alternate includes, not # an alternate install directory. -(cd gnu/lib/libregex; make -s -DNOMAN -DNODOC -DNOINFO MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc -I/tmp/i386/root/usr/include/gnu $CCARGS" CXX="c++ $CXXARGS" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" all install) +unset CC +export CC="cc -I/tmp/i386/root/usr/include/gnu $CCARGS" +(cd gnu/lib/libregex; make -k -DNOMAN -DNODOC -DNOINFOall install) # and now that we have enough libraries, build ld-elf32.so.1 cd libexec/rtld-elf -make -s -DNOMAN -DNODOC -DNOINFO PROG=ld-elf32.so.1 MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc $CCARGS -DCOMPAT_32BIT" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" obj -make -s -DNOMAN -DNODOC -DNOINFO PROG=ld-elf32.so.1 MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc $CCARGS -DCOMPAT_32BIT" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" depend -make -s -DNOMAN -DNODOC -DNOINFO PROG=ld-elf32.so.1 MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc $CCARGS -DCOMPAT_32BIT" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" -make -s -DNOMAN -DNODOC -DNOINFO PROG=ld-elf32.so.1 MAKEOBJDIRPREFIX=/tmp/i386 LIBDIR=/usr/lib32 SHLIBDIR=/usr/lib32 MACHINE_ARCH=i386 CC="cc $CCARGS -DCOMPAT_32BIT" LD="ld -m elf_i386_fbsd -Y P,/usr/lib32" install +export PROG=ld-elf32.so.1 +unset CC +export CC="cc $CCARGS -DCOMPAT_32BIT" +make -s -DNOMAN -DNODOC -DNOINFO -k obj +make -s -DNOMAN -DNODOC -DNOINFO -k depend +make -s -DNOMAN -DNODOC -DNOINFO -k +make -s -DNOMAN -DNODOC -DNOINFO -k install