Index: Makefile.in
===================================================================
--- Makefile.in	(revision 80868140c3a6350471c02fabe1fbf4a2a2712456)
+++ Makefile.in	(revision 1670eede8bc8cc428f900da7a93077718ecd2dcb)
@@ -68,8 +68,10 @@
 override MAKEFLAGS=
 
+# CVS formerly was xxx -- using CVS covers up a weird feature of the aclocal
+#  file in that it thinks CVS directories need a Makefile generated.
 $(MTARGETS): make_subdir
 	BASEDIR=`pwd`; \
-	for bsp in $(RTEMS_BSP) xxx; \
-	do if [ $$bsp != xxx ] ; then  \
+	for bsp in $(RTEMS_BSP) CVS; \
+	do if [ $$bsp != CVS ] ; then  \
 	    cd $$BASEDIR; \
 	    cmd="cd c; $(MAKE) RTEMS_BSP=$$bsp $(FLAGS_TO_PASS) \
Index: aclocal.m4
===================================================================
--- aclocal.m4	(revision 80868140c3a6350471c02fabe1fbf4a2a2712456)
+++ aclocal.m4	(revision 1670eede8bc8cc428f900da7a93077718ecd2dcb)
@@ -40,2 +40,62 @@
 AC_MSG_RESULT($rtems_cv_prog_MKDIR_M)
 ])
+
+dnl RTEMS_CHECK_MAKEFILE_T(path)
+dnl Private macro of RTEMS_CHECK_MAKEFILE
+AC_DEFUN(RTEMS_CHECK_MAKEFILE_T,
+[ test -f $srcdir/$1/Makefile.in && \
+    makefiles="$makefiles $1/Makefile"
+])
+
+dnl RTEMS_CHECK_MAKEFILE_R(path,temp,callback)
+dnl Private macro of RTEMS_CHECK_MAKEFILE
+dnl $1 path prefix
+dnl $2 temporary variable
+dnl $3 callback
+AC_DEFUN(RTEMS_CHECK_MAKEFILE_R,
+[ RTEMS_CHECK_MAKEFILE_T($1)
+  $2list=`ls $srcdir/$1`
+  for $2 in $$2list; do
+    if test -d "$srcdir/$1/$$2"; then
+      $3
+    fi
+  done
+])
+
+dnl RTEMS_CHECK_MAKEFILE(path)
+dnl Check for Makefile.in's within the directory starting
+dnl at path and append an entry for Makefile to global variable 
+dnl "makefiles" (from configure.in) for each Makefile.in found
+dnl 
+dnl NOTE: This function should be called recursivly, but m4-macro
+dnl expansion doesn't allow recursive macros. Therefore this
+dnl macro is expanded into a nonrecursive macro, limited to
+dnl a descrete directory depth, that should be sufficent.
+dnl 
+AC_DEFUN(RTEMS_CHECK_MAKEFILE,
+[ AC_MSG_CHECKING(for Makefiles in $1)
+  if test -d $srcdir/$1; then
+    RTEMS_CHECK_MAKEFILE_R($1,item,
+      RTEMS_CHECK_MAKEFILE_R($1/$item,item0,
+        RTEMS_CHECK_MAKEFILE_T($1/$item/$item0)
+      )
+    )
+    AC_MSG_RESULT(done)
+  else
+    AC_MSG_RESULT(no)
+  fi
+])
+
+dnl canonicalize target name
+dnl NOTE: Most rtems targets do not fullfil autoconf 
+dnl targets naming conventions "processor-vendor-os"
+dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
+dnl and we have to fix it for rtems ourselves 
+
+AC_DEFUN(RTEMS_CANONICAL_TARGET_CPU,
+[AC_MSG_CHECKING(rtems target cpu)
+changequote(<<, >>)dnl
+target_cpu=`echo $target | /usr/bin/sed 's%^\([^-]*\)-\(.*\)$%\1%'`
+changequote([, ])dnl
+AC_MSG_RESULT($target_cpu)
+])
Index: configure
===================================================================
--- configure	(revision 80868140c3a6350471c02fabe1fbf4a2a2712456)
+++ configure	(revision 1670eede8bc8cc428f900da7a93077718ecd2dcb)
@@ -552,14 +552,4 @@
 
 
-a29k_mk="c/src/exec/score/cpu/a29k/Makefile \
-c/src/lib/libbsp/a29k/Makefile \
-c/src/lib/libbsp/a29k/portsw/Makefile \
-c/src/lib/libbsp/a29k/portsw/console/Makefile \
-c/src/lib/libbsp/a29k/portsw/include/Makefile \
-c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile \
-c/src/lib/libbsp/a29k/portsw/startup/Makefile \
-c/src/lib/libbsp/a29k/portsw/wrapup/Makefile \
-c/src/lib/start/a29k/Makefile"
-
 i386_mk="c/src/exec/score/cpu/i386/Makefile \
 c/src/lib/libbsp/i386/Makefile \
@@ -590,200 +580,4 @@
 c/src/lib/libbsp/i386/go32/timer/Makefile \
 c/src/lib/libbsp/i386/go32/wrapup/Makefile"
