Makefile.in: Call gcc/ada/Makefile directly, not through the intermediary of gcc...
authorNathanael Nerode <neroden@gcc.gnu.org>
Thu, 15 Apr 2004 03:38:59 +0000 (03:38 +0000)
committerNathanael Nerode <neroden@gcc.gnu.org>
Thu, 15 Apr 2004 03:38:59 +0000 (03:38 +0000)
* Makefile.in: Call gcc/ada/Makefile directly, not through the
intermediary of gcc/Makefile.  Incorporate all necessary parts of
rules from gcc/ada/Make-lang.in, including extra gnatlib/gnattools
targets, rts-zfp, rts-ravenscar.  Get needed bits of GCC
configuration from (new) gcc/libada-mk.  Decide what gnatlib variant
to build in configure.ac, not here.
* configure.ac: Provide Makefile.in with the new information it needs,
such as GCC's tmake_file and xmake_file.
* configure: Regenerate.

From-SVN: r80711

libada/ChangeLog
libada/Makefile.in
libada/configure
libada/configure.ac

index 8c62345..c010887 100644 (file)
@@ -1,3 +1,15 @@
+2004-04-14  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.in: Call gcc/ada/Makefile directly, not through the
+       intermediary of gcc/Makefile.  Incorporate all necessary parts of
+       rules from gcc/ada/Make-lang.in, including extra gnatlib/gnattools
+       targets, rts-zfp, rts-ravenscar.  Get needed bits of GCC
+       configuration from (new) gcc/libada-mk.  Decide what gnatlib variant
+       to build in configure.ac, not here.
+       * configure.ac: Provide Makefile.in with the new information it needs,
+       such as GCC's tmake_file and xmake_file.
+       * configure: Regenerate.
+
 2004-03-10  Kelley Cook  <kcook@gcc.gnu.org>
 
        * configure.in: Rename file to ...
index e1565e7..5af0d51 100644 (file)
@@ -23,32 +23,229 @@ SHELL = @SHELL@
 srcdir = @srcdir@
 build = @build@
 target = @target@
-enable_shared = @enable_shared@
+prefix = @prefix@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
 
 # Nonstandard autoconf-set variables.
+enable_shared = @enable_shared@
+LN_S=@LN_S@
+target_noncanonical=@target_noncanonical@
+
+# Variables for the user (or the top level) to override.
+objext=.o
+GNATLIBFLAGS= -W -Wall -gnatpg
+THREAD_KIND=native
+TRACE=no
+GNATLIBLDFLAGS=
+ADA_FOR_BUILD=
+ADA_FOR_TARGET=
+LDFLAGS=
+STAGE_PREFIX=
+
+# The tedious process of getting CFLAGS right.
+CFLAGS=-g
+LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
+GCC_WARN_CFLAGS = $(LOOSE_WARN) $(NOCOMMON_FLAG)
 
