Index: configure
===================================================================
--- configure	(revision 25a9b5adefaebb173fab189e8ba954167858e6b7)
+++ configure	(revision c59712ef719214c06c49604e482d89f51c7745d4)
@@ -665,13 +665,4 @@
 CXX
 CFA_FLAGS
-MACHINE_TYPE
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
 BUILD_IN_TREE_FLAGS
 BUILD_IN_TREE_FLAGS_NOLIB
@@ -683,16 +674,19 @@
 CFA_INCDIR
 CFA_PREFIX
+CFA_BACKEND_CC
+BACKEND_CC
 DOendif
 DOifskipcompile
-BUILD_CONCURRENCY_FALSE
-BUILD_CONCURRENCY_TRUE
-BUILD_NO_LIB_FALSE
-BUILD_NO_LIB_TRUE
-BUILD_DEBUG_FALSE
-BUILD_DEBUG_TRUE
-BUILD_RELEASE_FALSE
-BUILD_RELEASE_TRUE
-CFA_BACKEND_CC
-BACKEND_CC
+LIBCFA_TARGET_MAKEFILES
+LIBCFA_TARGET_DIRS
+TARGET_HOSTS
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
 CFA_NAME
 am__untar
@@ -767,8 +761,6 @@
 enable_silent_rules
 with_cfa_name
+with_target_hosts
 with_backend_compiler
-enable_target_release
-enable_target_debug
-enable_threading
 enable_dependency_tracking
 '
@@ -1420,8 +1412,4 @@
   --enable-silent-rules   less verbose build output (undo: "make V=1")
   --disable-silent-rules  verbose build output (undo: "make V=0")
-  --enable-target-release Build and install the release target
-  --enable-target-debug   Build and install the debug target
-  --enable-threading      Build and install libcfa with threading support
-                          (Enabled by default)
   --enable-dependency-tracking
                           do not reject slow dependency extractors
@@ -1433,4 +1421,5 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-cfa-name=NAME     NAME too which cfa will be installed
+  --with-target-hosts=HOSTS     HOSTS comma seperated list of hosts to build for, format ARCH:debug|nodebug|nolib
   --with-backend-compiler=PROGRAM     PROGRAM that performs the final code compilation (must be gcc-compatible)
 
@@ -3077,4 +3066,5 @@
 
 
+#==============================================================================
 #Trasforming cc1 will break compilation
 if test "${program_transform_name}" = ""; then
@@ -3083,4 +3073,5 @@
 fi
 
+#Define the new name of the installed command
 
 # Check whether --with-cfa-name was given.
@@ -3092,7 +3083,133 @@
 
 
-#Define the new name of the installed command
 CFA_NAME=${cfa_name}
 
+
+#==============================================================================
+# handle the list of hosts to build for
+for var in $ac_configure_args
+do
+	#strip quotes surrouding values
+	var=$(echo $var | sed s/\'//g)
+	case $var in
+		# skip cross compilation related arguments
+		--host=*) ;; host_alias=*) ;; --build=*) ;; build_alias=*) ;; --target=*) ;; target_alias=*) ;;
+
+		# append all other arguments to the sub configure arguments
+		*) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";;
+	esac
+done
+
+echo $LIBCFA_GENERAL_ARGS
+
+#==============================================================================
+# handle the list of hosts to build for
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+default_target="${host_cpu}:debug, ${host_cpu}:nodebug"
+
+# Check whether --with-target-hosts was given.
+if test "${with_target_hosts+set}" = set; then :
+  withval=$with_target_hosts; target_hosts=$withval
+else
+  target_hosts=${default_target}
+fi
+
+
+TARGET_HOSTS=${target_hosts}
+
+
+for i in $(echo $target_hosts | sed "s/,/ /g")
+do
+	# call your procedure/other scripts here below
+	lib_arch=$(echo $i | sed -r "s/:(.*)//g")
+	lib_config=$(echo $i | sed -r "s/(.*)://g")
+	lib_dir="libcfa-${lib_arch}-${lib_config}"
+
+	LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}"
+	LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile"
+
+	mkdir -p libcfa-${lib_arch}-${lib_config}
+	echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data
+	echo -n "--host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data
+	echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data
+done
+
+
+
+
+
+#==============================================================================
+# version information
 
 rm -f version