-
-m68k_mk="c/src/exec/score/cpu/m68k/Makefile \
-c/src/lib/libbsp/m68k/Makefile \
-c/src/lib/libbsp/m68k/dmv152/Makefile \
-c/src/lib/libbsp/m68k/dmv152/clock/Makefile \
-c/src/lib/libbsp/m68k/dmv152/console/Makefile \
-c/src/lib/libbsp/m68k/dmv152/include/Makefile \
-c/src/lib/libbsp/m68k/dmv152/spurious/Makefile \
-c/src/lib/libbsp/m68k/dmv152/startup/Makefile \
-c/src/lib/libbsp/m68k/dmv152/timer/Makefile \
-c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile \
-c/src/lib/libbsp/m68k/efi332/Makefile \
-c/src/lib/libbsp/m68k/efi332/clock/Makefile \
-c/src/lib/libbsp/m68k/efi332/console/Makefile \
-c/src/lib/libbsp/m68k/efi332/include/Makefile \
-c/src/lib/libbsp/m68k/efi332/spurious/Makefile \
-c/src/lib/libbsp/m68k/efi332/startup/Makefile \
-c/src/lib/libbsp/m68k/efi332/start332/Makefile \
-c/src/lib/libbsp/m68k/efi332/timer/Makefile \
-c/src/lib/libbsp/m68k/efi332/wrapup/Makefile \
-c/src/lib/libbsp/m68k/efi68k/Makefile \
-c/src/lib/libbsp/m68k/efi68k/clock/Makefile \
-c/src/lib/libbsp/m68k/efi68k/console/Makefile \
-c/src/lib/libbsp/m68k/efi68k/include/Makefile \
-c/src/lib/libbsp/m68k/efi68k/spurious/Makefile \
-c/src/lib/libbsp/m68k/efi68k/startup/Makefile \
-c/src/lib/libbsp/m68k/efi68k/start68k/Makefile \
-c/src/lib/libbsp/m68k/efi68k/timer/Makefile \
-c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile \
-c/src/lib/libbsp/m68k/gen68302/Makefile \
-c/src/lib/libbsp/m68k/gen68302/clock/Makefile \
-c/src/lib/libbsp/m68k/gen68302/console/Makefile \
-c/src/lib/libbsp/m68k/gen68302/include/Makefile \
-c/src/lib/libbsp/m68k/gen68302/start302/Makefile \
-c/src/lib/libbsp/m68k/gen68302/startup/Makefile \
-c/src/lib/libbsp/m68k/gen68302/timer/Makefile \
-c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile \
-c/src/lib/libbsp/m68k/gen68360/Makefile \
-c/src/lib/libbsp/m68k/gen68360/clock/Makefile \
-c/src/lib/libbsp/m68k/gen68360/console/Makefile \
-c/src/lib/libbsp/m68k/gen68360/include/Makefile \
-c/src/lib/libbsp/m68k/gen68360/start360/Makefile \
-c/src/lib/libbsp/m68k/gen68360/startup/Makefile \
-c/src/lib/libbsp/m68k/gen68360/timer/Makefile \
-c/src/lib/libbsp/m68k/gen68360/network/Makefile \
-c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile \
-c/src/lib/libbsp/m68k/idp/Makefile \
-c/src/lib/libbsp/m68k/idp/clock/Makefile \
-c/src/lib/libbsp/m68k/idp/console/Makefile \
-c/src/lib/libbsp/m68k/idp/include/Makefile \
-c/src/lib/libbsp/m68k/idp/startup/Makefile \
-c/src/lib/libbsp/m68k/idp/timer/Makefile \
-c/src/lib/libbsp/m68k/idp/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme136/Makefile \
-c/src/lib/libbsp/m68k/mvme136/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme136/console/Makefile \
-c/src/lib/libbsp/m68k/mvme136/include/Makefile \
-c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile \
-c/src/lib/libbsp/m68k/mvme136/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme136/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme147/Makefile \
-c/src/lib/libbsp/m68k/mvme147/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme147/console/Makefile \
-c/src/lib/libbsp/m68k/mvme147/include/Makefile \
-c/src/lib/libbsp/m68k/mvme147/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme147/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/console/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/include/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme162/Makefile \
-c/src/lib/libbsp/m68k/mvme162/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme162/console/Makefile \
-c/src/lib/libbsp/m68k/mvme162/consolex/Makefile \
-c/src/lib/libbsp/m68k/mvme162/include/Makefile \
-c/src/lib/libbsp/m68k/mvme162/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme162/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme162/tod/Makefile \
-c/src/lib/libbsp/m68k/mvme162/tools/Makefile \
-c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile \
-c/src/lib/libbsp/m68k/ods68302/Makefile \
-c/src/lib/libbsp/m68k/ods68302/clock/Makefile \
-c/src/lib/libbsp/m68k/ods68302/console/Makefile \
-c/src/lib/libbsp/m68k/ods68302/include/Makefile \
-c/src/lib/libbsp/m68k/ods68302/start302/Makefile \
-c/src/lib/libbsp/m68k/ods68302/startup/Makefile \
-c/src/lib/libbsp/m68k/ods68302/timer/Makefile \
-c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile \
-c/src/lib/libcpu/m68k/Makefile \
-c/src/lib/libcpu/m68k/m68040/Makefile \
-c/src/lib/libcpu/m68k/m68040/fpsp/Makefile \
-c/src/lib/start/m68k/Makefile"
-
-no_cpu_mk="c/src/exec/score/cpu/no_cpu/Makefile \
-c/src/lib/libbsp/no_cpu/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile"
-
-sparc_mk="c/src/exec/score/cpu/sparc/Makefile \
-c/src/lib/libbsp/sparc/Makefile \
-c/src/lib/libbsp/sparc/erc32/Makefile \
-c/src/lib/libbsp/sparc/erc32/clock/Makefile \
-c/src/lib/libbsp/sparc/erc32/console/Makefile \
-c/src/lib/libbsp/sparc/erc32/include/Makefile \
-c/src/lib/libbsp/sparc/erc32/startsis/Makefile \
-c/src/lib/libbsp/sparc/erc32/startup/Makefile \
-c/src/lib/libbsp/sparc/erc32/timer/Makefile \
-c/src/lib/libbsp/sparc/erc32/wrapup/Makefile \
-c/src/lib/libcpu/sparc/Makefile \
-c/src/lib/libcpu/sparc/reg_win/Makefile"
-
-hppa1_1_mk="c/src/exec/score/cpu/hppa1_1/Makefile \
-c/src/exec/score/tools/hppa1_1/Makefile \
-c/src/lib/libbsp/hppa1_1/Makefile \
-c/src/lib/libbsp/hppa1_1/pxfl/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/include/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/shmsupp/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/startup/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/tools/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/tty/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/wrapup/Makefile \
-c/src/lib/libcpu/hppa1_1/Makefile \
-c/src/lib/libcpu/hppa1_1/clock/Makefile \
-c/src/lib/libcpu/hppa1_1/include/Makefile \
-c/src/lib/libcpu/hppa1_1/milli/Makefile \
-c/src/lib/libcpu/hppa1_1/runway/Makefile \
-c/src/lib/libcpu/hppa1_1/semaphore/Makefile \
-c/src/lib/libcpu/hppa1_1/timer/Makefile \
-c/src/lib/start/hppa1_1/Makefile"
-
-i960_mk="c/src/exec/score/cpu/i960/Makefile \
-c/src/lib/libbsp/i960/Makefile \
-c/src/lib/libbsp/i960/cvme961/Makefile \
-c/src/lib/libbsp/i960/cvme961/clock/Makefile \
-c/src/lib/libbsp/i960/cvme961/console/Makefile \
-c/src/lib/libbsp/i960/cvme961/include/Makefile \
-c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile \
-c/src/lib/libbsp/i960/cvme961/startup/Makefile \
-c/src/lib/libbsp/i960/cvme961/timer/Makefile \
-c/src/lib/libbsp/i960/cvme961/wrapup/Makefile \
-c/src/lib/start/i960/Makefile"
-
-mips64orion_mk="c/src/exec/score/cpu/mips64orion/Makefile \
-c/src/lib/libbsp/mips64orion/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/console/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/include/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/startup/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile \
-c/src/lib/libcpu/mips64orion/Makefile \
-c/src/lib/libcpu/mips64orion/clock/Makefile \
-c/src/lib/libcpu/mips64orion/include/Makefile \
-c/src/lib/libcpu/mips64orion/timer/Makefile \
-c/src/lib/start/mips64orion/Makefile"
-
-powerpc_mk="c/src/exec/score/cpu/ppc/Makefile \
-c/src/lib/libbsp/ppc/Makefile \
-c/src/lib/libbsp/ppc/papyrus/Makefile \
-c/src/lib/libbsp/ppc/papyrus/dlentry/Makefile \
-c/src/lib/libbsp/ppc/papyrus/flashentry/Makefile \
-c/src/lib/libbsp/ppc/papyrus/include/Makefile \
-c/src/lib/libbsp/ppc/papyrus/startup/Makefile \
-c/src/lib/libbsp/ppc/papyrus/wrapup/Makefile \
-c/src/lib/libcpu/ppc/Makefile \
-c/src/lib/libcpu/ppc/ppc403/Makefile \
-c/src/lib/libcpu/ppc/ppc403/clock/Makefile \
-c/src/lib/libcpu/ppc/ppc403/console/Makefile \
-c/src/lib/libcpu/ppc/ppc403/include/Makefile \
-c/src/lib/libcpu/ppc/ppc403/timer/Makefile \
-c/src/lib/libcpu/ppc/ppc403/vectors/Makefile"
-
-posix_mk="c/src/exec/score/cpu/unix/Makefile \
-c/src/exec/score/tools/unix/Makefile \
-c/src/lib/libbsp/unix/Makefile \
-c/src/lib/libbsp/unix/posix/Makefile \
-c/src/lib/libbsp/unix/posix/clock/Makefile \
-c/src/lib/libbsp/unix/posix/console/Makefile \
-c/src/lib/libbsp/unix/posix/include/Makefile \
-c/src/lib/libbsp/unix/posix/shmsupp/Makefile \
-c/src/lib/libbsp/unix/posix/startup/Makefile \
-c/src/lib/libbsp/unix/posix/timer/Makefile \
-c/src/lib/libbsp/unix/posix/wrapup/Makefile"
 
 ka9q_mk="c/src/lib/libka9q/Makefile"