-FLAGS_TO_PASS =
+ADA_CFLAGS=
+T_ADA_CFLAGS=
+# HPPA is literally the only target which sets X_ADA_CFLAGS
+X_ADA_CFLAGS=@x_ada_cflags@
+ALL_ADA_CFLAGS=$(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
 
-GNATLIB = gnatlib
+# Variables for gnattools.
+ADAFLAGS= -gnatpg -gnata
+ADA_INCLUDE_DIR = $(libsubdir)/adainclude
+ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
 
-ifeq ($(build),$(target))
-  GNATTOOLS = gnattools
+# For finding the GCC build dir, which is used far too much
+GCC_DIR=../../gcc
+# Include fragment generated by GCC configure.
+include $(GCC_DIR)/libada-mk
+# Variables based on those gleaned from the GCC makefile.  :-P
+libsubdir=$(libdir)/gcc/$(target_noncanonical)/$(gcc_version)
 
-  ifeq ($(enable_shared),yes)
-    GNATLIB = gnatlib-shared
-  endif
+TARGET_LIBGCC2_CFLAGS=
+GNATLIBCFLAGS= -g -O2
+# Get target-specific overrides for TARGET_LIBGCC2_CFLAGS
+# and possibly GNATLIBCFLAGS.  Currently this uses files
+# in gcc/config.  The 'subst' call is used to rerelativize them
+# from their gcc locations.  This is hackery, but there isn't
+# yet a better way to do this.
+tmake_file=$(subst /config,/../gcc/config,$(gcc_tmake_file))
+ifneq ($(tmake_file),)
+include $(tmake_file)
+endif
 
-else
-  GNATTOOLS = cross-gnattools ada.all.cross
+# Get possible host-specific override for libsubdir (ick).
+xmake_file=$(subst /config,/../gcc/config,$(gcc_xmake_file))
+ifneq ($(xmake_file),)
+include $(xmake_file)
 endif
 
+FLAGS_TO_PASS = \
+        "MAKEOVERRIDES=" \
+        "LDFLAGS=$(LDFLAGS)" \
+        "LN_S=$(LN_S)" \
+        "SHELL=$(SHELL)" \
+        "exeext=$(exeext)" \
+        "objext=$(objext)" \
+        "prefix=$(prefix)" \
+        "STAGE_PREFIX=$(STAGE_PREFIX)" \
+       "CC=$(cc_set_by_configure)" \
+        "CFLAGS=$(CFLAGS) $(WARN_CFLAGS)"
+
+ADA_FLAGS_TO_PASS = \
+        "ADA_FOR_BUILD=$(ADA_FOR_BUILD)"        \
+        "ADA_INCLUDE_DIR=$(ADA_INCLUDE_DIR)"    \
+        "ADA_RTL_OBJ_DIR=$(ADA_RTL_OBJ_DIR)"    \
+        "ADAFLAGS=$(ADAFLAGS)"                  \
+        "ADA_FOR_TARGET=$(ADA_FOR_TARGET)"      \
+        "INSTALL=$(INSTALL)"                    \
+        "INSTALL_DATA=$(INSTALL_DATA)"          \
+        "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
+
+ADA_TOOLS_FLAGS_TO_PASS=\
+        "CC=../../xgcc -B../../"        \
+        "CFLAGS=$(CFLAGS)"              \
+        "exeext=$(exeext)"              \
+        "ADAFLAGS=$(ADAFLAGS)"          \
+        "ADA_INCLUDES=-I../rts"         \
+        "GNATMAKE=../../gnatmake"       \
+        "GNATLINK=../../gnatlink"       \
+        "GNATBIND=../../gnatbind"
+
+fyi:
+       echo $(tmake_file)
+
 # Rules to build gnatlib.
-gnatlib:
-       $(MAKE) -C ../../gcc $(FLAGS_TO_PASS) $(GNATLIB)
+.PHONY: gnatlib gnatlib-plain gnatlib-sjlj gnatlib-shared
+gnatlib: @default_gnatlib_target@
+
+gnatlib-plain:
+       $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+         GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+         GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+         TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+         THREAD_KIND="$(THREAD_KIND)" \
+         TRACE="$(TRACE)" \
+         gnatlib ; \
+
+gnatlib-sjlj:
+       $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+         GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+         GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+         TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+         THREAD_KIND="$(THREAD_KIND)" \
+         TRACE="$(TRACE)" \
+         gnatlib-sjlj ; \
+
+gnatlib-shared:
+       $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+         GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+         GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+         GNATLIBLDFLAGS="$(GNATLIBLDFLAGS)" \
+         TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+         THREAD_KIND="$(THREAD_KIND)" \
+         TRACE="$(TRACE)" \
+         gnatlib-shared ; \
+
+.PHONY: rts-zfp rts-ravenscar
+rts-zfp:
+       $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+         GNATMAKE=../gnatmake-cross \
+         rts-zfp
+
+rts-ravenscar:
+       $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) \
+         GNATMAKE=../gnatmake-cross \
+         rts-ravenscar
 
 # Rules to build gnattools.
