Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 422 lines (369 sloc) 12.472 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
7f19af0 @rickard-green Improve ethread atomics
rickard-green authored
5 dnl Copyright Ericsson AB 1998-2011. 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
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
228 AC_ARG_WITH(javac,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
229 AS_HELP_STRING([--with-javac=JAVAC], [specify Java compiler to use])
230 AS_HELP_STRING([--with-javac], [use a Java compiler if found (default)])
231 AS_HELP_STRING([--without-javac], [don't use any Java compiler]))
84adefa The R13B03 release.
Erlang/OTP authored
232
233 AC_ARG_ENABLE(megaco_flex_scanner_lineno,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
234 AS_HELP_STRING([--disable-megaco-flex-scanner-lineno],
235 [disable megaco flex scanner lineno]))
84adefa The R13B03 release.
Erlang/OTP authored
236
237 AC_ARG_ENABLE(megaco_reentrant_flex_scanner,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
238 AS_HELP_STRING([--disable-megaco-reentrant-flex-scanner],
239 [disable reentrant megaco flex scanner]))
84adefa The R13B03 release.
Erlang/OTP authored
240
241 AC_ARG_WITH(ssl,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
242 AS_HELP_STRING([--with-ssl=PATH], [specify location of OpenSSL include and lib])
243 AS_HELP_STRING([--with-ssl], [use SSL (default)])
244 AS_HELP_STRING([--without-ssl], [don't use SSL]))
84adefa The R13B03 release.
Erlang/OTP authored
245
246 AC_ARG_ENABLE(dynamic-ssl-lib,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
247 AS_HELP_STRING([--disable-dynamic-ssl-lib],
248 [disable using dynamic openssl libraries]))
84adefa The R13B03 release.
Erlang/OTP authored
249
250 AC_ARG_ENABLE(shared-zlib,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
251 AS_HELP_STRING([--enable-shared-zlib], [enable using shared zlib library]))
84adefa The R13B03 release.
Erlang/OTP authored
252
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
253 dnl This functionality has been lost along the way... :(
254 dnl It could perhaps be nice to reintroduce some day; therefore,
255 dnl it is not removed just commented out.
256 dnl
257 dnl #
258 dnl # Set Erlang man page directory
259 dnl #
260 dnl AC_ARG_ENABLE(erlang-mandir,
261 dnl [ --disable-erlang-mandir do not install Erlang man pages in a private directory],
262 dnl [ case "$enableval" in
263 dnl no) erl_mandir=$mandir ;;
264 dnl *) erl_mandir='$(erlang_libdir)/man' ;;
265 dnl esac ], erl_mandir='$(erlang_libdir)/man')
266 dnl AC_SUBST(erl_mandir)
84adefa The R13B03 release.
Erlang/OTP authored
267
268 AC_ARG_ENABLE(darwin-universal,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
269 AS_HELP_STRING([--enable-darwin-universal],
270 [build universal binaries on darwin i386]),
84adefa The R13B03 release.
Erlang/OTP authored
271 [ case "$enableval" in
272 no) enable_darwin_universal=no ;;
273 *) enable_darwin_univeral=yes ;;
274 esac
275 ],enable_darwin_universal=no)
276
277
278 AC_ARG_ENABLE(darwin-64bit,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
279 AS_HELP_STRING([--enable-darwin-64bit], [build 64bit binaries on darwin]),
84adefa The R13B03 release.
Erlang/OTP authored
280 [ case "$enableval" in
281 no) enable_darwin_64bit=no ;;
282 *) enable_darwin_64bit=yes ;;
283 esac
284 ],enable_darwin_64bit=no)
285
286 AC_ARG_ENABLE(m64-build,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
287 AS_HELP_STRING([--enable-m64-build],
288 [build 64bit binaries using the -m64 flag to (g)cc]),
84adefa The R13B03 release.
Erlang/OTP authored
289 [ case "$enableval" in
290 no) enable_m64_build=no ;;
291 *) enable_m64_build=yes ;;
292 esac
293 ],enable_m64_build=no)
294
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
295 AC_ARG_ENABLE(m32-build,
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
296 AS_HELP_STRING([--enable-m32-build],
297 [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
298 [ case "$enableval" in
299 no) enable_m32_build=no ;;
300 *)
301 if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
302 then
303 AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
304 fi ;
305 enable_m32_build=yes ;;
306 esac
307 ],enable_m32_build=no)
308
7aa711e @rickard-green Cleanup configure help texts
rickard-green authored
309 AC_ARG_WITH(libatomic_ops,
310 AS_HELP_STRING([--with-libatomic_ops=PATH],
311 [specify and prefer usage of libatomic_ops in the ethread library]))
312
84adefa The R13B03 release.
Erlang/OTP authored
313 dnl OK, we might have darwin switches off different kinds, lets
314 dnl check it all before continuing.
315 TMPSYS=`uname -s`-`uname -m`
316 if test X${enable_darwin_universal} = Xyes; then
317 if test X${enable_darwin_64bit} = Xyes; then
318 AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
319 fi
320 enable_hipe=no
321 CFLAGS="-arch i386 -arch ppc $CFLAGS"
322 export CFLAGS
323 LDFLAGS="-arch i386 -arch ppc $LDFLAGS"
324 export LDFLAGS
325 fi
326 if test X${enable_darwin_64bit} = Xyes; then
327 case "$TMPSYS" in
328 Darwin-i386|Darwin-x86_64)
329 ;;
330 Darwin*)
331 AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
332 ;;
333 *)
334 AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
335 ;;
336 esac
337 enable_hipe=no
338 CFLAGS="-m64 $CFLAGS"
339 export CFLAGS
340 LDFLAGS="-m64 $LDFLAGS"
341 export LDFLAGS
342 elif test X"$TMPSYS" '=' X"Darwin-i386"; then
343 CFLAGS="-m32 $CFLAGS"
344 export CFLAGS
345 LDFLAGS="-m32 $LDFLAGS"
346 export LDFLAGS
347 fi
348
349 if test X${enable_m64_build} = Xyes; then
350 enable_hipe=no
351 CFLAGS="-m64 $CFLAGS"
352 export CFLAGS
353 LDFLAGS="-m64 $LDFLAGS"
354 export LDFLAGS
355 fi
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
356 if test X${enable_m32_build} = Xyes; then
357 enable_hipe=no
358 CFLAGS="-m32 $CFLAGS"
359 export CFLAGS
360 LDFLAGS="-m32 $LDFLAGS"
361 export LDFLAGS
362 fi
84adefa The R13B03 release.
Erlang/OTP authored
363
364 export ERL_TOP
365 AC_CONFIG_SUBDIRS(lib erts)
366
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
367 AC_CONFIG_FILES([Makefile])
368 AC_CONFIG_FILES([make/emd2exml], [chmod +x make/emd2exml])
369
370 AC_OUTPUT
84adefa The R13B03 release.
Erlang/OTP authored
371
372 pattern="lib/*/SKIP"
373 files=`echo $pattern`
374 if test "$files" != "$pattern"; then
375 echo '*********************************************************************'
376 echo '********************** APPLICATIONS DISABLED **********************'
377 echo '*********************************************************************'
378 echo
379 for skipfile in $files; do
380 app=`dirname $skipfile`; app=`basename $app`
381 printf "%-15s: " $app; cat $skipfile
382 done
383 echo
384 echo '*********************************************************************'
385 fi
386 pattern="lib/*/CONF_INFO"
387 files=`echo $pattern`
300b419 @rickard-green Rewrite ethread library
rickard-green authored
388 if test "$files" != "$pattern" || test -f erts/CONF_INFO; then
84adefa The R13B03 release.
Erlang/OTP authored
389 echo '*********************************************************************'
390 echo '********************** APPLICATIONS INFORMATION *******************'
391 echo '*********************************************************************'
392 echo
300b419 @rickard-green Rewrite ethread library
rickard-green authored
393 test ! -f erts/CONF_INFO || files="$files erts/CONF_INFO"
84adefa The R13B03 release.
Erlang/OTP authored
394 for infofile in $files; do
395 app=`dirname $infofile`; app=`basename $app`
396 printf "%-15s: " $app; cat $infofile
397 done
398 echo
399 echo '*********************************************************************'
400 fi
401 if test -f "erts/doc/CONF_INFO"; then
402 echo '*********************************************************************'
403 echo '********************** DOCUMENTATION INFORMATION ******************'
404 echo '*********************************************************************'
405 echo
406 printf "%-15s: \n" documentation;
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
407 havexsltproc="yes"
84adefa The R13B03 release.
Erlang/OTP authored
408 for cmd in `cat erts/doc/CONF_INFO`; do
409 echo " $cmd is missing."
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
410 if test $cmd = "xsltproc"; then
411 havexsltproc="no"
412 fi
84adefa The R13B03 release.
Erlang/OTP authored
413 done
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
414 if test $havexsltproc = "no"; then
415 echo ' The documentation can not be built.'
416 else
417 echo ' Using fakefop to generate placeholder PDF files.'
418 fi
84adefa The R13B03 release.
Erlang/OTP authored
419 echo
420 echo '*********************************************************************'
421 fi
Something went wrong with that request. Please try again.