source: scripts/target-scripts/target-bzip2.sh@ 83ea618

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 83ea618 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: 1.7 KB
Line 
1#!/bin/bash
2
3# cross-lfs target bzip2 build
4# ----------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12
13LOG="bzip2-target.log"
14libdirname="lib"
15
16SELF=`basename ${0}`
17set_buildenv
18set_libdirname
19setup_multiarch
20
21if [ "${USE_SYSROOT}" = "Y" ]; then
22 BUILD_PREFIX=/usr
23 INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
24else
25 BUILD_PREFIX=${TGT_TOOLS}
26 INSTALL_PREFIX="${TGT_TOOLS}"
27fi
28
29export CC="${TARGET}-gcc ${ARCH_CFLAGS}"
30export CXX="${TARGET}-g++ ${ARCH_CFLAGS}"
31
32unpack_tarball bzip2-${BZIP2_VER} &&
33cd ${PKGDIR}
34
35# Edit Makefiles
36for file in Makefile-libbz2_so Makefile ; do
37 test -f ${file}-ORIG ||
38 mv ${file} ${file}-ORIG
39
40 sed -e "s@^\(CC=\).*@\1${CC}@g" \
41 -e "s@^\(AR=\).*@\1${TARGET}-ar@g" \
42 -e "s@^\(RANLIB=\).*@\1${TARGET}-ranlib@g" \
43 -e 's@^\(all:.*\) test@\1@g' \
44 -e "s@/lib\(/\| \|$\)@/${libdirname}\1@g" \
45 ${file}-ORIG > ${file}
46done
47
48max_log_init Bzip2 ${BZIP2_VER} "target (shared)" ${BUILDLOGS} ${LOG}
49make -f Makefile-libbz2_so \
50 >> ${LOGFILE} 2>&1 &&
51echo -e "\n${BRKLN}" >> ${LOGFILE} &&
52make ${PMFLAGS} LDFLAGS="-s" \
53 >> ${LOGFILE} 2>&1 &&
54echo " o Build OK" || barf
55
56# Remove existing bz* files in ${TGT_TOOLS}/bin
57rm -f ${INSTALL_PREFIX}/bin/bz*
58
59min_log_init ${INSTLOGS} &&
60CC="${CC}" CXX="${CXX}" make PREFIX=${INSTALL_PREFIX} install \
61 >> ${LOGFILE} 2>&1 &&
62echo " o ALL OK" || barf
63
64yes | cp bzip2-shared ${INSTALL_PREFIX}/bin/bzip2
65ln -s libbz2.so.1.0 libbz2.so
66
67# There is no cp -a under solaris... thats why we build coreutlis cp
68cp -a libbz2.so* ${INSTALL_PREFIX}/${libdirname}
69
70rm -f ${INSTALL_PREFIX}/bin/{bunzip2,bzcat}
71ln -s bzip2 ${INSTALL_PREFIX}/bin/bunzip2
72ln -s bzip2 ${INSTALL_PREFIX}/bin/bzcat
73#ldconfig
Note: See TracBrowser for help on using the repository browser.