]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.1
authorfred <fred>
Sun, 24 Mar 2002 19:50:39 +0000 (19:50 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:50:39 +0000 (19:50 +0000)
configure
flower/configure

index d2c4808da791628f7a108f90aa205d687269669b..ab1ca42f2771ed4a9aba4bcb51eb842f1fc78cae 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,9 +14,9 @@ ac_default_prefix=/usr/local
 ac_help="$ac_help
   enable-printing         turn on debug printing"
 ac_help="$ac_help
-  enable-checking        set runtime checks (assert calls). Default: on"
+  enable-checking         set runtime checks (assert calls). Default: on"
 ac_help="$ac_help
-  enable-debugging       set debug info. Default: on"
+  enable-debugging        set debug info. Default: on"
 ac_help="$ac_help
   enable-optimise         use maximal speed optimisations. Default: off"
 ac_help="$ac_help
@@ -28,7 +28,7 @@ ac_help="$ac_help
 ac_help="$ac_help
   tex-dir=DIR             set the directory to put LilyPond TeX files in. "
 ac_help="$ac_help
-  mf-dir=DIR              set the directory to put LilyPond MetaFont files in."
+  out-dir                 set the directory for machine generated files. Default out or out-HOST"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -538,22 +538,27 @@ fi
 
 
 
+if test x$srcdir != x.; then
+  echo Please look in the INSTALL instructions for
+  echo directions for multi-architecture building
+    
+  { echo "configure: error: This package does not support --srcdir." 1>&2; exit 1; }
+fi
+
 # if given here, these vars are initted at the checking point.
 if test x$host = xNONE; then
-    buildprefix=.
+    OUTDIR_NAME=${OUTDIR_NAME-"out"}
 else
-    buildprefix="$host-build-dir"
-    mkdir $buildprefix;
-    for a in `find -type d -and -not -name '*-build-dir'`; do
-       mkdir $buildprefix/$a;
-    done
+    OUTDIR_NAME=${OUTDIR_NAME-"out-$host"}
 fi
+
 printing_b=no
 checking_b=yes
 debug_b=yes
 optimise_b=no
 profile_b=no
 warn_b=no    
+
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -625,12 +630,14 @@ else
 fi
 
 
-# Check whether --enable-mf-dir or --disable-mf-dir was given.
-if test "${enable_mf_dir+set}" = set; then
-  enableval="$enable_mf_dir"
-  MFDIR=$enableval
-else
-  MFDIR=auto 
+
+
+
+# Check whether --enable-out-dir or --disable-out-dir was given.
+if test "${enable_out_dir+set}" = set; then
+  enableval="$enable_out_dir"
+  OUTDIR_NAME=$enableval
+    
 fi
 
 
@@ -660,6 +667,14 @@ if test $optimise_b = yes; then
     DEFINES="$DEFINES -O2 -DSTRING_UTILS_INLINED"
 fi
 
+if test "x$OSTYPE" = "xWindows_NT"; then
+    LN=cp # hard link does not work under cygnus-nt (yet?)
+    ZIP="zip -r -9" #
+else
+    LN=ln
+    ZIP="zip -r -9"
+fi
+
 AUTOHEADER="This file was automatically generated by configure"
 CPPFLAGS=${CPPFLAGS:-""}       # we don't want -g -O junk
 CXXFLAGS=${CXXFLAGS:-""}       # we don't want -g -O junk
@@ -669,7 +684,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:673: checking for $ac_word" >&5
+echo "configure:688: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -700,7 +715,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:704: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:719: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -710,11 +725,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 714 "configure"
+#line 729 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -734,12 +749,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:738: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:753: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:743: checking whether we are using GNU C++" >&5
+echo "configure:758: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -748,7 +763,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -763,7 +778,7 @@ if test $ac_cv_prog_gxx = yes; then
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS=
   echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:767: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:782: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -793,7 +808,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:797: checking for $ac_word" >&5
+echo "configure:812: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -849,7 +864,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:853: checking for a BSD compatible install" >&5
+echo "configure:868: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -903,7 +918,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:907: checking for $ac_word" >&5
+echo "configure:922: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -937,7 +952,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:941: checking for $ac_word" >&5
+echo "configure:956: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -973,7 +988,11 @@ if test FIND = error; then
     warn_b=yes
 
 fi
-    
+
+
+
+
+
 
 
 
@@ -995,7 +1014,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:999: checking for $ac_word" >&5
+echo "configure:1018: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1029,7 +1048,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1033: checking for $ac_word" >&5
+echo "configure:1052: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1063,7 +1082,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1067: checking for $ac_word" >&5
+echo "configure:1086: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1095,7 +1114,7 @@ test -n "$MAKE" || MAKE="error"
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1099: checking for $ac_word" >&5
+echo "configure:1118: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1129,7 +1148,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1133: checking for $ac_word" >&5
+echo "configure:1152: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1165,7 +1184,7 @@ if test "x$TEXPREFIX" = xauto ; then
     
 
     echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6
-echo "configure:1169: checking TeX/MF root dir directory" >&5    
+echo "configure:1188: checking TeX/MF root dir directory" >&5    
 
     find_root_prefix="$prefix"
     
@@ -1206,7 +1225,7 @@ if test "x$TEXDIR" = xauto ; then
     
     
     echo $ac_n "checking TeX input directory""... $ac_c" 1>&6
-echo "configure:1210: checking TeX input directory" >&5    
+echo "configure:1229: checking TeX input directory" >&5    
     find_dirdir=`(cd $find_texprefix; 
       $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')`
     
@@ -1227,59 +1246,73 @@ echo "configure:1210: checking TeX input directory" >&5
 fi
 
     
-if test $MAKE = "error" 
-then
-       { echo "configure: error: Please install GNU make" 1>&2; exit 1; }
-else
-       $MAKE -v| grep GNU > /dev/null
-       if test "$?" = 1
+
+
+       if test $MAKE = "error" 
        then
-           
-    echo "configure: warning: Please install *GNU* make" 1>&2
+               
+    echo "configure: warning: can't find GNU make. You should install GNU make" 1>&2
     warn_b=yes
-    fi 
-fi 
-    
-if test $BISON = "error" 
-then
-       
-    echo "configure: warning: can't find bison. Please install Bison (1.25 or better)" 1>&2
+
+       fi
+
+
+       if test $BISON = "error" 
+       then
+               
+    echo "configure: warning: can't find bison. Please install Bison" 1>&2
     warn_b=yes
 
-else
-    bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
-    if test $bison_version -lt 25; then
-       
-    echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2
+       fi
+
+
+       if test $PERL = "error" 
+       then
+               
+    echo "configure: warning: can't find perl. You should install Perl" 1>&2
     warn_b=yes
 
-    fi 
-fi
+       fi
 
-if test $PERL = "error" 
-then
-       
-    echo "configure: warning: can't find perl. You should install Perl (version 5 or better)" 1>&2
+
+       if test $PODMAN = "error" 
+       then
+               
+    echo "configure: warning: can't find pod. You should install Perl" 1>&2
     warn_b=yes
 
-       PERL=/usr/bin/perl
-fi
+       fi
 
-if test $PODMAN = "error" 
-then
-       
-    echo "configure: warning: can't find pod. You should install Perl (version 5 or better)" 1>&2
+
+       if test $FLEX = "error" 
+       then
+               
+    echo "configure: warning: can't find flex. Please install Flex" 1>&2
     warn_b=yes
 
-fi
+       fi
 
-if test $FLEX = "error" 
-then
+
+
+if test $MAKE != "error" ; then
+    $MAKE -v| grep GNU > /dev/null
+    if test "$?" = 1
+    then
+           
+    echo "configure: warning: Please install *GNU* make" 1>&2
+    warn_b=yes
+    fi 
+fi 
+    
+if test $BISON != "error"; then
+    bison_version=`$BISON --version| sed 's/^.*version 1.//g' `
+    if test $bison_version -lt 25; then
        
-    echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2
+    echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2
     warn_b=yes
 
+    fi 
 fi
 
 if $CXX --version | grep '2\.7' > /dev/null
@@ -1293,7 +1326,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
-echo "configure:1297: checking how to run the C++ preprocessor" >&5
+echo "configure:1330: checking how to run the C++ preprocessor" >&5
 if test -z "$CXXCPP"; then
 if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1306,12 +1339,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
   CXXCPP="${CXX-g++} -E"
   cat > conftest.$ac_ext <<EOF
-#line 1310 "configure"
+#line 1343 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1331,17 +1364,17 @@ echo "$ac_t""$CXXCPP" 1>&6
 
 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6
-echo "configure:1335: checking for FlexLexer.h" >&5
+echo "configure:1368: checking for FlexLexer.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1340 "configure"
+#line 1373 "configure"
 #include "confdefs.h"
 #include <FlexLexer.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1378: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1367,8 +1400,18 @@ else
 fi
 
 
+for a in `find -type d -and -not -name 'out*'`; do
+    if test ! -d  $a/$OUTDIR_NAME; then
+       mkdir $a/$OUTDIR_NAME
+    fi
+done
+
 subdirs="flower"
 
+
+# ugh
+eval "DIR_DATADIR=$datadir/lilypond"
+    
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -1482,7 +1525,9 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "$buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
+    lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
+    Makefile:make/Toplevel.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1518,6 +1563,7 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
 s%@TAR@%$TAR%g
 s%@FIND@%$FIND%g
+s%@OUTDIR_NAME@%$OUTDIR_NAME%g
 s%@ICFLAGS@%$ICFLAGS%g
 s%@ILDFLAGS@%$ILDFLAGS%g
 s%@DEFINES@%$DEFINES%g
@@ -1525,10 +1571,13 @@ s%@COMPILEINFO@%$COMPILEINFO%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@BISON@%$BISON%g
 s%@FLEX@%$FLEX%g
+s%@LN@%$LN%g
 s%@PERL@%$PERL%g
+s%@ZIP@%$ZIP%g
 s%@TEXPREFIX@%$TEXPREFIX%g
 s%@TEXDIR@%$TEXDIR%g
 s%@MFDIR@%$MFDIR%g
+s%@DIR_DATADIR@%$DIR_DATADIR%g
 s%@EXTRA_LIBES@%$EXTRA_LIBES%g
 s%@MAKE@%$MAKE%g
 s%@PODMAN@%$PODMAN%g
@@ -1575,7 +1624,9 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"$buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in"}
+CONFIG_FILES=\${CONFIG_FILES-"make/$OUTDIR_NAME/Configure_variables.make:make/Configure_variables.make.in
+    lib/$OUTDIR_NAME/config.hh:lib/config.hh.in
+    Makefile:make/Toplevel.make.in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -1744,49 +1795,20 @@ if test "$no_recursion" != yes; then
 fi
 
 
-
-
-eval "DIR_DATADIR=$datadir"
-DIR_DATADIR="$DIR_DATADIR/lilypond"
-echo $ac_n "checking ""... $ac_c" 1>&6
-echo "configure:1753: checking " >&5
-
-cat << EOF > $buildprefix/lib/out/config.hh
-
-/* automatically generated by configure */
-/* include this file only once! */
-
-#define  DIR_DATADIR "$DIR_DATADIR"
-
-EOF
-
-CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh
-
-touch $buildprefix/make/out/Site.make
-
-# ugr
-(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh
-
-)
-(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh
-)
-
-echo '# WARNING : Automatically generated from make/Toplevel.make.in' \
-    | cat - make/Toplevel.make.in > Makefile
-
+touch make/$OUTDIR_NAME/Site.make
 
 cat << END
 For making everything, do:
 
     make               # GNU make
 
-or if you used --host=SunUltraWitteReus
+or if you used --outdir=blabla
 
-    make buildprefix=SunUltraWitteReus-build-dir
+    make OUTDIR_NAME=blabla
     
 If you want to make site-wide extensions to the makefiles, please use
 
-    make/out/Site.make
+    make/$OUTDIR_NAME/Site.make
     
 END
 
index 53ff4301cf99ed7da2bee61ce08d75c89c17108d..920d8c0c0828e8229c395a6d319218d0f5e55b5b 100644 (file)
@@ -15,6 +15,8 @@ ac_help="$ac_help
   enable-shared       shared flower library"
 ac_help="$ac_help
   disable-optimise    optimisations off"
+ac_help="$ac_help
+  out-dir                      set the directory for machine generated files. Default out or out-HOST"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -534,16 +536,18 @@ optimise_b=yes
 shared_b=no
 LIB_SUFFIX=.a
 
-# if given here, these vars are initted at the checking point.
 if test x$host = xNONE; then
-    flowerbuildprefix=.
+    OUTDIR_NAME=${OUTDIR_NAME-"out"}
 else
-    flowerbuildprefix="../$host-build-dir/Flower"
-    mkdir $flowerbuildprefix;
-    for a in `find -type d -and -not -name '*-build-dir'`; do
-       mkdir $flowerbuildprefix/$a;
-    done
+    OUTDIR_NAME=${OUTDIR_NAME-"out-$host"}
 fi
+
+for a in `find -type d -and -not -name 'out'`; do
+       if test ! -d  $a/$OUTDIR_NAME; then
+               mkdir $a/$OUTDIR_NAME;
+       fi
+done
+
     
 # Check whether --enable-shared or --disable-shared was given.
 if test "${enable_shared+set}" = set; then
@@ -559,6 +563,14 @@ if test "${enable_optimise+set}" = set; then
 fi
 
 
+# Check whether --enable-out-dir or --disable-out-dir was given.
+if test "${enable_out_dir+set}" = set; then
+  enableval="$enable_out_dir"
+  OUTDIR_NAME=$enableval
+    
+fi
+
+
 if test $shared_b = yes; then
        MODULE_CXXFLAGS="$MODULE_CXXFLAGS -fPIC"
        MODULE_LDFLAGS="-shared -Wl,-soname,libflower.so "
@@ -578,7 +590,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:582: checking for $ac_word" >&5
+echo "configure:594: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -609,7 +621,7 @@ test -n "$CXX" || CXX="gcc"
 
 
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:613: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:625: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
 
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -619,11 +631,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L
 cross_compiling=$ac_cv_prog_cxx_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 623 "configure"
+#line 635 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cxx_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -643,12 +655,12 @@ if test $ac_cv_prog_cxx_works = no; then
   { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:647: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:659: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
 cross_compiling=$ac_cv_prog_cxx_cross
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:652: checking whether we are using GNU C++" >&5
+echo "configure:664: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -657,7 +669,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -672,7 +684,7 @@ if test $ac_cv_prog_gxx = yes; then
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS=
   echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:676: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:688: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -700,7 +712,7 @@ else
 fi
 
 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:704: checking for 8-bit clean memcmp" >&5
+echo "configure:716: checking for 8-bit clean memcmp" >&5
 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -708,7 +720,7 @@ else
   ac_cv_func_memcmp_clean=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 712 "configure"
+#line 724 "configure"
 #include "confdefs.h"
 #ifdef __cplusplus
 extern "C" void exit(int);
@@ -721,7 +733,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_memcmp_clean=yes
 else
@@ -739,12 +751,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:743: checking for vprintf" >&5
+echo "configure:755: checking for vprintf" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 748 "configure"
+#line 760 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -770,7 +782,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_vprintf=yes"
 else
@@ -794,12 +806,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:798: checking for _doprnt" >&5
+echo "configure:810: checking for _doprnt" >&5
 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 803 "configure"
+#line 815 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -825,7 +837,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func__doprnt=yes"
 else
@@ -852,12 +864,12 @@ fi
 for ac_func in memmem snprintf 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:856: checking for $ac_func" >&5
+echo "configure:868: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 861 "configure"
+#line 873 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -883,7 +895,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -908,8 +920,10 @@ fi
 done
 
 
+if test ! -d $OUTDIR_NAME ; then
+    mkdir $OUTDIR_NAME
+fi
 
-CXX="$ac_cv_prog_CXX" ../bin/make-version > $flowerbuildprefix/out/version.hh
 
 trap '' 1 2 15
 cat > confcache <<\EOF
@@ -1011,7 +1025,7 @@ done
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "$flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in $flowerbuildprefix/out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$OUTDIR_NAME/Flower-flags.make:Flower-flags.make.in $OUTDIR_NAME/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1087,7 +1101,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"$flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in"}
+CONFIG_FILES=\${CONFIG_FILES-"$OUTDIR_NAME/Flower-flags.make:Flower-flags.make.in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -1163,7 +1177,7 @@ ac_eD='%g'
 if test "${CONFIG_HEADERS+set}" != set; then
 EOF
 cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="$flowerbuildprefix/out/config.hh:config.hh.in"
+  CONFIG_HEADERS="$OUTDIR_NAME/config.hh:config.hh.in"
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 fi