]>
Commit | Line | Data |
---|---|---|
8e31204b | 1 | # Configure script for libada. |
fbd26352 | 2 | # Copyright (C) 2003-2019 Free Software Foundation, Inc. |
8e31204b | 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 | |
6bc9506f | 6 | # the Free Software Foundation; either version 3 of the License, or |
8e31204b | 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 | |
6bc9506f | 15 | # along with this program; see the file COPYING3. If not see |
16 | # <http://www.gnu.org/licenses/>. | |
8e31204b | 17 | |
5b2c7553 | 18 | sinclude(../config/acx.m4) |
cc67441d | 19 | sinclude(../config/multi.m4) |
5b2c7553 | 20 | sinclude(../config/override.m4) |
d89b8910 | 21 | sinclude(../config/picflag.m4) |
53c7fb87 | 22 | sinclude(../config/unwind_ipinfo.m4) |
5b2c7553 | 23 | |
0050aaf6 | 24 | AC_INIT |
8e31204b | 25 | |
1f83ab49 | 26 | AC_CONFIG_SRCDIR([Makefile.in]) |
27 | ||
f0903548 | 28 | # Determine the host, build, and target systems |
29 | AC_CANONICAL_BUILD | |
30 | AC_CANONICAL_HOST | |
31 | AC_CANONICAL_TARGET | |
cc67441d | 32 | target_alias=${target_alias-$host_alias} |
f0903548 | 33 | |
34 | # Determine the noncanonical target name, for directory use. | |
35 | ACX_NONCANONICAL_TARGET | |
36 | ||
37 | # Determine the target- and build-specific subdirectories | |
38 | GCC_TOPLEV_SUBDIRS | |
39 | ||
1f83ab49 | 40 | # Command-line options. |
8e31204b | 41 | # Very limited version of AC_MAINTAINER_MODE. |
1f83ab49 | 42 | AC_ARG_ENABLE([maintainer-mode], |
43 | [AC_HELP_STRING([--enable-maintainer-mode], | |
8e31204b | 44 | [enable make rules and dependencies not useful (and |
1f83ab49 | 45 | sometimes confusing) to the casual installer])], |
8e31204b | 46 | [case ${enable_maintainer_mode} in |
47 | yes) MAINT='' ;; | |
48 | no) MAINT='#' ;; | |
49 | *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;; | |
50 | esac | |
51 | maintainer_mode=${enableval}], | |
52 | [MAINT='#']) | |
53 | AC_SUBST([MAINT])dnl | |
54 | ||
3356431d | 55 | AM_ENABLE_MULTILIB(, ..) |
56 | # Calculate toolexeclibdir | |
57 | # Also toolexecdir, though it's only used in toolexeclibdir | |
58 | case ${enable_version_specific_runtime_libs} in | |
59 | yes) | |
60 | # Need the gcc compiler version to know where to install libraries | |
61 | # and header files if --enable-version-specific-runtime-libs option | |
62 | # is selected. | |
63 | toolexecdir='$(libdir)/gcc/$(target_alias)' | |
64 | toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' | |
65 | ;; | |
66 | no) | |
67 | if test -n "$with_cross_host" && | |
68 | test x"$with_cross_host" != x"no"; then | |
69 | # Install a library built with a cross compiler in tooldir, not libdir. | |
70 | toolexecdir='$(exec_prefix)/$(target_alias)' | |
71 | toolexeclibdir='$(toolexecdir)/lib' | |
72 | else | |
73 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' | |
74 | toolexeclibdir='$(libdir)' | |
75 | fi | |
76 | multi_os_directory=`$CC -print-multi-os-directory` | |
77 | case $multi_os_directory in | |
78 | .) ;; # Avoid trailing /. | |
79 | *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; | |
80 | esac | |
81 | ;; | |
82 | esac | |
83 | AC_SUBST(toolexecdir) | |
84 | AC_SUBST(toolexeclibdir) | |
85 | #TODO: toolexeclibdir is currently disregarded | |
86 | ||
87 | # Check the compiler. | |
88 | # The same as in boehm-gc and libstdc++. Have to borrow it from there. | |
89 | # We must force CC to /not/ be precious variables; otherwise | |
90 | # the wrong, non-multilib-adjusted value will be used in multilibs. | |
91 | # As a side effect, we have to subst CFLAGS ourselves. | |
92 | ||
93 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) | |
94 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
95 | AC_PROG_CC | |
9abe4a66 | 96 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
3356431d | 97 | |
98 | AC_SUBST(CFLAGS) | |
99 | ||
1f83ab49 | 100 | AC_ARG_ENABLE([shared], |
101 | [AC_HELP_STRING([--disable-shared], | |
102 | [don't provide a shared libgnat])], | |
103 | [ | |
104 | case $enable_shared in | |
8e31204b | 105 | yes | no) ;; |
106 | *) | |
107 | enable_shared=no | |
108 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
109 | for pkg in $enableval; do | |
1f83ab49 | 110 | case $pkg in |
111 | ada | libada) | |
112 | enable_shared=yes ;; | |
113 | esac | |
8e31204b | 114 | done |
115 | IFS="$ac_save_ifs" | |
116 | ;; | |
1f83ab49 | 117 | esac |
8e31204b | 118 | ], [enable_shared=yes]) |
1f83ab49 | 119 | AC_SUBST([enable_shared]) |
120 | ||
d89b8910 | 121 | GCC_PICFLAG |
122 | AC_SUBST([PICFLAG]) | |
123 | ||
8732b645 | 124 | # These must be passed down, or are needed by gcc/libgcc.mvars |
125 | AC_PROG_AWK | |
1f83ab49 | 126 | AC_PROG_LN_S |
127 | ||
1f83ab49 | 128 | # Determine what to build for 'gnatlib' |
8c3a6139 | 129 | if test ${enable_shared} = yes; then |
1f83ab49 | 130 | default_gnatlib_target="gnatlib-shared" |
131 | else | |
40caaded | 132 | default_gnatlib_target="gnatlib" |
1f83ab49 | 133 | fi |
134 | AC_SUBST([default_gnatlib_target]) | |
6cd7b009 | 135 | |
53c7fb87 | 136 | # Check for _Unwind_GetIPInfo |
137 | GCC_CHECK_UNWIND_GETIPINFO | |
53c7fb87 | 138 | if test x$have_unwind_getipinfo = xyes; then |
139 | have_getipinfo=-DHAVE_GETIPINFO | |
8c3a6139 | 140 | else |
141 | have_getipinfo= | |
53c7fb87 | 142 | fi |
8c3a6139 | 143 | AC_SUBST([have_getipinfo]) |
53c7fb87 | 144 | |
7b0e33c3 | 145 | # Check for <sys/capability.h> |
146 | AC_CHECK_HEADER([sys/capability.h], have_capability=-DHAVE_CAPABILITY, have_capability=) | |
8c3a6139 | 147 | AC_SUBST([have_capability]) |
7b0e33c3 | 148 | |
0812bb06 | 149 | # Determine what GCC version number to use in filesystem paths. |
150 | GCC_BASE_VER | |
151 | ||
1f83ab49 | 152 | # Output: create a Makefile. |
153 | AC_CONFIG_FILES([Makefile]) | |
8e31204b | 154 | |
155 | AC_OUTPUT |