]>
Commit | Line | Data |
---|---|---|
b0b70d84 | 1 | # Configure script for libada. |
818ab71a | 2 | # Copyright (C) 2003-2016 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 | 18 | sinclude(../config/acx.m4) |
05682af8 | 19 | sinclude(../config/multi.m4) |
18c04407 | 20 | sinclude(../config/override.m4) |
e3aa9eba | 21 | sinclude(../config/picflag.m4) |
2f18d9af | 22 | sinclude(../config/unwind_ipinfo.m4) |
18c04407 | 23 | |
215cae7b | 24 | AC_INIT |
df58e648 | 25 | AC_PREREQ([2.64]) |
b0b70d84 | 26 | |
80dab182 NN |
27 | AC_CONFIG_SRCDIR([Makefile.in]) |
28 | ||
9bd6112c PB |
29 | # Determine the host, build, and target systems |
30 | AC_CANONICAL_BUILD | |
31 | AC_CANONICAL_HOST | |
32 | AC_CANONICAL_TARGET | |
05682af8 | 33 | target_alias=${target_alias-$host_alias} |
9bd6112c PB |
34 | |
35 | # Determine the noncanonical target name, for directory use. | |
36 | ACX_NONCANONICAL_TARGET | |
37 | ||
38 | # Determine the target- and build-specific subdirectories | |
39 | GCC_TOPLEV_SUBDIRS | |
40 | ||
80dab182 | 41 | # Command-line options. |
b0b70d84 | 42 | # Very limited version of AC_MAINTAINER_MODE. |
80dab182 NN |
43 | AC_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='#']) | |
54 | AC_SUBST([MAINT])dnl | |
55 | ||
7193e639 LG |
56 | AM_ENABLE_MULTILIB(, ..) |
57 | # Calculate toolexeclibdir | |
58 | # Also toolexecdir, though it's only used in toolexeclibdir | |
59 | case ${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 | ;; | |
83 | esac | |
84 | AC_SUBST(toolexecdir) | |
85 | AC_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 | ||
94 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
95 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
96 | AC_PROG_CC | |
1b3b24c2 | 97 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
7193e639 LG |
98 | |
99 | AC_SUBST(CFLAGS) | |
100 | ||
80dab182 NN |
101 | AC_ARG_ENABLE([shared], |
102 | [AC_HELP_STRING([--disable-shared], | |
103 | [don't provide a shared libgnat])], | |
104 | [ | |
105 | case $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 | 118 | esac |
b0b70d84 | 119 | ], [enable_shared=yes]) |
80dab182 NN |
120 | AC_SUBST([enable_shared]) |
121 | ||
e3aa9eba RO |
122 | GCC_PICFLAG |
123 | AC_SUBST([PICFLAG]) | |
124 | ||
c390c361 PB |
125 | # These must be passed down, or are needed by gcc/libgcc.mvars |
126 | AC_PROG_AWK | |
80dab182 NN |
127 | AC_PROG_LN_S |
128 | ||
80dab182 NN |
129 | # Determine what to build for 'gnatlib' |
130 | if 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" | |
134 | else | |
f206bf50 | 135 | default_gnatlib_target="gnatlib-plain" |
80dab182 NN |
136 | fi |
137 | AC_SUBST([default_gnatlib_target]) | |
d743b2b6 | 138 | |
2f18d9af EB |
139 | # Check for _Unwind_GetIPInfo |
140 | GCC_CHECK_UNWIND_GETIPINFO | |
141 | have_getipinfo= | |
142 | if test x$have_unwind_getipinfo = xyes; then | |
143 | have_getipinfo=-DHAVE_GETIPINFO | |
144 | fi | |
145 | AC_SUBST(have_getipinfo) | |
146 | ||
80dab182 NN |
147 | # Output: create a Makefile. |
148 | AC_CONFIG_FILES([Makefile]) | |
b0b70d84 AC |
149 | |
150 | AC_OUTPUT |