Skip to content
Newer
Older
100644 436 lines (382 sloc) 12.8 KB
84adefa The R13B03 release.
Erlang/OTP authored
1 dnl Process this file with autoconf to produce a configure script.
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
2
3 dnl %CopyrightBegin%
4 dnl
ce4431b @psyeugenic Update copyright years
psyeugenic authored
5 dnl Copyright Ericsson AB 1998-2012. All Rights Reserved.
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
6 dnl
7 dnl The contents of this file are subject to the Erlang Public License,
8 dnl Version 1.1, (the "License"); you may not use this file except in
9 dnl compliance with the License. You should have received a copy of the
10 dnl Erlang Public License along with this software. If not, it can be
11 dnl retrieved online at http://www.erlang.org/.
12 dnl
13 dnl Software distributed under the License is distributed on an "AS IS"
14 dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15 dnl the License for the specific language governing rights and limitations
16 dnl under the License.
17 dnl
18 dnl %CopyrightEnd%
19
84adefa The R13B03 release.
Erlang/OTP authored
20 AC_PREREQ(2.8)dnl
21
22 AC_INIT()
23
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
24 LM_PRECIOUS_VARS
25
84adefa The R13B03 release.
Erlang/OTP authored
26 default_cache_file=./config.cache
27
28 if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
29 # The no_recursion variable is not documented, but the only
30 # action we take on it is disabling caching which is safe!
31 if test "x$cache_file" != "x$default_cache_file"; then
32 echo "Ignoring the --cache-file argument since it can cause the system to be erroneously configured"
33 fi
34 echo "Disabling caching"
35 if test -f $cache_file; then
36 echo "Removing cache file $cache_file"
37 rm -f $cache_file
38 fi
39 cache_file=/dev/null
40 fi
41
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
42 case "X$ERL_TOP" in
43 X)
44 ;;
45 X/*)
46 test -f $ERL_TOP/erts/emulator/beam/beam_emu.c || {
47 AC_MSG_ERROR([Invalid \$ERL_TOP])
48 }
49 srcdir="$ERL_TOP";;
50 *)
51 AC_MSG_ERROR([\$ERL_TOP needs to be absolute]);;
52 esac
53
84adefa The R13B03 release.
Erlang/OTP authored
54 dnl How to set srcdir absolute is taken from the GNU Emacs distribution
55 #### Make srcdir absolute, if it isn't already. It's important to
56 #### avoid running the path through pwd unnecessary, since pwd can
57 #### give you automounter prefixes, which can go away.
58 case "${srcdir}" in
59 /* ) ;;
60 . )
61 ## We may be able to use the $PWD environment variable to make this
62 ## absolute. But sometimes PWD is inaccurate.
63 ## Make sure CDPATH doesn't affect cd (in case PWD is relative).
64 CDPATH=
65 if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
66 then
67 srcdir="$PWD"
68 else
69 srcdir="`(cd ${srcdir}; pwd)`"
70 fi
71 ;;
72 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
73 esac
74
75 #
76 # Now srcdir is absolute and also the top of Erlang distribution, ERL_TOP.
77 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
78 test "X$ERL_TOP" != "X" || ERL_TOP="$srcdir"
84adefa The R13B03 release.
Erlang/OTP authored
79 AC_SUBST(ERL_TOP)
80
81 dnl
82 dnl Aux programs are found in erts/autoconf
83 dnl
84 AC_CONFIG_AUX_DIR(${srcdir}/erts/autoconf)
85
86 dnl
87 dnl Figure out what we are running on. And in violation of autoconf
88 dnl style assume that $host is also what we are building for. I would
89 dnl like to get cross compiling working, since we actually have
90 dnl systems we cross compile for!
91 dnl
92
93 if test "X$host" != "Xfree_source" -a "X$host" != "Xwin32"; then
94 AC_CANONICAL_HOST
95 fi
96
97 TARGET=$host
98 AC_SUBST(TARGET)
99
af62952 @rickard-green Fix SSL build failure when building in minimal source tree
rickard-green authored
100 if test "$cross_compiling" = "yes"; then
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
101 CROSS_COMPILING=yes
102 else
103 CROSS_COMPILING=no
104 fi
105 AC_SUBST(CROSS_COMPILING)
106
107
108 AC_ARG_ENABLE(bootstrap-only,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
109 AS_HELP_STRING([--enable-bootstrap-only],
110 [enable bootstrap only configuration]),
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
111 [ if test "X$enableval" = "Xyes"; then
112 BOOTSTRAP_ONLY=yes
113 else
114 BOOTSTRAP_ONLY=no
115 fi
116 ],
117 BOOTSTRAP_ONLY=no)
118
119 AC_SUBST(BOOTSTRAP_ONLY)
120
121 if test $CROSS_COMPILING = yes -a $BOOTSTRAP_ONLY = yes; then
122 AC_MSG_ERROR([Cannot both cross compile and build a bootstrap system])
123 fi
84adefa The R13B03 release.
Erlang/OTP authored
124
125 dnl Checks for programs.
126
127 AC_PROG_CC
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
128 AC_PROG_CXX
129 AC_CHECK_TOOL(LD, [ld])
84adefa The R13B03 release.
Erlang/OTP authored
130
131 #
132 # We need GNU make, complain if we can't find it
133 #
134 AC_MSG_CHECKING(for GNU make)
135 # If there is a Makefile created we don't want make to start making, run
136 # in a subdirectory and -f /dev/null
137 MAKE_PROG=x
138 if test X"$CLEARCASE_MAKE_COMPAT" = X"gnu" -a X"$CLEARCASE_ROOT" != X"" ; then
139 eval clearmake -version 2>&1 | grep clearmake > /dev/null 2>&1
140 case $? in
141 0) MAKE_PROG="clearmake -V";;
142 *);;
143 esac
144 fi
145 if test X"$MAKE_PROG" = X"x"; then
146 mkdir conftestmake
147 if test -d conftestmake; then
148 cd conftestmake
149 for m in make gmake ggmake; do
150 eval $m --version -f /dev/null 2>&1 | grep GNU > /dev/null 2>&1
151 case $? in
152 0) MAKE_PROG=$m ; break ;;
153 *) ;;
154 esac
155 done
156 cd ..
157 else
158 AC_MSG_ERROR(could not create subdirectory)
159 fi
160 fi
161 rm -rf conftestmake
162 case $MAKE_PROG in
163 x) AC_MSG_RESULT(no)
164 AC_MSG_ERROR(GNU make is required!)
165 ;;
166 *) AC_MSG_RESULT(yes ($MAKE_PROG))
167 AC_SUBST(MAKE_PROG)
168 ;;
169 esac
170
171 AC_PROG_INSTALL
172 if test X"${INSTALL}" = "X${ac_aux_dir}/install-sh -c" && test -f /usr/ucb/install ; then
173 case $host_os in
174 osf*) ;;
175 *) INSTALL="/usr/ucb/install -c" ;;
176 esac
177 fi
178
179 AC_PROG_LN_S
180 AC_PROG_RANLIB
181
182 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
183 # Get erts version and otp release from erts/vsn.mk
84adefa The R13B03 release.
Erlang/OTP authored
184 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
185 AC_MSG_CHECKING([ERTS version])
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
186 [ERTS_VSN=`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
187 AC_MSG_RESULT([$ERTS_VSN])
188 AC_SUBST(ERTS_VSN)
84adefa The R13B03 release.
Erlang/OTP authored
189
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
190 AC_MSG_CHECKING([OTP release])
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
191 [OTP_REL=`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
192 AC_MSG_RESULT([$OTP_REL])
193 AC_SUBST(OTP_REL)
84adefa The R13B03 release.
Erlang/OTP authored
194
195 AC_ARG_ENABLE(threads,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
196 AS_HELP_STRING([--enable-threads], [enable async thread support])
197 AS_HELP_STRING([--disable-threads], [disable async thread support]))
84adefa The R13B03 release.
Erlang/OTP authored
198
fb94cd9 @bufflig Store pointers to heap data in 32-bit words
bufflig authored
199 AC_ARG_ENABLE(halfword-emulator,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
200 AS_HELP_STRING([--enable-halfword-emulator],
201 [enable halfword emulator (only for 64bit builds)]))
fb94cd9 @bufflig Store pointers to heap data in 32-bit words
bufflig authored
202
84adefa The R13B03 release.
Erlang/OTP authored
203 AC_ARG_ENABLE(smp-support,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
204 AS_HELP_STRING([--enable-smp-support], [enable smp support])
205 AS_HELP_STRING([--disable-smp-support], [disable smp support]))
84adefa The R13B03 release.
Erlang/OTP authored
206
207 AC_ARG_WITH(termcap,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
208 AS_HELP_STRING([--with-termcap], [use termcap (default)])
209 AS_HELP_STRING([--without-termcap],
210 [do not use any termcap libraries (ncurses,curses,termcap,termlib)]))
84adefa The R13B03 release.
Erlang/OTP authored
211
212 AC_ARG_ENABLE(kernel-poll,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
213 AS_HELP_STRING([--enable-kernel-poll], [enable kernel poll support])
214 AS_HELP_STRING([--disable-kernel-poll], [disable kernel poll support]))
215
216 AC_ARG_ENABLE(sctp,
217 AS_HELP_STRING([--enable-sctp], [enable sctp support])
218 AS_HELP_STRING([--disable-sctp], [disable sctp support]))
84adefa The R13B03 release.
Erlang/OTP authored
219
220 AC_ARG_ENABLE(hipe,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
221 AS_HELP_STRING([--enable-hipe], [enable hipe support])
222 AS_HELP_STRING([--disable-hipe], [disable hipe support]))
223
224 AC_ARG_ENABLE(native-libs,
225 AS_HELP_STRING([--enable-native-libs],
226 [compile Erlang libraries to native code]))
227
cca350e @bufflig Change to more specific configure options for dtrace
bufflig authored
228 AC_ARG_WITH(dynamic-trace,
229 AS_HELP_STRING([--with-dynamic-trace={dtrace|systemtap}],
230 [specify use of dynamic trace framework, dtrace or systemtap])
231 AS_HELP_STRING([--without-dynamic-trace],
232 [don't enable any dynamic tracing (default)]))
233 AC_ARG_ENABLE(vm-probes,
234 AS_HELP_STRING([--enable-vm-probes],
235 [add dynamic trace probes to the Beam VM (only possible if --with-dynamic-trace is enabled, and then default)]))
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
236 AC_ARG_WITH(javac,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
237 AS_HELP_STRING([--with-javac=JAVAC], [specify Java compiler to use])
238 AS_HELP_STRING([--with-javac], [use a Java compiler if found (default)])
239 AS_HELP_STRING([--without-javac], [don't use any Java compiler]))
84adefa The R13B03 release.
Erlang/OTP authored
240
241 AC_ARG_ENABLE(megaco_flex_scanner_lineno,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
242 AS_HELP_STRING([--disable-megaco-flex-scanner-lineno],
243 [disable megaco flex scanner lineno]))
84adefa The R13B03 release.
Erlang/OTP authored
244
245 AC_ARG_ENABLE(megaco_reentrant_flex_scanner,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
246 AS_HELP_STRING([--disable-megaco-reentrant-flex-scanner],
247 [disable reentrant megaco flex scanner]))
84adefa The R13B03 release.
Erlang/OTP authored
248
249 AC_ARG_WITH(ssl,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
250 AS_HELP_STRING([--with-ssl=PATH], [specify location of OpenSSL include and lib])
251 AS_HELP_STRING([--with-ssl], [use SSL (default)])
252 AS_HELP_STRING([--without-ssl], [don't use SSL]))
84adefa The R13B03 release.
Erlang/OTP authored
253
254 AC_ARG_ENABLE(dynamic-ssl-lib,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
255 AS_HELP_STRING([--disable-dynamic-ssl-lib],
256 [disable using dynamic openssl libraries]))
84adefa The R13B03 release.
Erlang/OTP authored
257
258 AC_ARG_ENABLE(shared-zlib,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
259 AS_HELP_STRING([--enable-shared-zlib], [enable using shared zlib library]))
84adefa The R13B03 release.
Erlang/OTP authored
260
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
261 dnl This functionality has been lost along the way... :(
262 dnl It could perhaps be nice to reintroduce some day; therefore,
263 dnl it is not removed just commented out.
264 dnl
265 dnl #
266 dnl # Set Erlang man page directory
267 dnl #
268 dnl AC_ARG_ENABLE(erlang-mandir,
269 dnl [ --disable-erlang-mandir do not install Erlang man pages in a private directory],
270 dnl [ case "$enableval" in
271 dnl no) erl_mandir=$mandir ;;
272 dnl *) erl_mandir='$(erlang_libdir)/man' ;;
273 dnl esac ], erl_mandir='$(erlang_libdir)/man')
274 dnl AC_SUBST(erl_mandir)
84adefa The R13B03 release.
Erlang/OTP authored
275
276 AC_ARG_ENABLE(darwin-universal,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
277 AS_HELP_STRING([--enable-darwin-universal],
278 [build universal binaries on darwin i386]),
84adefa The R13B03 release.
Erlang/OTP authored
279 [ case "$enableval" in
280 no) enable_darwin_universal=no ;;
281 *) enable_darwin_univeral=yes ;;
282 esac
283 ],enable_darwin_universal=no)
284
285
286 AC_ARG_ENABLE(darwin-64bit,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
287 AS_HELP_STRING([--enable-darwin-64bit], [build 64bit binaries on darwin]),
84adefa The R13B03 release.
Erlang/OTP authored
288 [ case "$enableval" in
289 no) enable_darwin_64bit=no ;;
290 *) enable_darwin_64bit=yes ;;
291 esac
292 ],enable_darwin_64bit=no)
293
294 AC_ARG_ENABLE(m64-build,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
295 AS_HELP_STRING([--enable-m64-build],
296 [build 64bit binaries using the -m64 flag to (g)cc]),
84adefa The R13B03 release.
Erlang/OTP authored
297 [ case "$enableval" in
298 no) enable_m64_build=no ;;
299 *) enable_m64_build=yes ;;
300 esac
301 ],enable_m64_build=no)
302
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
303 AC_ARG_ENABLE(m32-build,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
304 AS_HELP_STRING([--enable-m32-build],
305 [build 32bit binaries using the -m32 flag to (g)cc]),
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
306 [ case "$enableval" in
307 no) enable_m32_build=no ;;
308 *)
309 if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
310 then
311 AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
312 fi ;
313 enable_m32_build=yes ;;
314 esac
315 ],enable_m32_build=no)
316
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
317 AC_ARG_WITH(libatomic_ops,
318 AS_HELP_STRING([--with-libatomic_ops=PATH],
319 [specify and prefer usage of libatomic_ops in the ethread library]))
320
84adefa The R13B03 release.
Erlang/OTP authored
321 dnl OK, we might have darwin switches off different kinds, lets
322 dnl check it all before continuing.
323 TMPSYS=`uname -s`-`uname -m`
324 if test X${enable_darwin_universal} = Xyes; then
325 if test X${enable_darwin_64bit} = Xyes; then
326 AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
327 fi
328 enable_hipe=no
329 CFLAGS="-arch i386 -arch ppc $CFLAGS"
330 export CFLAGS
331 LDFLAGS="-arch i386 -arch ppc $LDFLAGS"
332 export LDFLAGS
333 fi
334 if test X${enable_darwin_64bit} = Xyes; then
335 case "$TMPSYS" in
336 Darwin-i386|Darwin-x86_64)
337 ;;
338 Darwin*)
339 AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
340 ;;
341 *)
342 AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
343 ;;
344 esac
345 enable_hipe=no
346 CFLAGS="-m64 $CFLAGS"
347 export CFLAGS
348 LDFLAGS="-m64 $LDFLAGS"
349 export LDFLAGS
350 elif test X"$TMPSYS" '=' X"Darwin-i386"; then
351 CFLAGS="-m32 $CFLAGS"
352 export CFLAGS
353 LDFLAGS="-m32 $LDFLAGS"
354 export LDFLAGS
355 fi
356
357 if test X${enable_m64_build} = Xyes; then
358 enable_hipe=no
359 CFLAGS="-m64 $CFLAGS"
360 export CFLAGS
361 LDFLAGS="-m64 $LDFLAGS"
362 export LDFLAGS
363 fi
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
364 if test X${enable_m32_build} = Xyes; then
365 enable_hipe=no
366 CFLAGS="-m32 $CFLAGS"
367 export CFLAGS
368 LDFLAGS="-m32 $LDFLAGS"
369 export LDFLAGS
370 fi
84adefa The R13B03 release.
Erlang/OTP authored
371
d28b000 @bufflig Make hipe hipe-compiled w/ --enable-native-libs
bufflig authored
372 NATIVE_LIBS_ENABLED=
373 if test X${enable_native_libs} = Xyes -a X${enable_hipe} != Xno; then
374 NATIVE_LIBS_ENABLED=yes
375 fi
376 AC_SUBST(NATIVE_LIBS_ENABLED)
377
84adefa The R13B03 release.
Erlang/OTP authored
378 export ERL_TOP
379 AC_CONFIG_SUBDIRS(lib erts)
380
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
381 AC_CONFIG_FILES([Makefile])
382 AC_CONFIG_FILES([make/emd2exml], [chmod +x make/emd2exml])
383
384 AC_OUTPUT
84adefa The R13B03 release.
Erlang/OTP authored
385
386 pattern="lib/*/SKIP"
387 files=`echo $pattern`
388 if test "$files" != "$pattern"; then
389 echo '*********************************************************************'
390 echo '********************** APPLICATIONS DISABLED **********************'
391 echo '*********************************************************************'
392 echo
393 for skipfile in $files; do
394 app=`dirname $skipfile`; app=`basename $app`
395 printf "%-15s: " $app; cat $skipfile
396 done
397 echo
398 echo '*********************************************************************'
399 fi
400 pattern="lib/*/CONF_INFO"
401 files=`echo $pattern`
300b419 @rickard-green Rewrite ethread library
rickard-green authored
402 if test "$files" != "$pattern" || test -f erts/CONF_INFO; then
84adefa The R13B03 release.
Erlang/OTP authored
403 echo '*********************************************************************'
404 echo '********************** APPLICATIONS INFORMATION *******************'
405 echo '*********************************************************************'
406 echo
300b419 @rickard-green Rewrite ethread library
rickard-green authored
407 test ! -f erts/CONF_INFO || files="$files erts/CONF_INFO"
84adefa The R13B03 release.
Erlang/OTP authored
408 for infofile in $files; do
409 app=`dirname $infofile`; app=`basename $app`
410 printf "%-15s: " $app; cat $infofile
411 done
412 echo
413 echo '*********************************************************************'
414 fi
415 if test -f "erts/doc/CONF_INFO"; then
416 echo '*********************************************************************'
417 echo '********************** DOCUMENTATION INFORMATION ******************'
418 echo '*********************************************************************'
419 echo
420 printf "%-15s: \n" documentation;
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
421 havexsltproc="yes"
84adefa The R13B03 release.
Erlang/OTP authored
422 for cmd in `cat erts/doc/CONF_INFO`; do
423 echo " $cmd is missing."
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
424 if test $cmd = "xsltproc"; then
425 havexsltproc="no"
426 fi
84adefa The R13B03 release.
Erlang/OTP authored
427 done
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
428 if test $havexsltproc = "no"; then
429 echo ' The documentation can not be built.'
430 else
431 echo ' Using fakefop to generate placeholder PDF files.'
432 fi
84adefa The R13B03 release.
Erlang/OTP authored
433 echo
434 echo '*********************************************************************'
435 fi
Something went wrong with that request. Please try again.