1 # Configure script for libada.
2 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
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 3 of the License, or
7 # (at your option) any later version.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
18 sinclude(../config/acx.m4)
19 sinclude(../config/multi.m4)
20 sinclude(../config/override.m4)
21 sinclude(../config/picflag.m4)
22 sinclude(../config/unwind_ipinfo.m4)
27 AC_CONFIG_SRCDIR([Makefile.in])
29 # Determine the host, build, and target systems
33 target_alias=${target_alias-$host_alias}
35 # Determine the noncanonical target name, for directory use.
36 ACX_NONCANONICAL_TARGET
38 # Determine the target- and build-specific subdirectories
41 # Command-line options.
42 # Very limited version of AC_MAINTAINER_MODE.
43 AC_ARG_ENABLE([maintainer-mode],
44 [AC_HELP_STRING([--enable-maintainer-mode],
45 [enable make rules and dependencies not useful (and
46 sometimes confusing) to the casual installer])],
47 [case ${enable_maintainer_mode} in
50 *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
52 maintainer_mode=${enableval}],
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
61 # Need the gcc compiler version to know where to install libraries
62 # and header files if --enable-version-specific-runtime-libs option
64 toolexecdir='$(libdir)/gcc/$(target_alias)'
65 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
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'
74 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
75 toolexeclibdir='$(libdir)'
77 multi_os_directory=`$CC -print-multi-os-directory`
78 case $multi_os_directory in
79 .) ;; # Avoid trailing /.
80 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
85 AC_SUBST(toolexeclibdir)
86 #TODO: toolexeclibdir is currently disregarded
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.
94 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
95 m4_define([_AC_ARG_VAR_PRECIOUS],[])
97 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
101 AC_ARG_ENABLE([shared],
102 [AC_HELP_STRING([--disable-shared],
103 [don't provide a shared libgnat])],
105 case $enable_shared in
109 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
110 for pkg in $enableval; do
119 ], [enable_shared=yes])
120 AC_SUBST([enable_shared])
125 # These must be passed down, or are needed by gcc/libgcc.mvars
129 # Determine what to build for 'gnatlib'
130 if test ${enable_shared} = yes; then
131 default_gnatlib_target="gnatlib-shared"
133 default_gnatlib_target="gnatlib-plain"
135 AC_SUBST([default_gnatlib_target])
137 # Check for _Unwind_GetIPInfo
138 GCC_CHECK_UNWIND_GETIPINFO
139 if test x$have_unwind_getipinfo = xyes; then
140 have_getipinfo=-DHAVE_GETIPINFO
144 AC_SUBST([have_getipinfo])
146 # Check for <sys/capability.h>
147 AC_CHECK_HEADER([sys/capability.h], have_capability=-DHAVE_CAPABILITY, have_capability=)
148 AC_SUBST([have_capability])
150 # Determine what GCC version number to use in filesystem paths.
153 # Output: create a Makefile.
154 AC_CONFIG_FILES([Makefile])