+# For cross builds of gnattools,
+# put the host RTS dir first in the PATH to hide the default runtime
+# files that are among the sources
+RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+.PHONY: gnattools regnattools
 gnattools: gnatlib
-       $(MAKE) -C ../../gcc $(FLAGS_TO_PASS) $(GNATTOOLS)
+       if test $(build) = $(target) ; then \
+         $(MAKE) -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
+           ADA_INCLUDES="-I- -I../rts" \
+           CC="../../xgcc -B../../" STAGE_PREFIX=../../  gnattools1 ; \
+         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2 ; \
+         $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3 ; \
+       else \
+         $(MAKE)  -C $(GCC_DIR)/ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS) \
+           ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \
+           GNATMAKE="gnatmake" \
+           GNATBIND="gnatbind" \
+           GNATLINK="gnatlink" \
+           LIBGNAT="" \
+           gnattools1-re gnattools2 gnattools4 ; \
+         $(MAKE) $(FLAGS_TO_PASS) ada.all.cross ; \
+       fi
+
+regnattools:
+       $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools1-re
+       $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools2
+       $(MAKE) -C $(GCC_DIR)/ada $(ADA_TOOLS_FLAGS_TO_PASS) gnattools3
+
+# It's unclear whether this is even needed, and if so whether it should run
+# *before* the rest of crossgnattools or *after* it.
+ada.all.cross:
+       if [ -f $(GCC_DIR)/gnatbind$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatbind$(exeext) $(GCC_DIR)/gnatbind-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatbl$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatbl$(exeext) $(GCC_DIR)/gnatbl-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatchop$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatchop$(exeext) $(GCC_DIR)/gnatchop-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnat$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnat$(exeext) $(GCC_DIR)/gnat-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatkr$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatkr$(exeext) $(GCC_DIR)/gnatkr-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatlink$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatlink$(exeext) $(GCC_DIR)/gnatlink-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatls$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatls$(exeext) $(GCC_DIR)/gnatls-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatmake$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatmake$(exeext) $(GCC_DIR)/gnatmake-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatmem$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatmem$(exeext) $(GCC_DIR)/gnatmem-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatname$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatname$(exeext) $(GCC_DIR)/gnatname-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatprep$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatprep$(exeext) $(GCC_DIR)/gnatprep-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatxref$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatxref$(exeext) $(GCC_DIR)/gnatxref-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatfind$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatfind$(exeext) $(GCC_DIR)/gnatfind-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatclean$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatclean$(exeext) $(GCC_DIR)/gnatclean-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gnatsym$(exeext) ] ; then \
+         mv $(GCC_DIR)/gnatsym$(exeext) $(GCC_DIR)/gnatsym-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gpr2make$(exeext) ] ; then \
+         mv $(GCC_DIR)/gpr2make$(exeext) $(GCC_DIR)/gpr2make-cross$(exeext); \
+       fi
+       if [ -f $(GCC_DIR)/gprcmd$(exeext) ] ; then \
+         mv $(GCC_DIR)/gprcmd$(exeext) $(GCC_DIR)/gprcmd-cross$(exeext); \
+       fi
 
 # Check uninstalled version.
 check:
index 8c24809..e887087 100755 (executable)
@@ -272,7 +272,7 @@ PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
 ac_unique_file="Makefile.in"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os enable_shared LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT enable_shared INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical LN_S x_ada_cflags default_gnatlib_target LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -881,7 +881,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -1230,9 +1230,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-# This is an autoconf 2.5x script.
 
 
+# Command-line options.
 # Very limited version of AC_MAINTAINER_MODE.
 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
@@ -1249,11 +1249,31 @@ else
   MAINT='#'
 fi;
 
-# Start of actual configure tests
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval="$enable_shared"
+
+case $enable_shared in
+  yes | no) ;;
+  *)
+    enable_shared=no
+    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+    for pkg in $enableval; do
+      case $pkg in
+        ada | libada)
+          enable_shared=yes ;;
+      esac
+    done
+    IFS="$ac_save_ifs"
+    ;;
+esac
+
+else
+  enable_shared=yes
+fi;
 