@@ -960,5 +754,5 @@
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:963: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:757: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
@@ -1033,5 +827,5 @@
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:1036: checking host system type" >&5
+echo "configure:830: checking host system type" >&5
 
 host_alias=$host
@@ -1054,5 +848,5 @@
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:1057: checking target system type" >&5
+echo "configure:851: checking target system type" >&5
 
 target_alias=$target
@@ -1072,5 +866,5 @@
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1075: checking build system type" >&5
+echo "configure:869: checking build system type" >&5
 
 build_alias=$build
@@ -1197,13 +991,9 @@
 RTEMS_PREFIX=${target_cpu}-${target_vendor}
 
-#
-#  Generate the configure.host file
-#
-
 
 # Extract the first word of "cat", so it can be a program name with args.
 set dummy cat; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1208: checking for $ac_word" >&5
+echo "configure:998: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CAT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1236,5 +1026,5 @@
 set dummy rm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1239: checking for $ac_word" >&5
+echo "configure:1029: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1267,5 +1057,5 @@
 set dummy cp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1270: checking for $ac_word" >&5
+echo "configure:1060: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1298,5 +1088,5 @@
 set dummy mv; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1301: checking for $ac_word" >&5
+echo "configure:1091: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1329,5 +1119,5 @@
 set dummy ln; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1332: checking for $ac_word" >&5
+echo "configure:1122: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1360,5 +1150,5 @@
 set dummy chmod; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1363: checking for $ac_word" >&5
+echo "configure:1153: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1391,5 +1181,5 @@
 set dummy sort; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1394: checking for $ac_word" >&5
+echo "configure:1184: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SORT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1423,5 +1213,5 @@
 set dummy mkdir; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1426: checking for $ac_word" >&5
+echo "configure:1216: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1455,5 +1245,5 @@
 
 echo $ac_n "checking for working $MKDIR -m 0755""... $ac_c" 1>&6
-echo "configure:1458: checking for working $MKDIR -m 0755" >&5
+echo "configure:1248: checking for working $MKDIR -m 0755" >&5
 if eval "test \"`echo '$''{'rtems_cv_prog_MKDIR_P'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1472,5 +1262,5 @@
 
 echo $ac_n "checking for working $MKDIR -p""... $ac_c" 1>&6
-echo "configure:1475: checking for working $MKDIR -p" >&5
+echo "configure:1265: checking for working $MKDIR -p" >&5
 if eval "test \"`echo '$''{'rtems_cv_prog_mkdir_p'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1492,5 +1282,5 @@
 set dummy enscript; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1495: checking for $ac_word" >&5
+echo "configure:1285: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1526,5 +1316,5 @@
 set dummy mp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1529: checking for $ac_word" >&5
+echo "configure:1319: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1561,5 +1351,5 @@
 set dummy pr; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1564: checking for $ac_word" >&5
+echo "configure:1354: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1603,5 +1393,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1606: checking for $ac_word" >&5
+echo "configure:1396: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_PRINT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1638,5 +1428,5 @@
 set dummy touch; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1641: checking for $ac_word" >&5
+echo "configure:1431: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_TOUCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1669,5 +1459,5 @@
 set dummy cmp; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1672: checking for $ac_word" >&5
+echo "configure:1462: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1700,5 +1490,5 @@
 set dummy dirname; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1703: checking for $ac_word" >&5
+echo "configure:1493: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_DIRNAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1731,5 +1521,5 @@
 set dummy basename; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1734: checking for $ac_word" >&5
