source: scripts_home/scripts/target-scripts/target-gawk.sh@ 1c9c5c3

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

r624@server (orig r622): jim | 2005-10-31 12:40:28 -0800
Rearranging Archive

  • Property mode set to 100755
File size: 1.6 KB
Line 
1#!/bin/bash
2
3# cross-lfs target gawk build
4# ---------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG=gawk-cross.log
13
14unpack_tarball gawk-${GAWK_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 target is same as build host, adjust build slightly to avoid running
31# configure checks which we cannot run
32if [ "${TARGET}" = "${BUILD}" ]; then
33 BUILD=`echo ${BUILD} | sed 's@\([_a-zA-Z0-9]*\)\(-[_a-zA-Z0-9]*\)\(.*\)@\1\2x\3@'`
34fi
35
36# gawk is braindead for setting version information
37# during install while cross compiling, here we will use
38# gawk-$(PACKAGE_VERSION) instead of trying to run gawk --version
39# (which cant be done when cross compiling, derr) to get version info
40test -f Makefile.in-ORIG ||
41 cp -p Makefile.in Makefile.in-ORIG
42sed 's@\(fullname=gawk-\).*\(;.*\)@\1\$(PACKAGE_VERSION) \2@g' \
43 Makefile.in-ORIG > Makefile.in
44
45max_log_init Gawk ${GAWK_VER} "initial (shared)" ${CONFLOGS} ${LOG}
46CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
47CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
48./configure --prefix=${BUILD_PREFIX} \
49 --build=${BUILD} --host=${TARGET} \
50 >> ${LOGFILE} 2>&1 &&
51echo " o Configure OK" &&
52
53min_log_init ${BUILDLOGS} &&
54make ${PMFLAGS} LDFLAGS="-s" \
55 >> ${LOGFILE} 2>&1 &&
56echo " o Build OK" &&
57
58min_log_init ${INSTLOGS} &&
59make ${INSTALL_OPTIONS} install \
60 >> ${LOGFILE} 2>&1 &&
61echo " o ALL OK" || barf
62
Note: See TracBrowser for help on using the repository browser.