From ea2dfe7386ae02dac0cb7a54f4cb6cea0213585f Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Wed, 27 May 2009 06:33:49 +0000 Subject: Revert zlib to doing separate builds for static and dynamic libraries to ensure the -fPIC parameter is set properly in both cases. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@8932 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/zlib.xml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'chapter06') diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml index 9d4fccd81..c3c00730c 100644 --- a/chapter06/zlib.xml +++ b/chapter06/zlib.xml @@ -47,17 +47,12 @@ a specified CFLAGS variable, be sure to add the -fPIC directive to the CFLAGS variable for the duration of the configure command below, then - remove it afterwards. + remove it when building the static library. - Modify the build scripts to ensure compilation with position independent - code and allow building both static and dynamic libraries in one step: + Prepare Zlib for building the dynamic library: -patch -Np1 -i ../&zlib-fpic-patch; - - Prepare Zlib for compilation: - -./configure --prefix=/usr --shared +./configure --prefix=/usr --shared --libdir=/lib Compile the package: @@ -67,13 +62,35 @@ make check - Install the libraries: + Install the shared library: + +make install + + 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 + + Build the static library: + +make clean +./configure --prefix=/usr +make + + To test the results again, issue: + +make check + + Install the static library: make install - Finally, fix permissions on the static library: + Fix the permissions on the static library: -chmod 0644 /usr/lib/libz.a +chmod -v 644 /usr/lib/libz.a -- cgit v1.2.3-54-g00ecf