From 989ff8e43ac4f5abaa7a5a23f5c364de7eb4acea Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 26 Jun 2012 21:49:09 -0400 Subject: F17 udpates Various updates to stage 1 and 2 to build with F17 GA SRPMs --- recipe.d/0002-ncurses | 3 + recipe.d/0006-readline | 5 + recipe.d/0007-gdb | 2 +- recipe.d/0009-nspr | 13 ++- recipe.d/0010-pcre | 2 + recipe.d/0011-readline | 5 - recipe.d/0012-chkconfig | 9 +- recipe.d/0019-perl | 6 + recipe.d/0020-openssl | 10 +- recipe.d/0021-popt | 5 + recipe.d/0022-libffi | 5 + recipe.d/0022-pkgconfig | 5 + recipe.d/0022-popt | 5 - recipe.d/0023-glib2 | 5 + recipe.d/0023-nss-util | 48 ++++++++ recipe.d/0024-nss-softokn | 53 +++++++++ recipe.d/0024-pkgconfig | 5 - recipe.d/0025-nss | 18 +-- recipe.d/0026-rsync | 0 recipe.d/0030-file | 0 recipe.d/0031-ustr | 0 recipe.d/0032-libusb1 | 4 + recipe.d/0033-libusb | 2 +- recipe.d/0034-tzdata | 1 + recipe.d/0101-libsepol | 5 + recipe.d/0102-attr | 7 ++ recipe.d/0102-pam | 12 -- recipe.d/0103-acl | 8 ++ recipe.d/0103-shadow | 4 - recipe.d/0104-libsemanage | 5 + recipe.d/0104-strace | 4 - recipe.d/0105-pam | 16 +++ recipe.d/0105-util-linux | 4 - recipe.d/0106-libxcb | 4 - recipe.d/0106-shadow-utils | 4 + recipe.d/0107-strace | 4 + recipe.d/XXXX-audit | 0 stage1 | 282 ++++++++++++++++++++++++++++++++++++++------- stage2 | 40 ++++++- 39 files changed, 503 insertions(+), 107 deletions(-) create mode 100644 recipe.d/0006-readline delete mode 100644 recipe.d/0011-readline create mode 100644 recipe.d/0021-popt create mode 100644 recipe.d/0022-libffi create mode 100644 recipe.d/0022-pkgconfig delete mode 100644 recipe.d/0022-popt create mode 100644 recipe.d/0023-nss-util create mode 100644 recipe.d/0024-nss-softokn delete mode 100644 recipe.d/0024-pkgconfig mode change 100755 => 100644 recipe.d/0026-rsync mode change 100755 => 100644 recipe.d/0030-file mode change 100755 => 100644 recipe.d/0031-ustr create mode 100644 recipe.d/0032-libusb1 mode change 100755 => 100644 recipe.d/0033-libusb mode change 100755 => 100644 recipe.d/0034-tzdata create mode 100644 recipe.d/0101-libsepol create mode 100644 recipe.d/0102-attr delete mode 100644 recipe.d/0102-pam create mode 100644 recipe.d/0103-acl delete mode 100644 recipe.d/0103-shadow create mode 100644 recipe.d/0104-libsemanage delete mode 100644 recipe.d/0104-strace create mode 100644 recipe.d/0105-pam delete mode 100644 recipe.d/0105-util-linux delete mode 100644 recipe.d/0106-libxcb create mode 100644 recipe.d/0106-shadow-utils create mode 100644 recipe.d/0107-strace mode change 100755 => 100644 recipe.d/XXXX-audit diff --git a/recipe.d/0002-ncurses b/recipe.d/0002-ncurses index 767b582..f950766 100644 --- a/recipe.d/0002-ncurses +++ b/recipe.d/0002-ncurses @@ -11,3 +11,6 @@ make $J make $J install +echo "INPUT(-lncurses)" > /usr/lib/libcurses.so +echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so +echo "INPUT(-ltinfo)" > /usr/lib/libtermcap.so diff --git a/recipe.d/0006-readline b/recipe.d/0006-readline new file mode 100644 index 0000000..ed2f513 --- /dev/null +++ b/recipe.d/0006-readline @@ -0,0 +1,5 @@ + mcd $BUILDDIR/readline + $SRC/readline-*/configure $TCONFIGARGS + make $J + make $J install + diff --git a/recipe.d/0007-gdb b/recipe.d/0007-gdb index 7be409b..62b8aaf 100644 --- a/recipe.d/0007-gdb +++ b/recipe.d/0007-gdb @@ -1,5 +1,5 @@ mcd $BUILDDIR/gdb - $SRC/gdb-*/configure $TCONFIGARGS --without-rpm + $SRC/gdb-*/configure $TCONFIGARGS --without-rpm --with-system-readline notparallel make $J -k make $J -k install diff --git a/recipe.d/0009-nspr b/recipe.d/0009-nspr index d1bc7ce..de46994 100644 --- a/recipe.d/0009-nspr +++ b/recipe.d/0009-nspr @@ -1,5 +1,10 @@ - mcd $BUILDDIR/nspr - $SRC/nspr-*/mozilla/nsprpub/configure $TCONFIGARGS --enable-thumb2 - make $J - make $J install +case "$TARGET" in + *armv[567]* ) FLAGS2="--enable-thumb2" ;; + * ) FLAGS2="" ;; +esac + +mcd $BUILDDIR/nspr +$SRC/nspr-*/mozilla/nsprpub/configure $TCONFIGARGS $FLAGS2 +make $J +make $J install diff --git a/recipe.d/0010-pcre b/recipe.d/0010-pcre index 9ef89ef..bfcb1dd 100644 --- a/recipe.d/0010-pcre +++ b/recipe.d/0010-pcre @@ -1,3 +1,5 @@ +# install fails if these files already exist! +rm -f /usr/share/man/man3/pcre* || true mcd $BUILDDIR/pcre $SRC/pcre-*/configure $TCONFIGARGS make $J diff --git a/recipe.d/0011-readline b/recipe.d/0011-readline deleted file mode 100644 index ed2f513..0000000 --- a/recipe.d/0011-readline +++ /dev/null @@ -1,5 +0,0 @@ - mcd $BUILDDIR/readline - $SRC/readline-*/configure $TCONFIGARGS - make $J - make $J install - diff --git a/recipe.d/0012-chkconfig b/recipe.d/0012-chkconfig index a423cbe..4a5686e 100644 --- a/recipe.d/0012-chkconfig +++ b/recipe.d/0012-chkconfig @@ -1,5 +1,6 @@ - mcd $BUILDDIR/pth - #$SRC/${1}-*/configure $TCONFIGARGS - make $J - make $J install +mcd $BUILDDIR/chkconfig +cp -rp $SRC/chkconfig-*/* . +sed '/install.*ntsysv/d; /all/s/ntsysv//' Makefile > Makefile.stage2 +make -f Makefile.stage2 $J CC=gcc +make -f Makefile.stage2 $J -k install || true diff --git a/recipe.d/0019-perl b/recipe.d/0019-perl index 2505a78..2a1ebf3 100644 --- a/recipe.d/0019-perl +++ b/recipe.d/0019-perl @@ -1,6 +1,12 @@ mcd $BUILDDIR/perl cd $SRC/perl-* + sh $SRC/perl-*/Configure -des -Dprefix=/usr -DDEBUGGING=-g -Dcc=gcc -Dmyhostname=localhost -Dperladmin=root@localhost -Duseshrplib -Dusethreads -Duseithreads -Uusedtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto + +BUILD_BZIP2=0 +BZIP2_LIB=%{_libdir} +export BUILD_BZIP2 BZIP2_LIB + make make install diff --git a/recipe.d/0020-openssl b/recipe.d/0020-openssl index a8379c1..b47a1a5 100644 --- a/recipe.d/0020-openssl +++ b/recipe.d/0020-openssl @@ -1,6 +1,14 @@ mcd $BUILDDIR/openssl cd $SRC/openssl-* - ./Configure --prefix=/usr --openssldir=/etc/pki/tls zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 enable-cms enable-md2 no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa shared linux-generic32 +./Configure \ + --prefix=/usr --openssldir=/etc/pki/tls \ + zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 \ + enable-cms enable-md2 no-idea no-mdc2 no-rc5 no-ec no-ec2m no-ecdh no-ecdsa no-srp \ + --enginesdir=/usr/lib/openssl/engines \ + shared linux-generic32 fips + +# ./Configure --prefix=/usr --openssldir=/etc/pki/tls zlib enable-camellia enable-seed enable-tlsext enable-rfc3779 enable-cms enable-md2 no-idea no-mdc2 no-rc5 no-ec no-ecdh no-ecdsa no-srp fips shared linux-generic32 + make depend make all make rehash diff --git a/recipe.d/0021-popt b/recipe.d/0021-popt new file mode 100644 index 0000000..18cccaf --- /dev/null +++ b/recipe.d/0021-popt @@ -0,0 +1,5 @@ + mcd $BUILDDIR/popt + $SRC/popt-*/configure $TCONFIGARGS + make $J + make $J install + diff --git a/recipe.d/0022-libffi b/recipe.d/0022-libffi new file mode 100644 index 0000000..cd0d9b1 --- /dev/null +++ b/recipe.d/0022-libffi @@ -0,0 +1,5 @@ +mcd $BUILDDIR/libffi +$SRC/libffi-*/configure $TCONFIGARGS +make $J +make $J install + diff --git a/recipe.d/0022-pkgconfig b/recipe.d/0022-pkgconfig new file mode 100644 index 0000000..863e66d --- /dev/null +++ b/recipe.d/0022-pkgconfig @@ -0,0 +1,5 @@ + mcd $BUILDDIR/pkg-config + $SRC/pkg-config-*/configure $TCONFIGARGS --disable-shared --with-installed-glib --with-installed-popt + make $J + make $J install + diff --git a/recipe.d/0022-popt b/recipe.d/0022-popt deleted file mode 100644 index 18cccaf..0000000 --- a/recipe.d/0022-popt +++ /dev/null @@ -1,5 +0,0 @@ - mcd $BUILDDIR/popt - $SRC/popt-*/configure $TCONFIGARGS - make $J - make $J install - diff --git a/recipe.d/0023-glib2 b/recipe.d/0023-glib2 index 750d709..294be35 100644 --- a/recipe.d/0023-glib2 +++ b/recipe.d/0023-glib2 @@ -1,6 +1,11 @@ mcd $BUILDDIR/glib2 # glib2 expects --enable-threads=yes to enable threads, # anything else disables threads + + GIO=`cd $SRC/glib-*/gio; pwd` + sed 's@gdbus-2.0/codegen@@g' $GIO/Makefile.in | sed 's/ tests$//' > $GIO/Makefile.stage2 + mv $GIO/Makefile.stage2 $GIO/Makefile.in + $SRC/glib-*/configure `echo $TCONFIGARGS | sed 's/posix/yes/'` --enable-static make $J make $J install diff --git a/recipe.d/0023-nss-util b/recipe.d/0023-nss-util new file mode 100644 index 0000000..1c546d5 --- /dev/null +++ b/recipe.d/0023-nss-util @@ -0,0 +1,48 @@ +######################################################## +# needs perl +######################################################## + +mcd $BUILDDIR/nss + +BUILD_OPT=1 +export BUILD_OPT + +PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 +PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 +export PKG_CONFIG_ALLOW_SYSTEM_LIBS +export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS + +NSPR_INCLUDE_DIR=/usr/include/nspr +NSPR_LIB_DIR=/usr/lib +export NSPR_INCLUDE_DIR +export NSPR_LIB_DIR + +FREEBL_NO_DEPEND=1 +export FREEBL_NO_DEPEND + +NSS_USE_SYSTEM_SQLITE=1 +export NSS_USE_SYSTEM_SQLITE + +make -C $SRC/${1}-3.*/mozilla/security/coreconf +make -C $SRC/${1}-3.*/mozilla/security/dbm +make -C $SRC/${1}-3.*/mozilla/security/nss + +cd $SRC/${1}-3.*/mozilla/security/coreconf +make install +cd $SRC/${1}-3.*/mozilla/security/dbm +make install +cd $SRC/${1}-3.*/mozilla/security/nss +make install +# Copy the binary libraries we want +cd $SRC/${1}-3.* + +for file in `cd mozilla/dist/*.OBJ/lib; echo *` +do + install -p -m 755 mozilla/dist/*.OBJ/lib/$file /usr/lib/ +done +# Copy the include files we want +test -d /usr/include/nss3 || mkdir -p /usr/include/nss3 +for file in $SRC/nss-*/mozilla/dist/public/nss/*.h +do + install -p -m 644 $file /usr/include/nss3/ +done diff --git a/recipe.d/0024-nss-softokn b/recipe.d/0024-nss-softokn new file mode 100644 index 0000000..2df15e6 --- /dev/null +++ b/recipe.d/0024-nss-softokn @@ -0,0 +1,53 @@ +######################################################## +# needs perl +######################################################## + +mcd $BUILDDIR/nss + +BUILD_OPT=1 +export BUILD_OPT + +PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 +PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 +export PKG_CONFIG_ALLOW_SYSTEM_LIBS +export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS + +NSPR_INCLUDE_DIR=/usr/include/nspr +NSPR_LIB_DIR=/usr/lib +export NSPR_INCLUDE_DIR +export NSPR_LIB_DIR + +NSSUTIL_INCLUDE_DIR=/usr/include/nss3 +NSSUTIL_LIB_DIR=/usr/lib +export NSSUTIL_INCLUDE_DIR +export NSS_LIB_DIR + +FREEBL_NO_DEPEND=1 +export FREEBL_NO_DEPEND + +NSS_USE_SYSTEM_SQLITE=1 +export NSS_USE_SYSTEM_SQLITE + +make -C $SRC/${1}-3.*/mozilla/security/coreconf +make -C $SRC/${1}-3.*/mozilla/security/dbm +make -C $SRC/${1}-3.*/mozilla/security/nss + +cd $SRC/${1}-3.*/mozilla/security/coreconf +make install +cd $SRC/${1}-3.*/mozilla/security/dbm +make install +cd $SRC/${1}-3.*/mozilla/security/nss +make install +# Copy the binary libraries we want +cd $SRC/${1}-3.* + +for file in `cd mozilla/dist/*.OBJ/lib; echo *` +do + install -p -m 755 mozilla/dist/*.OBJ/lib/$file /usr/lib/ +done +# Copy the include files we want +test -d /usr/include/nss3 || mkdir -p /usr/include/nss3 +for file in $SRC/nss-*/mozilla/dist/public/nss/*.h +do + install -p -m 644 $file /usr/include/nss3/ +done diff --git a/recipe.d/0024-pkgconfig b/recipe.d/0024-pkgconfig deleted file mode 100644 index 863e66d..0000000 --- a/recipe.d/0024-pkgconfig +++ /dev/null @@ -1,5 +0,0 @@ - mcd $BUILDDIR/pkg-config - $SRC/pkg-config-*/configure $TCONFIGARGS --disable-shared --with-installed-glib --with-installed-popt - make $J - make $J install - diff --git a/recipe.d/0025-nss b/recipe.d/0025-nss index 19b631d..0050a57 100644 --- a/recipe.d/0025-nss +++ b/recipe.d/0025-nss @@ -15,17 +15,21 @@ export NSPR_LIB_DIR NSS_USE_SYSTEM_SQLITE=1 export NSS_USE_SYSTEM_SQLITE - make -C $SRC/${1}-3.12.10/mozilla/security/coreconf - make -C $SRC/${1}-3.12.10/mozilla/security/dbm - make -C $SRC/${1}-3.12.10/mozilla/security/nss - cd $SRC/${1}-3.12.10/mozilla/security/coreconf + + FREEBL_LIB_DIR=/usr/lib + export FREEBL_LIB_DIR + + make -C $SRC/${1}-3.*/mozilla/security/coreconf + make -C $SRC/${1}-3.*/mozilla/security/dbm + make -C $SRC/${1}-3.*/mozilla/security/nss + cd $SRC/${1}-3.*/mozilla/security/coreconf make install - cd $SRC/${1}-3.12.10/mozilla/security/dbm + cd $SRC/${1}-3.*/mozilla/security/dbm make install - cd $SRC/${1}-3.12.10/mozilla/security/nss + cd $SRC/${1}-3.*/mozilla/security/nss make install # Copy the binary libraries we want - cd $SRC/${1}-3.12.10 + cd $SRC/${1}-3.* for file in libnss3.so libnssckbi.so libnsspem.so libnsssysinit.so libsmime3.so libssl3.so libnssutil3.so libnssdbm3.chk libfreebl3.chk libfreebl3.so libnssdbm3.so libsoftokn3.chk libsoftokn3.so do install -p -m 755 mozilla/dist/*.OBJ/lib/$file /usr/lib/ diff --git a/recipe.d/0026-rsync b/recipe.d/0026-rsync old mode 100755 new mode 100644 diff --git a/recipe.d/0030-file b/recipe.d/0030-file old mode 100755 new mode 100644 diff --git a/recipe.d/0031-ustr b/recipe.d/0031-ustr old mode 100755 new mode 100644 diff --git a/recipe.d/0032-libusb1 b/recipe.d/0032-libusb1 new file mode 100644 index 0000000..ea29d44 --- /dev/null +++ b/recipe.d/0032-libusb1 @@ -0,0 +1,4 @@ +cd $SRC/libusb-1* +./configure $TCONFIGARGS +make $J +make install diff --git a/recipe.d/0033-libusb b/recipe.d/0033-libusb old mode 100755 new mode 100644 index 477096d..f8ed4bb --- a/recipe.d/0033-libusb +++ b/recipe.d/0033-libusb @@ -1,4 +1,4 @@ -cd $SRC/${1}-* +cd $SRC/libusb-compat-* ./configure $TCONFIGARGS make $J make install diff --git a/recipe.d/0034-tzdata b/recipe.d/0034-tzdata old mode 100755 new mode 100644 index f9f8056..0362bf6 --- a/recipe.d/0034-tzdata +++ b/recipe.d/0034-tzdata @@ -2,6 +2,7 @@ # Note: java tzdata is not built (unlike tzdata.spec) # cd $SRC/$1 +test -d obj && rm -rf obj make $J make $J install diff --git a/recipe.d/0101-libsepol b/recipe.d/0101-libsepol new file mode 100644 index 0000000..427647f --- /dev/null +++ b/recipe.d/0101-libsepol @@ -0,0 +1,5 @@ +mcd $BUILDDIR/libsepol +rsync -av $SRC/libsepol-*/ ./ + +make $J +make $J install diff --git a/recipe.d/0102-attr b/recipe.d/0102-attr new file mode 100644 index 0000000..6f9d867 --- /dev/null +++ b/recipe.d/0102-attr @@ -0,0 +1,7 @@ +mcd $BUILDDIR/attr +rsync -av $SRC/attr-*/ ./ +./configure $TCONFIGARGS --libexecdir=/usr/lib +make $J LIBTOOL="libtool --tag=CC" +make $J install +make $J install-dev +make $J install-lib diff --git a/recipe.d/0102-pam b/recipe.d/0102-pam deleted file mode 100644 index 4b1e00e..0000000 --- a/recipe.d/0102-pam +++ /dev/null @@ -1,12 +0,0 @@ - # FIXME: this possibly has a problem with pam_faillock.8 - # not sure if configure would re-generate that warning at this point - mcd $BUILDDIR/pam - rsync -av $SRC/Linux-PAM-*/ ./ - ./configure \ - --libdir=/lib \ - --includedir=/usr/include/security \ - --disable-prelude \ - --disable-selinux \ - --disable-audit - make $J - make $J install diff --git a/recipe.d/0103-acl b/recipe.d/0103-acl new file mode 100644 index 0000000..878a406 --- /dev/null +++ b/recipe.d/0103-acl @@ -0,0 +1,8 @@ +mcd $BUILDDIR/acl +rsync -av $SRC/acl-*/ ./ +touch .census +./configure $TCONFIGARGS --libexecdir=/usr/lib +make $J LIBTOOL="libtool --tag=CC" +make $J install +make $J install-dev +make $J install-lib diff --git a/recipe.d/0103-shadow b/recipe.d/0103-shadow deleted file mode 100644 index 7cef382..0000000 --- a/recipe.d/0103-shadow +++ /dev/null @@ -1,4 +0,0 @@ - mcd $BUILDDIR/shadow - $SRC/shadow-*/configure $TCONFIGARGS - make $J - make $J install diff --git a/recipe.d/0104-libsemanage b/recipe.d/0104-libsemanage new file mode 100644 index 0000000..ce9ff42 --- /dev/null +++ b/recipe.d/0104-libsemanage @@ -0,0 +1,5 @@ +mcd $BUILDDIR/libsemanage +rsync -av $SRC/libsemanage-*/ ./ + +make $J +make $J install diff --git a/recipe.d/0104-strace b/recipe.d/0104-strace deleted file mode 100644 index c755d60..0000000 --- a/recipe.d/0104-strace +++ /dev/null @@ -1,4 +0,0 @@ - mcd $BUILDDIR/strace - $SRC/strace-*/configure $TCONFIGARGS - make $J - make $J install diff --git a/recipe.d/0105-pam b/recipe.d/0105-pam new file mode 100644 index 0000000..479b3c4 --- /dev/null +++ b/recipe.d/0105-pam @@ -0,0 +1,16 @@ +# FIXME: this possibly has a problem with pam_faillock.8 +# not sure if configure would re-generate that warning at this point +mcd $BUILDDIR/pam +rsync -av $SRC/Linux-PAM-*/ ./ + +./configure \ + --libdir=/lib \ + --includedir=/usr/include/security \ + --disable-prelude \ + --disable-selinux \ + --disable-audit +make Makefile +sed 's/= .*\.8.*/=/' modules/pam_faillock/Makefile > modules/pam_faillock/Makefile.stage2 +mv modules/pam_faillock/Makefile.stage2 modules/pam_faillock/Makefile +make $J +make $J install diff --git a/recipe.d/0105-util-linux b/recipe.d/0105-util-linux deleted file mode 100644 index c755d60..0000000 --- a/recipe.d/0105-util-linux +++ /dev/null @@ -1,4 +0,0 @@ - mcd $BUILDDIR/strace - $SRC/strace-*/configure $TCONFIGARGS - make $J - make $J install diff --git a/recipe.d/0106-libxcb b/recipe.d/0106-libxcb deleted file mode 100644 index 5108bc1..0000000 --- a/recipe.d/0106-libxcb +++ /dev/null @@ -1,4 +0,0 @@ - mcd $BUILDDIR/libxcb - $SRC/libxcb-*/configure $TCONFIGARGS - make $J - make $J install diff --git a/recipe.d/0106-shadow-utils b/recipe.d/0106-shadow-utils new file mode 100644 index 0000000..7cef382 --- /dev/null +++ b/recipe.d/0106-shadow-utils @@ -0,0 +1,4 @@ + mcd $BUILDDIR/shadow + $SRC/shadow-*/configure $TCONFIGARGS + make $J + make $J install diff --git a/recipe.d/0107-strace b/recipe.d/0107-strace new file mode 100644 index 0000000..c755d60 --- /dev/null +++ b/recipe.d/0107-strace @@ -0,0 +1,4 @@ + mcd $BUILDDIR/strace + $SRC/strace-*/configure $TCONFIGARGS + make $J + make $J install diff --git a/recipe.d/XXXX-audit b/recipe.d/XXXX-audit old mode 100755 new mode 100644 diff --git a/stage1 b/stage1 index 53e872e..993d303 100755 --- a/stage1 +++ b/stage1 @@ -38,9 +38,13 @@ J=-j12 BUILDDIR=$TOP/builds PREFIX=$TOP/install -KCONFIGDIR=$TOP/rpmbuild/SOURCES -KCONFIG=config-armv7l-omap +KCONFIGDIR=$BUILDDIR/kernel/configs +KCONFIG=kernel-3.*-armv7hl-tegra.config +# used by kernel and glibc KARCH=arm +KIMAGE=uImage +NEED_XLOADER=yes +NEED_UBOOT=yes # The cross-compiler target TARGET=armv7hl-redhat-linux-gnueabi @@ -50,6 +54,14 @@ RPMTARGET=armv7l-redhat-linux-gnu # this is where the new rootfs will be built ROOTFS=$TOP/rootfs +CONFIG_EXTRA="--with-cpu=cortex-a8 + --with-tune=cortex-a8 + --with-arch=armv7-a + --with-float=hard + --with-fpu=vfpv3-d16 + --with-abi=aapcs-linux +" + if [ -f $MYDIR/local.conf ] then . $MYDIR/local.conf @@ -81,6 +93,13 @@ unset AR unset LD unset AS +if [ -f /usr/local/include/ppl_c.h ] +then + WITHPPL="--with-ppl=/usr/local" +else + WITHPPL="" +fi + # ------------------------------------------------------------ echo @@ -116,12 +135,14 @@ srpm() { STOP=${2-$TOP} SDIR=$SRPMDIR_LOCAL - SRPM=$(cd $SDIR; \ls -1 $1-*.src.rpm 2>/dev/null | tail -1) + SRPM=$(cd $SDIR; \ls -1 $1-*.src.rpm 2>/dev/null | egrep -v $1'-.*-.*-' | tail -1) if [ -f $SDIR/$SRPM ] then true; else SDIR=$SRPMDIR SRPM=$(cd $SDIR; \ls -1 $1-*.src.rpm 2>/dev/null | tail -1) + SRPM=$(cd $SDIR; \ls -1 $1-*.src.rpm 2>/dev/null | egrep -v $1'-.*-.*-' | tail -1) fi + echo SRPM is $SRPM SPEC=${SRPM%-*} SPEC=${SPEC%-*} if [ -f $STOP/rpmbuild/SPECS/$SPEC.spec ] @@ -145,40 +166,38 @@ BUILD=`gcc -v 2>&1 | grep Target: | sed 's/.*: //'` # These are for cross-tools like gcc, binutils CONFIGARGS="--prefix=$PREFIX --target=$TARGET - --with-cpu=cortex-a8 - --with-tune=cortex-a8 - --with-arch=armv7-a - --with-float=hard - --with-fpu=vfpv3-d16 - --with-abi=aapcs-linux + ${CONFIG_EXTRA} --enable-languages=c,c++ --with-sysroot=$ROOTFS --enable-threads=posix - --disable-libssp + --enable-64-bit-bfd + $WITHPPL " TCONFIGARGS="--prefix=/usr + --with-sysroot=/ + --with-build-sysroot=$ROOTFS --build=$BUILD --host=$TARGET --target=$TARGET --enable-werror=no --enable-cxx - --with-cpu=cortex-a8 - --with-tune=cortex-a8 - --with-arch=armv7-a - --with-float=hard - --with-fpu=vfpv3-d16 - --with-abi=aapcs-linux + ${CONFIG_EXTRA} --enable-languages=c,c++ --enable-threads=posix - --disable-libssp " +KERNELARGS="ARCH=${KARCH} CROSS_COMPILE=${TARGET}-" -KERNELARGS="ARCH=arm CROSS_COMPILE=${TARGET}-" # Must use install_root=$ROOTFS on all makes +prefill_gcc_cache() +{ + echo 'lt_cv_shlibpath_overrides_runpath=no' > config.cache + echo 'gcc_cv_libc_provides_ssp=yes' > config.cache +} + setup_glibc() { # This path MUST be relative, not absolute @@ -215,6 +234,52 @@ prefill_glibc_cache() { echo libc_cv_forced_unwind=yes > config.cache echo libc_cv_c_cleanup=yes >> config.cache + echo libc_cv_ctors_header=yes >> config.cache + echo ac_cv_header_cpuid_h=yes >> config.cache + echo libc_cv_ssp=no >> config.cache + echo libc_cv_gcc_builtin_expect=yes >> config.cache +} + +setup_eglibc() +{ + # This path MUST be relative, not absolute + GLIBCPORTSSRC=../$(cd $SRC/eglibc-*; echo ports*) + #GLIBCPORTSSRC=ports + + GV=$(cd $SRC; echo eglibc-*/libc) + EGLIBCARGS0="--prefix=/usr + --includedir=/usr/include + --with-headers=$ROOTFS/usr/include + --enable-kernel=2.6.32 + --enable-bind-now + --build $BUILD + --host $TARGET + --disable-profile + --cache-file=config.cache + --without-cvs + --with-elf + --without-gd" + EGLIBCARGS1="$EGLIBCARGS0 + --enable-add-ons=$GLIBCPORTSSRC,nptl + --disable-sanity-checks + --with-tls + --with-__thread + " + EGLIBCARGS2="$EGLIBCARGS0 + --enable-add-ons=$GLIBCPORTSSRC,nptl + --disable-sanity-checks + --with-tls + --with-__thread + " +} + +prefill_eglibc_cache() +{ + echo libc_cv_forced_unwind=yes > config.cache + echo libc_cv_c_cleanup=yes >> config.cache + echo libc_cv_ctors_header=yes >> config.cache + echo libc_cv_ssp=yes >> config.cache + echo libc_cv_gcc_builtin_expect=yes >> config.cache } notparallel() @@ -250,6 +315,7 @@ go() case "$1" in "" ) + go usrlinks go kernel-headers go binutils go gcc-host @@ -259,16 +325,16 @@ case "$1" in go gcc go dev - go kernel - go x-loader - go u-boot - +# go kernel + test x"$NEED_XLOADER" == x"yes" && go x-loader + test x"$NEED_UBOOT" == x"yes" && go u-boot go gmp go mpfr go mpc go ppl go cloog + go libsepol go libselinux go zlib @@ -340,10 +406,24 @@ case "$1" in "gcc-host" ) srpm gcc mcd $BUILDDIR/gcc - $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include + prefill_gcc_cache + $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include --cache-file=config.cache notparallel make $J all-host make $J install-host + + +if false; then + mkdirp $ROOTFS/usr/lib + for o in crt Scrt1 crti crtbegin crtbeginS crtend crtendS crtn + do + $TARGET-gcc -nostdlib -nostartfiles -c -x c /dev/null -c -o $ROOTFS/usr/lib/$o.o + done + for so in gcc gcc_s c + do + $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $ROOTFS/usr/lib/lib$so.so + done +fi ;; "glibc-headers" ) @@ -354,7 +434,40 @@ case "$1" in prefill_glibc_cache $SRC/$GV/configure $GLIBCARGS1 notparallel - make $J ARCH=arm cross-compiling=yes install-headers install_root=$ROOTFS + make $J ARCH=${KARCH} cross-compiling=yes install-headers install_root=$ROOTFS + touch $ROOTFS/usr/include/gnu/stubs.h + touch $ROOTFS/usr/include/bits/stdio_lim.h + cp $SRC/$GV/nptl/sysdeps/pthread/pthread.h $ROOTFS/usr/include + + ( cd $ROOTFS/usr/include/bits + sed '/ifndef.*NO_LONG_DOUBLE/,/#endif/d' < mathdef.h > mathdef.h.new + mv mathdef.h.new mathdef.h + ) + + + # We also build just enough files to link libgcc.so. The fake + # libc.so will never actually get used. + mkdirp $ROOTFS/usr/lib + make $J ARCH=${KARCH} cross-compiling=yes csu/subdir_lib +# cp csu/crt*.o $ROOTFS/usr/lib + for C in `cd csu; echo crt*.o`; do + echo "" | $TARGET-as -o $ROOTFS/usr/lib/$C + done + $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $ROOTFS/usr/lib/libc.so + + ln -s ld-linux-armhf.so.3 $ROOTFS/ld-linux.so.3 + + ;; + + "eglibc-headers" ) + set -vx + srpm eglibc + setup_eglibc + mcd $BUILDDIR/eglibc-stage1 + prefill_eglibc_cache + $SRC/$GV/configure $EGLIBCARGS1 + notparallel + make $J ARCH=arm cross-compiling=yes install-headers install_root=$ROOTFS install-bootstrap-headers=yes touch $ROOTFS/usr/include/gnu/stubs.h touch $ROOTFS/usr/include/bits/stdio_lim.h cp $SRC/$GV/nptl/sysdeps/pthread/pthread.h $ROOTFS/usr/include @@ -370,16 +483,19 @@ case "$1" in mkdirp $ROOTFS/usr/lib make $J ARCH=arm cross-compiling=yes csu/subdir_lib cp csu/crt*.o $ROOTFS/usr/lib + cp csu/elf-init*.o $ROOTFS/usr/lib + cp csu/libc-start*.o $ROOTFS/usr/lib $TARGET-gcc -nostdlib -nostartfiles -shared -x c /dev/null -o $ROOTFS/usr/lib/libc.so ;; "gcc-libgcc" ) srpm gcc mcd $BUILDDIR/gcc - $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include + prefill_gcc_cache + $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include --cache-file=config.cache notparallel - make $J all-target-libgcc - make $J install-target-libgcc + make $J all-target-libgcc all-target-libssp + make $J install-target-libgcc install-target-libssp ;; "glibc" ) @@ -389,19 +505,39 @@ case "$1" in prefill_glibc_cache $SRC/$GV/configure $GLIBCARGS2 notparallel - make $J ARCH=arm cross-compiling=yes - make $J ARCH=arm cross-compiling=yes install install_root=$ROOTFS + make $J ARCH=${KARCH} cross-compiling=yes + make $J ARCH=${KARCH} cross-compiling=yes install install_root=$ROOTFS ( cd $ROOTFS/usr/include/bits sed '/ifndef.*NO_LONG_DOUBLE/,/#endif/d' < mathdef.h > mathdef.h.new mv mathdef.h.new mathdef.h ) + + ln -s ld-linux-armhf.so.3 $ROOTFS/lib/ld-linux.so.3 + ;; + "eglibc" ) + srpm eglibc + setup_eglibc + mcd $BUILDDIR/eglibc + prefill_eglibc_cache + $SRC/$GV/configure $EGLIBCARGS2 + notparallel + make $J ARCH=arm cross-compiling=yes + make $J ARCH=arm cross-compiling=yes install install_root=$ROOTFS + + ( cd $ROOTFS/usr/include/bits + sed '/ifndef.*NO_LONG_DOUBLE/,/#endif/d' < mathdef.h > mathdef.h.new + mv mathdef.h.new mathdef.h + ) + ;; + "gcc" ) - srpm gcc - mcd $BUILDDIR/gcc - $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include + srpm gcc + mcd $BUILDDIR/gcc + prefill_gcc_cache + $SRC/gcc-*/configure $CONFIGARGS --with-headers=$ROOTFS/usr/include --cache-file=config.cache notparallel make $J make $J install @@ -413,6 +549,16 @@ case "$1" in #-------------------------------------------------- # target boot support + "usrlinks" ) + test -d $ROOTFS || mkdir -p $ROOTFS + mkdir $ROOTFS/usr + for i in bin sbin lib + do + ln -s usr/$i $ROOTFS/$i + mkdir $ROOTFS/usr/$i + done + ;; + "dev" ) rsync -av $TOP/dev-template/ $ROOTFS/ @@ -438,6 +584,11 @@ case "$1" in sudo mknod ttyO1 c 253 1 sudo mknod ttyO2 c 253 2 sudo mknod ttyO3 c 253 3 + + sudo mknod ttyS0 c 4 64 + sudo mknod ttyS1 c 4 65 + sudo mknod ttyS2 c 4 66 + sudo mknod ttyS3 c 4 67 sudo chmod a+rw null zero ;; @@ -448,13 +599,13 @@ case "$1" in rsync -a --delete $SRC/kernel-*/linux-*/ ./ cp $KCONFIGDIR/$KCONFIG .config make $J ARCH=$KARCH CROSS_COMPILE=${TARGET}- silentoldconfig - make $J ARCH=$KARCH CROSS_COMPILE=${TARGET}- uImage + make $J ARCH=$KARCH CROSS_COMPILE=${TARGET}- $KIMAGE make $J ARCH=$KARCH CROSS_COMPILE=${TARGET}- modules make $J ARCH=$KARCH CROSS_COMPILE=${TARGET}- INSTALL_MOD_PATH=$ROOTFS modules_install mkdirp $ROOTFS/boot mkdirp $ROOTFS/lib/firmware - cp arch/$KARCH/boot/uImage $ROOTFS/boot + cp arch/$KARCH/boot/$KIMAGE $ROOTFS/boot ;; "x-loader" ) @@ -538,12 +689,34 @@ case "$1" in fix_la cloog ;; + libsepol ) + srpm libsepol + mcd $BUILDDIR/t-libsepol + rsync -av $SRC/libsepol*/ ./ + make $J \ + CC=${TARGET}-gcc \ + AS=${TARGET}-as \ + AR=${TARGET}-ar \ + STRIP=${TARGET}-strip \ + RANLIB=${TARGET}-ranlib \ + CFLAGS="" \ + TLSFLAGS="" \ + all + make $J \ + DESTDIR=${ROOTFS} \ + install + ;; + # TLSFLAGS are set in order to avoid a bogus check in # libselinux/src/Makefile. libselinux ) srpm libselinux mcd $BUILDDIR/t-libselinux rsync -av $SRC/libselinux*/ ./ + # libselinux uses $prefix/include for both -I and *.pc, which + # prevents cross compiling. + sed 's@-I$(INCLUDEDIR)@@' < src/Makefile > src/Makefile.stage1 + mv src/Makefile.stage1 src/Makefile make $J \ CC=${TARGET}-gcc \ AS=${TARGET}-as \ @@ -594,8 +767,8 @@ EOF mcd $BUILDDIR/t-gcc $SRC/gcc-*/configure $TCONFIGARGS notparallel - make - make install DESTDIR=${ROOTFS} + make $J + make $J install DESTDIR=${ROOTFS} ;; make | tar | gzip | diffutils | findutils | gawk | which | grep ) @@ -671,7 +844,7 @@ EOF coreutils ) srpm coreutils mcd $BUILDDIR/$1 - $SRC/${1}-*/configure $TCONFIGARGS + $SRC/${1}-*/configure $TCONFIGARGS --disable-pam notparallel for i in $(cd $SRC/${1}-*/man; echo *.x) do @@ -685,7 +858,11 @@ EOF util-linux ) srpm util-linux mcd $BUILDDIR/$1 - $SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --disable-wall + cat < config.cache +ax_cv_have_tls=yes +scanf_cv_alloc_modifier=yes +EOF + $SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --disable-wall --cache-file=config.cache notparallel make $J V=1 make $J install DESTDIR=${ROOTFS} @@ -721,16 +898,35 @@ EOF # install source trees in rootfs, so stage2 will have them for # its builds. - mkdirp $ROOTFS/stage2 + case "$TARGET" in + *i686* ) + if [ ! -f $ROOTFS/usr/bin/uname-bin ] + then + mv $ROOTFS/usr/bin/uname $ROOTFS/usr/bin/uname-bin + echo "#!/bin/sh" > $ROOTFS/usr/bin/uname + echo '/usr/bin/uname-bin "$@" | sed s/x86_64/i686/g' >> $ROOTFS/usr/bin/uname + chmod a+x $ROOTFS/usr/bin/uname + fi + ;; + esac + + mkdirp $ROOTFS/stage2/recipe.d # FIXME: the recipe files need to be copied into the rootfs # before they can be used. + cp $MYDIR/recipe.d/* $ROOTFS/stage2/recipe.d + for PKG in $ROOTFS/stage2/recipe.d/[0-9][0-9][0-9][0-9]-* do + case "$PKG" in + *~ ) ;; + *) PKG=$(echo $PKG | sed "s/.*\\/[0-9][0-9][0-9][0-9]-//") echo "Installing SRPM for $PKG" rsrpm $PKG + ;; + esac done ( @@ -742,14 +938,20 @@ EOF cp $STAGE2 $ROOTFS/stage2/stage2 ( + grep '^J=' local.conf || true echo TARGET=$TARGET echo RPMTARGET=$RPMTARGET echo TCONFIGARGS=\"$TCONFIGARGS\" \ | sed 's/--build=[^ ]*//' \ | sed 's/--host=[^ ]*//' \ - | sed 's/--target=[^ ]*//' + | sed 's/--target=[^ ]*//' \ + | sed 's/--with-sysroot=[^ ]*//' \ + | sed 's/--with-build-sysroot=[^ ]*//' + echo export TARGET RPMTARGET TCONFIGARGS ) > $ROOTFS/stage2/local.conf + echo stage2 ready + ;; esac diff --git a/stage2 b/stage2 index 5037927..b249576 100755 --- a/stage2 +++ b/stage2 @@ -66,6 +66,8 @@ BUILDDIR=$TOP/builds # The cross-compiler target TARGET=armv7hl-redhat-linux-gnueabi +export TARGET BUILDDIR J SRC STAGE2 MYDIR TOP + if [ -f $MYDIR/local.conf ] then . $MYDIR/local.conf @@ -140,6 +142,8 @@ fix_la() done } +test -d /stage2/done || mkdir /stage2/done + case "$1" in "" ) go clean @@ -148,11 +152,20 @@ case "$1" in # enabled recipes start with [0-9]{4}- # disabled recipes start with XXXX- - for PKG in /stage2/recipe.d/[0-9][0-9][0-9][0-9]-* - do - PKG="$(basename $PKG|sed 's/^[0-9]{4}-//')" - go "$PKG" - done + + for PKG in /stage2/recipe.d/[0-9][0-9][0-9][0-9]-* + do + PKG="$(basename $PKG|sed 's/^[0-9]*-//')" + if [ ! -f "/stage2/done/$PKG" ] + then + if go "$PKG" + then + echo "$PKG" OK + else + echo "$PKG" BAD + fi + fi + done ;; "clean" ) @@ -171,10 +184,25 @@ case "$1" in #-------------------------------------------------- + *~ ) ;; + * ) if [ -f "/stage2/recipe.d/"[0-9][0-9][0-9][0-9]"-$1" ] then - . /stage2/recipe.d/[0-9][0-9][0-9][0-9]-$1 + echo + echo + echo Building $1 . . . + echo + set -e + + . /stage2/recipe.d/[0-9][0-9][0-9][0-9]-"$1" + + set +e + echo + echo Building $1 succeeded + echo + : > /stage2/done/$1 + exit 0 else echo "No build recipe found for $1" >&2 exit 2 -- cgit