summaryrefslogtreecommitdiffstats
path: root/macros/canonical-target-name.m4
diff options
context:
space:
mode:
Diffstat (limited to 'macros/canonical-target-name.m4')
-rw-r--r--macros/canonical-target-name.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/macros/canonical-target-name.m4 b/macros/canonical-target-name.m4
new file mode 100644
index 0000000000..53d1a2962c
--- /dev/null
+++ b/macros/canonical-target-name.m4
@@ -0,0 +1,40 @@
+dnl
+dnl $Id$
+dnl
+
+dnl canonicalize target cpu
+dnl NOTE: Most rtems targets do not fullfil autoconf's
+dnl target 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_CANONICAL_SYSTEM
+AC_MSG_CHECKING(rtems target cpu)
+changequote(,)dnl
+case "${target}" in
+ # hpux unix port should go here
+ i[34567]86-*linux*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ i[34567]86-*freebsd*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ i[34567]86-pc-cygwin*) # Cygwin is just enough unix like :)
+ RTEMS_CPU=unix
+ ;;
+ no_cpu-*rtems*)
+ RTEMS_CPU=no_cpu
+ ;;
+ sparc-sun-solaris*) # unix "simulator" port
+ RTEMS_CPU=unix
+ ;;
+ *)
+ RTEMS_CPU=`echo $target | sed 's%^\([^-]*\)-\(.*\)$%\1%'`
+ ;;
+esac
+changequote([,])dnl
+AC_SUBST(RTEMS_CPU)
+AC_MSG_RESULT($RTEMS_CPU)
+])