From 5989dac3caaa1e76896f8ec70128dba93a5ecccc Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Thu, 17 Apr 1997 20:47:20 +0000 Subject: Wed Apr 16 16:55:36 1997 Marcus G. Daniels * 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. --- configure.in | 47 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 50aabe4..1683d3f 100644 --- a/configure.in +++ b/configure.in @@ -39,16 +39,55 @@ AC_PREFIX_DEFAULT() # # Programs # -AC_PROG_CC +AC_PROG_CC_LOCAL AC_PROG_AWK AC_PROG_INSTALL -AC_PROG_LEX -AC_PROG_YACC AC_CHECK_TOOL(MIG, mig, mig) -if test $host != $build; then +if test $cross_compiling = yes; then AC_CHECK_PROG(BUILD_CC, gcc cc) + CC=$BUILD_CC +fi + +AC_PROG_LEX +AC_PROG_YACC + +if test $cross_compiling = yes ; then + CC=$ac_cv_prog_CC +fi + + +usable_libc='yes' +needed_funcs='memcpy memset bcopy bzero htonl ntohl ntohs' +AC_CHECK_FUNCS($needed_funcs, , usable_libc=no) +if test $usable_libc = no ; then + echo "Support functions not found using $CC, trying $BUILD_CC." + CC="$BUILD_CC" + for i in $needed_funcs ; do + unset ac_cv_func_$i + done + usable_libc=yes + AC_CHECK_FUNCS($needed_funcs, , usable_libc=no) + if test $usable_libc = no ; then + echo "Configuration problem:" 1>&2 + echo "Please set installed-clib in the toplevel Makefile so the functions:" + echo "$needed_funcs are available." + exit 1 + else + changequote(,) + set -- `$BUILD_CC -v 2>&1 | sed -n 's/.*from \(.*\)\/lib\/gcc-lib\/\([^/][^/]*\).*/\1 \2/p'` + changequote([,]) + if test -f "$1/$2/lib/libc.a" ; then + installed_clib=$1/$2/lib/libc.a + else + installed_clib=$1/lib/libc.a + fi + fi + CC=$ac_cv_prog_CC +else + installed_clib=$prefix/lib/libcrt.a fi +AC_SUBST(installed_clib) # Set up `machine' link in build directory for easier header file location. AC_LINK_FILES(${systype}/${systype},machine) -- cgit v1.2.3