+echo "configure:1524: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_BASENAME'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1763,5 +1553,5 @@
 set dummy unifdef; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1766: checking for $ac_word" >&5
+echo "configure:1556: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_UNIFDEF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1794,5 +1584,5 @@
 set dummy ed; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1797: checking for $ac_word" >&5
+echo "configure:1587: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ED'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1825,5 +1615,5 @@
 set dummy sed; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1828: checking for $ac_word" >&5
+echo "configure:1618: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1858,5 +1648,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1861: checking for $ac_word" >&5
+echo "configure:1651: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1894,5 +1684,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1897: checking for $ac_word" >&5
+echo "configure:1687: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_M4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1929,5 +1719,5 @@
 set dummy fgrep; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1932: checking for $ac_word" >&5
+echo "configure:1722: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_FGREP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1960,5 +1750,5 @@
 set dummy grep; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1963: checking for $ac_word" >&5
+echo "configure:1753: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GREP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1991,5 +1781,5 @@
 set dummy egrep; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1994: checking for $ac_word" >&5
+echo "configure:1784: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_EGREP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2023,5 +1813,5 @@
 set dummy catman; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2026: checking for $ac_word" >&5
+echo "configure:1816: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_CATMAN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2057,5 +1847,5 @@
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2060: checking for $ac_word" >&5
+echo "configure:1850: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2098,5 +1888,5 @@
 set dummy ident; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2101: checking for $ac_word" >&5
+echo "configure:1891: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RCS_IDENT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2129,5 +1919,5 @@
 set dummy co; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2132: checking for $ac_word" >&5
+echo "configure:1922: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_RCS_CO'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2160,71 +1950,217 @@
 
 
+
+echo "TARGET"
+echo "cpu    $target_cpu"
+echo "os     $target_os"
+echo "vendor $target_vendor"
+
+
+case "${target}" in
+  # hpux unix port should go here
+  hppa1.1-rtems*)
+	target_cpu=hppa1_1
+	;;
+  i[3456]86-go32-rtems*)
+	target_cpu=i386
+	rtems_bsp="go32 go32_p5"
+       	aux_makefiles=$i386_go32_mk
+	RTEMS_HAS_POSIX_API=no
+	;;
+  i[3456]86-rtems*)
+	target_cpu=i386
+	rtems_bsp="force386 i386ex"
+       	aux_makefiles=$i386_mk
+	;;
+  i[3456]86-pc-linux*)         # unix "simulator" port
+	target_cpu=unix
+	RTEMS_HAS_POSIX_API=no
+	;;
+  no_cpu-rtems*)
+        target_cpu=no_cpu
+	RTEMS_HAS_POSIX_API=no
+	;;
+  powerpc-rtems*|ppc-rtems*)
+	target_cpu=ppc
+	;;
+  sparc-sun-solaris*)             # unix "simulator" port
+	target_cpu=unix
+	RTEMS_HAS_POSIX_API=no
+	;;
+  *) 
+	echo $ac_n "checking rtems target cpu""... $ac_c" 1>&6
+echo "configure:1993: checking rtems target cpu" >&5
+target_cpu=`echo $target | /usr/bin/sed 's%^\([^-]*\)-\(.*\)$%\1%'`
+echo "$ac_t""$target_cpu" 1>&6
+
+	;;
+esac
+
+echo $ac_n "checking if cpu $target_cpu is supported""... $ac_c" 1>&6
+echo "configure:2001: checking if cpu $target_cpu is supported" >&5
+if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
+  echo "$ac_t""yes" 1>&6
+  makefiles="c/src/exec/score/cpu/$target_cpu/Makefile"
+else
+  { echo "configure: error: no" 1>&2; exit 1; }
+fi
+
+ echo $ac_n "checking for Makefiles in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6
+echo "configure:2010: checking for Makefiles in c/src/exec/score/tools/$target_cpu" >&5
+  if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then
+      test -f $srcdir/c/src/exec/score/tools/$target_cpu/Makefile.in && \
+    makefiles="$makefiles c/src/exec/score/tools/$target_cpu/Makefile"
+
+  itemlist=`ls $srcdir/c/src/exec/score/tools/$target_cpu`
+  for item in $itemlist; do
+    if test -d "$srcdir/c/src/exec/score/tools/$target_cpu/$item"; then
+        test -f $srcdir/c/src/exec/score/tools/$target_cpu/$item/Makefile.in && \
+    makefiles="$makefiles c/src/exec/score/tools/$target_cpu/$item/Makefile"
+
+  item0list=`ls $srcdir/c/src/exec/score/tools/$target_cpu/$item`
+  for item0 in $item0list; do
+    if test -d "$srcdir/c/src/exec/score/tools/$target_cpu/$item/$item0"; then
+       test -f $srcdir/c/src/exec/score/tools/$target_cpu/$item/$item0/Makefile.in && \
+    makefiles="$makefiles c/src/exec/score/tools/$target_cpu/$item/$item0/Makefile"
+
+      
+    fi
+  done
+
+    
+    fi
+  done
+
+    echo "$ac_t""done" 1>&6
+  else
+    echo "$ac_t""no" 1>&6
+  fi
+
+
+if test -n "$aux_makefiles";then
+  makefiles="$makefiles $aux_makefiles"
+  echo "MAKEFILES PRESET TO $makefiles"
+else
+echo $ac_n "checking for c/src/lib/libbsp/$target_cpu""... $ac_c" 1>&6
+echo "configure:2046: checking for c/src/lib/libbsp/$target_cpu" >&5
+if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
+  echo "$ac_t""yes" 1>&6
+  files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
+  for file in $files; do
+    case $file in
+      shared*);;
+      Makefile*);;
+      READ*);;
+      *) rtems_bsp="$rtems_bsp $file";;
+    esac;
+  done
+   echo $ac_n "checking for Makefiles in c/src/lib/libbsp/$target_cpu""... $ac_c" 1>&6
+echo "configure:2059: checking for Makefiles in c/src/lib/libbsp/$target_cpu" >&5
+  if test -d $srcdir/c/src/lib/libbsp/$target_cpu; then
+      test -f $srcdir/c/src/lib/libbsp/$target_cpu/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libbsp/$target_cpu/Makefile"
+
+  itemlist=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
+  for item in $itemlist; do
+    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$item"; then
+        test -f $srcdir/c/src/lib/libbsp/$target_cpu/$item/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libbsp/$target_cpu/$item/Makefile"
+
+  item0list=`ls $srcdir/c/src/lib/libbsp/$target_cpu/$item`
+  for item0 in $item0list; do
+    if test -d "$srcdir/c/src/lib/libbsp/$target_cpu/$item/$item0"; then
+       test -f $srcdir/c/src/lib/libbsp/$target_cpu/$item/$item0/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libbsp/$target_cpu/$item/$item0/Makefile"
+
+      
+    fi
+  done
+
+    
+    fi
+  done
+
+    echo "$ac_t""done" 1>&6
+  else
+    echo "$ac_t""no" 1>&6
+  fi
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for Makefiles in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6
+echo "configure:2094: checking for Makefiles in c/src/lib/libcpu/$target_cpu" >&5
+  if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then
+      test -f $srcdir/c/src/lib/libcpu/$target_cpu/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libcpu/$target_cpu/Makefile"
+
+  itemlist=`ls $srcdir/c/src/lib/libcpu/$target_cpu`
+  for item in $itemlist; do
+    if test -d "$srcdir/c/src/lib/libcpu/$target_cpu/$item"; then
+        test -f $srcdir/c/src/lib/libcpu/$target_cpu/$item/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libcpu/$target_cpu/$item/Makefile"
+
+  item0list=`ls $srcdir/c/src/lib/libcpu/$target_cpu/$item`
+  for item0 in $item0list; do
+    if test -d "$srcdir/c/src/lib/libcpu/$target_cpu/$item/$item0"; then
+       test -f $srcdir/c/src/lib/libcpu/$target_cpu/$item/$item0/Makefile.in && \
+    makefiles="$makefiles c/src/lib/libcpu/$target_cpu/$item/$item0/Makefile"
+
+      
+    fi
+  done
+
+    
+    fi
+  done
+
+    echo "$ac_t""done" 1>&6
+  else
+    echo "$ac_t""no" 1>&6
+  fi
+
+ echo $ac_n "checking for Makefiles in c/src/lib/start/$target_cpu""... $ac_c" 1>&6
+echo "configure:2125: checking for Makefiles in c/src/lib/start/$target_cpu" >&5
+  if test -d $srcdir/c/src/lib/start/$target_cpu; then
+      test -f $srcdir/c/src/lib/start/$target_cpu/Makefile.in && \
+    makefiles="$makefiles c/src/lib/start/$target_cpu/Makefile"
+
+  itemlist=`ls $srcdir/c/src/lib/start/$target_cpu`
+  for item in $itemlist; do
+    if test -d "$srcdir/c/src/lib/start/$target_cpu/$item"; then
+        test -f $srcdir/c/src/lib/start/$target_cpu/$item/Makefile.in && \
+    makefiles="$makefiles c/src/lib/start/$target_cpu/$item/Makefile"
+
+  item0list=`ls $srcdir/c/src/lib/start/$target_cpu/$item`
+  for item0 in $item0list; do
+    if test -d "$srcdir/c/src/lib/start/$target_cpu/$item/$item0"; then
+       test -f $srcdir/c/src/lib/start/$target_cpu/$item/$item0/Makefile.in && \
+    makefiles="$makefiles c/src/lib/start/$target_cpu/$item/$item0/Makefile"
+
+      
+    fi
+  done
+
+    
+    fi
+  done
+
+    echo "$ac_t""done" 1>&6
+  else
+    echo "$ac_t""no" 1>&6
+  fi
+
+
+fi	# aux_makefiles
+
+echo "MAKEFILES $makefiles"
+
+
+
 #
 #  Target configurations are listed in alphabetical order.  
 #  The BSPs for a target configuration are also listed in alphabetical order.
 #
