source: scripts/native-scripts/native-zlib.sh@ fdfb73b

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since fdfb73b 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.4 KB
Line 
1#!/bin/bash
2
3# cross-lfs native zlib build
4# ---------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11LOG=zlib-native.log
12
13SELF=`basename ${0}`
14set_buildenv
15set_libdirname
16setup_multiarch
17if [ ! "${libdirname}" = "lib" ]; then
18 extra_conf="--libdir=/usr/${libdirname}"
19fi
20
21cd ${SRC}
22unpack_tarball zlib-${ZLIB_VER}
23cd ${PKGDIR}
24
25#TODO - fix this for later zlibs
26test "1.1.4" = "${ZLIB_VER}" &&
27{
28 # Fix up zlibs Makefile so we can properly pass in LDFLAGS from
29 # the env without clobbering existing settings for zlib build
30 test -f Makefile.in-ORIG ||
31 cp Makefile.in Makefile.in-ORIG
32
33 # make LDFLAGS in Makefile.in empty and move existing LDFLAGS
34 # to ZLIB_LDFLAGS. Append $(ZLIB_LDFLAGS) wherever $(LDFLAGS) exists
35 sed -e 's@LDFLAGS=.*@ZLIB_&@' \
36 -e '/ZLIB_LDFLAGS=/i\
37LDFLAGS=' \
38 -e 's@$(LDFLAGS)@& $(ZLIB_LDFLAGS)@g' \
39 Makefile.in-ORIG > Makefile.in
40}
41
42max_log_init Zlib ${ZLIB_VER} "target (shared)" ${CONFLOGS} ${LOG}
43
44# Check to see if we are on alpha
45# Req's a fix as specified on Kelledins Alpha page
46# Pointed out by J.Schmelling
47case "${TGT_ARCH}" in
48 alpha | x86_64 ) extra_cflags="-fPIC" ;;
49esac
50# NOTE: It's probably not a bad idea in general to enable -fPIC...
51
52test "1.1.4" = "${ZLIB_VER}" &&
53{
54 # Apply Kelledin's vsnprintf patch
55 # see http://archive.linuxfromscratch.org/lfs-dev/2003/02/.....
56 apply_patch zlib-${ZLIB_VER}-vsnprintf
57 CC="${CC-gcc} ${ARCH_CFLAGS}" \
58 CXX="${CXX-g++} ${ARCH_CFLAGS}" \
59 CFLAGS="-O2 -pipe ${extra_cflags} ${TGT_CFLAGS}" \
60 CPPFLAGS="-DHAS_vsnprintf" \
61 ./configure --prefix=/usr --shared ${extra_conf} \
62 >> ${LOGFILE} 2>&1
63} || {
64 CC="${CC-gcc} ${ARCH_CFLAGS}" \
65 CXX="${CXX-g++} ${ARCH_CFLAGS}" \
66 CFLAGS="-O2 -pipe ${extra_cflags} ${TGT_CFLAGS}" \
67 ./configure --prefix=/usr \
68 --shared ${extra_conf} \
69 >> ${LOGFILE} 2>&1
70}
71echo " o Configure OK" &&
72
73min_log_init ${BUILDLOGS} &&
74make ${PMFLAGS} \
75 >> ${LOGFILE} 2>&1 &&
76echo " o Build OK" || barf
77
78min_log_init ${TESTLOGS} &&
79make test \
80 >> ${LOGFILE} 2>&1 &&
81echo " o Test OK" || errmsg
82
83min_log_init ${INSTLOGS} &&
84make LIBS="libz.so.${ZLIB_VER} libz.a" install \
85 >> ${LOGFILE} 2>&1 &&
86echo " o Install OK" || barf
87
88mv /usr/${libdirname}/libz.so.* /${libdirname}
89ln -sf ../../${libdirname}/libz.so.1 /usr/${libdirname}/libz.so
90cp -f zlib.3 /usr/share/man/man3
91
92ldconfig
Note: See TracBrowser for help on using the repository browser.