X-Git-Url: https://hackdaworld.org/gitweb/?p=hdw-linux%2Fhdw-linux.git;a=blobdiff_plain;f=scripts%2FBuild;h=be436fab2b478211fa272f3a490a191b9a8f9c51;hp=41a2fa032ca019bfbdec44da23fc58433f46c6b2;hb=8dd2356c22327a15f0e16abbc887c4f72fc62985;hpb=054c7ecaf04f6aa5157d2709d36e38b8ed2b2e28 diff --git a/scripts/Build b/scripts/Build index 41a2fa0..be436fa 100755 --- a/scripts/Build +++ b/scripts/Build @@ -5,7 +5,7 @@ # this script is used to build hdw-linux packages. # -hdw_status="" +stage="" package="" no_src_del="" priority="" @@ -13,7 +13,7 @@ dir="*" while [ "$1" ] ; do case "$1" in - -stage) hdw_status=$2 ; shift 2 ;; + -stage) stage=$2 ; shift 2 ;; -package) package=$2 ; shift 2 ;; -no_src_del) no_src_del="1" ; shift 1 ;; -priority) priority=$2 ; shift 2 ;; @@ -34,9 +34,8 @@ if [ -z "$package" ]; then exit 1 fi -if [ -z "$hdw_status" ]; then - echo "stage level not specified. something went wrong ... hey," - echo "this is a development version ;)" +if [ -z "$stage" ]; then + echo "no stage level specified, abort." exit 1 fi @@ -47,13 +46,13 @@ fi export priority # load config andsubroutines -. ./scripts/Config -stage $hdw_status +. ./scripts/Config -stage $stage . ./scripts/subroutines # optimization . ./scripts/optimization # check for dietlibc -if [ "$hdw_status" != "1" -a "$hdw_use_dietlibc" = "1" ] ; then +if [ "$stage" != "1" -a "$hdw_use_dietlibc" = "1" ] ; then export CC="diet-dyn $CC -nostdinc" export CXX="diet-dyn $CXX -nostdinc" fi @@ -120,17 +119,17 @@ echo "found $package config file ..." make_conf=""; install_conf="" prefix=""; docdir="" - if [ "$hdw_status" -lt "2" ] ; then + if [ "$stage" -lt "2" ] ; then # use the symlink as prefix - prefix="/${s1_prefix}" + prefix="/${tc_name}" docdir="$prefix/share/doc/$package" install_conf="PREFIX=$prefix" else - if [ "$hdw_status" = "2" -o "$hdw_status" = "3" ] ; then + if [ "$stage" = "2" -o "$stage" = "3" ] ; then prefix="$root/usr"; docdir="$root/usr/doc/$package" localstatedir="$root/var" sysconfdir="$root/etc" - elif [ "$hdw_status" = "4" ] ; then + elif [ "$stage" = "4" ] ; then prefix="$root/opt/$package" docdir="$root/opt/$package/doc" localstatedir="$root/var/opt/$package" @@ -150,7 +149,7 @@ echo "found $package config file ..." confopt="$confopt --datadir=$prefix/share" confopt="$confopt --infodir=$prefix/info" confopt="$confopt --mandir=$prefix/man" - if [ "$hdw_status" -gt "1" ] ; then + if [ "$stage" -gt "1" ] ; then confopt="$confopt --localstatedir=$localstatedir" confopt="$confopt --sysconfdir=$sysconfdir" fi @@ -186,7 +185,7 @@ echo "found $package config file ..." # flist find variables/command flist_path="bin/ boot/ etc/ lib/ opt/ sbin/ usr/ var/" - [ "$hdw_status" -lt "2" ] && flist_path="${flist_path} ${s1_prefix}/" + [ "$stage" -lt "2" ] && flist_path="${flist_path} ${tc_name}/" flist_cmd="find \$flist_path \( -cnewer $root/.time_$package -o \ -newer $root/.time_$package \) \( -not -type d -o \ -type d -empty \) -print" @@ -203,7 +202,7 @@ echo "found $package config file ..." umask 0022 # run ldconfig to, maybe we installed some libs before! - if [ "$hdw_status" != "1" ] ; then + if [ "$stage" != "1" ] ; then echo "running ldconfig ..." ldconfig fi @@ -284,7 +283,7 @@ echo "found $package config file ..." done fi # stage specific patches - for xtra_patch in `ls $confdir/*.patch.${hdw_status} 2> /dev/null`; do + for xtra_patch in `ls $confdir/*.patch.${stage} 2> /dev/null`; do echo "applying patch $xtra_patch ..." patch -Nfp1 < $xtra_patch done @@ -295,6 +294,7 @@ echo "found $package config file ..." echo echo "Debug: (buildenvironment)" printenv + echo "gcc to use: `which gcc`, `which cc`" echo fi build_main @@ -310,7 +310,7 @@ echo "found $package config file ..." done fi # setup scripts - if [ "$hdw_status" != "1" ] ; then + if [ "$stage" != "1" ] ; then for my_setup in `ls $confdir/*.setup 2> /dev/null`; do create_setup_scripts $my_setup done @@ -326,23 +326,23 @@ echo "found $package config file ..." # let's create the flist append="" - [ "$hdw_status" = "0" ] && append=".stage0" - [ "$hdw_status" = "1" ] && append=".stage1" + [ "$stage" = "0" ] && append=".stage0" + [ "$stage" = "1" ] && append=".stage1" append="${append}-${priority}" export package export append - export hdw_status + export stage export priority awk '\ BEGIN { package=ENVIRON["package"] ; append=ENVIRON["append"] ; \ - stage=ENVIRON["hdw_status"] ; priority=ENVIRON["priority"] } \ + stage=ENVIRON["stage"] ; priority=ENVIRON["priority"] } \ { print package ": " $0 } \ END { print package ": " "var/adm/logs/" stage "-" priority "-" \ package ; \ print package ": " "var/adm/flists/" package append }' \ $root/flist.$package > $root/var/adm/flists/${package}${append} # manually add dependency files, calculated after flist - if [ "$hdw_status" -ge "3" ] ; then + if [ "$stage" -ge "3" ] ; then echo "${package}: var/adm/deps/build/$package" >> \ $root/var/adm/flists/${package}${append} echo "${package}: var/adm/deps/run/$package" >> \ @@ -352,13 +352,13 @@ echo "found $package config file ..." # build/runtime dependencies (just libs >= stage 3, # default is 'hardcoded') # still in development !! - if [ "$hdw_status" -ge "3" ] ; then + if [ "$stage" -ge "3" ] ; then # build deps rm -f $root/var/adm/deps/build/$package echo -n "calculating build dependencies ... " alldeps="" for lib in `grep '\ -l[A-Za-z]' \ - $root/var/adm/logs/${hdw_status}-${priority}-$package.out`; do + $root/var/adm/logs/${stage}-${priority}-$package.out`; do if [ -n "`echo $lib | grep '^-l'`" ] ; then lib=${lib//-l/lib} for dep in `grep "/$lib\." \ @@ -391,7 +391,7 @@ echo "found $package config file ..." grep -v '^ldd'`; do for rpkg in `grep $rdep -r \ $root/var/adm/flists | \ - grep -v $s1_prefix | \ + grep -v $tc_name | \ awk -F: '{ print $2 }'`; do add=1 for cmp in $alldeps; do @@ -411,7 +411,7 @@ echo "found $package config file ..." grep -v '^ldd'`; do for rpkg in `grep $rdep -r \ $root/var/adm/flists | \ - grep -v $s1_prefix | \ + grep -v $tc_name | \ awk -F: '{ print $2 }'`; do add=1 for cmp in $alldeps; do