openpkg/openpkg.spec

changeset 434
66c3db5d26f6
parent 429
b363f8ef6dcb
child 435
24700f8ed057
     1.1 --- a/openpkg/openpkg.spec	Wed Aug 01 23:27:43 2012 +0200
     1.2 +++ b/openpkg/openpkg.spec	Wed Aug 01 23:37:13 2012 +0200
     1.3 @@ -825,6 +825,14 @@
     1.4      cd openpkg-%{version}
     1.5      . ./.buildenv
     1.6  
     1.7 +    #   force usage of proper architecture parameter
     1.8 +    bitopt=
     1.9 +    case `sh $shtool platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
    1.10 +        amd64-*          ) bitopt=-m64 ;;
    1.11 +        ia64-*           ) bitopt=-m64 ;;
    1.12 +        sparc64-*        ) bitopt=-m64 ;;
    1.13 +    esac
    1.14 +
    1.15      #   display verbosity header
    1.16      set +x; VERBOSE "BUILD: Build GNU bash (Bourne-Again Shell)"; set -x
    1.17  
    1.18 @@ -850,10 +858,10 @@
    1.19        export AUTOCONF
    1.20        CC="${l_cc}"
    1.21        export CC
    1.22 -      LDFLAGS=""
    1.23 -      export LDFLAGS
    1.24 +      CCFLAGS_FOR_BUILD="$bitopt -O" \
    1.25 +      export CCFLAGS_FOR_BUILD
    1.26        case "$plid" in
    1.27 -          Darwin/* ) LDFLAGS="-Wl,-search_paths_first" ;;
    1.28 +          Darwin/* ) LDFLAGS="$bitopt -Wl,-search_paths_first" ;;
    1.29        esac
    1.30        ./configure \
    1.31            --cache-file=./config.cache \
    1.32 @@ -870,7 +878,7 @@
    1.33  
    1.34      #   build BZIP2 library
    1.35      ( cd bzip2-%{V_bzip2}
    1.36 -      ${l_make} CC="${l_cc}" CFLAGS="-O" libbz2.a bzip2 || exit $?
    1.37 +      ${l_make} CC="${l_cc}" CFLAGS="$bitopt -O" libbz2.a bzip2 || exit $?
    1.38        ( echo "# libbz2.la - a libtool library file"
    1.39          echo "# Generated by ltmain.sh - GNU libtool x.x.x"
    1.40          echo "dlname=''"
    1.41 @@ -893,7 +901,7 @@
    1.42  
    1.43      #   build ZLIB library
    1.44      ( cd zlib-%{V_zlib}
    1.45 -      CC="${l_cc}" CFLAGS="-O" ./configure
    1.46 +      CC="${l_cc}" CFLAGS="$bitopt -O" ./configure
    1.47        ${l_make} CC="${l_cc}" libz.a || exit $? # intentionally do not pass CFLAGS here
    1.48      ) || exit $?
    1.49  
    1.50 @@ -907,7 +915,7 @@
    1.51            Darwin/* ) opts="--disable-assembler" ;;
    1.52        esac
    1.53        CC="${l_cc}" \
    1.54 -      CFLAGS="-O" \
    1.55 +      CFLAGS="$bitopt -O" \
    1.56        ./configure \
    1.57            --prefix=%{l_prefix} \
    1.58            --libdir="%{l_prefix}/lib" \
    1.59 @@ -926,7 +934,8 @@
    1.60      #   build OSSP uuid tool
    1.61      ( cd uuid-%{V_uuid}
    1.62        CC="${l_cc}" \
    1.63 -      CFLAGS="-O" \
    1.64 +      CFLAGS="$bitopt -O" \
    1.65 +      LDFLAGS="$bitopt" \
    1.66        GREP="grep" \
    1.67        ./configure \
    1.68          --prefix=%{l_prefix} \
    1.69 @@ -994,6 +1003,9 @@
    1.70        sh $shtool subst \
    1.71            -e "1s;^.*\$;#!$l_perl;" \
    1.72            Configure `find . -name "*.pl" -print`
    1.73 +      sh $shtool subst \
    1.74 +          -e 's;xarch=amd64;m64;g' \
    1.75 +          Configure
    1.76        opts=""
    1.77        case `sh $shtool platform -n -L -S "" -C "+" -F "%<ap>-%<sp>"` in
    1.78            *-solaris*       ) opts="-lnsl -lsocket" ;;
    1.79 @@ -1017,9 +1029,9 @@
    1.80      #   build BSD libarchive
    1.81      ( cd libarchive-%{V_libarchive}
    1.82        CC="${l_cc}" \
    1.83 -      CFLAGS="-O -D_POSIX_PTHREAD_SEMANTICS" \
    1.84 +      CFLAGS="$bitopt -O -D_POSIX_PTHREAD_SEMANTICS" \
    1.85        CPPFLAGS="-I`pwd`/../zlib-%{V_zlib} -I`pwd`/../bzip2-%{V_bzip2} -I`pwd`/../xz-%{V_xz}/src/liblzma/api -I`pwd`/../openssl-%{V_openssl}/include" \
    1.86 -      LDFLAGS="-L`pwd`/../zlib-%{V_zlib} -L`pwd`/../bzip2-%{V_bzip2} -L`pwd`/../xz-%{V_xz}/src/liblzma/.libs -L`pwd`/../openssl-%{V_openssl}" \
    1.87 +      LDFLAGS="$bitopt -L`pwd`/../zlib-%{V_zlib} -L`pwd`/../bzip2-%{V_bzip2} -L`pwd`/../xz-%{V_xz}/src/liblzma/.libs -L`pwd`/../openssl-%{V_openssl}" \
    1.88        GREP="grep" \
    1.89        ./configure \
    1.90            --prefix=%{l_prefix} \
    1.91 @@ -1042,11 +1054,10 @@
    1.92      #   build GNU diffutils
    1.93      ( cd diffutils-%{V_diffutils}
    1.94        CC="${l_cc}" \
    1.95 -      CFLAGS="-O" \
    1.96 +      CFLAGS="$bitopt -O" \
    1.97        ./configure \
    1.98            --prefix=%{l_prefix} \
    1.99            --disable-nls
   1.100 -      ${l_make} || exit $?
   1.101        ( mv src/diff src/diff3 src/sdiff src/cmp ..
   1.102          ${l_make} clean || true
   1.103          mv ../diff ../diff3 ../sdiff ../cmp .
   1.104 @@ -1063,9 +1074,9 @@
   1.105          echo 'lt_cv_sys_max_cmd_len=100'
   1.106        ) >config.cache
   1.107        CC="${l_cc}" \
   1.108 -      CFLAGS="-I`pwd`/../zlib-%{V_zlib}" \
   1.109 +      CFLAGS="$bitopt -I`pwd`/../zlib-%{V_zlib}" \
   1.110        CPPFLAGS="-I`pwd`/../zlib-%{V_zlib}" \
   1.111 -      LDFLAGS="-L`pwd`/../zlib-%{V_zlib}" \
   1.112 +      LDFLAGS="$bitopt -L`pwd`/../zlib-%{V_zlib}" \
   1.113        GREP="grep" \
   1.114        ./configure \
   1.115            --cache-file=./config.cache \
   1.116 @@ -1085,6 +1096,7 @@
   1.117      #   build PCRE library
   1.118      ( cd pcre-%{V_pcre}
   1.119        CC="${l_cc}" \
   1.120 +      CFLAGS="$bitopt -O" \
   1.121        GREP="grep" \
   1.122        ./configure \
   1.123            --disable-cpp \
   1.124 @@ -1114,7 +1126,7 @@
   1.125          echo 'bc_cv_as_noexecstack=no'
   1.126        ) >config.cache
   1.127        CC="${l_cc}" \
   1.128 -      CFLAGS="-O" \
   1.129 +      CFLAGS="$bitopt -O" \
   1.130        ./configure \
   1.131          --cache-file=./config.cache \
   1.132          --prefix=%{l_prefix} \
   1.133 @@ -1139,6 +1151,7 @@
   1.134      #   build POPT library
   1.135      ( cd popt-%{V_popt}
   1.136        CC="${l_cc}" \
   1.137 +      CFLAGS="$bitopt -O" \
   1.138        CPPFLAGS="-DOPENPKG -DPOPT_fprintf=fprintf" \
   1.139        GREP="grep" \
   1.140        ./configure \
   1.141 @@ -1158,6 +1171,7 @@
   1.142      #   build SQLite library
   1.143      ( cd sqlite-%{V_sqlite}
   1.144        CC="${l_cc}" \
   1.145 +      CFLAGS="$bitopt -O" \
   1.146        LIBS="-lm" \
   1.147        GREP="grep" \
   1.148        ./configure \
   1.149 @@ -1194,9 +1208,9 @@
   1.150  
   1.151        #   set build tool flags
   1.152        CC="${l_cc}"
   1.153 -      CFLAGS=""
   1.154 +      CFLAGS="$bitopt"
   1.155        CPPFLAGS="-DRPM_VENDOR_OPENPKG"
   1.156 -      LDFLAGS=""
   1.157 +      LDFLAGS="$bitopt"
   1.158        LIBS=""
   1.159        LIBS="$LIBS -lm"
   1.160        export CC
   1.161 @@ -1313,7 +1327,7 @@
   1.162      ${l_make} -f `SOURCE mutex.mk` \
   1.163            CC="${l_cc}" \
   1.164            CPPFLAGS="-Ipopt-%{V_popt}" \
   1.165 -          LDFLAGS="-Lpopt-%{V_popt} -Lpopt-%{V_popt}/.libs" \
   1.166 +          LDFLAGS="$bitopt -Lpopt-%{V_popt} -Lpopt-%{V_popt}/.libs" \
   1.167            MUTEX_DOT_C="`SOURCE mutex.c`"
   1.168  
   1.169  %install

mercurial