On 1/3/06, Tushar Teredesai <[EMAIL PROTECTED]> wrote: > Sometime back I added a patch to the patches repository that adds > -fPIC to the compiler flags when compiling shared library. > Additionally it allows building the shared and static library in a > single pass. See: > <http://www.linuxfromscratch.org/patches/downloads/zlib/zlib-1.2.2-fPIC-1.patch>. > Though the patch is for 1.2.2 it also applies to 1.2.3.
Tushar, I like what's in the patch, but I'm not a big fan of adding a patch to drastically alter the build system. The current --shared, make clean, etc. works with the exception of the -fPIC crap. Another option that only affects the CFLAGS settings is just to make an sed on SFLAGS so it looks like what's in your patch. If you don't mind trashing the other arch SFLAGS (which we shouldn't since this isn't HP_UX from scratch), then you can do sed -i 's/SFLAGS=.*/SFLAGS="${CFLAGS-"-O3"} -fPIC"/' configure It's easily confirmed, but here's some evidence anyway: $ export CFLAGS="-O2 -pipe" <snip> $ make gcc -O2 -pipe -fPIC -DUSE_MMAP -c -o example.o example.c $ make clean <snip> $ unset CFLAGS <snip> $ make gcc -O3 -fPIC -DUSE_MMAP -c -o example.o example.c Will others please comment on either of these two suggestions? -- Dan -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page