reorganized Config file
[hdw-linux/hdw-linux.git] / scripts / Build
index 4d1bb3c..41a2fa0 100755 (executable)
@@ -150,15 +150,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
                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()   { 
@@ -351,7 +352,7 @@ echo "found $package config file ..."
        # build/runtime dependencies (just libs >= stage 3, 
        # default is 'hardcoded')
        # still in development !!
-       if [ "$hdw_status" -ge "2" ] ; then
+       if [ "$hdw_status" -ge "3" ] ; then
                # build deps
                rm -f $root/var/adm/deps/build/$package
                echo -n "calculating build dependencies ... "
@@ -375,6 +376,7 @@ echo "found $package config file ..."
                for dep in $alldeps; do
                        echo "$dep" >> $root/var/adm/deps/build/$package
                done
+               touch $root/var/adm/deps/build/$package
                echo "done"
                # runtime deps
                rm -f $root/var/adm/deps/run/$package
@@ -383,32 +385,47 @@ echo "found $package config file ..."
                for binary in `grep 'bin\/' \
                                $root/var/adm/flists/${package}${append} | \
                                awk '{ print $2 }'`; do
-                       for rdep in `ldd $root/$binary | awk '{ print $3 }' | \
-                                       sed 's$/$$'i | grep -v stage | \
-                                       awk -F: '{ print $2 }'`; do
-                               add=1
-                               for cmp in $alldeps; do
-                                       [ "$cmp" = "rdep" ] && add=0
+                       for rdep in `ldd $root/$binary 2>&1 | \
+                                       awk '{ print $3 }' | \
+                                       sed 's$/$$' | grep -v 'dynamic' | \
+                                       grep -v '^ldd'`; do
+                               for rpkg in `grep $rdep -r \
+                                               $root/var/adm/flists | \
+                                               grep -v $s1_prefix | \
+                                               awk -F: '{ print $2 }'`; do
+                                       add=1
+                                       for cmp in $alldeps; do
+                                               [ "$cmp" = "$rpkg" ] && add=0
+                                       done
+                                       [ "$add" = "1" ] && \
+                                               alldeps="$rpkg $alldeps"
                                done
-                               [ "$add" = "1" ] && alldeps="$rdep $alldeps"
                        done
                done
                for library in `grep 'lib\/.*.so.*' \
                                $root/var/adm/flists/${package}${append} | \
                                awk '{ print $2 }'`; do
-                       for rdep in `ldd $root/$binary | awk '{ print $3 }' | \
-                                       sed 's$/$$'i | grep -v stage | \
-                                       awk -F: '{ print $2 }'`; do
-                               add=1
-                               for cmp in $alldeps; do
-                                       [ "$cmp" = "rdep" ] && add=0
+                       for rdep in `ldd $root/$library 2>&1 | \
+                                       awk '{ print $3 }' | \
+                                       sed 's$/$$' | grep -v 'dynamic' | \
+                                       grep -v '^ldd'`; do
+                               for rpkg in `grep $rdep -r \
+                                               $root/var/adm/flists | \
+                                               grep -v $s1_prefix | \
+                                               awk -F: '{ print $2 }'`; do
+                                       add=1
+                                       for cmp in $alldeps; do
+                                               [ "$cmp" = "$rpkg" ] && add=0
+                                       done
+                                       [ "$add" = "1" ] && \
+                                               alldeps="$rpkg $alldeps"
                                done
-                               [ "$add" = "1" ] && alldeps="$rdep $alldeps"
                        done
                done
                for dep in $alldeps; do
                        echo "$dep" >> $root/var/adm/deps/run/$package
                done
+               touch $root/var/adm/deps/run/$package
                echo "done"
        fi