Skip to content
Newer
Older
100644 389 lines (341 sloc) 11.1 KB
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
24 LM_PRECIOUS_VARS
25
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
78 test "X$ERL_TOP" != "X" || ERL_TOP="$srcdir"
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
127 AC_PROG_CXX
128 AC_CHECK_TOOL(LD, [ld])
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
182 # Get erts version and otp release from erts/vsn.mk
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
183 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
184 AC_MSG_CHECKING([ERTS version])
185 [ERTS=erts-`sed -n "s/^VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
186 AC_MSG_RESULT([$ERTS])
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
187 AC_SUBST(ERTS)
188
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
189 AC_MSG_CHECKING([OTP release])
190 [OTP=OTP-`sed -n "s/^SYSTEM_VSN[ ]*=[ ]*\(.*\)/\1/p" < $ERL_TOP/erts/vsn.mk`]
191 AC_MSG_RESULT([$OTP])
192 AC_SUBST(OTP)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
193
194 AC_ARG_ENABLE(threads,
195 [ --enable-threads enable async thread support
196 --disable-threads disable async thread support])
197
198 AC_ARG_ENABLE(smp-support,
199 [ --enable-smp-support enable smp support
200 --disable-smp-support disable smp support])
201
202 AC_ARG_WITH(termcap,
203 [ --with-termcap use termcap (default)
204 --without-termcap do not use any termcap libraries (ncurses,curses,termcap,termlib)])
205
206 AC_ARG_ENABLE(kernel-poll,
207 [ --enable-kernel-poll enable kernel poll support])
208
209 AC_ARG_ENABLE(hipe,
210 [ --enable-hipe enable hipe support
211 --disable-hipe disable hipe support])
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
212
213 AC_ARG_WITH(javac,
214 [ --with-javac=JAVAC specify Java compiler to use
215 --with-javac use a Java compiler if found (default)
216 --without-javac don't use any Java compiler])
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
217
218 AC_ARG_ENABLE(megaco_flex_scanner_lineno,
219 [ --enable-megaco-flex-scanner-lineno enable megaco flex scanner lineno
220 --disable-megaco-flex-scanner-lineno disable megaco flex scanner lineno])
221
222 AC_ARG_ENABLE(megaco_reentrant_flex_scanner,
223 [ --enable-megaco-reentrant-flex-scanner enable reentrans megaco flex scanner
224 --disable-megaco-reentrant-flex-scanner disable reentrans megaco flex scanner])
225
226 AC_ARG_WITH(ssl,
227 [ --with-ssl=PATH specify location of OpenSSL include and lib
228 --with-ssl use SSL (default)
229 --without-ssl don't use SSL])
230
231 AC_ARG_ENABLE(dynamic-ssl-lib,
232 [ --enable-dynamic-ssl-lib force using dynamic openssl libraries
233 --disable-dynamic-ssl-lib disable using dynamic openssl libraries])
234
235 AC_ARG_ENABLE(shared-zlib,
236 [ --enable-shared-zlib enable using shared zlib library
237 --disable-shared-zlib disable shared zlib, compile own zlib source (default)])
238
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
239 dnl This functionality has been lost along the way... :(
240 dnl It could perhaps be nice to reintroduce some day; therefore,
241 dnl it is not removed just commented out.
242 dnl
243 dnl #
244 dnl # Set Erlang man page directory
245 dnl #
246 dnl AC_ARG_ENABLE(erlang-mandir,
247 dnl [ --disable-erlang-mandir do not install Erlang man pages in a private directory],
248 dnl [ case "$enableval" in
249 dnl no) erl_mandir=$mandir ;;
250 dnl *) erl_mandir='$(erlang_libdir)/man' ;;
251 dnl esac ], erl_mandir='$(erlang_libdir)/man')
252 dnl AC_SUBST(erl_mandir)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
253
254 AC_ARG_ENABLE(darwin-universal,
255 [ --enable-darwin-universal build universal binaries on darwin i386],
256 [ case "$enableval" in
257 no) enable_darwin_universal=no ;;
258 *) enable_darwin_univeral=yes ;;
259 esac
260 ],enable_darwin_universal=no)
261
262
263 AC_ARG_ENABLE(darwin-64bit,
264 [ --enable-darwin-64bit build 64bit binaries on darwin],
265 [ case "$enableval" in
266 no) enable_darwin_64bit=no ;;
267 *) enable_darwin_64bit=yes ;;
268 esac
269 ],enable_darwin_64bit=no)
270
271 AC_ARG_ENABLE(m64-build,
272 [ --enable-m64-build build 64bit binaries using the -m64 flag to (g)cc],
273 [ case "$enableval" in
274 no) enable_m64_build=no ;;
275 *) enable_m64_build=yes ;;
276 esac
277 ],enable_m64_build=no)
278
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored Dec 8, 2009
279 AC_ARG_ENABLE(m32-build,
280 [ --enable-m32-build build 32bit binaries using the -m32 flag to (g)cc],
281 [ case "$enableval" in
282 no) enable_m32_build=no ;;
283 *)
284 if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
285 then
286 AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
287 fi ;
288 enable_m32_build=yes ;;
289 esac
290 ],enable_m32_build=no)
291
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
292 dnl OK, we might have darwin switches off different kinds, lets
293 dnl check it all before continuing.
294 TMPSYS=`uname -s`-`uname -m`
295 if test X${enable_darwin_universal} = Xyes; then
296 if test X${enable_darwin_64bit} = Xyes; then
297 AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
298 fi
299 enable_hipe=no
300 CFLAGS="-arch i386 -arch ppc $CFLAGS"
301 export CFLAGS
302 LDFLAGS="-arch i386 -arch ppc $LDFLAGS"
303 export LDFLAGS
304 fi
305 if test X${enable_darwin_64bit} = Xyes; then
306 case "$TMPSYS" in
307 Darwin-i386|Darwin-x86_64)
308 ;;
309 Darwin*)
310 AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
311 ;;
312 *)
313 AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
314 ;;
315 esac
316 enable_hipe=no
317 CFLAGS="-m64 $CFLAGS"
318 export CFLAGS
319 LDFLAGS="-m64 $LDFLAGS"
320 export LDFLAGS
321 elif test X"$TMPSYS" '=' X"Darwin-i386"; then
322 CFLAGS="-m32 $CFLAGS"
323 export CFLAGS
324 LDFLAGS="-m32 $LDFLAGS"
325 export LDFLAGS
326 fi
327
328 if test X${enable_m64_build} = Xyes; then
329 enable_hipe=no
330 CFLAGS="-m64 $CFLAGS"
331 export CFLAGS
332 LDFLAGS="-m64 $LDFLAGS"
333 export LDFLAGS
334 fi
cad901a @bufflig Teach configure --enable-m32-build for forcing a 32-bit build
bufflig authored Dec 8, 2009
335 if test X${enable_m32_build} = Xyes; then
336 enable_hipe=no
337 CFLAGS="-m32 $CFLAGS"
338 export CFLAGS
339 LDFLAGS="-m32 $LDFLAGS"
340 export LDFLAGS
341 fi
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
342
343 export ERL_TOP
344 AC_CONFIG_SUBDIRS(lib erts)
345
346 AC_OUTPUT(Makefile)
347
348 pattern="lib/*/SKIP"
349 files=`echo $pattern`
350 if test "$files" != "$pattern"; then
351 echo '*********************************************************************'
352 echo '********************** APPLICATIONS DISABLED **********************'
353 echo '*********************************************************************'
354 echo
355 for skipfile in $files; do
356 app=`dirname $skipfile`; app=`basename $app`
357 printf "%-15s: " $app; cat $skipfile
358 done
359 echo
360 echo '*********************************************************************'
361 fi
362 pattern="lib/*/CONF_INFO"
363 files=`echo $pattern`
364 if test "$files" != "$pattern"; then
365 echo '*********************************************************************'
366 echo '********************** APPLICATIONS INFORMATION *******************'
367 echo '*********************************************************************'
368 echo
369 for infofile in $files; do
370 app=`dirname $infofile`; app=`basename $app`
371 printf "%-15s: " $app; cat $infofile
372 done
373 echo
374 echo '*********************************************************************'
375 fi
376 if test -f "erts/doc/CONF_INFO"; then
377 echo '*********************************************************************'
378 echo '********************** DOCUMENTATION INFORMATION ******************'
379 echo '*********************************************************************'
380 echo
381 printf "%-15s: \n" documentation;
382 for cmd in `cat erts/doc/CONF_INFO`; do
383 echo " $cmd is missing."
384 done
385 echo ' The documentation can not be built.'
386 echo
387 echo '*********************************************************************'
388 fi
Something went wrong with that request. Please try again.