source: scripts/host-scripts/host-coreutils-binaries.sh@ 17c4d95

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 17c4d95 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 2.6 KB
Line 
1#!/bin/bash
2
3### COREUTILS BINARIES ###
4
5# NOTE: Here we are only creating a small subset of the coreutils binaries.
6
7cd ${SRC}
8LOG=coreutils-buildhost.log
9
10unpack_tarball coreutils-${COREUTILS_VER}
11cd ${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
16case ${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 ;;
24esac
25
26max_log_init Coreutils ${COREUTILS_VER} "buildhost echo (shared)" ${CONFLOGS} ${LOG}
27CC="${CC-gcc}" \
28CFLAGS="-O2 -pipe" \
29DEFAULT_POSIX2_VERSION=199209 \
30./configure --prefix=${HST_TOOLS} \
31 --disable-nls \
32 >> ${LOGFILE} 2>&1 &&
33echo " o Configure OK" &&
34
35min_log_init ${BUILDLOGS} &&
36make ${PMFLAGS} LDFLAGS="-s" -C lib \
37 >> ${LOGFILE} 2>&1 || barf
38
39case ${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 ;;
45esac
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
57make ${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
64make ${PMFLAGS} LDFLAGS="-s" -C src ginstall \
65 >> ${LOGFILE} 2>&1 &&
66
67
68# During kernel headers install, solaris expr causes a syntax error.
69
70make ${PMFLAGS} LDFLAGS="-s" -C src expr \
71 >> ${LOGFILE} 2>&1 &&
72
73
74# ensure we have a cp which takes -a ( -dpR)
75
76make ${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
83make ${PMFLAGS} LDFLAGS="-s" -C src ln \
84 >> ${LOGFILE} 2>&1 &&
85
86echo " o Build OK" &&
87
88cp -p src/echo ${HST_TOOLS}/bin/echo &&
89cp -p src/ginstall ${HST_TOOLS}/bin/install &&
90cp -p src/expr ${HST_TOOLS}/bin/expr &&
91cp -p src/cp ${HST_TOOLS}/bin/cp &&
92cp -p src/ln ${HST_TOOLS}/bin/ln &&
93echo " o Install OK"
94
Note: See TracBrowser for help on using the repository browser.