| 1 |
# Configure script for gnattools |
| 2 |
# Copyright 2003, 2004, 2009, 2012 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 |
# <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
sinclude(../config/acx.m4) |
| 19 |
sinclude(../config/override.m4) |
| 20 |
|
| 21 |
AC_INIT |
| 22 |
|
| 23 |
AC_CONFIG_SRCDIR([Makefile.in]) |
| 24 |
|
| 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 |
| 39 |
|
| 40 |
# Start of actual configure tests |
| 41 |
|
| 42 |
AC_PROG_INSTALL |
| 43 |
|
| 44 |
AC_CANONICAL_BUILD |
| 45 |
AC_CANONICAL_HOST |
| 46 |
AC_CANONICAL_TARGET |
| 47 |
|
| 48 |
ACX_NONCANONICAL_HOST |
| 49 |
ACX_NONCANONICAL_TARGET |
| 50 |
|
| 51 |
# Need to pass this down for now :-P |
| 52 |
AC_PROG_LN_S |
| 53 |
|
| 54 |
# Target-specific stuff (defaults) |
| 55 |
TOOLS_TARGET_PAIRS= |
| 56 |
EXTRA_GNATTOOLS= |
| 57 |
|
| 58 |
# Per-target case statement |
| 59 |
# ------------------------- |
| 60 |
case "${target}" in |
| 61 |
*-*-aix*) |
| 62 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-aix.adb" |
| 63 |
;; |
| 64 |
*-*-darwin*) |
| 65 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-darwin.adb" |
| 66 |
;; |
| 67 |
*-*-dragonfly*) |
| 68 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-gnu.adb" |
| 69 |
;; |
| 70 |
*-*-freebsd*) |
| 71 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-gnu.adb" |
| 72 |
;; |
| 73 |
*-*-linux*) |
| 74 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-gnu.adb" |
| 75 |
;; |
| 76 |
*-*-vxworks*) |
| 77 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-gnu.adb" |
| 78 |
;; |
| 79 |
*-*-cygwin32* | *-*-mingw32* | *-*-pe) |
| 80 |
TOOLS_TARGET_PAIRS="indepsw.adb<indepsw-gnu.adb" |
| 81 |
EXTRA_GNATTOOLS='../../gnatdll$(exeext)' |
| 82 |
;; |
| 83 |
esac |
| 84 |
|
| 85 |
AC_SUBST(TOOLS_TARGET_PAIRS) |
| 86 |
AC_SUBST(EXTRA_GNATTOOLS) |
| 87 |
|
| 88 |
# From user or toplevel makefile. |
| 89 |
AC_SUBST(ADA_CFLAGS) |
| 90 |
|
| 91 |
# This is testing the CC passed from the toplevel Makefile, not the |
| 92 |
# one we will select below. |
| 93 |
AC_PROG_CC |
| 94 |
warn_cflags= |
| 95 |
if test "x$GCC" = "xyes"; then |
| 96 |
warn_cflags='$(GCC_WARN_CFLAGS)' |
| 97 |
fi |
| 98 |
AC_SUBST(warn_cflags) |
| 99 |
|
| 100 |
# Enable --enable-host-pie |
| 101 |
AC_ARG_ENABLE(host-pie, |
| 102 |
[AS_HELP_STRING([--enable-host-pie], |
| 103 |
[build host code as PIE])], |
| 104 |
[PICFLAG=-fPIE; LD_PICFLAG=-pie], [PICFLAG=-fno-PIE; LD_PICFLAG=-no-pie]) |
| 105 |
AC_SUBST(PICFLAG) |
| 106 |
|
| 107 |
# Enable --enable-host-bind-now |
| 108 |
AC_ARG_ENABLE(host-bind-now, |
| 109 |
[AS_HELP_STRING([--enable-host-bind-now], |
| 110 |
[link host code as BIND_NOW])], |
| 111 |
[LD_PICFLAG="$LD_PICFLAG -Wl,-z,now"], []) |
| 112 |
AC_SUBST(LD_PICFLAG) |
| 113 |
|
| 114 |
# Determine what to build for 'gnattools'. Test after the above, |
| 115 |
# because testing for CC sets the final value of cross_compiling, even |
| 116 |
# if we end up using a different CC. We want to build |
| 117 |
# gnattools-native when: (a) this is a native build, i.e., |
| 118 |
# cross_compiling=no, otherwise we know we cannot run binaries |
| 119 |
# produced by the toolchain used for the build, not even the binaries |
| 120 |
# created within ../gcc/; (b) build and host are the same, otherwise |
| 121 |
# this is to be regarded as a cross build environment even if it seems |
| 122 |
# that we can run host binaries; (c) host and target are the same, |
| 123 |
# otherwise the tools in ../gcc/ generate code for a different |
| 124 |
# platform. If you change this test, be sure to adjust |
| 125 |
# ../gcc/ada/gcc-interface/config-lang.in as well. |
| 126 |
if test "x$cross_compiling/$build/$host" = "xno/$host/$target" ; then |
| 127 |
default_gnattools_target="gnattools-native" |
| 128 |
else |
| 129 |
default_gnattools_target="gnattools-cross" |
| 130 |
fi |
| 131 |
AC_SUBST([default_gnattools_target]) |
| 132 |
|
| 133 |
# Output: create a Makefile. |
| 134 |
AC_CONFIG_FILES([Makefile]) |
| 135 |
|
| 136 |
AC_OUTPUT |