-
-case "${target}" in
-  a29k-rtems*)
-	rtems_bsp=portsw
-       	makefiles=$a29k_mk
-	;;
-  # hpux unix port should go here
-  hppa1.1-rtems*)
-	rtems_bsp=simhppa
-	makefiles=$hppa1_1_mk
-	;;
-  i[3456]86-go32-rtems*)
-	rtems_bsp="go32 go32_p5"
-       	makefiles=$i386_go32_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  i[3456]86-rtems*)
-	rtems_bsp="force386 i386ex"
-       	makefiles=$i386_mk
-	;;
-  i[3456]86-pc-linux*)         # unix "simulator" port
-	rtems_bsp=posix
-       	makefiles=$posix_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  i960-rtems*)
-	rtems_bsp=cvme961
-       	makefiles=$i960_mk
-	;;
-  m68k-rtems*)
-	rtems_bsp="dmv152 efi332 efi68k gen68302 gen68360 gen68360_040 idp \
-                   mvme136 mvme147 mvme147s mvme162 mvme162lx ods68302"
-       	makefiles=$m68k_mk
-	;;
-  mips64orion-rtems*)
-	rtems_bsp="p4600 p4650"
-       	makefiles=$mips64orion_mk
-	;;
-  no_cpu-rtems*)
-	rtems_bsp=no_bsp
-	makefiles=$no_cpu_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  powerpc-rtems*|ppc-rtems*)
-	rtems_bsp=papyrus
-       	makefiles=$powerpc_mk
-	;;
-  sparc-sun-solaris*)             # unix "simulator" port
-	rtems_bsp=posix
-       	makefiles=$posix_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  sparc-rtems*)         
-	rtems_bsp=erc32 
-	makefiles=$sparc_mk
-	;;
-  *)                    
-	rtems_bsp=no_bsp
-	makefiles=$no_cpu_mk
-	echo Error: RTEMS is not supported on target: $target
-	exit 1
-	;;
-esac
 
 
@@ -2237,7 +2173,6 @@
 fi
 
-
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2242: checking whether ln -s works" >&5
+echo "configure:2177: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2294,4 +2229,5 @@
 RTEMS_BSP=$enableval
 fi
+
 
 
@@ -2504,5 +2440,5 @@
 c/src/tests/tools/unix/posix/Makefile
 $makefiles
-c/update-tools/Makefile " | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+c/update-tools/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -2712,5 +2648,5 @@
 c/src/tests/tools/unix/posix/Makefile
 $makefiles
