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