-# Output: create a Makefile.
-          ac_config_files="$ac_config_files Makefile"
 
+# Start of actual configure tests
 
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
@@ -1280,6 +1300,86 @@ ac_config_guess="$SHELL $ac_aux_dir/config.guess"
 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
 ac_configure="$SHELL $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
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
 # Make sure we can run config.sub.
 $ac_config_sub sun4 >/dev/null 2>&1 ||
   { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
@@ -1363,27 +1463,106 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-# Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval="$enable_shared"
+# Autoconf M4 include file defining utility macros for complex Canadian
+# cross builds.
+
+
+
+
+
+
+####
+# _NCN_TOOL_PREFIXES:  Some stuff that oughtta be done in AC_CANONICAL_SYSTEM
+# or AC_INIT.
+# These demand that AC_CANONICAL_SYSTEM be called beforehand.
+
+####
+# NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like AC_CHECK_TOOL, but tries a prefix of the target, not the host.
+# Code is pretty much lifted from autoconf2.53.
+
+
+
+####
+# NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like AC_CHECK_TOOL, but requires the prefix if build!=host.
+
+
+
+####
+# NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
+# Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target.
 
-  case $enable_shared in
-  yes | no) ;;
-  *)
-    enable_shared=no
-    IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
-    for pkg in $enableval; do
-      if test "$pkg" = "ada" || test "$pkg" = "libada"; then
-        enable_shared=yes
-      fi
-    done
-    IFS="$ac_save_ifs"
-    ;;
-  esac
 
+###
+# AC_PROG_CPP_WERROR
+# Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
+# triggers warnings from the preprocessor.  Will be in autoconf 2.58.
+# For now, using this also overrides header checks to use only the
+# preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
+# bit harder from here).
+# Eventually autoconf will default to checking headers with the compiler
+# instead, and we'll have to do this differently.
+
+# AC_PROG_CPP_WERROR
+
+# Test for GNAT.
+# We require the gnatbind program, and a compiler driver that
+# understands Ada.  We use the user's CC setting, already found.
+#
+# Sets the shell variable have_gnat to yes or no as appropriate, and
+# substitutes GNATBIND.
+
+
+ case ${build_alias} in
+  "") build_noncanonical=${build} ;;
+  *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+  "") host_noncanonical=${build_noncanonical} ;;
+  *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+  "") target_noncanonical=${host_noncanonical} ;;
+  *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+# Need to pass this down for now :-P
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
 else
-  enable_shared=yes
-fi;
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+
+# Determine x_ada_cflags
+case $host in
+  hppa*) x_ada_cflags=-mdisable-indexing ;;
+  *) x_ada_cflags= ;;
+esac
+
+
+# Determine what to build for 'gnatlib'
+if test $build = $target \
+   && test ${enable_shared} = yes ; then
+  # Note that build=target is almost certainly the wrong test; FIXME
+  default_gnatlib_target="gnatlib-shared"
+else
+  default_gnatlib_target="gnatlib-simple"
+fi
+
+
+# Output: create a Makefile.
+          ac_config_files="$ac_config_files Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -1842,6 +2021,7 @@ Copyright (C) 2003 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 srcdir=$srcdir
+INSTALL="$INSTALL"
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -2021,6 +2201,10 @@ s,@ECHO_N@,$ECHO_N,;t t
 s,@ECHO_T@,$ECHO_T,;t t
 s,@LIBS@,$LIBS,;t t
 s,@MAINT@,$MAINT,;t t
+s,@enable_shared@,$enable_shared,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
 s,@build@,$build,;t t
 s,@build_cpu@,$build_cpu,;t t
 s,@build_vendor@,$build_vendor,;t t
