[617118d] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
| 3 | ### COREUTILS BINARIES ###
|
---|
| 4 |
|
---|
| 5 | # NOTE: Here we are only creating a small subset of the coreutils binaries.
|
---|
| 6 |
|
---|
| 7 | cd ${SRC}
|
---|
| 8 | LOG=coreutils-buildhost.log
|
---|
| 9 |
|
---|
| 10 | unpack_tarball coreutils-${COREUTILS_VER}
|
---|
| 11 | cd ${PKGDIR}
|
---|
| 12 |
|
---|
| 13 | # If we don't want to conform to POSIX 200212L, override
|
---|
| 14 | # NOTE: This is coreutils 5.0 specific, later versions will have
|
---|
| 15 | # a configure/compile time option
|
---|
| 16 | case ${COREUTILS_VER} in
|
---|
| 17 | 5.1.7 | 5.[2-9]* ) ;;
|
---|
| 18 | * ) mv lib/posixver.c lib/posixver.c-ORIG
|
---|
| 19 | sed '/\/\* The POSIX version that utilities should conform to/i\
|
---|
| 20 | #undef _POSIX2_VERSION\
|
---|
| 21 | #define _POSIX2_VERSION 199209L\
|
---|
| 22 | ' lib/posixver.c-ORIG > lib/posixver.c
|
---|
| 23 | ;;
|
---|
| 24 | esac
|
---|
| 25 |
|
---|
| 26 | max_log_init Coreutils ${COREUTILS_VER} "buildhost echo (shared)" ${CONFLOGS} ${LOG}
|
---|
| 27 | CC="${CC-gcc}" \
|
---|
| 28 | CFLAGS="-O2 -pipe" \
|
---|
| 29 | DEFAULT_POSIX2_VERSION=199209 \
|
---|
| 30 | ./configure --prefix=${HST_TOOLS} \
|
---|
| 31 | --disable-nls \
|
---|
| 32 | >> ${LOGFILE} 2>&1 &&
|
---|
| 33 | echo " o Configure OK" &&
|
---|
| 34 |
|
---|
| 35 | min_log_init ${BUILDLOGS} &&
|
---|
| 36 | make ${PMFLAGS} LDFLAGS="-s" -C lib \
|
---|
| 37 | >> ${LOGFILE} 2>&1 || barf
|
---|
| 38 |
|
---|
| 39 | case ${COREUTILS_VER} in
|
---|
| 40 | 5.2* )
|
---|
| 41 | # coreutils-5.2.1+ - Create localedir.h
|
---|
| 42 | make ${PMFLAGS} LDFLAGS="-s" -C src localedir.h
|
---|
| 43 | >> ${LOGFILE} 2>&1 || barf
|
---|
| 44 | ;;
|
---|
| 45 | esac
|
---|
| 46 |
|
---|
| 47 | # glibc build gets upset by systems with a non BSDish echo program which
|
---|
| 48 | # always expands \n regardless if it is contained inside single quotes.
|
---|
| 49 | # (solaris)
|
---|
| 50 |
|
---|
| 51 | # NOTE: building echo doesn't solve this issue when echo is issued from
|
---|
| 52 | # make, as make invokes /bin/sh which for some reason doesn't use
|
---|
| 53 | # what you would expect to be the first echo in PATH.
|
---|
| 54 | # This is avoided later by passing SHELL="bash" to affected makes
|
---|
| 55 | # to force use of bash's internal echo
|
---|
| 56 |
|
---|
| 57 | make ${PMFLAGS} LDFLAGS="-s" -C src echo \
|
---|
| 58 | >> ${LOGFILE} 2>&1 &&
|
---|
| 59 |
|
---|
| 60 | # Fix issues with binutils brokenness when it cannot find a working
|
---|
| 61 | # bsd compatible install on the system
|
---|
| 62 | # (solaris)
|
---|
| 63 |
|
---|
| 64 | make ${PMFLAGS} LDFLAGS="-s" -C src ginstall \
|
---|
| 65 | >> ${LOGFILE} 2>&1 &&
|
---|
| 66 |
|
---|
| 67 |
|
---|
| 68 | # During kernel headers install, solaris expr causes a syntax error.
|
---|
| 69 |
|
---|
| 70 | make ${PMFLAGS} LDFLAGS="-s" -C src expr \
|
---|
| 71 | >> ${LOGFILE} 2>&1 &&
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | # ensure we have a cp which takes -a ( -dpR)
|
---|
| 75 |
|
---|
| 76 | make ${PMFLAGS} LDFLAGS="-s" -C src cp \
|
---|
| 77 | >> ${LOGFILE} 2>&1 &&
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | # ensure we have a ln which properly handles -sf
|
---|
| 81 | # (on solaris it errors out if name of link being created already exists)
|
---|
| 82 |
|
---|
| 83 | make ${PMFLAGS} LDFLAGS="-s" -C src ln \
|
---|
| 84 | >> ${LOGFILE} 2>&1 &&
|
---|
| 85 |
|
---|
| 86 | echo " o Build OK" &&
|
---|
| 87 |
|
---|
| 88 | cp -p src/echo ${HST_TOOLS}/bin/echo &&
|
---|
| 89 | cp -p src/ginstall ${HST_TOOLS}/bin/install &&
|
---|
| 90 | cp -p src/expr ${HST_TOOLS}/bin/expr &&
|
---|
| 91 | cp -p src/cp ${HST_TOOLS}/bin/cp &&
|
---|
| 92 | cp -p src/ln ${HST_TOOLS}/bin/ln &&
|
---|
| 93 | echo " o Install OK"
|
---|
| 94 |
|
---|