summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-01-29 15:27:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-01-29 15:27:25 +0000
commit560aae24e2aedf480676e5daf9c4c3e0eb62a120 (patch)
treee8c409e0f835f0ac3d317fb1597daba70e78183e
parent37222c7e74e745152f24389d7b74ed81deee9ca1 (diff)
downloadrtems-560aae24e2aedf480676e5daf9c4c3e0eb62a120.tar.bz2
2001-01-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* aclocal/enable-rtemsbsp.m4: Split out RTEMS_ENV_RTEMSBSP, RTEMS_ENV_RTEMSCPU. * aclocal/env-rtemsbsp.m4: New file for RTEMS_ENV_RTEMSBSP, add special treatment for GCC_SPECS. * aclocal/env-rtemscpu.m4: New file for RTEMS_ENV_RTEMSCPU, add special treatment for GCC_SPECS. * aclocal/bsp-enable-arg.m4: New file, introduce RTEMS_BSP_ARG_ENABLE. * aclocal/prog-cc.m4: Add AC_PROG_CPP, use build_os in GCCSED hack. * automake/compile.am: New treatment of CPP, GCCSPECS, use `..` instead of $(shell ..) for LIBC_LIB*.
-rw-r--r--ChangeLog13
-rw-r--r--aclocal/bsp-arg-enable.m418
-rw-r--r--aclocal/enable-rtemsbsp.m444
-rw-r--r--aclocal/env-rtemsbsp.m439
-rw-r--r--aclocal/env-rtemscpu.m424
-rw-r--r--aclocal/prog-cc.m43
-rw-r--r--automake/compile.am21
7 files changed, 103 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index f7ebdb11ab..a3030ae25a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2001-01-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
+
+ * aclocal/enable-rtemsbsp.m4: Split out RTEMS_ENV_RTEMSBSP,
+ RTEMS_ENV_RTEMSCPU.
+ * aclocal/env-rtemsbsp.m4: New file for RTEMS_ENV_RTEMSBSP, add
+ special treatment for GCC_SPECS.
+ * aclocal/env-rtemscpu.m4: New file for RTEMS_ENV_RTEMSCPU, add
+ special treatment for GCC_SPECS.
+ * aclocal/bsp-enable-arg.m4: New file, introduce RTEMS_BSP_ARG_ENABLE.
+ * aclocal/prog-cc.m4: Add AC_PROG_CPP, use build_os in GCCSED hack.
+ * automake/compile.am: New treatment of CPP, GCCSPECS, use `..`
+ instead of $(shell ..) for LIBC_LIB*.
+
2001-01-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* aclocal/bsp-alias.m4, aclocal/check-bsps.m4: Add simsh7032 and
diff --git a/aclocal/bsp-arg-enable.m4 b/aclocal/bsp-arg-enable.m4
new file mode 100644
index 0000000000..53ea4845de
--- /dev/null
+++ b/aclocal/bsp-arg-enable.m4
@@ -0,0 +1,18 @@
+dnl $Id$
+dnl
+dnl RTEMS_BSP_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
+dnl
+dnl Accept --enable-FEATURE=<RTEMS_BSP>:<value> and --enable-FEATURE=<value>
+dnl in BSP-configure scripts.
+dnl
+dnl Configure scripts will receive <value> if <RTEMS_BSP> matches the actual
+dnl value of the shell variable RTEMS_BSP (cf. RTEMS_ENV_RTEMSBSP), and
+dnl <RTEMS_BSP>:<value>.
+dnl
+AC_DEFUN(RTEMS_BSP_ARG_ENABLE,
+[AC_REQUIRE([RTEMS_ENV_RTEMSBSP])
+AC_ARG_ENABLE([$1],[$2],
+[enableval=`echo "[$enable_]patsubst([$1], -, _)" | sed -e "s%^${RTEMS_BSP}:%%"`
+ eval "[enable_]patsubst([$1], -, _)='$enableval'"
+$3],[$4])
+])
diff --git a/aclocal/enable-rtemsbsp.m4 b/aclocal/enable-rtemsbsp.m4
index a1fb24a335..d4057d0b7e 100644
--- a/aclocal/enable-rtemsbsp.m4
+++ b/aclocal/enable-rtemsbsp.m4
@@ -13,47 +13,3 @@ AC_ARG_ENABLE(rtemsbsp,
*) $1=$enableval;;
esac],[$1=""])
])
-
-dnl Pass a single BSP via an environment variable
-dnl used by per BSP configure scripts
-AC_DEFUN(RTEMS_ENV_RTEMSBSP,
-[dnl
-AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
-AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
-AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
-
-AC_MSG_CHECKING([for RTEMS_BSP])
-AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
-[dnl
- test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
-])dnl
-if test -z "$rtems_cv_RTEMS_BSP"; then
- AC_MSG_ERROR([Missing RTEMS_BSP])
-fi
-RTEMS_BSP="$rtems_cv_RTEMS_BSP"
-AC_MSG_RESULT(${RTEMS_BSP})
-AC_SUBST(RTEMS_BSP)
-
-RTEMS_ENABLE_BARE
-AC_SUBST(BARE_CPU_MODEL)
-AC_SUBST(BARE_CPU_CFLAGS)
-
-RTEMS_ROOT=$PROJECT_ROOT/c/$RTEMS_BSP
-AC_SUBST(RTEMS_ROOT)
-AM_CONDITIONAL(RTEMS_CONFIG_PER_BSP, test x = x);
-])
-
-AC_DEFUN(RTEMS_ENV_RTEMSCPU,
-[AC_REQUIRE([RTEMS_ENABLE_MULTILIB])
-
-if test x"$multilib" = x"no"; then
- RTEMS_ENV_RTEMSBSP
- RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
-else
- rtems_cv_RTEMS_BSP="multilib"
- RTEMS_BSP="$rtems_cv_RTEMS_BSP"
- AC_SUBST(RTEMS_BSP)
- RTEMS_ROOT=$PROJECT_ROOT/c
- AC_SUBST(RTEMS_ROOT)
-fi
-])
diff --git a/aclocal/env-rtemsbsp.m4 b/aclocal/env-rtemsbsp.m4
new file mode 100644
index 0000000000..3c5ad6c0f3
--- /dev/null
+++ b/aclocal/env-rtemsbsp.m4
@@ -0,0 +1,39 @@
+dnl $Id$
+
+dnl Pass a single BSP via an environment variable
+dnl used by per BSP configure scripts
+AC_DEFUN(RTEMS_ENV_RTEMSBSP,
+[dnl
+AC_BEFORE([$0], [RTEMS_ENABLE_RTEMSBSP])dnl
+AC_BEFORE([$0], [RTEMS_PROJECT_ROOT])dnl
+AC_BEFORE([$0], [RTEMS_CHECK_CUSTOM_BSP])dnl
+
+AC_MSG_CHECKING([for RTEMS_BSP])
+AC_CACHE_VAL(rtems_cv_RTEMS_BSP,
+[dnl
+ test -n "${RTEMS_BSP}" && rtems_cv_RTEMS_BSP="$RTEMS_BSP";
+])dnl
+if test -z "$rtems_cv_RTEMS_BSP"; then
+ AC_MSG_ERROR([Missing RTEMS_BSP])
+fi
+RTEMS_BSP="$rtems_cv_RTEMS_BSP"
+AC_MSG_RESULT(${RTEMS_BSP})
+AC_SUBST(RTEMS_BSP)
+
+RTEMS_BSP_SPECS="-specs bsp_specs -qrtems"
+AC_SUBST(RTEMS_BSP_SPECS)
+
+GCC_SPECS="-B\$(PROJECT_ROOT)/$RTEMS_BSP/lib/"
+AC_SUBST(GCC_SPECS)
+
+RTEMS_ROOT=$PROJECT_ROOT/c/$RTEMS_BSP
+AC_SUBST(RTEMS_ROOT)
+
+RTEMS_ENABLE_BARE
+AC_SUBST(BARE_CPU_MODEL)
+AC_SUBST(BARE_CPU_CFLAGS)
+
+AM_CONDITIONAL(RTEMS_CONFIG_PER_BSP, test x = x);
+
+includedir="\${exec_prefix}/\$(RTEMS_BSP)/lib/include"
+])
diff --git a/aclocal/env-rtemscpu.m4 b/aclocal/env-rtemscpu.m4
new file mode 100644
index 0000000000..1b2f81cfaf
--- /dev/null
+++ b/aclocal/env-rtemscpu.m4
@@ -0,0 +1,24 @@
+dnl $Id$
+
+AC_DEFUN(RTEMS_ENV_RTEMSCPU,
+[AC_REQUIRE([RTEMS_ENABLE_MULTILIB])
+
+if test x"$multilib" = x"no"; then
+ RTEMS_ENV_RTEMSBSP
+ RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
+else
+## FIXME: There is no multilib BSP
+ rtems_cv_RTEMS_BSP="multilib"
+ RTEMS_BSP="$rtems_cv_RTEMS_BSP"
+ AC_SUBST(RTEMS_BSP)
+
+ RTEMS_BSP_SPECS=""
+ AC_SUBST(RTEMS_BSP_SPECS)
+
+ GCC_SPECS="-B\$(PROJECT_ROOT)/lib/"
+ AC_SUBST(GCC_SPECS)
+
+ RTEMS_ROOT=$PROJECT_ROOT/c
+ AC_SUBST(RTEMS_ROOT)
+fi
+])
diff --git a/aclocal/prog-cc.m4 b/aclocal/prog-cc.m4
index 73967f035e..164934ba51 100644
--- a/aclocal/prog-cc.m4
+++ b/aclocal/prog-cc.m4
@@ -16,6 +16,7 @@ RTEMS_CHECK_TOOL(CC,gcc)
test -z "$CC" && \
AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_PROG_CC
+AC_PROG_CPP
AM_CONDITIONAL(RTEMS_USE_GCC,test x"$GCC" = x"yes")
])
@@ -43,7 +44,7 @@ AM_CONDITIONAL(RTEMS_USE_GCC272, test x"$RTEMS_USE_GCC272" = x"yes")
AC_SUBST(RTEMS_USE_GCC272)
dnl FIXME: HACK for egcs/cygwin mixing '\\' and '/' in gcc -print-*
-case $host_os in
+case $build_os in
*cygwin*) GCCSED="| sed 's%\\\\%/%g'" ;;
*) ;;
esac
diff --git a/automake/compile.am b/automake/compile.am
index b618e0cb12..916a136dbb 100644
--- a/automake/compile.am
+++ b/automake/compile.am
@@ -54,21 +54,18 @@ if RTEMS_USE_GCC272
RTEMS_CPPFLAGS = -isystem $(PROJECT_INCLUDE)
# default location of Standard C Library
-LIBC_LIBC = $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libc.a $(GCCSED))
-LIBC_LIBM = $(shell $(CC) $(CPU_CFLAGS) -print-file-name=libm.a $(GCCSED))
-LIBC_LIBGCC = $(shell $(CC) $(CPU_CFLAGS) -print-libgcc-file-name $(GCCSED))
+LIBC_LIBC = `$(CC) $(CPU_CFLAGS) -print-file-name=libc.a $(GCCSED)`
+LIBC_LIBM = `$(CC) $(CPU_CFLAGS) -print-file-name=libm.a $(GCCSED)`
+LIBC_LIBGCC = `$(CC) $(CPU_CFLAGS) -print-libgcc-file-name $(GCCSED)`
### FIXME: False if using multilibbed RTEMS
LINK_LIBS_RTEMS = $(PROJECT_RELEASE)/lib/librtemsall$(LIBSUFFIX_VA)
LINK_LIBS_GCC272 = $(LINK_LIBS_RTEMS) $(LIBC_LIBC) $(LIBC_LIBGCC)
+GCCSPECS =
else
## gcc >= 2.8.x
-if RTEMS_CONFIG_PER_BSP
-BSP_SPECS = -specs bsp_specs -qrtems
-endif
-
-GCCSPECS = -B$(PROJECT_RELEASE)/lib/ $(BSP_SPECS)
+GCCSPECS = $(GCC_SPECS) $(RTEMS_BSP_SPECS)
endif
else
## fall back to the old style compilers/*.cfg
@@ -111,12 +108,6 @@ LDFLAGS=$(LDFLAGS_PROFILE) $(LDFLAGS_DEBUG) $(LD_PATHS:%=-L %)
# Client compiler and support tools
#
-## HACK: specific to gcc
-## FIXME: Do we call the correct CPP, why aren't
-## CPPFLAGS and CFLAGS part of this call?
-# CPP command to write file to standard output
-CPP=$(CC) -E -ansi -w -Wp,-$$
-
ARFLAGS=ruv
#
@@ -278,6 +269,8 @@ RTEMS_CFLAGS__V = $(RTEMS_CFLAGS_OPTIMIZE_V)
CC = @CC@ $(GCCSPECS)
CXX = @CXX@ $(GCCSPECS)
+CPP = @CPP@ $(GCCSPECS)
+
LD = @LD@
OBJCOPY = @OBJCOPY@
NM = @NM@