source: scripts/target-scripts/target-coreutils.sh@ b67b7ca

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b67b7ca 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.3 KB
Line 
1#!/bin/bash
2
3# cross-lfs target coreutils build
4# --------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG=coreutils-target.log
13
14unpack_tarball coreutils-${COREUTILS_VER}
15cd ${PKGDIR}
16
17set_libdirname
18setup_multiarch
19
20if [ "${USE_SYSROOT}" = "Y" ]; then
21 BUILD_PREFIX=/usr
22 INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
23 INSTALL_OPTIONS="DESTDIR=${LFS}"
24else
25 BUILD_PREFIX=${TGT_TOOLS}
26 INSTALL_PREFIX="${TGT_TOOLS}"
27 INSTALL_OPTIONS=""
28fi
29
30# If we don't want to conform to POSIX 200212L, override
31# NOTE: This is coreutils 5.0 specific, later versions will have
32# a configure/compile time option
33case ${COREUTILS_VER} in
34 5.1.7 | 5.[2-9]* ) ;;
35 * ) mv lib/posixver.c lib/posixver.c-ORIG
36 sed '/\/\* The POSIX version that utilities should conform to/i\
37#undef _POSIX2_VERSION\
38#define _POSIX2_VERSION 199209L\
39 ' lib/posixver.c-ORIG > lib/posixver.c
40 ;;
41esac
42
43# Cannot check whether we have a working getline in glibc when
44# cross compiling. Say yes here as we will get failure on x86_64
45# where getline is type _IO_ssize_t in stdio.h (long with x86_64)
46# and the provided getline in coreutils (well gnulib) is type int.
47echo "am_cv_func_working_getline=yes" >> config.cache
48
49# UTILS_OPEN_MAX does not get defined when cross-compiling as
50# it is an AC_RUN test used to determine roughly how many open
51# FD's a process can have.
52# We will set it to 1024 (NR_OPEN in /usr/include/linux/limits.h )
53echo "utils_cv_sys_open_max=1024" >> config.cache
54
55# if target is same as build host, adjust build slightly to avoid running
56# configure checks which we cannot run
57if [ "${TARGET}" = "${BUILD}" ]; then
58 BUILD=`echo ${BUILD} | sed 's@\([_a-zA-Z0-9]*\)\(-[_a-zA-Z0-9]*\)\(.*\)@\1\2x\3@'`
59fi
60
61max_log_init Coreutils ${COREUTILS_VER} "target (shared)" ${CONFLOGS} ${LOG}
62CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
63CFLAGS="-O2 -pipe ${TGT_CFLAGS}" DEFAULT_POSIX2_VERSION=199209 \
64./configure --prefix=${BUILD_PREFIX} \
65 --build=${BUILD} --host=${TARGET} --cache-file=config.cache \
66 >> ${LOGFILE} 2>&1 &&
67echo " o Configure OK" &&
68
69min_log_init ${BUILDLOGS} &&
70make ${PMFLAGS} LDFLAGS="-s" \
71 >> ${LOGFILE} 2>&1 &&
72echo " o Build OK" &&
73
74min_log_init ${INSTLOGS} &&
75echo Password: &&
76su -c "make ${INSTALL_OPTIONS} install" \
77 >> ${LOGFILE} 2>&1 &&
78echo " o ALL OK" || barf
79
Note: See TracBrowser for help on using the repository browser.