-c/update-tools/Makefile "}
+c/update-tools/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
Index: configure.in
===================================================================
--- configure.in	(revision 80868140c3a6350471c02fabe1fbf4a2a2712456)
+++ configure.in	(revision 1670eede8bc8cc428f900da7a93077718ecd2dcb)
@@ -2,14 +2,4 @@
 AC_PREREQ(2.12)
 AC_INIT(README)
-
-a29k_mk="c/src/exec/score/cpu/a29k/Makefile \
-c/src/lib/libbsp/a29k/Makefile \
-c/src/lib/libbsp/a29k/portsw/Makefile \
-c/src/lib/libbsp/a29k/portsw/console/Makefile \
-c/src/lib/libbsp/a29k/portsw/include/Makefile \
-c/src/lib/libbsp/a29k/portsw/shmsupp/Makefile \
-c/src/lib/libbsp/a29k/portsw/startup/Makefile \
-c/src/lib/libbsp/a29k/portsw/wrapup/Makefile \
-c/src/lib/start/a29k/Makefile"
 
 i386_mk="c/src/exec/score/cpu/i386/Makefile \
@@ -41,200 +31,4 @@
 c/src/lib/libbsp/i386/go32/timer/Makefile \
 c/src/lib/libbsp/i386/go32/wrapup/Makefile"