@@ -2033,7 +2217,10 @@ s,@target@,$target,;t t
 s,@target_cpu@,$target_cpu,;t t
 s,@target_vendor@,$target_vendor,;t t
 s,@target_os@,$target_os,;t t
-s,@enable_shared@,$enable_shared,;t t
+s,@target_noncanonical@,$target_noncanonical,;t t
+s,@LN_S@,$LN_S,;t t
+s,@x_ada_cflags@,$x_ada_cflags,;t t
+s,@default_gnatlib_target@,$default_gnatlib_target,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
@@ -2197,12 +2384,11 @@ case $ac_abs_builddir in
 esac
 
 
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -2241,6 +2427,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
         fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
@@ -2258,6 +2450,7 @@ s,@builddir@,$ac_builddir,;t t
 s,@abs_builddir@,$ac_abs_builddir,;t t
 s,@top_builddir@,$ac_top_builddir,;t t
 s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
   rm -f $tmp/stdin
   if test x"$ac_file" != x-; then
index e2d6198..580447e 100644 (file)
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 AC_INIT
-AC_CONFIG_SRCDIR([Makefile.in])
-
-# This is an autoconf 2.5x script.
 AC_PREREQ([2.59])
 
+AC_CONFIG_SRCDIR([Makefile.in])
+
+# Command-line options.
 # Very limited version of AC_MAINTAINER_MODE.
-AC_ARG_ENABLE(
-  [maintainer-mode],
-  AC_HELP_STRING([--enable-maintainer-mode],
+AC_ARG_ENABLE([maintainer-mode],
+  [AC_HELP_STRING([--enable-maintainer-mode],
                  [enable make rules and dependencies not useful (and
-                  sometimes confusing) to the casual installer]),
+                  sometimes confusing) to the casual installer])],
   [case ${enable_maintainer_mode} in
      yes) MAINT='' ;;
      no) MAINT='#' ;;
@@ -36,30 +35,58 @@ AC_ARG_ENABLE(
   [MAINT='#'])
 AC_SUBST([MAINT])dnl
 
-# Start of actual configure tests
-
-# Output: create a Makefile.
-AC_CONFIG_FILES([Makefile])
-
-AC_CANONICAL_SYSTEM
-
-AC_ARG_ENABLE(shared,
-[  --disable-shared        don't provide a shared libgnat],
-[ 
-  case $enable_shared in
+AC_ARG_ENABLE([shared],
+[AC_HELP_STRING([--disable-shared],
+                [don't provide a shared libgnat])],
+[
+case $enable_shared in
   yes | no) ;;
   *)
     enable_shared=no
     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
     for pkg in $enableval; do
-      if test "$pkg" = "ada" || test "$pkg" = "libada"; then
-        enable_shared=yes
-      fi
+      case $pkg in
+        ada | libada)
+          enable_shared=yes ;;
+      esac
     done
     IFS="$ac_save_ifs"
     ;;
-  esac
+esac
 ], [enable_shared=yes])
-AC_SUBST(enable_shared)
+AC_SUBST([enable_shared])
+
+# Start of actual configure tests
+
+AC_PROG_INSTALL
+
+AC_CANONICAL_SYSTEM
+
+sinclude(../config/acx.m4)
+_GCC_TOPLEV_NONCANONICAL_TARGET
+AC_SUBST(target_noncanonical)
+
+# Need to pass this down for now :-P
+AC_PROG_LN_S
+
+# Determine x_ada_cflags
+case $host in
+  hppa*) x_ada_cflags=-mdisable-indexing ;;
+  *) x_ada_cflags= ;;
+esac
+AC_SUBST([x_ada_cflags])
+
+# Determine what to build for 'gnatlib'
+if test $build = $target \
+   && test ${enable_shared} = yes ; then
+  # Note that build=target is almost certainly the wrong test; FIXME
+  default_gnatlib_target="gnatlib-shared"
+else
+  default_gnatlib_target="gnatlib-simple"
+fi
+AC_SUBST([default_gnatlib_target])
+
+# Output: create a Makefile.
+AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT