diff options
author | Thomas Bushnell <thomas@gnu.org> | 1997-04-17 20:47:20 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1997-04-17 20:47:20 +0000 |
commit | 5989dac3caaa1e76896f8ec70128dba93a5ecccc (patch) | |
tree | aca0a74be9ce85ddbfa2194ffd61f70ac41cd265 /aclocal.m4 | |
parent | d3a30dc4c105f0ffc185030b0ba3a946369c015b (diff) | |
download | gnumach-5989dac3caaa1e76896f8ec70128dba93a5ecccc.tar.gz gnumach-5989dac3caaa1e76896f8ec70128dba93a5ecccc.tar.bz2 gnumach-5989dac3caaa1e76896f8ec70128dba93a5ecccc.zip |
Wed Apr 16 16:55:36 1997 Marcus G. Daniels <marcus@cathcart.sysc.pdx.edu>
* configure.in: Replace AC_PROG_CC with AC_PROG_CC_LOCAL.
If cross compiling do Lex/Yacc checks with BUILD_CC.
Check CC and BUILD_CC for libraries having the needed support,
and substitute discovery in installed_clib.
* aclocal.m4: New file. These replacement macros are to handle
the case where there is a cross compiler but no supporting files.
* Makefile.in (installed-clib): Don't hardwire a Hurd libcrt.a.
(cross_linkable): Only define cross-migcom variable when it will
be possible to build it.
(all, install): Use $(cross-migcom).
(install): Install cross-migcom only if was to be built.
(mkinstalldirs): Add $(bindir), $(includedir)/mach/exec
(cross-lexxer.o lexxer.o): lexxer.o needs cpu.h.
(./cross-migcom): Prevent dependency generation for cross-* MiG files
unless they can actually be built.
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000..3d04b825 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,73 @@ +dnl These modifications are to allow for an empty cross compiler tree. +dnl In the situation that cross-linking is impossible, the variable +dnl `cross_linkable' will be substituted with "yes". + +dnl +AC_DEFUN(AC_PROG_CC_LOCAL, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_PROG(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_WORKS_LOCAL +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= +dnl AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +dnl # This doesn't work on Linux (libc-4.5.26): Because of differences between +dnl # the shared and the static libraries there are less symbols available +dnl # without -g than with -g. It is therefore better to run the configuration +dnl # without -g and to add -g afterwards than the contrary. So don't add +dnl # -g to the CFLAGS now. +dnl elif test $ac_cv_prog_cc_g = yes; then +dnl CFLAGS="-g -O" + else +dnl CFLAGS="-O" + # Add "-O" to both the CC and CPP commands, to eliminate possible confusion + # that results from __OPTIMIZE__ being defined for CC but not CPP. +changequote(, )dnl + if echo "$CC " | grep ' -O[1-9 ]' > /dev/null 2>&1; then +changequote([, ])dnl + : # already optimizing + else + CC="$CC -O" + ac_cv_prog_CC="$CC" + fi + fi +else + GCC= +dnl # See above. +dnl test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +AC_DEFUN(AC_PROG_CC_WORKS_LOCAL, +[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) +AC_LANG_RESTORE +AC_MSG_RESULT($ac_cv_prog_cc_works) +if test $ac_cv_prog_cc_works = no; then + cross_linkable=no + ac_cv_prog_cc_cross=yes + # AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) +else + cross_linkable=yes +fi +AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) +AC_MSG_RESULT($ac_cv_prog_cc_cross) +AC_SUBST(cross_linkable) +cross_compiling=$ac_cv_prog_cc_cross +]) |