X-Git-Url: https://hackdaworld.org/gitweb/?p=hdw-linux%2Fhdw-linux.git;a=blobdiff_plain;f=scripts%2FBuild;h=cd557713e8f1d2ad2573186cb7fbb2777953c42a;hp=1dbe2fe74f5b5e0622d7381ef5878f934aa79adf;hb=504579d0d381b02fc33fe1c696d64f96135a15a8;hpb=b756476d01e1ff39de954cc625e4e4744ff30841 diff --git a/scripts/Build b/scripts/Build index 1dbe2fe..cd55771 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,15 +149,16 @@ echo "found $package config file ..." confopt="$confopt --datadir=$prefix/share" confopt="$confopt --infodir=$prefix/info" confopt="$confopt --mandir=$prefix/man" - confopt="$confopt --build=$hdw_arch_build" - confopt="$confopt --host=$hdw_arch_target" - # crosscompiling - [ "$hdw_crossbuild" != "0" ] && \ - confopt="$confopt --target=$hdw_arch_target" - if [ "$hdw_status" -gt "1" ] ; then + if [ "$stage" -gt "1" ] ; then confopt="$confopt --localstatedir=$localstatedir" confopt="$confopt --sysconfdir=$sysconfdir" fi + # architecture specific stuff + confopt="$confopt --build=$hdw_arch_build" + confopt="$confopt --host=$hdw_arch_host" + # crosscompiling + [ "$package" = "gcc" -o "$package" = "binutils" ] && \ + confopt="$confopt --target=$hdw_arch_target" # buildfunctions pre_install() { @@ -185,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" @@ -202,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 @@ -283,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 @@ -309,7 +309,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 @@ -325,23 +325,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" >> \ @@ -351,13 +351,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\." \ @@ -390,7 +390,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 @@ -410,7 +410,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