OSDN Git Service

PR libstdc++/38732
[pf3gnuchains/gcc-fork.git] / libada / configure.ac
1 # Configure script for libada.
2 #   Copyright 2003, 2004 Free Software Foundation, Inc.
3 #
4 # This file is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 sinclude(../config/acx.m4)
19 sinclude(../config/override.m4)
20
21 AC_INIT
22 AC_PREREQ([2.59])
23
24 AC_CONFIG_SRCDIR([Makefile.in])
25
26 # Determine the host, build, and target systems
27 AC_CANONICAL_BUILD
28 AC_CANONICAL_HOST
29 AC_CANONICAL_TARGET
30
31 # Determine the noncanonical target name, for directory use.
32 ACX_NONCANONICAL_TARGET
33
34 # Determine the target- and build-specific subdirectories
35 GCC_TOPLEV_SUBDIRS
36
37 # Command-line options.
38 # Very limited version of AC_MAINTAINER_MODE.
39 AC_ARG_ENABLE([maintainer-mode],
40   [AC_HELP_STRING([--enable-maintainer-mode],
41                  [enable make rules and dependencies not useful (and
42                   sometimes confusing) to the casual installer])],
43   [case ${enable_maintainer_mode} in
44      yes) MAINT='' ;;
45      no) MAINT='#' ;;
46      *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
47    esac
48    maintainer_mode=${enableval}],
49   [MAINT='#'])
50 AC_SUBST([MAINT])dnl
51
52 AC_CANONICAL_SYSTEM
53 target_alias=${target_alias-$host_alias}
54
55 AM_ENABLE_MULTILIB(, ..)
56 # Calculate toolexeclibdir
57 # Also toolexecdir, though it's only used in toolexeclibdir
58 case ${enable_version_specific_runtime_libs} in
59   yes)
60     # Need the gcc compiler version to know where to install libraries
61     # and header files if --enable-version-specific-runtime-libs option
62     # is selected.
63     toolexecdir='$(libdir)/gcc/$(target_alias)'
64     toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
65     ;;
66   no)
67     if test -n "$with_cross_host" &&
68        test x"$with_cross_host" != x"no"; then
69       # Install a library built with a cross compiler in tooldir, not libdir.
70       toolexecdir='$(exec_prefix)/$(target_alias)'
71       toolexeclibdir='$(toolexecdir)/lib'
72     else
73       toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
74       toolexeclibdir='$(libdir)'
75     fi
76     multi_os_directory=`$CC -print-multi-os-directory`
77     case $multi_os_directory in
78       .) ;; # Avoid trailing /.
79       *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
80     esac
81     ;;
82 esac
83 AC_SUBST(toolexecdir)
84 AC_SUBST(toolexeclibdir)
85 #TODO: toolexeclibdir is currently disregarded
86
87 # Check the compiler.
88 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
89 # We must force CC to /not/ be precious variables; otherwise
90 # the wrong, non-multilib-adjusted value will be used in multilibs.
91 # As a side effect, we have to subst CFLAGS ourselves.
92
93 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
94 m4_define([_AC_ARG_VAR_PRECIOUS],[])
95 AC_PROG_CC
96 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
97
98 AC_SUBST(CFLAGS)
99
100 AC_ARG_ENABLE([shared],
101 [AC_HELP_STRING([--disable-shared],
102                 [don't provide a shared libgnat])],
103 [
104 case $enable_shared in
105   yes | no) ;;
106   *)
107     enable_shared=no
108     IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
109     for pkg in $enableval; do
110       case $pkg in
111         ada | libada)
112           enable_shared=yes ;;
113       esac
114     done
115     IFS="$ac_save_ifs"
116     ;;
117 esac
118 ], [enable_shared=yes])
119 AC_SUBST([enable_shared])
120
121 # Need to pass this down for now :-P
122 AC_PROG_LN_S
123
124 # Determine what to build for 'gnatlib'
125 if test $build = $target \
126    && test ${enable_shared} = yes ; then
127   # Note that build=target is almost certainly the wrong test; FIXME
128   default_gnatlib_target="gnatlib-shared"
129 else
130   default_gnatlib_target="gnatlib-plain"
131 fi
132 AC_SUBST([default_gnatlib_target])
133
134 AC_PROG_CC
135 warn_cflags=
136 if test "x$GCC" = "xyes"; then
137   warn_cflags='$(GCC_WARN_CFLAGS)'
138 fi
139 AC_SUBST(warn_cflags)
140
141 # Output: create a Makefile.
142 AC_CONFIG_FILES([Makefile])
143
144 AC_OUTPUT