From 9b65d5229b483563ad484fb890f07524fcc86f05 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 4 Sep 1995 21:13:22 +0000 Subject: [PATCH] * configure.in: Run ../bfd/configure.host before AC_PROG_CC. Subsitute CFLAGS and AR. Call AC_PROG_INSTALL. Don't substitute host_makefile_frag or frags. * aclocal.m4: New file. * configure: Rebuild. * Makefile.in (INSTALL): Set to @INSTALL@. (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. (INSTALL_DATA): Set to @INSTALL_DATA@. (AR): Set to @AR@. (AR_FLAGS): Set to rc rather than qc. (CC): Define as @CC@. (CFLAGS): Set to @CFLAGS@. (@host_makefile_frag@): Remove. (config.status): Remove dependency upon @frags@. --- opcodes/.Sanitize | 1 + opcodes/ChangeLog | 15 ++++ opcodes/aclocal.m4 | 45 ++++++++++++ opcodes/configure | 168 ++++++++++++++++++++++++++------------------- 4 files changed, 157 insertions(+), 72 deletions(-) create mode 100644 opcodes/aclocal.m4 diff --git a/opcodes/.Sanitize b/opcodes/.Sanitize index a513ce639e..019adfbe48 100644 --- a/opcodes/.Sanitize +++ b/opcodes/.Sanitize @@ -41,6 +41,7 @@ Things-to-keep: ChangeLog Makefile.in +aclocal.m4 alpha-dis.c alpha-opc.h arm-dis.c diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index bf4a8924a2..3c8497cad1 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,20 @@ Mon Sep 4 14:28:46 1995 Ian Lance Taylor + * configure.in: Run ../bfd/configure.host before AC_PROG_CC. + Subsitute CFLAGS and AR. Call AC_PROG_INSTALL. Don't substitute + host_makefile_frag or frags. + * aclocal.m4: New file. + * configure: Rebuild. + * Makefile.in (INSTALL): Set to @INSTALL@. + (INSTALL_PROGRAM): Set to @INSTALL_PROGRAM@. + (INSTALL_DATA): Set to @INSTALL_DATA@. + (AR): Set to @AR@. + (AR_FLAGS): Set to rc rather than qc. + (CC): Define as @CC@. + (CFLAGS): Set to @CFLAGS@. + (@host_makefile_frag@): Remove. + (config.status): Remove dependency upon @frags@. + * configure.in: ../bfd/config.bfd now just sets shell variables. Use them rather than looking through target Makefile fragments. * configure: Rebuild. diff --git a/opcodes/aclocal.m4 b/opcodes/aclocal.m4 new file mode 100644 index 0000000000..dabc963f4d --- /dev/null +++ b/opcodes/aclocal.m4 @@ -0,0 +1,45 @@ +dnl +dnl This ugly hack is needed because the Cygnus configure script won't +dnl tell us what CC is going to be, and "cc" isn't always right. (The +dnl top-level Makefile will always override anything we choose here, so +dnl the usual gcc/cc selection is useless.) +dnl +dnl It knows where it is in the tree; don't try using it elsewhere. +dnl +undefine([AC_PROG_CC])dnl +AC_DEFUN(AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +dnl +dnl The ugly bit... +dnl +AC_MSG_CHECKING([for CC]) +dnl Don't bother with cache. +test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'` +test -z "$CC" && CC=cc +AC_MSG_RESULT(setting CC to $CC) +AC_SUBST(CC) +dnl +dnl Find out if we are using GNU C, under whatever name. +dnl The semicolon is to pacify NeXT's syntax-checking cpp. +cat > conftest.c <&AC_FD_CC | egrep yes >/dev/null 2>&1; then + GCC=yes + if test "${CFLAGS+set}" != set; then + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + CFLAGS="-g -O" + else + CFLAGS="-O" + fi + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +rm -f conftest* +])dnl +dnl diff --git a/opcodes/configure b/opcodes/configure index 90eeb69a7d..3b24f9c7bd 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -431,69 +431,23 @@ fi # host-specific stuff: -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - 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 - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi +. ${srcdir}/../bfd/configure.host +echo $ac_n "checking for CC""... $ac_c" 1>&6 +test -z "$CC" && CC=`egrep '^CC *=' ../Makefile | tail -1 | sed 's/^CC *= *//'` +test -z "$CC" && CC=cc +echo "$ac_t""setting CC to $CC" 1>&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c < conftest.c <&5 | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -if test $ac_cv_prog_gcc = yes; then GCC=yes if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes -else - ac_cv_prog_gcc_g=no -fi -rm -f conftest* - -fi - echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then + echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then CFLAGS="-g -O" else CFLAGS="-O" @@ -503,6 +457,10 @@ else GCC= test "${CFLAGS+set}" = set || CFLAGS="-g" fi +rm -f conftest* + + +AR=${AR-ar} # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 @@ -532,6 +490,78 @@ else echo "$ac_t""no" 1>&6 fi +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_ifs" + # As a last resort, use the slow shell script. + test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh" +fi + INSTALL="$ac_cv_path_install" +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -547,7 +577,7 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error @@ -561,7 +591,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error @@ -594,7 +624,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -752,18 +782,6 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," -. ${srcdir}/../bfd/configure.host - -if test -f ${srcdir}/../bfd/config/${my_host}.mh ; then - host_makefile_frag=${srcdir}/../bfd/config/${my_host}.mh - frags=${host_makefile_frag} -else - host_makefile_frag=/dev/null - frags= -fi - - - # target-specific stuff: # Canonicalize the secondary target names. @@ -952,6 +970,7 @@ do done ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 @@ -970,7 +989,10 @@ s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@CC@%$CC%g +s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g s%@CPP@%$CPP%g s%@host@%$host%g s%@host_alias@%$host_alias%g @@ -987,9 +1009,6 @@ s%@build_alias@%$build_alias%g s%@build_cpu@%$build_cpu%g s%@build_vendor@%$build_vendor%g s%@build_os@%$build_os%g -/@host_makefile_frag@/r $host_makefile_frag -s%@host_makefile_frag@%%g -s%@frags@%$frags%g s%@archdefs@%$archdefs%g s%@BFD_MACHINES@%$BFD_MACHINES%g @@ -1032,6 +1051,10 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1044,6 +1067,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file fi; done rm -f conftest.subs -- 2.34.1