diff --git a/scripts/Build-Pkg b/scripts/Build-Pkg index 8b6ae8c6c..d878842f2 100755 --- a/scripts/Build-Pkg +++ b/scripts/Build-Pkg @@ -146,14 +146,12 @@ export ROCK_CHECK_SYSTEM_OK=1 if [ -z "$root" -a $stagelevel -le 1 ] || \ [ -z "$root" -a $chroot -eq 1 ] || \ [ "$root" = auto ]; then - if [ $stagelevel -gt 0 ]; then root="build/$ROCKCFG_ID" - else root="build/$ROCKCFG_ID/ROCK/$toolsdir"; fi + root="build/$ROCKCFG_ID" fi [ "$pkgdir" -a "${pkgdir#/}" = "$pkgdir" ] && pkgdir="$base/$pkgdir" [ "$root" -a "${root#/}" = "$root" ] && root="$base/$root" -prefix=${prefix%/} ; prefix=${prefix#/} ; root=${root%/} -xroot="$root" ; [ $stagelevel -gt 1 ] && root="" +root=${root%/} ; xroot="$root" ; [ $stagelevel -ge 3 ] && root="" if [ -z "$id" ] ; then id=`get_unique` @@ -181,6 +179,11 @@ builddir="$base/src.$xpkg.$id" # get real pkg name for mapped packages . build/$ROCKCFG_ID/ROCK/$toolsdir/lib/pkgmapper +if [ $stagelevel -le 1 ] ; then + prefix="$tools" +fi +prefix=${prefix%/} ; prefix=${prefix#/} + # set desktop file name desktopfiles="$( echo ${base}/package/*/${pkg} )/*.desktop" @@ -286,6 +289,11 @@ if [ "$chroot" = 1 ] ; then if [ ! -f proc/mounts ]; then mount -t proc proc $PWD/proc fi + # A /dev with working PTYs is essential for make check in + # binutils and gcc. + if ! grep "$( pwd -P )/dev" /etc/mtab ; then + mount --rbind /dev $PWD/dev + fi for x in Documentation architecture misc package scripts target; do if [ ! -e ROCK/$x ]; then ln -s "loop/$x" "ROCK/$x"; fi @@ -403,16 +411,20 @@ mkdir -p $root/var/adm/{provides,requires,conflicts} rm -f $root/var/adm/logs/$stagelevel-$xpkg.{out,log,err} if [ $this_is_the_2nd_run = 0 ] ; then - [ $stagelevel -gt 1 ] && . /etc/profile options="-this_is_the_2nd_run $options $pkg=$xpkg" - if [ "$ROCKCFG_CREATE_CACHE" = 1 -a $stagelevel -gt 1 ] ; then + if [ "$ROCKCFG_CREATE_CACHE" = 1 -a $stagelevel -ge 3 ] ; then mkdir -p $root/var/adm/cache touch $root/var/adm/cache/$xpkg rm -f $root/var/adm/cache/$xpkg.tm /usr/bin/time -o "$root/var/adm/cache/$xpkg.tm" \ - -f 'buildtime=$(qcalc %U + %S)' $0 $options + -f 'buildtime=$(qcalc %U + %S)' \ + env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' PATH="$PATH" \ + TZ="$TZ" ROCK_BUILD_TARGET=$ROCK_BUILD_TARGET \ + build_root="$build_root" build_rock="$build_rock" \ + build_logs="$build_logs" build_pkgs="$build_pkgs" \ + ROCK_THIS_IS_CHROOT="$ROCK_THIS_IS_CHROOT" $0 $options returncode=$? [ ! -e "$root/var/adm/cache/$xpkg.tm" ] && exit $returncode @@ -478,7 +490,11 @@ if [ $this_is_the_2nd_run = 0 ] ; then exit $returncode else - exec $0 $options + exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' PATH="$PATH" \ + TZ="$TZ" ROCK_BUILD_TARGET=$ROCK_BUILD_TARGET \ + build_root="$build_root" build_rock="$build_rock" \ + build_logs="$build_logs" build_pkgs="$build_pkgs" \ + ROCK_THIS_IS_CHROOT="$ROCK_THIS_IS_CHROOT" $0 $options fi fi @@ -487,7 +503,25 @@ fi # ---- Setting Build Variables # -flistroot="bin boot etc lib sbin usr var opt" +dummydir="$builddir/rootdummy" +mkdir -p "$dummydir" + +if [[ "$xpkg" = *-32bit ]] ; then + instroot="$dummydir" + libs_only=1 +else + instroot="$root" + libs_only=0 +fi + +# +if [[ "$ROCKCFG_MULTILIB" = 0 || "$xpkg" = *-32bit ]] ; then + multilib="lib" +else + multilib="lib64" +fi + +flistroot="bin boot etc $multilib sbin usr var opt" flistrfilter="ldconfig\..*: .*|.*: /var/adm/.*" flistdel="var/adm/.*|var/tmp/.*|var/lock/.*|var/run/.*|etc/ld.so.cache|usr/tmp/.*|.*\\.old" @@ -495,7 +529,7 @@ pkgsplits="" if [ "$ROCKCFG_SPLIT_DEV" != 0 ]; then # this doesn't affect files in /lib, just /.../lib # so there needn't be an exception for linux kernel modules - splitreg 40 dev '(/lib/.*\.(la|a|o)$|/include/|/man[23]/)' + splitreg 40 dev "(/(lib|$multilib)/.*\.(la|a|o)\$|/include/|/man[23]/)" splitdesc_dev() { desc_I="$desc_I (development files)"; } fi if [ "$ROCKCFG_SPLIT_DOC" != 0 ]; then @@ -504,25 +538,24 @@ if [ "$ROCKCFG_SPLIT_DOC" != 0 ]; then splitdesc_doc() { desc_I="$desc_I (documentation)"; } fi -if [ $stagelevel -le 1 ] -then - makeopt='CC="$CC" CXX="$CXX" CC_FOR_BUILD="$BUILDCC"' - makeopt="$makeopt"' BUILDCC="$BUILDCC" BUILD_CC="$BUILD_CC"' - makeopt="$makeopt"' HOSTCC="$HOSTCC" HOST_CC="$HOST_CC"' - makeopt="$makeopt"' STRIP="$STRIP" AR="$AR" LD="$LD"' - makeopt="$makeopt"' RANLIB="$RANLIB" NM="$NM"' +makeopt='CC="$CC" CXX="$CXX"' +if [ $stagelevel -le 2 ] ; then + var_append makeopt ' ' 'CC_FOR_BUILD="$BUILDCC"' + var_append makeopt ' ' 'BUILDCC="$BUILDCC" BUILD_CC="$BUILD_CC"' + var_append makeopt ' ' 'HOSTCC="$HOSTCC" HOST_CC="$HOST_CC"' + var_append makeopt ' ' 'STRIP="$STRIP" AR="$AR" LD="$LD"' + var_append makeopt ' ' 'RANLIB="$RANLIB" NM="$NM"' +fi + +var_append makeinstopt ' ' "$makeopt prefix=\$instroot/\$prefix install" +var_append makeopt ' ' 'prefix=/$prefix' - makeinstopt="$makeopt"' prefix=$root/$prefix install' +for x in bindir sbindir datadir includedir \ + infodir mandir sysconfdir localstatedir ; do + var_append makeopt ' ' "$x=\${$x#\$instroot}" +done - for x in prefix bindir sbindir libdir datadir \ - infodir mandir sysconfdir localstatedir \ - includedir - do - makeopt="$makeopt $x=\${$x/${root//\//\\/}/}" - done -else - makeopt='prefix=/$prefix CC="$CC" CXX="$CXX"' - makeinstopt='prefix=/$prefix CC="$CC" CXX="$CXX" install' +if [ $stagelevel -ge 3 ] ; then flistdel="$flistdel|`echo $base | sed s,^/,,`/.*" fi @@ -590,29 +623,34 @@ patchfiles="`ls $confdir/*.patch $confdir/*.patch.$arch \ $targetdir/xpkg_$xpkg.patch $targetdir/xpkg_$xpkg.patch.$arch \ 2>/dev/null | tr '\n' ' '`" -if [ $stagelevel -le 1 ]; then +if [ $stagelevel -le 2 ]; then patchfiles="`ls $patchfiles $confdir/*.patch.cross \ $confdir/*.patch.cross.$arch 2>/dev/null | tr '\n' ' '`" fi -if [ $stagelevel -eq 0 ]; then - flistroot="$flistroot include share doc info man" - flistroot="$flistroot crosscc wrapper $arch_target" + +if [ $stagelevel -le 1 -o "$ROCKCFG_CROSSBUILD" = 0 -a $stagelevel -eq 2 ] ; then createdocs=0 fi - if [ -f $confdir/$pkg.cache ]; then if ! egrep -q '^\[PROVIDES].*\.(so|a)( |$)' $confdir/$pkg.cache; then forcefpic="0" fi fi +if [ $stagelevel -le 1 ] ; then + var_append flistroot " " "$tools" + flistdel="$flistdel|$tools/info/(dir|standards.info)" +else + flistdel="$flistdel|$tools(/.*|)" +fi -if [ $stagelevel -gt 1 ]; then +if [ $stagelevel -ge 3 ]; then for pc_file in $xroot/var/adm/parse-config/* ; do if [ -s "$pc_file" -a "${pc_file##*/}" != "$xpkg" ] then . "$pc_file" ; fi done unset pc_file fi + . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config set_confopt @@ -771,6 +809,13 @@ exec 202>&1 { ( set -e + set +h + + echo "Build-Pkg exec $PATH" + + echo -e "\n--- ENVIRONMENT Variables ---" + set | grep "^[^ ]*=" + echo -e "--- ENVIRONMENT Variables ---\n" if [ $xtrace -eq 1 -o $ROCKCFG_XTRACE -eq 1 ] ; then PS4=$'=[$FUNCNAME:$LINENO (last \\\$?=$?)> ' @@ -837,7 +882,7 @@ exec 202>&1 cat > "$builddir/debug_x.sh" <<- EOT #!/bin/bash export PROMPT_COMMAND='. debug.buildenv; cd .; unset PROMPT_COMMAND' - cd "$builddir"; exec bash 200>> build.pid + cd "$builddir" ; exec env -i bash --init-file debug.buildenv 200>> build.pid EOT # if [ "$ROCK_THIS_IS_CHROOT" != 1 ]; then @@ -898,9 +943,10 @@ exec 202>&1 fi if [ "$ROCKCFG_FLIST" = "flwrapper" -o \ "$ROCKCFG_FLIST" = "strace" ] ; then - if [ "$stagelevel" -le 1 ] + if [ "$stagelevel" -le 2 ] then xbase="$( cd $xroot/ 2> /dev/null ; pwd -P )" + if cat $builddir/fl_wrapper.wlog | sed 's,//*,/,g' | \ egrep -qv "[ ]($base|$xbase|$builddir|/tmp|/usr/tmp|/var/tmp|/var/backups|/proc|/dev)(/|$)" then @@ -962,7 +1008,7 @@ exec 202>&1 splitapply $xpkg "$builddir/flist.split" if [ "$ROCKCFG_FLIST" = "flwrapper" -o \ - "$ROCKCFG_FLIST" = "strace" ] && [ $stagelevel -gt 1 ] ; then + "$ROCKCFG_FLIST" = "strace" ] && [ $stagelevel -ge 3 ] ; then echo "Calculating build-time package dependencies ..." ! egrep -v "^($flistrfilter)\$" "$builddir"/fl_wrapper.[rw]log | @@ -1203,14 +1249,14 @@ EOT done < "$builddir/files.lst" fi - if [ $stagelevel -ge 2 -a $nopostinst = 0 -a -d /var/adm/postinstall ]; then + if [ $stagelevel -ge 3 -a $nopostinst = 0 -a -d /var/adm/postinstall ]; then cp var/adm/flists/$spkg "$(mktemp var/adm/postinstall/${spkg}-install.XXXXXX)" fi ) done echo "Making post-install adaptions." - if [ $stagelevel -ge 2 -a -f /sbin/ldconfig ] ; then ldconfig ; fi + if [ $stagelevel -ge 3 -a -f /sbin/ldconfig ] ; then ldconfig ; fi if [ "$ROCKCFG_PARANOIA_CHECK" = 1 ] ; then found_errors=0 diff --git a/scripts/Build-Target b/scripts/Build-Target index 2d4ea9f2d..62a9433a6 100755 --- a/scripts/Build-Target +++ b/scripts/Build-Target @@ -29,7 +29,7 @@ # for distribution. # # This script is the ROCK work-horse. It builds in a chroot environment -# (stage 2..9) and goes through a number of build stages: +# (stage 3..9) and goes through a number of build stages: # config=default @@ -332,7 +332,7 @@ pkgloop_package() { pkg_laststage=$(echo "$pkg_stages" | sed "s,-,,g; s,.*\(.\),\1,") cmd_root="-root auto" - [ $stagelevel -gt 1 ] && cmd_root="$cmd_root -chroot" + [ $stagelevel -ge 3 ] && cmd_root="$cmd_root -chroot" cmd_buildpkg="./scripts/Build-Pkg -$stagelevel -cfg $config -nopostinst" cmd_buildpkg="$cmd_buildpkg $cmd_root $pkg_basename=$pkg_name" @@ -464,6 +464,8 @@ build_target_exit() { umount -d -f -l $build_rock/{loop,config,download} 2> /dev/null umount -d -f $build_root/proc 2> /dev/null umount -d -f -l $build_root/proc 2> /dev/null + umount -d -f $build_root/dev 2> /dev/null + umount -d -f -l $build_root/dev 2> /dev/null echo_status "READY." echo diff --git a/scripts/Build-Tools b/scripts/Build-Tools index f5df19012..762f3bd2b 100755 --- a/scripts/Build-Tools +++ b/scripts/Build-Tools @@ -53,18 +53,6 @@ mkdir -p build/$ROCKCFG_ID/ROCK/$toolsdir/bin mkdir -p build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper mkdir -p build/$ROCKCFG_ID/ROCK/$toolsdir/lib -if [ $toolsdir = tools.cross ]; then - mkdir -p build/$ROCKCFG_ID/ROCK/$toolsdir/{var/adm,etc,share,include} - [ -L build/$ROCKCFG_ID/ROCK/$toolsdir/usr ] || - ln -s . build/$ROCKCFG_ID/ROCK/$toolsdir/usr - [ -L build/$ROCKCFG_ID/ROCK/$toolsdir/sbin ] || - ln -s bin build/$ROCKCFG_ID/ROCK/$toolsdir/sbin - [ -L build/$ROCKCFG_ID/ROCK/$toolsdir/var/adm/logs ] || - ln -s ../../../../var/adm/logs \ - build/$ROCKCFG_ID/ROCK/$toolsdir/var/adm/logs - mkdir -p build/$ROCKCFG_ID/var/adm/logs -fi - x="$( bash scripts/xfind.sh config/$config/. package/. scripts/. \ misc/. architecture/. target/. ! -name '*.cache' \ -newer build/$ROCKCFG_ID/ROCK/$toolsdir/.lastupdate \ diff --git a/scripts/config.hlp b/scripts/config.hlp index e92e1a03b..57708a88e 100644 --- a/scripts/config.hlp +++ b/scripts/config.hlp @@ -323,12 +323,6 @@ ROCKCFG_FLIST or modify files while the build is running. This should only be used if no other system for creating the file list can be used. -ROCKCFG_USE_CROSSCC - This option controls whether to use a pseudo-cross compiler even - for native (non-cross) builds. This is needed when the host and - target gcc or glibc differ in the ABI. - THIS IS STRONGLY RECOMMENDED! - ROCKCFG_DO_REBUILD_STAGE This options controls whether to rebuild all packages in the final rebuild stage. diff --git a/scripts/config.in b/scripts/config.in index e9baf2216..5ebeac560 100644 --- a/scripts/config.in +++ b/scripts/config.in @@ -97,8 +97,6 @@ block_begin 7 size 'Hard optimise for size (recommended)' \ lazy 'Lazy optimisation (for debugging binaries)' \ test 'Only optimize toolchain (for fast builds)' - - bool 'Build and use a (pseudo-)cross compiler' ROCKCFG_USE_CROSSCC 1 expert_end bool 'This is a cross-build between architectures' ROCKCFG_CROSSBUILD 0 if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then @@ -110,7 +108,6 @@ block_begin 7 comment '-- might cause damage on your build system if it is not read-only. So' comment '-- only run this if your /{bin,lib,usr,..} is somehow write-protected.' fi - ROCKCFGSET_USE_CROSSCC=1 const ROCKCFG_PSEUDONATIVE 0 block_end else @@ -123,8 +120,6 @@ block_begin 7 ROCKCFG_PSEUDONATIVE_NATIVEHOST '' text 'NFSROOT to be mounted on native host' \ ROCKCFG_PSEUDONATIVE_NFSROOT "$HOSTNAME:$PWD" - - ROCKCFGSET_USE_CROSSCC=1 fi fi block_end @@ -288,26 +283,25 @@ include target/$ROCKCFG_TARGET/postconfig.in filterscript="" if [ "$ROCKCFG_CROSSBUILD" = 1 ] ; then - var_append filterscript ' ' 's,^\(. ..\)[^ ]*,\1--------, ;' + var_append filterscript ' ' 's,^\(. ...\)[^ ]*,\1-------, ;' + var_append filterscript ' ' 's,^\(. .\)?,\1-, ;' if [ $ROCKCFG_CROSS_TESTALL = 1 ]; then - var_append filterscript ' ' 's,^\(. .\)?,\11, ;' + var_append filterscript ' ' 's,^\(. ..\)?,\12, ;' else - var_append filterscript ' ' 's,^\(. .\)?,\1-, ;' + var_append filterscript ' ' 's,^\(. ..\)?,\1-, ;' fi - var_append filterscript ' ' 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ;' + var_append filterscript ' ' 's,^\(. .\)X,\11, ; s,^\(. \)X,\1-, ; s,^\(. ..\)X,\12, ;' else - var_append filterscript ' ' 's,^\(. .\)[?X],\1-, ;' + var_append filterscript ' ' 's,^\(. .\)[?X],\1-, ; s,^\(. ..\)[?X],\1-, ;' if [ "$ROCKCFG_PSEUDONATIVE" = 1 ] ; then var_append filterscript ' ' 's,^\(. \)X,\10, ;' else var_append filterscript ' ' 's,^\(. \)X,\1-, ;' fi fi - -if [ $ROCKCFG_USE_CROSSCC != 1 ]; then - var_append filterscript ' ' 's,^\([XO] \)0,\1-, ;' +if [ "$ROCKCFG_MULTILIB" = 1 ] ; then + var_append filterscript ' ' '/ MULTILIB / { h ; s,\(\( [^ ]*\)\{3\}\) \([^ ]*\),\1 \3=\3-32bit, ; G } ;' fi - if [ $ROCKCFG_DO_REBUILD_STAGE != 1 ]; then var_append filterscript ' ' 's,^\([XO] [^ ]*\)9 ,\1- , ;' fi diff --git a/scripts/functions b/scripts/functions index 0f4eb0cdb..d8ed092fc 100644 --- a/scripts/functions +++ b/scripts/functions @@ -179,68 +179,78 @@ column_clean_tab() { # Re-run it in the package .conf file if you modify $prefix # set_confopt() { - confopt="--prefix=$root/$prefix" - - bindir="$root/$prefix/bin" - confopt="$confopt --bindir=\$bindir" - - sbindir="$root/$prefix/sbin" - confopt="$confopt --sbindir=\$sbindir" - - libdir="$root/$prefix/lib" - confopt="$confopt --libdir=\$libdir" + confopt="--prefix=$instroot/$prefix" + + bindir="$instroot/$prefix/bin" + sbindir="$instroot/$prefix/sbin" if [ -z "$prefix" ]; then - datadir="$root/usr/share" - includedir="$root/usr/include" + datadir="$instroot/usr/share" + includedir="$instroot/usr/include" + + docdir="$instroot/usr/share/doc/$xpkg" + infodir="$instroot/usr/share/info" + mandir="$instroot/usr/share/man" - docdir="$root/usr/share/doc/$xpkg" - infodir="$root/usr/share/info" - mandir="$root/usr/share/man" else - datadir="$root/$prefix/share" - includedir="$root/$prefix/include" + datadir="$instroot/$prefix/share" + includedir="$instroot/$prefix/include" - docdir="$root/$prefix/share/doc/$xpkg" - infodir="$root/$prefix/share/info" - mandir="$root/$prefix/share/man" + docdir="$instroot/$prefix/share/doc/$xpkg" + infodir="$instroot/$prefix/share/info" + mandir="$instroot/$prefix/share/man" fi - confopt="$confopt --datadir=\$datadir" - confopt="$confopt --includedir=\$includedir" - - confopt="$confopt --infodir=\$infodir" - confopt="$confopt --mandir=\$mandir" if [ "${prefix#opt/}" != "$prefix" ] ; then - sysconfdir="$root/etc/$prefix" - localstatedir="$root/var/$prefix" + sysconfdir="$instroot/etc/$prefix" + localstatedir="$instroot/var/$prefix" elif [ "${prefix#usr}" != "$prefix" ] ; then - sysconfdir="$root/etc" - localstatedir="$root/var" + sysconfdir="$instroot/etc" + localstatedir="$instroot/var" else - sysconfdir="$root/$prefix/etc" - localstatedir="$root/$prefix/var" + sysconfdir="$instroot/$prefix/etc" + localstatedir="$instroot/$prefix/var" fi - confopt="$confopt --sysconfdir=\$sysconfdir" - confopt="$confopt --localstatedir=\$localstatedir" + + libdir="$root/$prefix/$multilib" + + var_append confopt ' ' '--bindir=$bindir' + var_append confopt ' ' '--sbindir=$sbindir' + + var_append confopt ' ' '--datadir=$datadir' + var_append confopt ' ' '--includedir=$includedir' + + var_append confopt ' ' '--infodir=$infodir' + var_append confopt ' ' '--mandir=$mandir' + + var_append confopt ' ' '--sysconfdir=$sysconfdir' + var_append confopt ' ' '--localstatedir=$localstatedir' + + var_append confopt ' ' '--libdir=$libdir' if [ "$ROCKCFG_CONFIGURE_OPTS" ] ; then - confopt="$confopt $ROCKCFG_CONFIGURE_OPTS" + var_append confopt ' ' "$ROCKCFG_CONFIGURE_OPTS" fi if [ "$ROCKCFG_DEBUG" = 0 ] ; then - confopt="$confopt --disable-debug" + var_append confopt ' ' '--disable-debug' fi if [ "$stagelevel" -le 1 -o "$ROCKCFG_DISABLE_NLS" = 1 ] ; then confopt="${confopt//--enable-nls/} --disable-nls" fi - confopt="$confopt \$extraconfopt" + var_append confopt ' ' '$extraconfopt' + if [ "$stagelevel" -eq 0 ]; then - confopt="$confopt --target=\$arch_target --host=\$arch_build" + var_append confopt ' ' "--host=$arch_build --target=$arch_target" else - confopt="$confopt --build=\$arch_build --host=\$arch_target" + var_append confopt ' ' "--build=$arch_build" + if [[ "$ROCKCFG_MULTILIB" = 1 && "$xpkg" = *-32bit ]] ; then + var_append confopt ' ' "--host=$arch_target32" + else + var_append confopt ' ' "--host=$arch_target" + fi fi cmakedefs="-DCMAKE_INSTALL_PREFIX=/${prefix}" @@ -279,7 +289,7 @@ function eval_config_command() { autoconf fi fi - if [ $stagelevel -le 1 ] ; then + if [ $stagelevel -le 2 ] ; then create_config_cache >> config.cache grep -q '.--cache-file=' $configscript && set -- "$@" "--cache-file=config.cache" @@ -455,7 +465,7 @@ create_config_cache() { [ $arch_sizeof_char_p -eq $arch_sizeof_long_long ] && pt="long long" [ -n "$pt" ] && echo "db_cv_alignp_t=\"unsigned $pt\"" - echo "ac_cv_prog_CC=$CC" + echo "ac_cv_prog_CC='$CC'" } # Abort build before actual build starts @@ -528,11 +538,7 @@ dump_env() { pkginstalled() { local pattern="$1" ; pattern="${pattern//+/\\+}" - if [ $stagelevel = 0 ] ; then - ls "$base/build/$ROCKCFG_ID/ROCK/$toolsdir/var/adm/flists" | egrep -q "^($pattern)$" - else - ls $root/var/adm/flists | egrep -q "^($pattern)$" - fi + ls $root/var/adm/flists | egrep -q "^($pattern)$" } # Register a window-manager @@ -727,14 +733,6 @@ build_this_package() { rmemptydir="$x $rmemptydir" fi done - if [ ! -e $root/$prefix/man ]; then - ln -s ${mandir#$root} $root/$prefix/man - rmemptydir="$rmemptydir $root/$prefix/man" - fi - if [ ! -e $root/$prefix/info ]; then - ln -s ${infodir#$root} $root/$prefix/info - rmemptydir="$rmemptydir $root/$prefix/info" - fi fi if [ ".$custmain" = "." ] diff --git a/scripts/parse-config b/scripts/parse-config index 985cd0aa7..14b6d0820 100644 --- a/scripts/parse-config +++ b/scripts/parse-config @@ -1,3 +1,4 @@ +#!/bin/bash # # --- ROCK-COPYRIGHT-NOTE-BEGIN --- # @@ -32,6 +33,7 @@ crossnative=native ; stagelevel=${stagelevel:-1} ; arch=any arch_sizeof_long_long=undef ; arch_sizeof_int=undef ; arch_machine=undef arch_sizeof_char_p=undef ; arch_sizeof_long=undef ; arch_bigendian=undef arch_sizeof_short=undef ; arch_target=any-unknown-linux +arch_target32= ; arch_target64= if [ -f config/$config/config ] then @@ -60,13 +62,30 @@ if [ -f "architecture/$arch/archtest.out" ] if [ -f "architecture/$arch/archtest.sh" ] then . "architecture/$arch/archtest.sh" ; fi +if [ "$stagelevel" -ge 3 ] +then + if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] + then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi + + arch_build="$arch_target" ; archprefix="" +else + arch_build="`uname -m`-nocross-linux-gnu" + + if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] + then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi + + if [ $stagelevel -eq 2 ]; then + archprefix="${arch_target}-" + fi +fi + base=$(pwd -P) if [ "$ROCK_THIS_IS_CHROOT" = 1 ] then toolsdir=tools.chroot else - if [ $stagelevel -le 1 -a "$ROCKCFG_USE_CROSSCC" = 1 ] + if [ "$ROCKCFG_CROSSBUILD" == 1 ] then toolsdir=tools.cross else @@ -74,6 +93,8 @@ else fi fi +[ $stagelevel -ge 3 ] && . /etc/profile + new_path="" for x in ${PATH//:/ }; do if [ -d "$x" -a -z "${x##/*}" -a -n "${x##$base/*}" -a \ @@ -84,16 +105,36 @@ done export PATH="${new_path#:}" unset new_path -if [ $stagelevel -le 1 -a "$ROCKCFG_USE_CROSSCC" = 1 ] ; then - export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/crosscc:$PATH" +if [ $stagelevel -le 2 ] ; then + export LFS="$base/build/$ROCKCFG_ID" +else + export LFS="" +fi +export CLFS="$LFS" + +if [ "$ROCKCFG_CROSSBUILD" == 0 ] ; then + tools=ROCK/tools.native +else + tools=ROCK/tools.cross +fi +cross_tools="$tools" + +if [ $stagelevel -le 2 ] ; then + export PATH="$LFS/$tools/bin:/bin:/usr/bin:/sbin:/usr/sbin" fi +export CLFS_HOST="$arch_build" +export CLFS_TARGET="$arch_target" CLFS_TARGET32="$arch_target32" export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/bin:$PATH" export PATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper:$PATH" -unset LANG ${!LC_*}; export LC_ALL=C; umask 022 -export BUILDCC="cc" BUILD_CC="cc" HOSTCC="cc" HOST_CC="cc" -export BUILDCXX="c++" BUILD_CXX="c++" HOSTCXX="c++" HOST_CXX="c++" +export LC_ALL=C; umask 022 + +# export BUILDCC="cc" BUILD_CC="cc" HOSTCC="cc" HOST_CC="cc" +# export BUILDCXX="c++" BUILD_CXX="c++" HOSTCXX="c++" HOST_CXX="c++" +export BUILDCC="gcc" BUILD_CC="gcc" HOSTCC="gcc" HOST_CC="gcc" +export BUILDCXX="g++" BUILD_CXX="g++" HOSTCXX="g++" HOST_CXX="g++" +export BUILD32="-m32" BUILD64="-m64" if [ "$ROCKCFG_LINGUAS" == "all" ] ; then unset LINGUAS @@ -103,13 +144,9 @@ else export LINGUAS="$ROCKCFG_LINGUAS" fi -unset CPP ARFLAGS ASFLAGS CFLAGS CXXFLAGS CPPFLAGS FFLAGS LDFLAGS -unset LD_LIBRARY_PATH LD_PRELOAD FLWRAPPER C_INCLUDE_PATH CONFIG_SITE -unset DISPLAY BASH_ENV CDPATH GLOBIGNORE IFS MAIL MAILPATH -unset POSIXLY_CORRECT PROMPT_COMMAND TIMEFORMAT TMOUT - IFS=$' \t\n' set +o posix +set +h export STRIP_WRAPPER_MYPATH="$base/build/$ROCKCFG_ID/ROCK/$toolsdir/wrapper" export STRIP_WRAPPER_NOLOOP=0 @@ -126,27 +163,8 @@ export CMD_WRAPPER_NOLOOP=0 ; unset CMD_WRAPPER_OTHERS_TMP if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ] then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/wrapper-config ; fi -if [ "$stagelevel" -gt 1 -o "$ROCKCFG_USE_CROSSCC" = 0 ] -then - if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] - then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi - - arch_build="$arch_target" ; archprefix="" -else - arch_build="`uname -m`-nocross-linux-gnu" - - if [ -f $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ] - then . $base/build/$ROCKCFG_ID/ROCK/$toolsdir/lib/parse-config-fixarch ; fi - - if [ $stagelevel -eq 1 ]; then - archprefix="${arch_target}-" - if [ ! -f "$base/build/$ROCKCFG_ID/ROCK/$toolsdir/` - `crosscc/${archprefix}gcc" ] - then archprefix="Cross_CC_not_built_so_far_" ; fi - fi -fi - -export CC="${archprefix}cc" CXX="${archprefix}c++" +# export CC="${archprefix}cc" CXX="${archprefix}c++" +export CC="${archprefix}gcc" CXX="${archprefix}g++" export AS="${archprefix}as" STRIP="${archprefix}strip" export LD="${archprefix}ld" GASP="${archprefix}gasp" export AR="${archprefix}ar" RANLIB="${archprefix}ranlib" @@ -154,7 +172,7 @@ export NM="${archprefix}nm" KCC="${archprefix}kcc" export F77="${archprefix}f77" MAKE="make" export AWK="gawk" SED="sed" -if [ $stagelevel -le 1 -a "$ROCKCFG_PSEUDONATIVE" = 1 ]; then +if [ $stagelevel -le 2 -a "$ROCKCFG_PSEUDONATIVE" = 1 ]; then export BUILDCC="$BUILDCC -static" BUILDLD="$BUILDLD -static" fi @@ -162,4 +180,3 @@ if [ -f /etc/ROCK-PROFILE ]; then # this is the right place for e.g. build process ulimits . /etc/ROCK-PROFILE fi -