X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage2%2Fcis-zlib;h=74f9d9cac39018afa55c0db188d35a25caef7384;hb=7a241252d60ff447f09cf5c417d7c79a209f0bce;hp=a858ffcf3e9a106717616e298a4e21e55594061b;hpb=16cc35ba4890382ee9368a176e4f5a7fa773b7a6;p=hvlinux.git diff --git a/stage2/cis-zlib b/stage2/cis-zlib index a858ffc..74f9d9c 100755 --- a/stage2/cis-zlib +++ b/stage2/cis-zlib @@ -1,45 +1,35 @@ #!/bin/sh -# First argument of this script is the package name +set -o errexit + +# First argument of this script is the package name. +# Remaining arguments are additional configure options. # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list -ZLIB_VERSION=$(get_pkg_ver ${1}) - -# Zlib is known to build its shared library incorrectly if CFLAGS is -# specified in the environment. We need to add the -fPIC directive to CFLAGS -# for the duration of the below configure command, then remove it afterwards. -export CFLAGS="${CFLAGS} -fPIC" +PACKAGE=${1} +shift +CONFIGURE_OPTS=${*} # Applying patches (if any) -apply_patches ${1} && +apply_patches ${PACKAGE} -cd ${LFS_TMP}/${1} && +cd ${LFS_TMP}/${PACKAGE} ./configure \ --prefix=/usr \ - --shared \ - --libdir=/lib && -make -j ${MAKEJOBS} && - -# Installing the shared library -make install && + ${CONFIGURE_OPTS} +make +make install +ldconfig -# The previous command installed a .so file in /lib. We will remove -# it and relink it into /usr/lib: -rm -v /lib/libz.so && -ln -sfv ../../lib/libz.so.${ZLIB_VERSION} /usr/lib/libz.so && - -# Now also build the non-shared (static) library: -make clean && -./configure \ - --prefix=/usr && -make -j ${MAKEJOBS} && -make install && +# The previous command installed two .so files into /usr/lib. +# We will move it into /lib and then relink it to /usr/lib: +mv -v /usr/lib/libz.so.* /lib +ln -svf ../../lib/libz.so.1 /usr/lib/libz.so # Fix the permissions on the static library: chmod 644 /usr/lib/libz.a -# Return last error exit $?