1 # Configure script for libada.
2 # Copyright (C) 2003-2022 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/toolexeclibdir.m4)
23 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.
43 AC_ARG_ENABLE(version-specific-runtime-libs,
44 [AS_HELP_STRING([--enable-version-specific-runtime-libs],
45 [specify that runtime libraries should be
46 installed in a compiler-specific directory])],
51 AC_MSG_ERROR([--enable-version-specific-runtime-libs must be yes or no])
54 [enable_version_specific_runtime_libs=yes]
57 # Very limited version of AC_MAINTAINER_MODE.
58 AC_ARG_ENABLE([maintainer-mode],
59 [AC_HELP_STRING([--enable-maintainer-mode],
60 [enable make rules and dependencies not useful (and
61 sometimes confusing) to the casual installer])],
62 [case ${enable_maintainer_mode} in
65 *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
67 maintainer_mode=${enableval}],
71 GCC_WITH_TOOLEXECLIBDIR
73 AM_ENABLE_MULTILIB(, ..)
74 # Calculate toolexeclibdir
75 # Also toolexecdir, though it's only used in toolexeclibdir
76 case ${enable_version_specific_runtime_libs} in
78 # Need the gcc compiler version to know where to install libraries
79 # and header files if --enable-version-specific-runtime-libs option
81 toolexecdir='$(libdir)/gcc/$(target_noncanonical)'
82 toolexeclibdir='$(toolexecdir)/$(version)$(MULTISUBDIR)/adalib'
85 if test -n "$with_cross_host" &&
86 test x"$with_cross_host" != x"no"; then
87 # Install a library built with a cross compiler in tooldir, not libdir.
88 toolexecdir='$(exec_prefix)/$(target_alias)'
89 case ${with_toolexeclibdir} in
91 toolexeclibdir='$(toolexecdir)/lib'
94 toolexeclibdir=${with_toolexeclibdir}
98 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
99 toolexeclibdir='$(libdir)'
101 multi_os_directory=`$CC -print-multi-os-directory`
102 case $multi_os_directory in
103 .) ;; # Avoid trailing /.
104 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
108 AC_SUBST(toolexecdir)
109 AC_SUBST(toolexeclibdir)
111 # Check the compiler.
112 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
113 # We must force CC to /not/ be precious variables; otherwise
114 # the wrong, non-multilib-adjusted value will be used in multilibs.
115 # As a side effect, we have to subst CFLAGS ourselves.
117 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
118 m4_define([_AC_ARG_VAR_PRECIOUS],[])
120 m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
124 AC_ARG_ENABLE([shared],
125 [AC_HELP_STRING([--disable-shared],
126 [don't provide a shared libgnat])],
128 case $enable_shared in
132 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
133 for pkg in $enableval; do
142 ], [enable_shared=yes])
143 AC_SUBST([enable_shared])
148 # These must be passed down, or are needed by gcc/libgcc.mvars
152 # Determine what to build for 'gnatlib'
153 if test ${enable_shared} = yes; then
154 default_gnatlib_target="gnatlib-shared"
156 default_gnatlib_target="gnatlib"
158 AC_SUBST([default_gnatlib_target])
160 # Check for _Unwind_GetIPInfo
161 GCC_CHECK_UNWIND_GETIPINFO
162 if test x$have_unwind_getipinfo = xyes; then
163 have_getipinfo=-DHAVE_GETIPINFO
167 AC_SUBST([have_getipinfo])
169 # Check for <sys/capability.h>
170 AC_CHECK_HEADER([sys/capability.h], have_capability=-DHAVE_CAPABILITY, have_capability=)
171 AC_SUBST([have_capability])
173 # Determine what GCC version number to use in filesystem paths.
176 # Output: create a Makefile.
177 AC_CONFIG_FILES([Makefile])