diff --git a/Documentation/Developers/PKG-BUILD-VARS b/Documentation/Developers/PKG-BUILD-VARS index bdc5b3b30..76906183c 100644 --- a/Documentation/Developers/PKG-BUILD-VARS +++ b/Documentation/Developers/PKG-BUILD-VARS @@ -67,6 +67,7 @@ taropt ........ tar options for extracting createprefix .. '0' = skip creation for directory skeleton for $prefix createdocs .... '0' = skip automatic copying of documentation files autoso2a ...... '1' = automatically create *.a files for all *.so files +forcefpic ..... set to '0' to disable the force -fPIC mechanism custmain ...... command to execute instead of 'configure, make, make install' mainfunction .. alternate main function instead of build_this_package() diff --git a/architecture/x86/parse-config b/architecture/x86/parse-config new file mode 100644 index 000000000..a58a5d180 --- /dev/null +++ b/architecture/x86/parse-config @@ -0,0 +1,26 @@ +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/architecture/x86/parse-config +# ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +if [ "$ROCKCFG_X86_BITS" = 64 -a "$forcefpic" = "" ]; then + forcefpic="1" +fi + diff --git a/package/base/e2fsprogs/e2fsprogs.conf b/package/base/e2fsprogs/e2fsprogs.conf index 142bf825a..da2788d11 100644 --- a/package/base/e2fsprogs/e2fsprogs.conf +++ b/package/base/e2fsprogs/e2fsprogs.conf @@ -25,7 +25,7 @@ if [ "$ROCKCFG_DIETLIBC_e2fsprogs" == "1" ] ; then [ "$dietlibc_dynamic_static" = "dynamic" ] && confopt="$confopt --enable-dynamic-e2fsck" fi -confopt="$confopt --with-ccopts=-fPIC --enable-fsck --libdir=$root/lib --with-root-prefix=$root/" +confopt="$confopt --enable-fsck --libdir=$root/lib --with-root-prefix=$root/" if [ $stagelevel -gt 1 -o "$crossnative" == "cross" ] ; then diff --git a/package/base/gcc/parse-config b/package/base/gcc/parse-config index a8c6b5df4..d9c47bd9c 100644 --- a/package/base/gcc/parse-config +++ b/package/base/gcc/parse-config @@ -142,5 +142,14 @@ if [ $stagelevel -gt 1 -a "$ROCKCFG_PSEUDONATIVE" = 1 ]; then var_insert GCC_WRAPPER_INSERT " " "--specs=specs.chroot" fi +# register the forcefpic handler +gcc_force_fpic_handler() { + if [ "$forcefpic" = 1 ]; then + # echo_status "Enabling force -fPIC mechanism for gcc." + var_insert GCC_WRAPPER_INSERT " " "-fPIC" + fi +} +hook_add prepare 7 'gcc_force_fpic_handler' + # ---- NOT IN STAGE 0 --- fi diff --git a/package/base/zlib/zlib.conf b/package/base/zlib/zlib.conf index d9452cbf7..cd3cc00d2 100644 --- a/package/base/zlib/zlib.conf +++ b/package/base/zlib/zlib.conf @@ -31,7 +31,6 @@ zlib_pm() { } var_insert confopt " " "--shared" -var_insert CC_WRAPPER_INSERT " " "-fPIC" var_append makeinstopt " " "mandir=$mandir" hook_add preconf 3 "unset AR" hook_add postmake 3 "zlib_pm" diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 0d7574068..bc61a872a 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -528,7 +528,7 @@ taropt="--use-compress-program=bzip2 -xf" mainfunction="build_this_package" runconf=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; autopatch=1 autoextract=1 ; chownsrcdir=1 ; nocvsinsrcdir=1; patchopt="-bfp1 -z .orig" -createprefix=1 ; createdocs="" ; rmemptydir="" ; autoso2a=0 +createprefix=1 ; createdocs="" ; rmemptydir="" ; autoso2a=0 ; forcefpic="" check_shared=1 check_usrlocal=1 @@ -576,6 +576,12 @@ if [ $stagelevel -eq 0 ]; then createdocs=0 fi +if [ -f $confdir/$pkg.cache ]; then + if ! egrep -q '^\[PROVIDES].*\.so( |$)' $confdir/$pkg.cache; then + forcefpic="0" + fi +fi + if [ $stagelevel -gt 1 ]; then for pc_file in $xroot/var/adm/parse-config/* ; do if [ -s "$pc_file" -a "${pc_file##*/}" != "$xpkg" ]