d: Merge upstream dmd, druntime c8ae4adb2e, phobos 792c8b7c1.
[official-gcc.git] / gnattools / configure.ac
blob5b6f34ed9f48e8a6675c9c9f2ce4b00680808f0f
1 # Configure script for libada.
2 #   Copyright 2003, 2004, 2009, 2012 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/override.m4)
21 AC_INIT
23 AC_CONFIG_SRCDIR([Makefile.in])
25 # Command-line options.
26 # Very limited version of AC_MAINTAINER_MODE.
27 AC_ARG_ENABLE([maintainer-mode],
28   [AC_HELP_STRING([--enable-maintainer-mode],
29                  [enable make rules and dependencies not useful (and
30                   sometimes confusing) to the casual installer])],
31   [case ${enable_maintainer_mode} in
32      yes) MAINT='' ;;
33      no) MAINT='#' ;;
34      *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
35    esac
36    maintainer_mode=${enableval}],
37   [MAINT='#'])
38 AC_SUBST([MAINT])dnl
40 # Start of actual configure tests
42 AC_PROG_INSTALL
44 AC_CANONICAL_BUILD
45 AC_CANONICAL_HOST
46 AC_CANONICAL_TARGET
48 ACX_NONCANONICAL_HOST
49 ACX_NONCANONICAL_TARGET
51 # Need to pass this down for now :-P
52 AC_PROG_LN_S
54 # Target-specific stuff (defaults)
55 TOOLS_TARGET_PAIRS=
56 AC_SUBST(TOOLS_TARGET_PAIRS)
57 EXTRA_GNATTOOLS=
58 AC_SUBST(EXTRA_GNATTOOLS)
60 # Per-target case statement
61 # -------------------------
62 case "${target}" in
63   *-*-aix*)
64     TOOLS_TARGET_PAIRS="\
65     mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
66     indepsw.adb<indepsw-aix.adb"
67     ;;
68   *-*-darwin*)
69     TOOLS_TARGET_PAIRS="\
70     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb \
71     indepsw.adb<indepsw-darwin.adb"
72     ;;
73   *-*-dragonfly*)
74     TOOLS_TARGET_PAIRS="\
75     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
76     indepsw.adb<indepsw-gnu.adb"
77     ;;
78   *-*-freebsd*)
79     TOOLS_TARGET_PAIRS="\
80     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
81     indepsw.adb<indepsw-gnu.adb"
82     ;;
83   *-*-linux*)
84     TOOLS_TARGET_PAIRS="\
85     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
86     indepsw.adb<indepsw-gnu.adb"
87     ;;
88   *-*-solaris*)
89     TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb"
90     ;;
91   *-*-vxworks*)
92     TOOLS_TARGET_PAIRS="\
93     mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
94     indepsw.adb<indepsw-gnu.adb"
95     ;;
96   hppa*-hp-hpux11*)
97     TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb"
98     ;;
99   ia64-hp-hpux11*)
100     TOOLS_TARGET_PAIRS="mlib-tgt-specific.adb<mlib-tgt-specific-ia64-hpux.adb"
101     ;;
102   alpha*-*-vms* | alpha*-*-openvms*)
103     TOOLS_TARGET_PAIRS="\
104     mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
105     symbols.adb<symbols-vms.adb \
106     symbols-processing.adb<symbols-processing-vms-alpha.adb"
107     EXTRA_GNATTOOLS='../../gnatlbr$(exeext) ../../gnatsym$(exeext)'
108     ;;
109   ia64-*-vms* | ia64-*-openvms*)
110     TOOLS_TARGET_PAIRS="\
111     mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
112     symbols.adb<symbols-vms.adb \
113     symbols-processing.adb<symbols-processing-vms-ia64.adb"
114     EXTRA_GNATTOOLS='../../gnatlbr$(exeext) ../../gnatsym$(exeext)'
115     ;;
116   *-*-cygwin32* | *-*-mingw32* | *-*-pe)
117     TOOLS_TARGET_PAIRS="\
118     mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
119     indepsw.adb<indepsw-mingw.adb"
120     EXTRA_GNATTOOLS='../../gnatdll$(exeext)'
121     ;;
122 esac
124 # From user or toplevel makefile.
125 AC_SUBST(ADA_CFLAGS)
127 # This is testing the CC passed from the toplevel Makefile, not the
128 # one we will select below.
129 AC_PROG_CC
130 warn_cflags=
131 if test "x$GCC" = "xyes"; then
132   warn_cflags='$(GCC_WARN_CFLAGS)'
134 AC_SUBST(warn_cflags)
136 # Determine what to build for 'gnattools'.  Test after the above,
137 # because testing for CC sets the final value of cross_compiling, even
138 # if we end up using a different CC.  We want to build
139 # gnattools-native when: (a) this is a native build, i.e.,
140 # cross_compiling=no, otherwise we know we cannot run binaries
141 # produced by the toolchain used for the build, not even the binaries
142 # created within ../gcc/; (b) build and host are the same, otherwise
143 # this is to be regarded as a cross build environment even if it seems
144 # that we can run host binaries; (c) host and target are the same,
145 # otherwise the tools in ../gcc/ generate code for a different
146 # platform.  If you change this test, be sure to adjust
147 # ../gcc/ada/gcc-interface/config-lang.in as well.
148 if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then
149   default_gnattools_target="gnattools-native"
150 else
151   default_gnattools_target="gnattools-cross"
153 AC_SUBST([default_gnattools_target])
155 # Output: create a Makefile.
156 AC_CONFIG_FILES([Makefile])
158 AC_OUTPUT