-
-m68k_mk="c/src/exec/score/cpu/m68k/Makefile \
-c/src/lib/libbsp/m68k/Makefile \
-c/src/lib/libbsp/m68k/dmv152/Makefile \
-c/src/lib/libbsp/m68k/dmv152/clock/Makefile \
-c/src/lib/libbsp/m68k/dmv152/console/Makefile \
-c/src/lib/libbsp/m68k/dmv152/include/Makefile \
-c/src/lib/libbsp/m68k/dmv152/spurious/Makefile \
-c/src/lib/libbsp/m68k/dmv152/startup/Makefile \
-c/src/lib/libbsp/m68k/dmv152/timer/Makefile \
-c/src/lib/libbsp/m68k/dmv152/wrapup/Makefile \
-c/src/lib/libbsp/m68k/efi332/Makefile \
-c/src/lib/libbsp/m68k/efi332/clock/Makefile \
-c/src/lib/libbsp/m68k/efi332/console/Makefile \
-c/src/lib/libbsp/m68k/efi332/include/Makefile \
-c/src/lib/libbsp/m68k/efi332/spurious/Makefile \
-c/src/lib/libbsp/m68k/efi332/startup/Makefile \
-c/src/lib/libbsp/m68k/efi332/start332/Makefile \
-c/src/lib/libbsp/m68k/efi332/timer/Makefile \
-c/src/lib/libbsp/m68k/efi332/wrapup/Makefile \
-c/src/lib/libbsp/m68k/efi68k/Makefile \
-c/src/lib/libbsp/m68k/efi68k/clock/Makefile \
-c/src/lib/libbsp/m68k/efi68k/console/Makefile \
-c/src/lib/libbsp/m68k/efi68k/include/Makefile \
-c/src/lib/libbsp/m68k/efi68k/spurious/Makefile \
-c/src/lib/libbsp/m68k/efi68k/startup/Makefile \
-c/src/lib/libbsp/m68k/efi68k/start68k/Makefile \
-c/src/lib/libbsp/m68k/efi68k/timer/Makefile \
-c/src/lib/libbsp/m68k/efi68k/wrapup/Makefile \
-c/src/lib/libbsp/m68k/gen68302/Makefile \
-c/src/lib/libbsp/m68k/gen68302/clock/Makefile \
-c/src/lib/libbsp/m68k/gen68302/console/Makefile \
-c/src/lib/libbsp/m68k/gen68302/include/Makefile \
-c/src/lib/libbsp/m68k/gen68302/start302/Makefile \
-c/src/lib/libbsp/m68k/gen68302/startup/Makefile \
-c/src/lib/libbsp/m68k/gen68302/timer/Makefile \
-c/src/lib/libbsp/m68k/gen68302/wrapup/Makefile \
-c/src/lib/libbsp/m68k/gen68360/Makefile \
-c/src/lib/libbsp/m68k/gen68360/clock/Makefile \
-c/src/lib/libbsp/m68k/gen68360/console/Makefile \
-c/src/lib/libbsp/m68k/gen68360/include/Makefile \
-c/src/lib/libbsp/m68k/gen68360/start360/Makefile \
-c/src/lib/libbsp/m68k/gen68360/startup/Makefile \
-c/src/lib/libbsp/m68k/gen68360/timer/Makefile \
-c/src/lib/libbsp/m68k/gen68360/network/Makefile \
-c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile \
-c/src/lib/libbsp/m68k/idp/Makefile \
-c/src/lib/libbsp/m68k/idp/clock/Makefile \
-c/src/lib/libbsp/m68k/idp/console/Makefile \
-c/src/lib/libbsp/m68k/idp/include/Makefile \
-c/src/lib/libbsp/m68k/idp/startup/Makefile \
-c/src/lib/libbsp/m68k/idp/timer/Makefile \
-c/src/lib/libbsp/m68k/idp/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme136/Makefile \
-c/src/lib/libbsp/m68k/mvme136/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme136/console/Makefile \
-c/src/lib/libbsp/m68k/mvme136/include/Makefile \
-c/src/lib/libbsp/m68k/mvme136/shmsupp/Makefile \
-c/src/lib/libbsp/m68k/mvme136/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme136/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme136/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme147/Makefile \
-c/src/lib/libbsp/m68k/mvme147/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme147/console/Makefile \
-c/src/lib/libbsp/m68k/mvme147/include/Makefile \
-c/src/lib/libbsp/m68k/mvme147/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme147/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme147/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/console/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/include/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/shmsupp/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme147s/wrapup/Makefile \
-c/src/lib/libbsp/m68k/mvme162/Makefile \
-c/src/lib/libbsp/m68k/mvme162/clock/Makefile \
-c/src/lib/libbsp/m68k/mvme162/console/Makefile \
-c/src/lib/libbsp/m68k/mvme162/consolex/Makefile \
-c/src/lib/libbsp/m68k/mvme162/include/Makefile \
-c/src/lib/libbsp/m68k/mvme162/startup/Makefile \
-c/src/lib/libbsp/m68k/mvme162/timer/Makefile \
-c/src/lib/libbsp/m68k/mvme162/tod/Makefile \
-c/src/lib/libbsp/m68k/mvme162/tools/Makefile \
-c/src/lib/libbsp/m68k/mvme162/wrapup/Makefile \
-c/src/lib/libbsp/m68k/ods68302/Makefile \
-c/src/lib/libbsp/m68k/ods68302/clock/Makefile \
-c/src/lib/libbsp/m68k/ods68302/console/Makefile \
-c/src/lib/libbsp/m68k/ods68302/include/Makefile \
-c/src/lib/libbsp/m68k/ods68302/start302/Makefile \
-c/src/lib/libbsp/m68k/ods68302/startup/Makefile \
-c/src/lib/libbsp/m68k/ods68302/timer/Makefile \
-c/src/lib/libbsp/m68k/ods68302/wrapup/Makefile \
-c/src/lib/libcpu/m68k/Makefile \
-c/src/lib/libcpu/m68k/m68040/Makefile \
-c/src/lib/libcpu/m68k/m68040/fpsp/Makefile \
-c/src/lib/start/m68k/Makefile"
-
-no_cpu_mk="c/src/exec/score/cpu/no_cpu/Makefile \
-c/src/lib/libbsp/no_cpu/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/clock/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/console/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/include/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/shmsupp/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/startup/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/timer/Makefile \
-c/src/lib/libbsp/no_cpu/no_bsp/wrapup/Makefile"
-
-sparc_mk="c/src/exec/score/cpu/sparc/Makefile \
-c/src/lib/libbsp/sparc/Makefile \
-c/src/lib/libbsp/sparc/erc32/Makefile \
-c/src/lib/libbsp/sparc/erc32/clock/Makefile \
-c/src/lib/libbsp/sparc/erc32/console/Makefile \
-c/src/lib/libbsp/sparc/erc32/include/Makefile \
-c/src/lib/libbsp/sparc/erc32/startsis/Makefile \
-c/src/lib/libbsp/sparc/erc32/startup/Makefile \
-c/src/lib/libbsp/sparc/erc32/timer/Makefile \
-c/src/lib/libbsp/sparc/erc32/wrapup/Makefile \
-c/src/lib/libcpu/sparc/Makefile \
-c/src/lib/libcpu/sparc/reg_win/Makefile"
-
-hppa1_1_mk="c/src/exec/score/cpu/hppa1_1/Makefile \
-c/src/exec/score/tools/hppa1_1/Makefile \
-c/src/lib/libbsp/hppa1_1/Makefile \
-c/src/lib/libbsp/hppa1_1/pxfl/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/include/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/shmsupp/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/startup/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/tools/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/tty/Makefile \
-c/src/lib/libbsp/hppa1_1/simhppa/wrapup/Makefile \
-c/src/lib/libcpu/hppa1_1/Makefile \
-c/src/lib/libcpu/hppa1_1/clock/Makefile \
-c/src/lib/libcpu/hppa1_1/include/Makefile \
-c/src/lib/libcpu/hppa1_1/milli/Makefile \
-c/src/lib/libcpu/hppa1_1/runway/Makefile \
-c/src/lib/libcpu/hppa1_1/semaphore/Makefile \
-c/src/lib/libcpu/hppa1_1/timer/Makefile \
-c/src/lib/start/hppa1_1/Makefile"
-
-i960_mk="c/src/exec/score/cpu/i960/Makefile \
-c/src/lib/libbsp/i960/Makefile \
-c/src/lib/libbsp/i960/cvme961/Makefile \
-c/src/lib/libbsp/i960/cvme961/clock/Makefile \
-c/src/lib/libbsp/i960/cvme961/console/Makefile \
-c/src/lib/libbsp/i960/cvme961/include/Makefile \
-c/src/lib/libbsp/i960/cvme961/shmsupp/Makefile \
-c/src/lib/libbsp/i960/cvme961/startup/Makefile \
-c/src/lib/libbsp/i960/cvme961/timer/Makefile \
-c/src/lib/libbsp/i960/cvme961/wrapup/Makefile \
-c/src/lib/start/i960/Makefile"
-
-mips64orion_mk="c/src/exec/score/cpu/mips64orion/Makefile \
-c/src/lib/libbsp/mips64orion/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/console/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/include/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/liblnk/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/startup/Makefile \
-c/src/lib/libbsp/mips64orion/p4000/wrapup/Makefile \
-c/src/lib/libcpu/mips64orion/Makefile \
-c/src/lib/libcpu/mips64orion/clock/Makefile \
-c/src/lib/libcpu/mips64orion/include/Makefile \
-c/src/lib/libcpu/mips64orion/timer/Makefile \
-c/src/lib/start/mips64orion/Makefile"
-
-powerpc_mk="c/src/exec/score/cpu/ppc/Makefile \
-c/src/lib/libbsp/ppc/Makefile \
-c/src/lib/libbsp/ppc/papyrus/Makefile \
-c/src/lib/libbsp/ppc/papyrus/dlentry/Makefile \
-c/src/lib/libbsp/ppc/papyrus/flashentry/Makefile \
-c/src/lib/libbsp/ppc/papyrus/include/Makefile \
-c/src/lib/libbsp/ppc/papyrus/startup/Makefile \
-c/src/lib/libbsp/ppc/papyrus/wrapup/Makefile \
-c/src/lib/libcpu/ppc/Makefile \
-c/src/lib/libcpu/ppc/ppc403/Makefile \
-c/src/lib/libcpu/ppc/ppc403/clock/Makefile \
-c/src/lib/libcpu/ppc/ppc403/console/Makefile \
-c/src/lib/libcpu/ppc/ppc403/include/Makefile \
-c/src/lib/libcpu/ppc/ppc403/timer/Makefile \
-c/src/lib/libcpu/ppc/ppc403/vectors/Makefile"
-
-posix_mk="c/src/exec/score/cpu/unix/Makefile \
-c/src/exec/score/tools/unix/Makefile \
-c/src/lib/libbsp/unix/Makefile \
-c/src/lib/libbsp/unix/posix/Makefile \
-c/src/lib/libbsp/unix/posix/clock/Makefile \
-c/src/lib/libbsp/unix/posix/console/Makefile \
-c/src/lib/libbsp/unix/posix/include/Makefile \
-c/src/lib/libbsp/unix/posix/shmsupp/Makefile \
-c/src/lib/libbsp/unix/posix/startup/Makefile \
-c/src/lib/libbsp/unix/posix/timer/Makefile \
-c/src/lib/libbsp/unix/posix/wrapup/Makefile"
 
 ka9q_mk="c/src/lib/libka9q/Makefile"