@@ -3146,6 +3263,17 @@
 
 
-# Installation paths
-
+#==============================================================================
+# HACK to be able to use conditionnals inside makefiles
+DOifskipcompile='ifeq ($(skipcompile),yes)
+else'
+
+
+
+DOendif='endif'
+
+
+
+#==============================================================================
+# backend compiler implementation
 
 # Check whether --with-backend-compiler was given.
@@ -3157,7 +3285,7 @@
 
 if test "x$backendcompiler" != "x"; then
-	BACKEND_CC=${backendcompiler}
-else
-	# Extract the first word of "gcc", so it can be a program name with args.
+       BACKEND_CC=${backendcompiler}
+else
+       # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -3198,9 +3326,9 @@
 fi
 
-	# check gcc installed
-	if test "x$BACKEND_CC" = "x"; then
-		as_fn_error $? "some version of gcc is needed. Get it at ftp://ftp.gnu.org" "$LINENO" 5
-		exit 1
-	fi
+       # check gcc installed
+       if test "x$BACKEND_CC" = "x"; then
+               as_fn_error $? "some version of gcc is needed. Get it at ftp://ftp.gnu.org" "$LINENO" 5
+               exit 1
+       fi
 fi
 
@@ -3211,121 +3339,6 @@
 
 
-
-
-# Check whether --enable-target-release was given.
-if test "${enable_target_release+set}" = set; then :
-  enableval=$enable_target_release;
-fi
-
-# Check whether --enable-target-debug was given.
-if test "${enable_target_debug+set}" = set; then :
-  enableval=$enable_target_debug;
-fi
-
-# Check whether --enable-threading was given.
-if test "${enable_threading+set}" = set; then :
-  enableval=$enable_threading; case "${enableval}" in
-  yes) build_threading="yes" ;;
-  no)  build_threading="no" ;;
-  *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
-esac
-else
-  build_threading="yes"
-fi
-
-
-case "$enable_target_release" in
-	yes)
-		case "$enable_target_debug" in
-			yes)
-				build_release="yes"
-				build_debug="yes"
-				;;
-			no)
-				build_release="yes"
-				build_debug="no"
-				;;
-			*)
-				build_release="yes"
-				build_debug="no"
-				;;
-		esac
-		;;
-	no)
-		case "$enable_target_debug" in
-			yes)
-				build_release="no"
-				build_debug="yes"
-				;;
-			no)
-				build_release="no"
-				build_debug="no"
-				;;
-			*)
-				build_release="no"
-				build_debug="yes"
-				;;
-		esac
-		;;
-	*)
-		case "$enable_target_debug" in
-			yes)
-				build_release="no"
-				build_debug="yes"
-				;;
-			no)
-				build_release="yes"
-				build_debug="no"
-				;;
-			*)
-				build_release="yes"
-				build_debug="yes"
-				;;
-		esac
-		;;
-esac
-
- if test "x$build_release" = "xyes"; then
-  BUILD_RELEASE_TRUE=
-  BUILD_RELEASE_FALSE='#'
-else
-  BUILD_RELEASE_TRUE='#'
-  BUILD_RELEASE_FALSE=
-fi
-
- if test "x$build_debug" = "xyes"; then
-  BUILD_DEBUG_TRUE=
-  BUILD_DEBUG_FALSE='#'
-else
-  BUILD_DEBUG_TRUE='#'
-  BUILD_DEBUG_FALSE=
-fi
-
- if test "x$build_release$build_debug" = "xnono"; then
-  BUILD_NO_LIB_TRUE=
-  BUILD_NO_LIB_FALSE='#'
-else
-  BUILD_NO_LIB_TRUE='#'
-  BUILD_NO_LIB_FALSE=
-fi
-
- if test "x$build_threading" = "xyes"; then
-  BUILD_CONCURRENCY_TRUE=
-  BUILD_CONCURRENCY_FALSE='#'
-else
-  BUILD_CONCURRENCY_TRUE='#'
-  BUILD_CONCURRENCY_FALSE=
-fi
-
-
-DOifskipcompile='ifeq ($(skipcompile),yes)
-else'
-
-
-
-DOendif='endif'
-
-
-
+#==============================================================================
+# Installation paths
 if test "x$prefix" = "xNONE"; then
 	cfa_prefix=${ac_default_prefix}
