]> wagnertech.de Git - projects.git/blobdiff - tools/make/mconfigure
gitarre
[projects.git] / tools / make / mconfigure
index 4f0410ad4a62ac16e69c395de444beb9417ae183..0d053b1658538a3fb859fdcd1cd303ad5e2028c8 100755 (executable)
@@ -3,7 +3,8 @@ set -e
 
 function echo_usage {
        echo "usage: mconfigure [options] <package>"
-       ./configure -I
+       echo "  -o: old style build (not recommended"
+       ./configure -h
 }
 
 function create_conf {
@@ -16,7 +17,7 @@ function create_conf {
                then
                        echo "compile_type=CPP" > debian/$paket.conf
                else
-                       echo "compile_type=OLD" > debian/$paket.conf
+                       echo "compile_type=ANY" > debian/$paket.conf
                fi
        else
                echo "compile_type=NONE" > debian/$paket.conf
@@ -45,9 +46,11 @@ configure=0
 configure_args="-i debian/tmp"
 while [ $OPTIND -le "$#" ]
 do
-       if getopts "c" opt
+       if getopts "o" opt
        then
                case $opt in
+                       o) old_build=1
+                               ;;
                        \?) $confirure_args="$configure_ars -$OPTARG"
                                if [ $OPTARG="a" -o $OPTARG="C" -o $OPTARG="i" -o $OPTARG="v" ]
                                then
@@ -99,19 +102,29 @@ then
                rm -rf ~/build
                mkdir ~/build
        fi
-       configure_args="$configure_args -b"
+       configure_args="$configure_args -d ~/build"
 fi
 
 # perform configure
 . debian/$paket.conf
-if [ -n "$compile_dir" ]
+if [ -n $old_build ]
 then
-       configure_args="$configure_args -b $compile_dir"
+       rm debian/$paket.conf
 fi
-if [ -z "$compile_type" ]
+
+if [ "$compile_type" != "NONE" ]
 then
-       echo "compile_type required in $paket.conf"
-       exit 51
+       configure_args="$configure_args -b"
+       if [ -n "$compile_dir" ]
+       then
+               configure_args="$configure_args -d $compile_dir"
+       fi
+       if [ -z "$compile_type" ]
+       then
+               echo "compile_type required in $paket.conf"
+               exit 51
+       fi
+       configure_args="$configure_args -c $compile_type"
 fi
 if [ "$target_type" == "FILE" ]
 then
@@ -177,14 +190,20 @@ then
 elif [ "$target_type" == "FILE" ]
 then
        echo "PACK=version" >> debian/rules.pre
-       if [ "$compile_type" != "OLD" ]
+       if [ "$compile_type" != "ANY" ]
        then
                if [ -z "$compile_target" ]
                then
                        echo "compile_target is needed for target_type FILE"
                        exit 12
                fi
-               echo "TARGET = $compile_target" >> debian/rules.pre
+               echo "COMPILE_TARGET = $compile_target" >> debian/rules.pre
+               if [ -n "$target_name" ]
+               then
+                       echo "TARGET = $target_name" >> debian/rules.pre
+               else
+                       echo "TARGET = $paket" >> debian/rules.pre
+               fi
        fi
 else
        echo "Unknown target type: $target_type"