diff -r 231658e484c6 -r 66c3db5d26f6 openpkg/openpkg.spec --- a/openpkg/openpkg.spec Wed Aug 01 23:27:43 2012 +0200 +++ b/openpkg/openpkg.spec Wed Aug 01 23:37:13 2012 +0200 @@ -825,6 +825,14 @@ cd openpkg-%{version} . ./.buildenv + # force usage of proper architecture parameter + bitopt= + case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in + amd64-* ) bitopt=-m64 ;; + ia64-* ) bitopt=-m64 ;; + sparc64-* ) bitopt=-m64 ;; + esac + # display verbosity header set +x; VERBOSE "BUILD: Build GNU bash (Bourne-Again Shell)"; set -x @@ -850,10 +858,10 @@ export AUTOCONF CC="${l_cc}" export CC - LDFLAGS="" - export LDFLAGS + CCFLAGS_FOR_BUILD="$bitopt -O" \ + export CCFLAGS_FOR_BUILD case "$plid" in - Darwin/* ) LDFLAGS="-Wl,-search_paths_first" ;; + Darwin/* ) LDFLAGS="$bitopt -Wl,-search_paths_first" ;; esac ./configure \ --cache-file=./config.cache \ @@ -870,7 +878,7 @@ # build BZIP2 library ( cd bzip2-%{V_bzip2} - ${l_make} CC="${l_cc}" CFLAGS="-O" libbz2.a bzip2 || exit $? + ${l_make} CC="${l_cc}" CFLAGS="$bitopt -O" libbz2.a bzip2 || exit $? ( echo "# libbz2.la - a libtool library file" echo "# Generated by ltmain.sh - GNU libtool x.x.x" echo "dlname=''" @@ -893,7 +901,7 @@ # build ZLIB library ( cd zlib-%{V_zlib} - CC="${l_cc}" CFLAGS="-O" ./configure + CC="${l_cc}" CFLAGS="$bitopt -O" ./configure ${l_make} CC="${l_cc}" libz.a || exit $? # intentionally do not pass CFLAGS here ) || exit $? @@ -907,7 +915,7 @@ Darwin/* ) opts="--disable-assembler" ;; esac CC="${l_cc}" \ - CFLAGS="-O" \ + CFLAGS="$bitopt -O" \ ./configure \ --prefix=%{l_prefix} \ --libdir="%{l_prefix}/lib" \ @@ -926,7 +934,8 @@ # build OSSP uuid tool ( cd uuid-%{V_uuid} CC="${l_cc}" \ - CFLAGS="-O" \ + CFLAGS="$bitopt -O" \ + LDFLAGS="$bitopt" \ GREP="grep" \ ./configure \ --prefix=%{l_prefix} \ @@ -994,6 +1003,9 @@ sh $shtool subst \ -e "1s;^.*\$;#!$l_perl;" \ Configure `find . -name "*.pl" -print` + sh $shtool subst \ + -e 's;xarch=amd64;m64;g' \ + Configure opts="" case `sh $shtool platform -n -L -S "" -C "+" -F "%-%"` in *-solaris* ) opts="-lnsl -lsocket" ;; @@ -1017,9 +1029,9 @@ # build BSD libarchive ( cd libarchive-%{V_libarchive} CC="${l_cc}" \ - CFLAGS="-O -D_POSIX_PTHREAD_SEMANTICS" \ + CFLAGS="$bitopt -O -D_POSIX_PTHREAD_SEMANTICS" \ 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" \ - LDFLAGS="-L`pwd`/../zlib-%{V_zlib} -L`pwd`/../bzip2-%{V_bzip2} -L`pwd`/../xz-%{V_xz}/src/liblzma/.libs -L`pwd`/../openssl-%{V_openssl}" \ + 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}" \ GREP="grep" \ ./configure \ --prefix=%{l_prefix} \ @@ -1042,11 +1054,10 @@ # build GNU diffutils ( cd diffutils-%{V_diffutils} CC="${l_cc}" \ - CFLAGS="-O" \ + CFLAGS="$bitopt -O" \ ./configure \ --prefix=%{l_prefix} \ --disable-nls - ${l_make} || exit $? ( mv src/diff src/diff3 src/sdiff src/cmp .. ${l_make} clean || true mv ../diff ../diff3 ../sdiff ../cmp . @@ -1063,9 +1074,9 @@ echo 'lt_cv_sys_max_cmd_len=100' ) >config.cache CC="${l_cc}" \ - CFLAGS="-I`pwd`/../zlib-%{V_zlib}" \ + CFLAGS="$bitopt -I`pwd`/../zlib-%{V_zlib}" \ CPPFLAGS="-I`pwd`/../zlib-%{V_zlib}" \ - LDFLAGS="-L`pwd`/../zlib-%{V_zlib}" \ + LDFLAGS="$bitopt -L`pwd`/../zlib-%{V_zlib}" \ GREP="grep" \ ./configure \ --cache-file=./config.cache \ @@ -1085,6 +1096,7 @@ # build PCRE library ( cd pcre-%{V_pcre} CC="${l_cc}" \ + CFLAGS="$bitopt -O" \ GREP="grep" \ ./configure \ --disable-cpp \ @@ -1114,7 +1126,7 @@ echo 'bc_cv_as_noexecstack=no' ) >config.cache CC="${l_cc}" \ - CFLAGS="-O" \ + CFLAGS="$bitopt -O" \ ./configure \ --cache-file=./config.cache \ --prefix=%{l_prefix} \ @@ -1139,6 +1151,7 @@ # build POPT library ( cd popt-%{V_popt} CC="${l_cc}" \ + CFLAGS="$bitopt -O" \ CPPFLAGS="-DOPENPKG -DPOPT_fprintf=fprintf" \ GREP="grep" \ ./configure \ @@ -1158,6 +1171,7 @@ # build SQLite library ( cd sqlite-%{V_sqlite} CC="${l_cc}" \ + CFLAGS="$bitopt -O" \ LIBS="-lm" \ GREP="grep" \ ./configure \ @@ -1194,9 +1208,9 @@ # set build tool flags CC="${l_cc}" - CFLAGS="" + CFLAGS="$bitopt" CPPFLAGS="-DRPM_VENDOR_OPENPKG" - LDFLAGS="" + LDFLAGS="$bitopt" LIBS="" LIBS="$LIBS -lm" export CC @@ -1313,7 +1327,7 @@ ${l_make} -f `SOURCE mutex.mk` \ CC="${l_cc}" \ CPPFLAGS="-Ipopt-%{V_popt}" \ - LDFLAGS="-Lpopt-%{V_popt} -Lpopt-%{V_popt}/.libs" \ + LDFLAGS="$bitopt -Lpopt-%{V_popt} -Lpopt-%{V_popt}/.libs" \ MUTEX_DOT_C="`SOURCE mutex.c`" %install