@@ -3380,4 +3393,5 @@
 
 
+#==============================================================================
 # Create variables for commonly used targets
 DRIVER_DIR='$(top_builddir)/driver'
@@ -3403,4 +3417,5 @@
 
 
+#==============================================================================
 # Flag variables needed to build in tree
 LIBCFA_SRC='$(top_srcdir)/libcfa/src'
@@ -3411,101 +3426,6 @@
 
 
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-MACHINE_TYPE=$host_cpu
-
-
-if ! test "$host_cpu" = "$build_cpu"; then
-	case $host_cpu in
-		i386)
-			CFLAGS+=" -m32 "
-			CXXFLAGS+=" -m32 "
-			CFAFLAGS+=" -m32 "
-			LDFLAGS+=" -m32 "
-			;;
-		i686)
-			CFLAGS+=" -m32 "
-                  CXXFLAGS+=" -m32 "
-                  CFAFLAGS+=" -m32 "
-                  LDFLAGS+=" -m32 "
-			;;
-		x86_64)
-			CFLAGS+=" -m64 "
-			CXXFLAGS+=" -m64 "
-			CFAFLAGS+=" -m64 "
-			LDFLAGS+=" -m64 "
-			;;
-	esac
-fi
-
+#==============================================================================
+# CAFLAGS
 
 cat >>confdefs.h <<_ACEOF
@@ -3516,4 +3436,5 @@
 
 
+#==============================================================================
 # Checks for programs.
 ac_ext=cpp
@@ -6298,5 +6219,6 @@
 
 
-ac_config_files="$ac_config_files Makefile driver/Makefile src/Makefile benchmark/Makefile tests/Makefile tests/preempt_longrun/Makefile libcfa/prelude/Makefile libcfa/src/Makefile tools/Makefile tools/prettyprinter/Makefile"
+#==============================================================================
+ac_config_files="$ac_config_files Makefile driver/Makefile src/Makefile benchmark/Makefile tests/Makefile tests/preempt_longrun/Makefile tools/Makefile tools/prettyprinter/Makefile"
 
 
@@ -6431,20 +6353,4 @@
 fi
 
-if test -z "${BUILD_RELEASE_TRUE}" && test -z "${BUILD_RELEASE_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_RELEASE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_DEBUG_TRUE}" && test -z "${BUILD_DEBUG_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_DEBUG\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_NO_LIB_TRUE}" && test -z "${BUILD_NO_LIB_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_NO_LIB\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${BUILD_CONCURRENCY_TRUE}" && test -z "${BUILD_CONCURRENCY_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_CONCURRENCY\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error $? "conditional \"AMDEP\" was never defined.
@@ -7067,6 +6973,4 @@
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/preempt_longrun/Makefile") CONFIG_FILES="$CONFIG_FILES tests/preempt_longrun/Makefile" ;;
-    "libcfa/prelude/Makefile") CONFIG_FILES="$CONFIG_FILES libcfa/prelude/Makefile" ;;
-    "libcfa/src/Makefile") CONFIG_FILES="$CONFIG_FILES libcfa/src/Makefile" ;;
     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
     "tools/prettyprinter/Makefile") CONFIG_FILES="$CONFIG_FILES tools/prettyprinter/Makefile" ;;
@@ -7832,22 +7736,4 @@
 
 
-if test -z "$BUILD_RELEASE_TRUE"; then :
-  if test -z "$BUILD_DEBUG_TRUE"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release & debug" >&5
-$as_echo "$as_me: Building libcfa for target: release & debug" >&6;}
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: release" >&5
-$as_echo "$as_me: Building libcfa for target: release" >&6;}
-fi
-else
-  if test -z "$BUILD_DEBUG_TRUE"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Building libcfa for target: debug" >&5
-$as_echo "$as_me: Building libcfa for target: debug" >&6;}
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Running cfa without libcfa" >&5
-$as_echo "$as_me: Running cfa without libcfa" >&6;}
-fi
-fi
-
 # Final text
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Cforall configuraton completed. Type \"make -j 8 install\"." >&5