@@ -471,8 +265,4 @@
 RTEMS_PREFIX=${target_cpu}-${target_vendor}
 
-#
-#  Generate the configure.host file
-#
-
 dnl BEGIN configure.host.in
 
@@ -571,71 +361,98 @@
 dnl END configure.host.in
 
+dnl BEGIN configure.target.in
+
+echo "TARGET"
+echo "cpu    $target_cpu"
+echo "os     $target_os"
+echo "vendor $target_vendor"
+
+dnl canonicalize target name
+dnl NOTE: Most rtems targets do not fullfil autoconf 
+dnl targets naming conventions "processor-vendor-os"
+dnl Therefore autoconf's AC_CANONICAL_TARGET will fail for them
+dnl and we have to fix it for rtems ourselves 
+
+case "${target}" in
+  # hpux unix port should go here
+  hppa1.1-rtems*)
+	target_cpu=hppa1_1
+	;;
+  i[[3456]]86-go32-rtems*)
+	target_cpu=i386
+	rtems_bsp="go32 go32_p5"
+       	aux_makefiles=$i386_go32_mk
+	RTEMS_HAS_POSIX_API=no
+	;;
+  i[[3456]]86-rtems*)
+	target_cpu=i386
+	rtems_bsp="force386 i386ex"
+       	aux_makefiles=$i386_mk
+	;;
+  i[[3456]]86-pc-linux*)         # unix "simulator" port
+	target_cpu=unix
+	RTEMS_HAS_POSIX_API=no
+	;;
+  no_cpu-rtems*)
+        target_cpu=no_cpu
+	RTEMS_HAS_POSIX_API=no
+	;;
+  powerpc-rtems*|ppc-rtems*)
+	target_cpu=ppc
+	;;
+  sparc-sun-solaris*)             # unix "simulator" port
+	target_cpu=unix
+	RTEMS_HAS_POSIX_API=no
+	;;
+  *) 
+	RTEMS_CANONICAL_TARGET_CPU
+	;;
+esac
+
+AC_MSG_CHECKING([if cpu $target_cpu is supported])
+if test -d "$srcdir/c/src/exec/score/cpu/$target_cpu"; then
+  AC_MSG_RESULT(yes)
+  makefiles="c/src/exec/score/cpu/$target_cpu/Makefile"
+else
+  AC_MSG_ERROR(no)
+fi
+
+RTEMS_CHECK_MAKEFILE(c/src/exec/score/tools/$target_cpu)
+
+if test -n "$aux_makefiles";then
+  makefiles="$makefiles $aux_makefiles"
+  echo "MAKEFILES PRESET TO $makefiles"
+else
+AC_MSG_CHECKING([for c/src/lib/libbsp/$target_cpu])
+if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then
+  AC_MSG_RESULT(yes)
+  files=`ls $srcdir/c/src/lib/libbsp/$target_cpu`
+  for file in $files; do
+    case $file in
+      shared*);;
+      Makefile*);;
+      READ*);;
+      *) rtems_bsp="$rtems_bsp $file";;
+    esac;
+  done
+  RTEMS_CHECK_MAKEFILE(c/src/lib/libbsp/$target_cpu)
+else
+  AC_MSG_RESULT(no)
+fi
+
+RTEMS_CHECK_MAKEFILE(c/src/lib/libcpu/$target_cpu)
+RTEMS_CHECK_MAKEFILE(c/src/lib/start/$target_cpu)
+
+fi	# aux_makefiles
+
+echo "MAKEFILES $makefiles"
+
+dnl END configure.target.in
+
+
 #
 #  Target configurations are listed in alphabetical order.  
 #  The BSPs for a target configuration are also listed in alphabetical order.
 #
-
-case "${target}" in
-  a29k-rtems*)
-	rtems_bsp=portsw
-       	makefiles=$a29k_mk
-	;;
-  # hpux unix port should go here
-  hppa1.1-rtems*)
-	rtems_bsp=simhppa
-	makefiles=$hppa1_1_mk
-	;;
-  i[[3456]]86-go32-rtems*)
-	rtems_bsp="go32 go32_p5"
-       	makefiles=$i386_go32_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  i[[3456]]86-rtems*)
-	rtems_bsp="force386 i386ex"
-       	makefiles=$i386_mk
-	;;
-  i[[3456]]86-pc-linux*)         # unix "simulator" port
-	rtems_bsp=posix
-       	makefiles=$posix_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  i960-rtems*)
-	rtems_bsp=cvme961
-       	makefiles=$i960_mk
-	;;
-  m68k-rtems*)
-	rtems_bsp="dmv152 efi332 efi68k gen68302 gen68360 gen68360_040 idp \
-                   mvme136 mvme147 mvme147s mvme162 mvme162lx ods68302"
-       	makefiles=$m68k_mk
-	;;
-  mips64orion-rtems*)
-	rtems_bsp="p4600 p4650"
-       	makefiles=$mips64orion_mk
-	;;
-  no_cpu-rtems*)
-	rtems_bsp=no_bsp
-	makefiles=$no_cpu_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  powerpc-rtems*|ppc-rtems*)
-	rtems_bsp=papyrus
-       	makefiles=$powerpc_mk
-	;;
-  sparc-sun-solaris*)             # unix "simulator" port
-	rtems_bsp=posix
-       	makefiles=$posix_mk
-	RTEMS_HAS_POSIX_API=no
-	;;
-  sparc-rtems*)         
-	rtems_bsp=erc32 
-	makefiles=$sparc_mk
-	;;
-  *)                    
-	rtems_bsp=no_bsp
-	makefiles=$no_cpu_mk
-	echo Error: RTEMS is not supported on target: $target
-	exit 1
-	;;
-esac
 
 dnl NOTE: host_os is automatically set by autoconf
@@ -648,5 +465,4 @@
   fi
 fi
-
 
 AC_PROG_LN_S
@@ -688,5 +504,7 @@
 AC_SUBST(program_prefix)
 
-AC_OUTPUT( Makefile
+
+AC_OUTPUT( 
+Makefile
 c/Makefile
 c/build-tools/Makefile
@@ -770,5 +588,5 @@
 c/src/tests/tools/unix/posix/Makefile
 $makefiles
-c/update-tools/Makefile )
+c/update-tools/Makefile)
 
 echo
