]>
Commit | Line | Data |
---|---|---|
03385ed3 | 1 | # Process this file with autoconf to produce a configure script. |
fbd26352 | 2 | # Copyright (C) 2006-2019 Free Software Foundation, Inc. |
03385ed3 | 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 | # | |
1f580a79 | 21 | # export ACLOCAL=/usr/bin/aclocal-1.15 |
22 | # export AUTOMAKE=/usr/bin/automake-1.15 | |
23 | # export AUTOM4TE=/usr/bin/autom4te2.69 | |
24 | # export AUTOCONF=/usr/bin/autoconf2.69 | |
03385ed3 | 25 | # |
1f580a79 | 26 | # autoreconf2.69 |
03385ed3 | 27 | # |
28 | ||
03385ed3 | 29 | AC_INIT(package-unused, version-unused,, libphobos) |
30 | AC_CONFIG_SRCDIR(libdruntime/gcc/attribute.d) | |
31 | AC_CONFIG_HEADERS(config.h) | |
32 | ||
33 | AM_ENABLE_MULTILIB(, ..) | |
34 | AC_CANONICAL_SYSTEM | |
79c21307 | 35 | AC_USE_SYSTEM_EXTENSIONS |
03385ed3 | 36 | |
37 | target_alias=${target_alias-$target} | |
38 | AC_SUBST(target_alias) | |
39 | ||
40 | # 1.11.1: Require that version of automake. | |
41 | # foreign: Don't require README, INSTALL, NEWS, etc. | |
42 | # no-define: Don't define PACKAGE and VERSION. | |
43 | # no-dependencies: Don't generate automatic dependencies. | |
44 | # (because it breaks when using bootstrap-lean, since some of the | |
45 | # headers are gone at "make install" time). | |
a88a8aee | 46 | # subdir-objects: Build objects in sub-directories. |
03385ed3 | 47 | # -Wall: Issue all automake warnings. |
48 | # -Wno-portability: Don't warn about constructs supported by GNU make. | |
49 | # (because GCC requires GNU make anyhow). | |
f00f02a3 | 50 | # -Wno-override: Overrides used in testsuite. |
a88a8aee | 51 | AM_INIT_AUTOMAKE([1.11.1 foreign no-dist no-define no-dependencies subdir-objects -Wall -Wno-portability -Wno-override]) |
03385ed3 | 52 | |
53 | m4_rename([_AC_ARG_VAR_PRECIOUS],[glibd_PRECIOUS]) | |
54 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) | |
55 | AM_PROG_AS | |
56 | AC_PROG_CC | |
57 | AC_PROG_GDC | |
58 | WITH_LOCAL_DRUNTIME([GDC_CHECK_COMPILE], []) | |
59 | ||
60 | m4_rename_force([glibd_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) | |
61 | ||
62 | AC_SUBST(CFLAGS) | |
63 | AM_MAINTAINER_MODE | |
64 | AC_PROG_RANLIB | |
65 | AC_PROG_INSTALL | |
66 | AC_PROG_MAKE_SET | |
67 | ||
68 | # This should be inherited in the recursive make, but ensure it is defined. | |
69 | test "$AR" || AR=ar | |
70 | AC_SUBST(AR) | |
71 | ||
72 | CC_FOR_BUILD=${CC_FOR_BUILD:-gcc} | |
73 | AC_SUBST(CC_FOR_BUILD) | |
74 | AC_SUBST(CFLAGS_FOR_BUILD) | |
75 | ||
76 | # Enable libtool | |
77 | LT_INIT(dlopen) | |
78 | AM_PROG_LIBTOOL | |
79 | WITH_LOCAL_DRUNTIME([LT_LANG([D])], []) | |
03385ed3 | 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. | |
100 | if test "$enable_shared" = yes; then | |
101 | phobos_compiler_pic_flag="$lt_prog_compiler_pic_D" | |
102 | phobos_compiler_shared_flag="-fversion=Shared" | |
103 | else | |
104 | phobos_compiler_pic_flag= | |
105 | phobos_compiler_shared_flag= | |
106 | fi | |
107 | AC_SUBST(phobos_compiler_pic_flag) | |
108 | AC_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. | |
113 | lt_prog_compiler_pic_D="$phobos_compiler_shared_flag" | |
114 | pic_mode='default' | |
115 | ||
94555b5c | 116 | # Determine what GCC version number to use in filesystem paths. |
117 | GCC_BASE_VER | |
118 | ||
119 | # libphobos/libdruntime specific options and feature detection | |
120 | DRUNTIME_CONFIGURE | |
121 | DRUNTIME_MULTILIB | |
122 | DRUNTIME_WERROR | |
123 | DRUNTIME_GC | |
124 | DRUNTIME_CPU_SOURCES | |
125 | DRUNTIME_OS_UNIX | |
126 | DRUNTIME_OS_SOURCES | |
127 | DRUNTIME_OS_THREAD_MODEL | |
128 | DRUNTIME_OS_ARM_EABI_UNWINDER | |
129 | DRUNTIME_OS_MINFO_BRACKETING | |
130 | DRUNTIME_OS_DLPI_TLS_MODID | |
131 | DRUNTIME_OS_LINK_SPEC | |
132 | DRUNTIME_LIBRARIES_CLIB | |
133 | ||
134 | WITH_LOCAL_DRUNTIME([ | |
135 | AC_LANG_PUSH([D]) | |
136 | AC_SEARCH_LIBS([malloc], [c]) | |
137 | DRUNTIME_LIBRARIES_THREAD | |
138 | AC_SEARCH_LIBS([cosf], [m]) | |
139 | AC_SEARCH_LIBS([clock_gettime], [rt]) | |
140 | DRUNTIME_ENABLE_ATOMIC_BUILTINS | |
141 | AC_LANG_POP([D]) | |
142 | ], [-nophoboslib]) | |
143 | ||
144 | DRUNTIME_LIBRARIES_ATOMIC | |
145 | DRUNTIME_LIBRARIES_BACKTRACE | |
146 | DRUNTIME_LIBRARIES_DLOPEN | |
147 | DRUNTIME_LIBRARIES_NET | |
148 | DRUNTIME_LIBRARIES_ZLIB | |
149 | DRUNTIME_INSTALL_DIRECTORIES | |
150 | ||
20abc61c | 151 | AC_MSG_CHECKING([for --enable-libphobos]) |
152 | AC_ARG_ENABLE(libphobos, | |
153 | [AS_HELP_STRING([--enable-libphobos], [Enable libphobos])]) | |
154 | AC_MSG_RESULT($enable_libphobos) | |
155 | ||
156 | # See if supported. | |
157 | unset LIBPHOBOS_SUPPORTED | |
158 | AC_MSG_CHECKING([for host support for libphobos]) | |
159 | . ${srcdir}/configure.tgt | |
160 | case ${host} in | |
161 | x86_64-*-solaris2.* | i?86-*-solaris2.*) | |
162 | # libphobos doesn't compile with the Solaris/x86 assembler due to a | |
163 | # relatively low linelength limit. | |
164 | as_prog=`$CC -print-prog-name=as` | |
165 | if test -n "$as_prog" && $as_prog -v /dev/null 2>&1 | grep GNU > /dev/null 2>&1; then | |
166 | druntime_cv_use_gas=yes; | |
167 | else | |
168 | druntime_cv_use_gas=no; | |
169 | fi | |
170 | rm -f a.out | |
171 | if test x$druntime_cv_use_gas = xno; then | |
172 | LIBPHOBOS_SUPPORTED=no | |
173 | fi | |
94555b5c | 174 | # 64-bit D execution fails with Solaris ld without -z relax=transtls support. |
175 | if test "$druntime_ld_gld" = "no" && test "$druntime_ld_relax_transtls" = "no"; then | |
176 | LIBPHOBOS_SUPPORTED=no | |
177 | fi | |
20abc61c | 178 | ;; |
179 | esac | |
180 | AC_MSG_RESULT($LIBPHOBOS_SUPPORTED) | |
181 | ||
182 | # Decide if it's usable. | |
183 | case $LIBPHOBOS_SUPPORTED:$enable_libphobos in | |
184 | *:no) use_libphobos=no ;; | |
185 | *:yes) use_libphobos=yes ;; | |
186 | yes:*) use_libphobos=yes ;; | |
187 | *:*) use_libphobos=no ;; | |
188 | esac | |
189 | AM_CONDITIONAL(ENABLE_LIBPHOBOS, test x$use_libphobos = xyes) | |
190 | ||
e06fcd5a | 191 | # Add drtbegin.o/drtend.o to startfile/endfile specs in libgphobos.spec |
192 | if test "$DCFG_MINFO_BRACKETING" = "false"; then | |
193 | DRTSTUFF_SPEC=$srcdir/src/drtstuff.spec | |
194 | else | |
195 | DRTSTUFF_SPEC=/dev/null | |
196 | fi | |
197 | AC_SUBST_FILE(DRTSTUFF_SPEC) | |
198 | ||
03385ed3 | 199 | # Add dependencies for libgphobos.spec file |
200 | SPEC_PHOBOS_DEPS="$LIBS" | |
201 | AC_SUBST(SPEC_PHOBOS_DEPS) | |
202 | ||
203 | # Libdruntime / phobos soname version | |
345422ff | 204 | libtool_VERSION=76:3:0 |
205 | AC_SUBST(libtool_VERSION) | |
03385ed3 | 206 | |
207 | # Set default flags (after DRUNTIME_WERROR!) | |
208 | if test -z "$GDCFLAGS"; then | |
209 | GDCFLAGS="-Wall $WERROR_FLAG -g -frelease -O2" | |
210 | fi | |
211 | AC_SUBST(GDCFLAGS) | |
212 | ||
213 | if test -z "$GDCFLAGSX"; then | |
214 | GDCFLAGSX="-Wall $WERROR_FLAG -g -fno-release -funittest" | |
215 | fi | |
216 | AC_SUBST(GDCFLAGSX) | |
217 | ||
218 | # Sanity check for the cross-compilation case: | |
219 | AC_CHECK_HEADER(stdio.h,:, | |
220 | [AC_MSG_ERROR([cannot find stdio.h.])]) | |
221 | ||
5114391d | 222 | AC_CONFIG_FILES(Makefile) |
03385ed3 | 223 | |
224 | AC_CONFIG_FILES(libdruntime/gcc/config.d libdruntime/gcc/libbacktrace.d) | |
225 | AC_CONFIG_FILES(src/libgphobos.spec) | |
226 | AC_CONFIG_FILES([testsuite/testsuite_flags],[chmod +x testsuite/testsuite_flags]) | |
227 | ||
5114391d | 228 | # Multilibs need MULTISUBDIR defined correctly in certain makefiles so |
229 | # that multilib installs will end up installed in the correct place. | |
230 | # The testsuite needs it for multilib-aware ABI baseline files. | |
231 | # To work around this not being passed down from config-ml.in -> | |
232 | # srcdir/Makefile.am -> srcdir/{src,libdruntime,...}/Makefile.am, manually | |
233 | # append it here. Only modify Makefiles that have just been created. | |
234 | # | |
235 | # Also, get rid of this simulated-VPATH thing that automake does. | |
236 | AC_CONFIG_FILES(AC_FOREACH([DIR], [libdruntime src testsuite], [DIR/Makefile ]), | |
237 | [cat > vpsed$$ << \_EOF | |
238 | s!`test -f '$<' || echo '$(srcdir)/'`!! | |
03385ed3 | 239 | _EOF |
5114391d | 240 | sed -f vpsed$$ $ac_file > tmp$$ |
241 | mv tmp$$ $ac_file | |
242 | rm vpsed$$ | |
243 | echo 'MULTISUBDIR =' >> $ac_file | |
244 | ml_norecursion=yes | |
245 | . ${multi_basedir}/config-ml.in | |
246 | AS_UNSET([ml_norecursion]) | |
03385ed3 | 247 | ]) |
248 | ||
249 | AC_OUTPUT |