]> git.ipfire.org Git - thirdparty/gcc.git/blame - libphobos/configure.ac
Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856).
[thirdparty/gcc.git] / libphobos / configure.ac
CommitLineData
b4c522fa
IB
1# Process this file with autoconf to produce a configure script.
2# Copyright (C) 2006-2018 Free Software Foundation, Inc.
3#
4# GCC is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# GCC is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GCC; see the file COPYING3. If not see
16# <http://www.gnu.org/licenses/>.
17
18# This requires that you have your environment set-up to use explicit
19# versions of automake and autoconf.
20#
21# export ACLOCAL=/usr/bin/aclocal-1.11
22# export AUTOMAKE=/usr/bin/automake-1.11
23# export AUTOM4TE=/usr/bin/autom4te2.64
24# export AUTOCONF=/usr/bin/autoconf2.64
25#
26# autoreconf2.64
27#
28
b4c522fa
IB
29AC_INIT(package-unused, version-unused,, libphobos)
30AC_CONFIG_SRCDIR(libdruntime/gcc/attribute.d)
31AC_CONFIG_HEADERS(config.h)
32
33AM_ENABLE_MULTILIB(, ..)
34AC_CANONICAL_SYSTEM
35
36target_alias=${target_alias-$target}
37AC_SUBST(target_alias)
38
39# 1.11.1: Require that version of automake.
40# foreign: Don't require README, INSTALL, NEWS, etc.
41# no-define: Don't define PACKAGE and VERSION.
42# no-dependencies: Don't generate automatic dependencies.
43# (because it breaks when using bootstrap-lean, since some of the
44# headers are gone at "make install" time).
45# -Wall: Issue all automake warnings.
46# -Wno-portability: Don't warn about constructs supported by GNU make.
47# (because GCC requires GNU make anyhow).
22e05272
JM
48# -Wno-override: Overrides used in testsuite.
49AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define no-dependencies -Wall -Wno-portability -Wno-override])
b4c522fa
IB
50
51m4_rename([_AC_ARG_VAR_PRECIOUS],[glibd_PRECIOUS])
52m4_define([_AC_ARG_VAR_PRECIOUS],[])
53AM_PROG_AS
54AC_PROG_CC
55AC_PROG_GDC
56WITH_LOCAL_DRUNTIME([GDC_CHECK_COMPILE], [])
57
58m4_rename_force([glibd_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
59
60AC_SUBST(CFLAGS)
61AM_MAINTAINER_MODE
62AC_PROG_RANLIB
63AC_PROG_INSTALL
64AC_PROG_MAKE_SET
65
66# This should be inherited in the recursive make, but ensure it is defined.
67test "$AR" || AR=ar
68AC_SUBST(AR)
69
70CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}
71AC_SUBST(CC_FOR_BUILD)
72AC_SUBST(CFLAGS_FOR_BUILD)
73
74# Enable libtool
75LT_INIT(dlopen)
76AM_PROG_LIBTOOL
77WITH_LOCAL_DRUNTIME([LT_LANG([D])], [])
78AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
79AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
80
81# libtool variables for Phobos shared and position-independent compiles.
82#
83# Use phobos_compiler_shared_flag to designate the compile-time flags for
84# creating shared objects. Default: -fversion=Shared.
85#
86# Use phobos_compiler_pic_flag to designate the compile-time flags for
87# creating position-independent objects. This varies with the target
88# hardware and operating system, but is often: -fPIC.
89#
90# The distinction between pic and shared compilation flags is not present in
91# libtool, and so we make it here. How it is handled is that in shared
92# compilations the `lt_prog_compiler_pic_D' variable is used to instead
93# ensure that conditional compilation of shared runtime code is compiled in.
94# The original PIC flags are then used in the compilation of every object.
95#
96# Why are objects destined for libgphobos.a compiled with -fPIC?
97# Because -fPIC is not harmful to use for objects destined for static
98# libraries. In addition, using -fPIC will allow the use of static
99# libgphobos.a in the creation of other D shared libraries.
100if test "$enable_shared" = yes; then
101 phobos_compiler_pic_flag="$lt_prog_compiler_pic_D"
102 phobos_compiler_shared_flag="-fversion=Shared"
103else
104 phobos_compiler_pic_flag=
105 phobos_compiler_shared_flag=
106fi
107AC_SUBST(phobos_compiler_pic_flag)
108AC_SUBST(phobos_compiler_shared_flag)
109
110# Override the libtool's pic_flag and pic_mode.
111# Do this step after AM_PROG_LIBTOOL, but before AC_OUTPUT.
112# NB: this impacts --with-pic and --without-pic.
113lt_prog_compiler_pic_D="$phobos_compiler_shared_flag"
114pic_mode='default'
115
116# Determine what GCC version number to use in filesystem paths.
117GCC_BASE_VER
118
119# libphobos/libdruntime specific options and feature detection
120DRUNTIME_CONFIGURE
121DRUNTIME_MULTILIB
122DRUNTIME_WERROR
123DRUNTIME_GC
124DRUNTIME_OS_UNIX
125DRUNTIME_OS_SOURCES
126DRUNTIME_OS_THREAD_MODEL
127DRUNTIME_OS_ARM_EABI_UNWINDER
128DRUNTIME_OS_MINFO_BRACKETING
129
130WITH_LOCAL_DRUNTIME([
131 AC_LANG_PUSH([D])
132 AC_SEARCH_LIBS([malloc], [c])
133 DRUNTIME_LIBRARIES_THREAD
134 AC_SEARCH_LIBS([cosf], [m])
135 AC_SEARCH_LIBS([clock_gettime], [rt])
136 DRUNTIME_ENABLE_ATOMIC_BUILTINS
137 AC_LANG_POP([D])
138], [-nophoboslib])
139
140DRUNTIME_LIBRARIES_ATOMIC
141DRUNTIME_LIBRARIES_BACKTRACE
142DRUNTIME_LIBRARIES_DLOPEN
143DRUNTIME_LIBRARIES_ZLIB
144DRUNTIME_INSTALL_DIRECTORIES
145
146# Add dependencies for libgphobos.spec file
147SPEC_PHOBOS_DEPS="$LIBS"
148AC_SUBST(SPEC_PHOBOS_DEPS)
149
150# Libdruntime / phobos soname version
151DRUNTIME_SOVERSION="76:2:0"
152PHOBOS_SOVERSION="76:2:0"
153AC_SUBST([DRUNTIME_SOVERSION])
154AC_SUBST([PHOBOS_SOVERSION])
155
156# Set default flags (after DRUNTIME_WERROR!)
157if test -z "$GDCFLAGS"; then
158 GDCFLAGS="-Wall $WERROR_FLAG -g -frelease -O2"
159fi
160AC_SUBST(GDCFLAGS)
161
162if test -z "$GDCFLAGSX"; then
163 GDCFLAGSX="-Wall $WERROR_FLAG -g -fno-release -funittest"
164fi
165AC_SUBST(GDCFLAGSX)
166
167# Sanity check for the cross-compilation case:
168AC_CHECK_HEADER(stdio.h,:,
169 [AC_MSG_ERROR([cannot find stdio.h.])])
170
171AC_CONFIG_FILES(Makefile src/Makefile libdruntime/Makefile testsuite/Makefile)
172
173AC_CONFIG_FILES(libdruntime/gcc/config.d libdruntime/gcc/libbacktrace.d)
174AC_CONFIG_FILES(src/libgphobos.spec)
175AC_CONFIG_FILES([testsuite/testsuite_flags],[chmod +x testsuite/testsuite_flags])
176
177# We need multilib support, but only if configuring for the target.
178AC_CONFIG_COMMANDS([default],
179[if test -n "$CONFIG_FILES"; then
180 if test -n "${with_target_subdir}"; then
181 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
182 # that multilib installs will end up installed in the correct place.
183 # The testsuite needs it for multilib-aware ABI baseline files.
184 # To work around this not being passed down from config-ml.in ->
185 # srcdir/Makefile.am -> srcdir/{src,libdruntime,...}/Makefile.am, manually
186 # append it here. Only modify Makefiles that have just been created.
187 #
188 # Also, get rid of this simulated-VPATH thing that automake does.
189 cat > vpsed << \_EOF
190 s!`test -f '$<' || echo '$(srcdir)/'`!!
191_EOF
192 for i in $SUBDIRS; do
193 case $CONFIG_FILES in
194 *${i}/Makefile*)
195 #echo "Adding MULTISUBDIR to $i/Makefile"
196 sed -f vpsed $i/Makefile > tmp
197 grep '^MULTISUBDIR =' Makefile >> tmp
198 mv tmp $i/Makefile
199 ;;
200 esac
201 done
202 rm vpsed
203 fi
204 fi
205],
206[
207# Variables needed in config.status (file generation) which aren't already
208# passed by autoconf.
209SUBDIRS="$SUBDIRS"
210])
211
212AC_OUTPUT