1 |
729 |
jeremybenn |
# Configure script for libada.
|
2 |
|
|
# Copyright 2003, 2004, 2009, 2011 Free Software Foundation, Inc.
|
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
|
6 |
|
|
# the Free Software Foundation; either version 3 of the License, or
|
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
|
15 |
|
|
# along with this program; see the file COPYING3. If not see
|
16 |
|
|
# .
|
17 |
|
|
|
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)
|
23 |
|
|
|
24 |
|
|
AC_INIT
|
25 |
|
|
AC_PREREQ([2.64])
|
26 |
|
|
|
27 |
|
|
AC_CONFIG_SRCDIR([Makefile.in])
|
28 |
|
|
|
29 |
|
|
# Determine the host, build, and target systems
|
30 |
|
|
AC_CANONICAL_BUILD
|
31 |
|
|
AC_CANONICAL_HOST
|
32 |
|
|
AC_CANONICAL_TARGET
|
33 |
|
|
target_alias=${target_alias-$host_alias}
|
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 |
|
|
|
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
|
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 |
|
|
|
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
|
97 |
|
|
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
98 |
|
|
|
99 |
|
|
AC_SUBST(CFLAGS)
|
100 |
|
|
|
101 |
|
|
AC_ARG_ENABLE([shared],
|
102 |
|
|
[AC_HELP_STRING([--disable-shared],
|
103 |
|
|
[don't provide a shared libgnat])],
|
104 |
|
|
[
|
105 |
|
|
case $enable_shared in
|
106 |
|
|
yes | no) ;;
|
107 |
|
|
*)
|
108 |
|
|
enable_shared=no
|
109 |
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
110 |
|
|
for pkg in $enableval; do
|
111 |
|
|
case $pkg in
|
112 |
|
|
ada | libada)
|
113 |
|
|
enable_shared=yes ;;
|
114 |
|
|
esac
|
115 |
|
|
done
|
116 |
|
|
IFS="$ac_save_ifs"
|
117 |
|
|
;;
|
118 |
|
|
esac
|
119 |
|
|
], [enable_shared=yes])
|
120 |
|
|
AC_SUBST([enable_shared])
|
121 |
|
|
|
122 |
|
|
GCC_PICFLAG
|
123 |
|
|
AC_SUBST([PICFLAG])
|
124 |
|
|
|
125 |
|
|
# These must be passed down, or are needed by gcc/libgcc.mvars
|
126 |
|
|
AC_PROG_AWK
|
127 |
|
|
AC_PROG_LN_S
|
128 |
|
|
|
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
|
135 |
|
|
default_gnatlib_target="gnatlib-plain"
|
136 |
|
|
fi
|
137 |
|
|
AC_SUBST([default_gnatlib_target])
|
138 |
|
|
|
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 |
|
|
|
147 |
|
|
# Output: create a Makefile.
|
148 |
|
|
AC_CONFIG_FILES([Makefile])
|
149 |
|
|
|
150 |
|
|
AC_OUTPUT
|