diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | configure.ac | 49 | ||||
-rw-r--r-- | configure.in | 62 |
3 files changed, 52 insertions, 62 deletions
@@ -1,5 +1,8 @@ 2006-11-29 Thomas Schwinge <tschwinge@gnu.org> + * configure.in: Move to... + * configure.ac: ... here and overhaul a bit. + * Makefile.am (TARGET_CPPFLAGS, TARGET_CFLAGS): New variables. * config.guess: Remove file. diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..f8eb3ad --- /dev/null +++ b/configure.ac @@ -0,0 +1,49 @@ +dnl configure script for GNU MIG. + +AC_PREREQ([2.53]) + +AC_INIT([GNU MIG], [1.3.1], [bug-hurd@gnu.org]) +AC_CONFIG_SRCDIR([migcom.c]) +AC_CONFIG_AUX_DIR([build-aux]) + +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AC_ARG_PROGRAM + +AM_INIT_AUTOMAKE + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_YACC +AM_PROG_LEX +AC_PROG_AWK +AC_PROG_INSTALL + +dnl Checks for header files. +AC_HEADER_STDC + +dnl Checks for library functions. +AC_FUNC_ALLOCA +AC_FUNC_VPRINTF + + +[if [ "$target" = "$host" ]; then + TARGET_CC='${CC}' +else] + AC_CHECK_PROG([TARGET_CC], [$target_alias-gcc], [$target_alias-gcc], [none]) + [if [ x"$TARGET_CC" != x"$target_alias"-gcc ]; then] + AC_MSG_ERROR([could not find a compiler for the target you requested]) + [fi +fi] +dnl These two are just for the user's convenience. +AC_SUBST([TARGET_CPPFLAGS]) +AC_SUBST([TARGET_CFLAGS]) + +[MIGCOM=`echo migcom | sed "$program_transform_name"`] +AC_SUBST([MIGCOM]) +[MIG=`echo mig | sed "$program_transform_name"`] +AC_SUBST([MIG]) + +AC_OUTPUT([Makefile mig]) diff --git a/configure.in b/configure.in deleted file mode 100644 index 75e444e..0000000 --- a/configure.in +++ /dev/null @@ -1,62 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(migcom.c) -AC_PREREQ(2.12) - -AC_CANONICAL_SYSTEM -AC_ARG_PROGRAM dnl needs SYSTEM, not just HOST and TARGET - -AM_INIT_AUTOMAKE(mig, 1.3.1) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_CPP -AC_PROG_YACC -AM_PROG_LEX -AC_PROG_AWK -AC_PROG_INSTALL - -dnl Checks for header files. -AC_STDC_HEADERS - -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_HAVE_FUNCS(vprintf) - -AC_MSG_CHECKING(for target compiler) -if test "x$TARGET_CC" != x; then - # User set it. - AC_MSG_RESULT([$TARGET_CC]) -elif test "$target" = "$host"; then - TARGET_CC='${CC}' - AC_MSG_RESULT([native, using host compiler]) -else - [mig_target=`echo "$target" | sed 's/[^a-zA-Z0-9_]/_/g'`] - AC_CACHE_VAL(mig_cv_${mig_target}_CC, [ dnl - ac_word="${target_alias}-gcc" - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - eval mig_cv_${mig_target}_CC='$ac_word' - break - fi - done - IFS="$ac_save_ifs"]) - eval TARGET_CC=\"\$mig_cv_${mig_target}_CC\" - if test "x$TARGET_CC" = x; then - AC_MSG_RESULT([${target_alias}-gcc not found]) - TARGET_CC='${CC}' - AC_MSG_WARN([using host compiler ($CC) for target $target]) - else - AC_MSG_RESULT([${TARGET_CC}]) - fi -fi -AC_SUBST(TARGET_CC) -dnl These two are just for the user's convenience. -AC_SUBST(TARGET_CPPFLAGS) -AC_SUBST(TARGET_CFLAGS) - -MIGCOM=`echo migcom | sed "$program_transform_name"` -AC_SUBST(MIGCOM) - -AC_OUTPUT([Makefile mig]) |