]> git.ipfire.org Git - thirdparty/gcc.git/blame - libada/configure.ac
re PR ada/41122 (libada multilib string parsing error)
[thirdparty/gcc.git] / libada / configure.ac
CommitLineData
b0b70d84 1# Configure script for libada.
748086b7 2# Copyright 2003, 2004, 2009 Free Software Foundation, Inc.
b0b70d84
AC
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
748086b7 6# the Free Software Foundation; either version 3 of the License, or
b0b70d84
AC
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
748086b7
JJ
15# along with this program; see the file COPYING3. If not see
16# <http://www.gnu.org/licenses/>.
b0b70d84 17
18c04407 18sinclude(../config/acx.m4)
05682af8 19sinclude(../config/multi.m4)
18c04407
RW
20sinclude(../config/override.m4)
21
215cae7b 22AC_INIT
df58e648 23AC_PREREQ([2.64])
b0b70d84 24
80dab182
NN
25AC_CONFIG_SRCDIR([Makefile.in])
26
9bd6112c
PB
27# Determine the host, build, and target systems
28AC_CANONICAL_BUILD
29AC_CANONICAL_HOST
30AC_CANONICAL_TARGET
05682af8 31target_alias=${target_alias-$host_alias}
9bd6112c
PB
32
33# Determine the noncanonical target name, for directory use.
34ACX_NONCANONICAL_TARGET
35
36# Determine the target- and build-specific subdirectories
37GCC_TOPLEV_SUBDIRS
38
80dab182 39# Command-line options.
b0b70d84 40# Very limited version of AC_MAINTAINER_MODE.
80dab182
NN
41AC_ARG_ENABLE([maintainer-mode],
42 [AC_HELP_STRING([--enable-maintainer-mode],
b0b70d84 43 [enable make rules and dependencies not useful (and
80dab182 44 sometimes confusing) to the casual installer])],
b0b70d84
AC
45 [case ${enable_maintainer_mode} in
46 yes) MAINT='' ;;
47 no) MAINT='#' ;;
48 *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
49 esac
50 maintainer_mode=${enableval}],
51 [MAINT='#'])
52AC_SUBST([MAINT])dnl
53
7193e639
LG
54AM_ENABLE_MULTILIB(, ..)
55# Calculate toolexeclibdir
56# Also toolexecdir, though it's only used in toolexeclibdir
57case ${enable_version_specific_runtime_libs} in
58 yes)
59 # Need the gcc compiler version to know where to install libraries
60 # and header files if --enable-version-specific-runtime-libs option
61 # is selected.
62 toolexecdir='$(libdir)/gcc/$(target_alias)'
63 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
64 ;;
65 no)
66 if test -n "$with_cross_host" &&
67 test x"$with_cross_host" != x"no"; then
68 # Install a library built with a cross compiler in tooldir, not libdir.
69 toolexecdir='$(exec_prefix)/$(target_alias)'
70 toolexeclibdir='$(toolexecdir)/lib'
71 else
72 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
73 toolexeclibdir='$(libdir)'
74 fi
75 multi_os_directory=`$CC -print-multi-os-directory`
76 case $multi_os_directory in
77 .) ;; # Avoid trailing /.
78 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
79 esac
80 ;;
81esac
82AC_SUBST(toolexecdir)
83AC_SUBST(toolexeclibdir)
84#TODO: toolexeclibdir is currently disregarded
85
86# Check the compiler.
87# The same as in boehm-gc and libstdc++. Have to borrow it from there.
88# We must force CC to /not/ be precious variables; otherwise
89# the wrong, non-multilib-adjusted value will be used in multilibs.
90# As a side effect, we have to subst CFLAGS ourselves.
91
92m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
93m4_define([_AC_ARG_VAR_PRECIOUS],[])
94AC_PROG_CC
1b3b24c2 95m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
7193e639
LG
96
97AC_SUBST(CFLAGS)
98
80dab182
NN
99AC_ARG_ENABLE([shared],
100[AC_HELP_STRING([--disable-shared],
101 [don't provide a shared libgnat])],
102[
103case $enable_shared in
b0b70d84
AC
104 yes | no) ;;
105 *)
106 enable_shared=no
107 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
108 for pkg in $enableval; do
80dab182
NN
109 case $pkg in
110 ada | libada)
111 enable_shared=yes ;;
112 esac
b0b70d84
AC
113 done
114 IFS="$ac_save_ifs"
115 ;;
80dab182 116esac
b0b70d84 117], [enable_shared=yes])
80dab182
NN
118AC_SUBST([enable_shared])
119
c390c361
PB
120# These must be passed down, or are needed by gcc/libgcc.mvars
121AC_PROG_AWK
80dab182
NN
122AC_PROG_LN_S
123
80dab182
NN
124# Determine what to build for 'gnatlib'
125if 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"
129else
f206bf50 130 default_gnatlib_target="gnatlib-plain"
80dab182
NN
131fi
132AC_SUBST([default_gnatlib_target])
d743b2b6 133
47ad7893
PB
134warn_cflags=
135if test "x$GCC" = "xyes"; then
136 warn_cflags='$(GCC_WARN_CFLAGS)'
137fi
138AC_SUBST(warn_cflags)
139
80dab182
NN
140# Output: create a Makefile.
141AC_CONFIG_FILES([Makefile])
b0b70d84
AC
142
143AC_OUTPUT