Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 405 lines (355 sloc) 11.95 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
5 dnl Copyright Ericsson AB 1998-2010. All Rights Reserved.
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
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
100 if test X$cross_compiling = Xyes; then
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,
109 [ --enable-bootstrap-only enable bootstrap only configuration],
110 [ if test "X$enableval" = "Xyes"; then
111 BOOTSTRAP_ONLY=yes
112 else
113 BOOTSTRAP_ONLY=no
114 fi
115 ],
116 BOOTSTRAP_ONLY=no)
117
118 AC_SUBST(BOOTSTRAP_ONLY)
119
120 if test $CROSS_COMPILING = yes -a $BOOTSTRAP_ONLY = yes; then
121 AC_MSG_ERROR([Cannot both cross compile and build a bootstrap system])
122 fi
84adefa The R13B03 release.
Erlang/OTP authored
123
124 dnl Checks for programs.
125
126 AC_PROG_CC
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
127 AC_PROG_CXX
128 AC_CHECK_TOOL(LD, [ld])
84adefa The R13B03 release.
Erlang/OTP authored
129
130 #
131 # We need GNU make, complain if we can't find it
132 #
133 AC_MSG_CHECKING(for GNU make)
134 # If there is a Makefile created we don't want make to start making, run
135 # in a subdirectory and -f /dev/null
136 MAKE_PROG=x
137 if test X"$CLEARCASE_MAKE_COMPAT" = X"gnu" -a X"$CLEARCASE_ROOT" != X"" ; then
138 eval clearmake -version 2>&1 | grep clearmake > /dev/null 2>&1
139 case $? in
140 0) MAKE_PROG="clearmake -V";;
141 *);;
142 esac
143 fi
144 if test X"$MAKE_PROG" = X"x"; then
145 mkdir conftestmake
146 if test -d conftestmake; then
147 cd conftestmake
148 for m in make gmake ggmake; do
149 eval $m --version -f /dev/null 2>&1 | grep GNU > /dev/null 2>&1
150 case $? in
151 0) MAKE_PROG=$m ; break ;;
152 *) ;;
153 esac
154 done
155 cd ..
156 else
157 AC_MSG_ERROR(could not create subdirectory)
158 fi
159 fi
160 rm -rf conftestmake
161 case $MAKE_PROG in
162 x) AC_MSG_RESULT(no)
163 AC_MSG_ERROR(GNU make is required!)
164 ;;
165 *) AC_MSG_RESULT(yes ($MAKE_PROG))
166 AC_SUBST(MAKE_PROG)
167 ;;
168 esac
169
170 AC_PROG_INSTALL
171 if test X"${INSTALL}" = "X${ac_aux_dir}/install-sh -c" && test -f /usr/ucb/install ; then
172 case $host_os in
173 osf*) ;;
174 *) INSTALL="/usr/ucb/install -c" ;;
175 esac
176 fi
177
178 AC_PROG_LN_S
179 AC_PROG_RANLIB
180
181 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
182 # Get erts version and otp release from erts/vsn.mk
84adefa The R13B03 release.
Erlang/OTP authored
183 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
184 AC_MSG_CHECKING([ERTS version])
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
185 [ERTS_VSN=`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
186 AC_MSG_RESULT([$ERTS_VSN])
187 AC_SUBST(ERTS_VSN)
84adefa The R13B03 release.
Erlang/OTP authored
188
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
189 AC_MSG_CHECKING([OTP release])
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
190 [OTP_REL=`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
191 AC_MSG_RESULT([$OTP_REL])
192 AC_SUBST(OTP_REL)
84adefa The R13B03 release.
Erlang/OTP authored
193
194 AC_ARG_ENABLE(threads,
195 [ --enable-threads enable async thread support
196 --disable-threads disable async thread support])
197
fb94cd9 @bufflig Store pointers to heap data in 32-bit words
bufflig authored
198 AC_ARG_ENABLE(halfword-emulator,
199 [ --enable-halfword-emulator enable halfword emulator (only for 64bit builds)
200 --disable-halfword-emulator disable halfword emulator (only for 64bit builds)])
201
84adefa The R13B03 release.
Erlang/OTP authored
202 AC_ARG_ENABLE(smp-support,
203 [ --enable-smp-support enable smp support
204 --disable-smp-support disable smp support])
205
206 AC_ARG_WITH(termcap,
207 [ --with-termcap use termcap (default)
208 --without-termcap do not use any termcap libraries (ncurses,curses,termcap,termlib)])
209
210 AC_ARG_ENABLE(kernel-poll,
211 [ --enable-kernel-poll enable kernel poll support])
212
213 AC_ARG_ENABLE(hipe,
214 [ --enable-hipe enable hipe support
215 --disable-hipe disable hipe support])
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
216
217 AC_ARG_WITH(javac,
218 [ --with-javac=JAVAC specify Java compiler to use
219 --with-javac use a Java compiler if found (default)
220 --without-javac don't use any Java compiler])
84adefa The R13B03 release.
Erlang/OTP authored
221
222 AC_ARG_ENABLE(megaco_flex_scanner_lineno,
223 [ --enable-megaco-flex-scanner-lineno enable megaco flex scanner lineno
224 --disable-megaco-flex-scanner-lineno disable megaco flex scanner lineno])
225
226 AC_ARG_ENABLE(megaco_reentrant_flex_scanner,
227 [ --enable-megaco-reentrant-flex-scanner enable reentrans megaco flex scanner
228 --disable-megaco-reentrant-flex-scanner disable reentrans megaco flex scanner])
229
230 AC_ARG_WITH(ssl,
231 [ --with-ssl=PATH specify location of OpenSSL include and lib
232 --with-ssl use SSL (default)
233 --without-ssl don't use SSL])
234
235 AC_ARG_ENABLE(dynamic-ssl-lib,
236 [ --enable-dynamic-ssl-lib force using dynamic openssl libraries
237 --disable-dynamic-ssl-lib disable using dynamic openssl libraries])
238
239 AC_ARG_ENABLE(shared-zlib,
240 [ --enable-shared-zlib enable using shared zlib library
241 --disable-shared-zlib disable shared zlib, compile own zlib source (default)])
242
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
243 dnl This functionality has been lost along the way... :(
244 dnl It could perhaps be nice to reintroduce some day; therefore,
245 dnl it is not removed just commented out.
246 dnl
247 dnl #
248 dnl # Set Erlang man page directory
249 dnl #
250 dnl AC_ARG_ENABLE(erlang-mandir,
251 dnl [ --disable-erlang-mandir do not install Erlang man pages in a private directory],
252 dnl [ case "$enableval" in
253 dnl no) erl_mandir=$mandir ;;
254 dnl *) erl_mandir='$(erlang_libdir)/man' ;;
255 dnl esac ], erl_mandir='$(erlang_libdir)/man')
256 dnl AC_SUBST(erl_mandir)
84adefa The R13B03 release.
Erlang/OTP authored
257
258 AC_ARG_ENABLE(darwin-universal,
259 [ --enable-darwin-universal build universal binaries on darwin i386],
260 [ case "$enableval" in
261 no) enable_darwin_universal=no ;;
262 *) enable_darwin_univeral=yes ;;
263 esac
264 ],enable_darwin_universal=no)
265
266
267 AC_ARG_ENABLE(darwin-64bit,
268 [ --enable-darwin-64bit build 64bit binaries on darwin],
269 [ case "$enableval" in
270 no) enable_darwin_64bit=no ;;
271 *) enable_darwin_64bit=yes ;;
272 esac
273 ],enable_darwin_64bit=no)
274
275 AC_ARG_ENABLE(m64-build,
276 [ --enable-m64-build build 64bit binaries using the -m64 flag to (g)cc],
277 [ case "$enableval" in
278 no) enable_m64_build=no ;;
279 *) enable_m64_build=yes ;;
280 esac
281 ],enable_m64_build=no)
282
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
283 AC_ARG_ENABLE(m32-build,
284 [ --enable-m32-build build 32bit binaries using the -m32 flag to (g)cc],
285 [ case "$enableval" in
286 no) enable_m32_build=no ;;
287 *)
288 if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
289 then
290 AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
291 fi ;
292 enable_m32_build=yes ;;
293 esac
294 ],enable_m32_build=no)
295
84adefa The R13B03 release.
Erlang/OTP authored
296 dnl OK, we might have darwin switches off different kinds, lets
297 dnl check it all before continuing.
298 TMPSYS=`uname -s`-`uname -m`
299 if test X${enable_darwin_universal} = Xyes; then
300 if test X${enable_darwin_64bit} = Xyes; then
301 AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
302 fi
303 enable_hipe=no
304 CFLAGS="-arch i386 -arch ppc $CFLAGS"
305 export CFLAGS
306 LDFLAGS="-arch i386 -arch ppc $LDFLAGS"
307 export LDFLAGS
308 fi
309 if test X${enable_darwin_64bit} = Xyes; then
310 case "$TMPSYS" in
311 Darwin-i386|Darwin-x86_64)
312 ;;
313 Darwin*)
314 AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
315 ;;
316 *)
317 AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
318 ;;
319 esac
320 enable_hipe=no
321 CFLAGS="-m64 $CFLAGS"
322 export CFLAGS
323 LDFLAGS="-m64 $LDFLAGS"
324 export LDFLAGS
325 elif test X"$TMPSYS" '=' X"Darwin-i386"; then
326 CFLAGS="-m32 $CFLAGS"
327 export CFLAGS
328 LDFLAGS="-m32 $LDFLAGS"
329 export LDFLAGS
330 fi
331
332 if test X${enable_m64_build} = Xyes; then
333 enable_hipe=no
334 CFLAGS="-m64 $CFLAGS"
335 export CFLAGS
336 LDFLAGS="-m64 $LDFLAGS"
337 export LDFLAGS
338 fi
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored
339 if test X${enable_m32_build} = Xyes; then
340 enable_hipe=no
341 CFLAGS="-m32 $CFLAGS"
342 export CFLAGS
343 LDFLAGS="-m32 $LDFLAGS"
344 export LDFLAGS
345 fi
84adefa The R13B03 release.
Erlang/OTP authored
346
347 export ERL_TOP
348 AC_CONFIG_SUBDIRS(lib erts)
349
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
350 AC_CONFIG_FILES([Makefile])
351 AC_CONFIG_FILES([make/emd2exml], [chmod +x make/emd2exml])
352
353 AC_OUTPUT
84adefa The R13B03 release.
Erlang/OTP authored
354
355 pattern="lib/*/SKIP"
356 files=`echo $pattern`
357 if test "$files" != "$pattern"; then
358 echo '*********************************************************************'
359 echo '********************** APPLICATIONS DISABLED **********************'
360 echo '*********************************************************************'
361 echo
362 for skipfile in $files; do
363 app=`dirname $skipfile`; app=`basename $app`
364 printf "%-15s: " $app; cat $skipfile
365 done
366 echo
367 echo '*********************************************************************'
368 fi
369 pattern="lib/*/CONF_INFO"
370 files=`echo $pattern`
300b419 @rickard-green Rewrite ethread library
rickard-green authored
371 if test "$files" != "$pattern" || test -f erts/CONF_INFO; then
84adefa The R13B03 release.
Erlang/OTP authored
372 echo '*********************************************************************'
373 echo '********************** APPLICATIONS INFORMATION *******************'
374 echo '*********************************************************************'
375 echo
300b419 @rickard-green Rewrite ethread library
rickard-green authored
376 test ! -f erts/CONF_INFO || files="$files erts/CONF_INFO"
84adefa The R13B03 release.
Erlang/OTP authored
377 for infofile in $files; do
378 app=`dirname $infofile`; app=`basename $app`
379 printf "%-15s: " $app; cat $infofile
380 done
381 echo
382 echo '*********************************************************************'
383 fi
384 if test -f "erts/doc/CONF_INFO"; then
385 echo '*********************************************************************'
386 echo '********************** DOCUMENTATION INFORMATION ******************'
387 echo '*********************************************************************'
388 echo
389 printf "%-15s: \n" documentation;
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
390 havexsltproc="yes"
84adefa The R13B03 release.
Erlang/OTP authored
391 for cmd in `cat erts/doc/CONF_INFO`; do
392 echo " $cmd is missing."
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
393 if test $cmd = "xsltproc"; then
394 havexsltproc="no"
395 fi
84adefa The R13B03 release.
Erlang/OTP authored
396 done
bdb41b9 @tuncer Build placeholder PDF files if FOP is not found
tuncer authored
397 if test $havexsltproc = "no"; then
398 echo ' The documentation can not be built.'
399 else
400 echo ' Using fakefop to generate placeholder PDF files.'
401 fi
84adefa The R13B03 release.
Erlang/OTP authored
402 echo
403 echo '*********************************************************************'
404 fi
Something went wrong with that request. Please try again.