1
1
dnl Process this file with autoconf to produce a configure script. -*-m4-*-
5
dnl Copyright Ericsson AB 1997-2009. All Rights Reserved.
5
dnl Copyright Ericsson AB 1997-2010. All Rights Reserved.
7
7
dnl The contents of this file are subject to the Erlang Public License,
8
8
dnl Version 1.1, (the "License"); you may not use this file except in
9
9
dnl compliance with the License. You should have received a copy of the
10
10
dnl Erlang Public License along with this software. If not, it can be
11
11
dnl retrieved online at http://www.erlang.org/.
13
13
dnl Software distributed under the License is distributed on an "AS IS"
14
14
dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15
15
dnl the License for the specific language governing rights and limitations
16
16
dnl under the License.
20
20
dnl The string "FIXME convbreak" means that there is a break of
94
109
ENABLE_ALLOC_TYPE_VARS=
95
110
AC_SUBST(ENABLE_ALLOC_TYPE_VARS)
97
AC_ARG_WITH(xcomp-conf,
98
[ --with-xcompconf=PATH path to cross compilation configuration])
99
if test "x$with_xcompconf" != "xno" -a "x$with_xcompconf" != "x" ; then
112
AC_ARG_ENABLE(bootstrap-only,
113
AS_HELP_STRING([--enable-bootstrap-only],
114
[enable bootstrap only configuration]),
115
[ if test "X$enableval" = "Xyes"; then
116
# Disable stuff not necessary in a bootstrap only system in order
117
# to speed up things by reducing the amount of stuff needing to be
120
enable_smp_support=no
104
129
AC_ARG_ENABLE(threads,
105
[ --enable-threads enable async thread support
106
--disable-threads disable async thread support],
130
AS_HELP_STRING([--enable-threads], [enable async thread support])
131
AS_HELP_STRING([--disable-threads], [disable async thread support]),
107
132
[ case "$enableval" in
108
133
no) enable_threads=no ;;
109
134
*) enable_threads=yes ;;
110
135
esac ], enable_threads=unknown)
137
AC_ARG_ENABLE(halfword-emulator,
138
AS_HELP_STRING([--enable-halfword-emulator],
139
[enable halfword emulator (only for 64bit builds)]),
140
[ case "$enableval" in
141
no) enable_halfword_emualtor=no ;;
142
*) enable_halfword_emulator=yes ;;
143
esac ], enable_halfword_emulator=unknown)
112
145
AC_ARG_ENABLE(smp-support,
113
[ --enable-smp-support enable smp support
114
--disable-smp-support disable smp support],
146
AS_HELP_STRING([--enable-smp-support], [enable smp support])
147
AS_HELP_STRING([--disable-smp-support], [disable smp support]),
115
148
[ case "$enableval" in
116
149
no) enable_smp_support=no ;;
117
150
*) enable_smp_support=yes ;;
118
151
esac ], enable_smp_support=unknown)
120
153
AC_ARG_WITH(termcap,
121
[ --with-termcap use termcap (default)
122
--without-termcap do not use any termcap libraries (ncurses,curses,termcap,termlib)],
154
AS_HELP_STRING([--with-termcap], [use termcap (default)])
155
AS_HELP_STRING([--without-termcap],
156
[do not use any termcap libraries (ncurses,curses,termcap,termlib)]),
124
158
[with_termcap=yes])
127
161
AC_ARG_ENABLE(hybrid-heap,
128
[ --enable-hybrid-heap enable hybrid heap
129
--disable-hybrid-heap disable hybrid heap],
162
AS_HELP_STRING([--enable-hybrid-heap], [enable hybrid heap]),
130
163
[ case "$enableval" in
131
164
no) enable_hybrid_heap=no ;;
132
165
*) enable_hybrid_heap=yes ;;
133
166
esac ], enable_hybrid_heap=unknown)
135
168
AC_ARG_ENABLE(lock-checking,
136
[ --enable-lock-checking enable lock checking],
169
AS_HELP_STRING([--enable-lock-checking], [enable lock checking]),
137
170
[ case "$enableval" in
138
171
no) enable_lock_check=no ;;
139
172
*) enable_lock_check=yes ;;
142
175
enable_lock_check=no)
144
177
AC_ARG_ENABLE(lock-counter,
145
[ --enable-lock-counter enable lock counters
146
--disable-lock-counter disable lock counters],
178
AS_HELP_STRING([--enable-lock-counter], [enable lock counters]),
147
179
[ case "$enableval" in
148
180
no) enable_lock_count=no ;;
149
181
*) enable_lock_count=yes ;;
150
182
esac ], enable_lock_count=no)
152
184
AC_ARG_ENABLE(kernel-poll,
153
[ --enable-kernel-poll enable kernel poll support
154
--disable-kernel-poll disable kernel poll support],
185
AS_HELP_STRING([--enable-kernel-poll], [enable kernel poll support])
186
AS_HELP_STRING([--disable-kernel-poll], [disable kernel poll support]),
155
187
[ case "$enableval" in
156
188
no) enable_kernel_poll=no ;;
157
189
*) enable_kernel_poll=yes ;;
161
193
AC_ARG_ENABLE(sctp,
162
[ --enable-sctp enable sctp support
163
--disable-sctp disable sctp support],
194
AS_HELP_STRING([--enable-sctp], [enable sctp support])
195
AS_HELP_STRING([--disable-sctp], [disable sctp support]),
164
196
[ case "$enableval" in
165
197
no) enable_sctp=no ;;
166
198
*) enable_sctp=yes ;;
167
199
esac ], enable_sctp=unknown)
169
201
AC_ARG_ENABLE(hipe,
170
[ --enable-hipe enable hipe support
171
--disable-hipe disable hipe support])
202
AS_HELP_STRING([--enable-hipe], [enable hipe support])
203
AS_HELP_STRING([--disable-hipe], [disable hipe support]))
173
205
AC_ARG_ENABLE(native-libs,
174
[ --enable-native-libs compile Erlang libraries to native code])
206
AS_HELP_STRING([--enable-native-libs],
207
[compile Erlang libraries to native code]))
176
209
AC_ARG_ENABLE(tsp,
177
[ --enable-tsp compile tsp app])
179
AC_ARG_ENABLE(elib-malloc,
180
[ --enable-elib-malloc use elib_malloc instead of normal malloc])
210
AS_HELP_STRING([--enable-tsp], [compile tsp app]))
182
212
AC_ARG_ENABLE(fp-exceptions,
183
[ --enable-fp-exceptions Use hardware floating point exceptions (default if hipe enabled)],
213
AS_HELP_STRING([--enable-fp-exceptions],
214
[use hardware floating point exceptions (default if hipe enabled)]),
184
215
[ case "$enableval" in
185
216
no) enable_fp_exceptions=no ;;
186
217
*) enable_fp_exceptions=yes ;;
188
219
],enable_fp_exceptions=auto)
190
221
AC_ARG_ENABLE(darwin-universal,
191
[ --enable-darwin-universal build universal binaries on darwin i386],
222
AS_HELP_STRING([--enable-darwin-universal],
223
[build universal binaries on darwin i386]),
192
224
[ case "$enableval" in
193
225
no) enable_darwin_universal=no ;;
194
226
*) enable_darwin_univeral=yes ;;
205
237
],enable_darwin_64bit=no)
207
239
AC_ARG_ENABLE(m64-build,
208
[ --enable-m64-build build 64bit binaries using the -m64 flag to (g)cc],
240
AS_HELP_STRING([--enable-m64-build],
241
[build 64bit binaries using the -m64 flag to (g)cc]),
209
242
[ case "$enableval" in
210
243
no) enable_m64_build=no ;;
211
244
*) enable_m64_build=yes ;;
213
246
],enable_m64_build=no)
248
AC_ARG_ENABLE(m32-build,
249
AS_HELP_STRING([--enable-m32-build],
250
[build 32bit binaries using the -m32 flag to (g)cc]),
251
[ case "$enableval" in
252
no) enable_m32_build=no ;;
254
if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
256
AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
258
enable_m32_build=yes ;;
260
],enable_m32_build=no)
215
262
AC_ARG_ENABLE(fixalloc,
216
[ --disable-fixalloc disable the use of fix_alloc])
263
AS_HELP_STRING([--disable-fixalloc], [disable the use of fix_alloc]))
217
264
if test x${enable_fixalloc} = xno ; then
218
265
AC_DEFINE(NO_FIX_ALLOC,[],
219
266
[Define if you don't want the fix allocator in Erlang])
238
286
AC_ARG_ENABLE(clock-gettime,
239
[ --enable-clock-gettime Use clock-gettime for time correction],
287
AS_HELP_STRING([--enable-clock-gettime],
288
[use clock-gettime for time correction]),
240
289
[ case "$enableval" in
241
290
no) clock_gettime_correction=no ;;
242
291
*) clock_gettime_correction=yes ;;
243
292
esac ], clock_gettime_correction=unknown)
245
AC_ARG_ENABLE(native-ethr-impls,
246
[ --enable-native-ethr-impls enable native ethread implementations
247
--disable-native-ethr-impls disable native ethread implementations],
248
[ case "$enableval" in
249
no) disable_native_ethr_impls=yes ;;
250
*) disable_native_ethr_impls=no ;;
251
esac ], disable_native_ethr_impls=no)
253
dnl Defined in libraries/megaco/configure.in but we need it here
254
dnl also in order to show it to the "top user"
256
AC_ARG_ENABLE(megaco_flex_scanner_lineno,
257
[ --disable-megaco-flex-scanner-lineno disable megaco flex scanner lineno])
259
294
dnl Magic test for clearcase.
261
296
if test "${ERLANG_COMMERCIAL_BUILD}" != ""; then
514
if test "${LFS_CFLAGS+set}" = "set" || \
515
test "${LFS_LDFLAGS+set}" = "set" || \
516
test "${LFS_LIBS+set}" = "set"; then
520
test "$GETCONF" = "false" || lfs_source=getconf
436
dnl Use the getconf utility if it exists
437
dnl to find large file support flags.
439
if type getconf >/dev/null 2>&1; then
440
CFLAGS="$CFLAGS `getconf LFS_CFLAGS 2>/dev/null`"
441
DEBUG_CFLAGS="$DEBUG_CFLAGS `getconf LFS_CFLAGS 2>/dev/null`"
442
LDFLAGS="$LDFLAGS `getconf LFS_LDFLAGS 2>/dev/null`"
443
LIBS="$LIBS `getconf LFS_LIBS 2>/dev/null`"
523
if test "$lfs_source" = "none"; then
524
AC_MSG_WARN([Do not know how to check for large file support flags; no getconf is available])
526
for var in CFLAGS LDFLAGS LIBS; do
527
AC_MSG_CHECKING([for large file support $var])
528
if test $lfs_source = user; then
529
eval "lfs_val=\"\$LFS_$var\""
531
eval "lfs_var=LFS_$var"
532
lfs_val=`$GETCONF $lfs_var 2>/dev/null` || lfs_conf=failed
533
if test $lfs_conf = failed; then
534
AC_MSG_RESULT([failed])
537
eval "$lfs_var=\"$lfs_val\""
539
test "$lfs_val" != "" || lfs_val=none
540
AC_MSG_RESULT([$lfs_val])
542
if test $lfs_conf = failed; then
543
AC_MSG_WARN([Check for large file support flags failed; $GETCONF failed])
545
CFLAGS="$CFLAGS $LFS_CFLAGS"
546
DEBUG_CFLAGS="$DEBUG_CFLAGS $LFS_CFLAGS"
547
LDFLAGS="$LDFLAGS $LFS_LDFLAGS"
548
LIBS="$LIBS $LFS_LIBS"
446
552
if test "x$GCC" = xyes; then
447
553
# until the emulator can handle this, I suggest we turn it off!
448
554
#WFLAGS="-Wall -Wshadow -Wcast-qual -Wmissing-declarations"
449
WFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes"
555
WFLAGS="-Wall -Wstrict-prototypes"
559
# tile-gcc is a bit stricter with -Wmissing-prototypes than other gccs,
560
# and too strict for our taste.
563
WFLAGS="$WFLAGS -Wmissing-prototypes";;
451
566
saved_CFLAGS=$CFLAGS
452
567
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
465
580
AC_SUBST(CFLAG_RUNTIME_LIBRARY_PATH)
467
AC_CHECK_SIZEOF(void *, $erl_xcomp_void_p) # Needed for ARCH and smp checks below
582
AC_CHECK_SIZEOF(void *) # Needed for ARCH and smp checks below
583
if test "x$ac_cv_sizeof_void_p" = x8; then
584
AC_SUBST(EXTERNAL_WORD_SIZE, 64)
586
AC_SUBST(EXTERNAL_WORD_SIZE, 32)
470
590
dnl Figure out operating system and cpu architecture
473
if test "x$erl_xcomp_os" != "x"; then
474
chk_opsys_=$erl_xcomp_os
593
if test "x$host_alias" != "x"; then
476
if test "x$host_os" = "xwin32"; then
479
chk_opsys_=`uname -s`
480
if test "x$chk_opsys_" = "xSunOS"; then
481
chk_opsys_=$chk_opsys_`uname -r`
596
chk_opsys_=`uname -s`
597
if test "x$chk_opsys_" = "xSunOS"; then
598
chk_opsys_=$chk_opsys_`uname -r`
485
601
case $chk_opsys_ in
636
763
AC_SUBST(LIBCARBON)
765
dnl Check if we should/can build a halfword emulator
767
AC_MSG_CHECKING(if we are building a halfword emulator (32bit heap on 64bit machine))
768
if test "$enable_halfword_emulator" = "yes"; then
769
if test "$ARCH" = "amd64"; then
770
AC_DEFINE(HALFWORD_HEAP_EMULATOR, [1],
771
[Define if building a halfword-heap 64bit emulator])
774
AC_MSG_ERROR(no; halfword emulator not supported on this architecture)
638
784
dnl some tests below will call this if we haven't already - and autoconf
639
785
dnl can't handle those tests being done conditionally at runtime
680
826
AC_CHECK_PROGS(XSLTPROC, xsltproc)
681
827
if test -z "$XSLTPROC"; then
682
828
echo "xsltproc" >> doc/CONF_INFO
683
AC_MSG_WARN([No 'xsltproc' command found: the documentation can not be built])
829
AC_MSG_WARN([No 'xsltproc' command found: the documentation cannot be built])
686
832
AC_CHECK_PROGS(FOP, fop)
687
833
if test -z "$FOP"; then
834
FOP="$ERL_TOP/make/fakefop"
688
835
echo "fop" >> doc/CONF_INFO
689
AC_MSG_WARN([No 'fop' command found: the documentation can not be built])
836
AC_MSG_WARN([No 'fop' command found: going to generate placeholder PDF files])
740
887
HCFLAGS="" AC_SUBST(HCFLAGS)
741
888
HCFLAGS="$HCFLAGS -I${ERL_TOP}/erts/$host"
742
889
vxworks_reclaim="" AC_SUBST(vxworks_reclaim)
743
LD='$(CC)' AC_SUBST(LD)
891
dnl We want to use $(CC) as linker for the emulator regardless of
892
dnl what the user say. This might not be the right way to do it, but
893
dnl for now that is the way we do it.
895
USER_LDFLAGS="$LDFLAGS"
899
LDFLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
900
AC_SUBST(LDFLAG_RUNTIME_LIBRARY_PATH)
746
902
dnl Check for cygwin and object/exe files extension
747
903
dnl AC_CYGWIN is deprecated
900
1056
AC_DEFINE(ERTS_HAVE_SMP_EMU, 1, [Define if the smp emulator is built])
1058
case "$ethr_have_native_atomics-$ethr_have_native_spinlock" in
1064
test -f "$ERL_TOP/erts/CONF_INFO" ||
1065
echo "" > "$ERL_TOP/erts/CONF_INFO"
1066
cat >> $ERL_TOP/erts/CONF_INFO <<EOF
1068
No native atomic implementation available.
1069
Fallbacks implemented using spinlocks will be
1070
used. Note that the performance of the SMP
1071
runtime system will suffer due to this.
1078
test -f "$ERL_TOP/erts/CONF_INFO" ||
1079
echo "" > "$ERL_TOP/erts/CONF_INFO"
1080
cat >> "$ERL_TOP/erts/CONF_INFO" <<EOF
1082
No native atomic implementation, nor no native
1083
spinlock implementation available. Fallbacks
1084
implemented using mutexes will be used. Note
1085
that the performance of the SMP runtime system
1086
will suffer much due to this.
901
1093
enable_threads=force
904
1096
AC_SUBST(ERTS_BUILD_SMP_EMU)
1098
AC_CHECK_FUNCS([posix_fadvise])
997
1190
enable_child_waiter_thread=yes
1000
AC_DEFINE(USE_RECURSIVE_MALLOC_MUTEX,[1],
1001
[Define if malloc should use a recursive mutex])
1002
1193
AC_MSG_CHECKING([whether dlopen() needs to be called before first call to dlerror()])
1003
if test "x$ETHR_THR_LIB_BASE_NAME" != "xnptl"; then
1194
if test "x$ETHR_THR_LIB_BASE_TYPE" != "xposix_nptl"; then
1004
1195
AC_DEFINE(ERTS_NEED_DLOPEN_BEFORE_DLERROR,[1],
1005
1196
[Define if dlopen() needs to be called before first call to dlerror()])
1006
1197
AC_MSG_RESULT(yes)
1008
1199
AC_MSG_RESULT(no)
1010
if test "x$ETHR_THR_LIB_BASE_NAME" != "xnptl"; then
1201
if test "x$ETHR_THR_LIB_BASE_TYPE" != "xposix_nptl"; then
1011
1202
# Child waiter thread cannot be enabled
1012
1203
disable_child_waiter_thread=yes
1013
1204
enable_child_waiter_thread=no
1296
1480
dnl Some Linuxes needs <sys/socketio.h> instead of <sys/sockio.h>
1298
1482
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \
1299
sys/stropts.h sys/sysctl.h \
1483
sys/types.h sys/stropts.h sys/sysctl.h \
1300
1484
sys/ioctl.h sys/time.h sys/uio.h \
1301
1485
sys/socket.h sys/sockio.h sys/socketio.h \
1302
1486
net/errno.h malloc.h mach-o/dyld.h arpa/nameser.h \
1303
pty.h util.h utmp.h langinfo.h)
1487
pty.h util.h utmp.h langinfo.h poll.h sdkddkver.h)
1305
1489
AC_CHECK_HEADER(sys/resource.h,
1306
1490
[AC_DEFINE(HAVE_SYS_RESOURCE_H, 1,
1462
AC_MSG_ERROR([This gcc miscompiles the Erlang runtime system; please use a different version])
1466
dnl AC_CHECK_SIZEOF(size_t, 4)dnl Assumes all cross compiling is to 32bit uP
1468
dnl The disabled one above does not include stddef.h, alas!
1470
AC_CACHE_CHECK([size of size_t], ac_cv_sizeof_size_t,
1472
#include <sys/types.h>
1476
int main(int argc, char **argv) {
1477
FILE *f = fopen("conftestval", "w");
1479
exit(1); /* Failed */
1480
fprintf(f, "%d\n", (int) sizeof(size_t));
1483
], ac_cv_sizeof_size_t=`cat conftestval`
1484
, ac_cv_sizeof_size_t=0
1485
, ac_cv_sizeof_size_t=$erl_xcomp_sizeof_size_t))
1486
AC_DEFINE_UNQUOTED(SIZEOF_SIZE_T, $ac_cv_sizeof_size_t, [The number of bytes in a size_t])
1488
dnl A standard size check does not include sys/types.h
1490
AC_CACHE_CHECK([size of off_t], ac_cv_sizeof_off_t,
1492
#include <sys/types.h>
1496
int main(int argc, char **argv) {
1497
FILE *f = fopen("conftestval", "w");
1499
exit(1); /* Failed */
1500
fprintf(f, "%d\n", (int) sizeof(off_t));
1503
], ac_cv_sizeof_off_t=`cat conftestval`
1504
, ac_cv_sizeof_off_t=0
1505
, ac_cv_sizeof_off_t=$erl_xcomp_sizeof_off_t))
1506
AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
1507
[The number of bytes in an off_t])
1509
AC_MSG_CHECKING([int/long/void*/size_t sizes])
1513
int main(int argc, char **argv) {
1514
if (sizeof(void *) >= 4 &&
1515
sizeof(void *) == sizeof(size_t) &&
1516
(sizeof(void *) == sizeof(int) || sizeof(void *) == sizeof(long))) {
1519
exit(1); /* Failed */
1522
,AC_MSG_RESULT(failed)
1523
AC_MSG_ERROR([Cannot handle this combination of int/long/void*/size_t sizes])
1526
if test "x$erl_xcomp_bigendian" != "x"; then
1527
ac_cv_c_bigendian=$erl_xcomp_bigendian
1646
], gcc_4_3_0_bug=no, gcc_4_3_0_bug=yes, gcc_4_3_0_bug=cross)
1648
case $gcc_4_3_0_bug in
1650
gcc_4_3_0_bug_result=$gcc_4_3_0_bug;;
1652
gcc_dumped_vsn=`$CC -dumpversion 2>/dev/null`
1653
case gcc-$gcc_dumped_vsn in
1654
gcc-4.3.0) gcc_4_3_0_bug=yes;;
1655
*) gcc_4_3_0_bug=no;;
1657
gcc_4_3_0_bug_result="$gcc_4_3_0_bug; could not run test since cross compiling, checked version number ($gcc_dumped_vsn) instead";;
1660
AC_MSG_RESULT([$gcc_4_3_0_bug_result])
1661
if test $gcc_4_3_0_bug = yes; then
1662
AC_MSG_ERROR([This gcc miscompiles the Erlang runtime system; please use a different version])
1667
case X$erl_xcomp_bigendian in
1669
Xyes|Xno) ac_cv_c_bigendian=$erl_xcomp_bigendian;;
1670
*) AC_MSG_ERROR([Bad erl_xcomp_bigendian value: $erl_xcomp_bigendian]);;
1542
1685
dnl Check if we have these, in which case we'll try to build
1543
1686
dnl inet_gethost with ipv6 support.
1544
AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes, have_getaddrinfo=no)
1687
AC_CHECK_HEADERS(windows.h)
1688
AC_CHECK_HEADERS(winsock2.h)
1689
AC_CHECK_HEADERS(ws2tcpip.h,[],[],[
1690
#ifdef HAVE_WINSOCK2_H
1691
#include <winsock2.h>
1693
#ifdef HAVE_WINDOWS_H
1694
#include <windows.h>
1697
dnl AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes, have_getaddrinfo=no)
1698
AC_MSG_CHECKING(for getaddrinfo)
1702
#ifdef HAVE_WINSOCK2_H
1703
#include <winsock2.h>
1705
#ifdef HAVE_WINDOWS_H
1706
#include <windows.h>
1708
#ifdef HAVE_WS2TCPIP_H
1709
#include <ws2tcpip.h>
1712
#include <sys/socket.h>
1717
getaddrinfo("","",NULL,NULL);
1718
],have_getaddrinfo=yes, have_getaddrinfo=no)
1545
1719
if test $have_getaddrinfo = yes; then
1720
AC_MSG_RESULT([yes])
1546
1721
AC_MSG_CHECKING([whether getaddrinfo accepts enough flags])
1548
1723
#include <stdlib.h>
1549
1724
#include <string.h>
1725
#ifdef HAVE_WINSOCK2_H
1726
#include <winsock2.h>
1728
#ifdef HAVE_WINDOWS_H
1729
#include <windows.h>
1731
#ifdef HAVE_WS2TCPIP_H
1732
#include <ws2tcpip.h>
1550
1735
#include <sys/socket.h>
1551
1736
#include <netdb.h>
1552
int main(int argc, char **argv) {
1553
1740
struct addrinfo hints, *ai;
1554
1741
memset(&hints, 0, sizeof(hints));
1555
hints.ai_flags = (AI_CANONNAME|AI_V4MAPPED|AI_ADDRCONFIG);
1742
hints.ai_flags = AI_CANONNAME;
1556
1743
hints.ai_socktype = SOCK_STREAM;
1557
1744
hints.ai_family = AF_INET6;
1558
1745
if (getaddrinfo("::", NULL, &hints, &ai) == 0) {
1565
],, have_getaddrinfo=no,
1566
if test "x$erl_xcomp_getaddrinfo" != "x"; then
1567
have_getaddrinfo=$erl_xcomp_getaddrinfo
1571
if test $have_getaddrinfo = yes; then
1751
],, have_getaddrinfo=no)
1752
AC_MSG_RESULT($have_getaddrinfo)
1753
case $have_getaddrinfo in
1573
1755
AC_DEFINE(HAVE_GETADDRINFO, [1],
1574
[Define to 1 if you have a good `getaddrinfo' function.])
1579
AC_CHECK_FUNCS([getnameinfo getipnodebyname getipnodebyaddr gethostbyname2])
1756
[Define to 1 if you have a good `getaddrinfo' function.]);;
1762
AC_MSG_CHECKING(for getnameinfo)
1766
#ifdef HAVE_WINSOCK2_H
1767
#include <winsock2.h>
1769
#ifdef HAVE_WINDOWS_H
1770
#include <windows.h>
1772
#ifdef HAVE_WS2TCPIP_H
1773
#include <ws2tcpip.h>
1776
#include <sys/socket.h>
1781
getnameinfo(NULL,0,NULL,0,NULL,0,0);
1782
],have_getnameinfo=yes, have_getnameinfo=no)
1783
if test $have_getnameinfo = yes; then
1784
AC_MSG_RESULT([yes])
1785
AC_DEFINE(HAVE_GETNAMEINFO, [1],
1786
[Define to 1 if you have a good `getnameinfo' function.])
1792
AC_CHECK_FUNCS([getipnodebyname getipnodebyaddr gethostbyname2])
1581
1794
AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlopen \
1582
1795
pread pwrite writev memmove strerror strerror_r strncasecmp \
1583
gethrtime localtime_r gmtime_r mremap memcpy mallopt \
1796
gethrtime localtime_r gmtime_r mmap mremap memcpy mallopt \
1584
1797
sbrk _sbrk __sbrk brk _brk __brk \
1585
flockfile fstat strlcpy strlcat setsid posix2time setlocale nl_langinfo])
1798
flockfile fstat strlcpy strlcat setsid posix2time setlocale nl_langinfo poll])
1800
AC_CHECK_DECLS([posix2time],,,[#include <time.h>])
1586
1802
if test "X$host" = "Xwin32"; then
1587
1803
ac_cv_func_setvbuf_reversed=yes
1644
1859
dnl Need by run_erl.
1645
1860
AC_CHECK_FUNCS([openpty])
1862
dnl fdatasync syscall (Unix only)
1863
AC_CHECK_FUNCS([fdatasync])
1865
dnl Find which C libraries are required to use fdatasync
1866
AC_SEARCH_LIBS(fdatasync, [rt])
1868
AC_CHECK_HEADERS(net/if_dl.h ifaddrs.h netpacket/packet.h)
1869
AC_CHECK_FUNCS([getifaddrs])
1647
1871
dnl ----------------------------------------------------------------------
1648
1872
dnl Checks for features/quirks in the system that affects Erlang.
1649
1873
dnl ----------------------------------------------------------------------
1705
1929
AC_DEFINE(HAVE_PROCESSOR_BIND, 1, [Define if you have processor_bind functionality])
1932
AC_MSG_CHECKING([for cpuset_getaffinity/cpuset_setaffinity])
1934
#include <sys/param.h>
1935
#include <sys/cpuset.h>
1941
CPU_SET(1, &cpuset);
1942
res = cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &cpuset);
1943
res = cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &cpuset);
1944
res = CPU_ISSET(1, &cpuset);
1945
CPU_CLR(1, &cpuset);
1947
cpuset_xetaffinity=yes,
1948
cpuset_xetaffinity=no)
1949
AC_MSG_RESULT([$cpuset_xetaffinity])
1950
if test $cpuset_xetaffinity = yes; then
1951
AC_DEFINE(HAVE_CPUSET_xETAFFINITY, 1, [Define if you have cpuset_getaffinity/cpuset_setaffinity])
1709
1954
AC_CACHE_CHECK([for 'end' symbol],
1710
1955
erts_cv_have_end_symbol,
1857
2102
erts_cv___after_morecore_hook_can_track_malloc=yes,
1858
2103
erts_cv___after_morecore_hook_can_track_malloc=no,
1859
if test "x$erl_xcomp_after_morecore_hook" != "x"; then
1860
erts_cv___after_morecore_hook_can_track_malloc=$erl_xcomp_after_morecore_hook
2105
case X$erl_xcomp_after_morecore_hook in
2106
X) erts_cv___after_morecore_hook_can_track_malloc=cross;;
2107
Xyes|Xno) erts_cv___after_morecore_hook_can_track_malloc=$erl_xcomp_after_morecore_hook;;
2108
*) AC_MSG_ERROR([Bad erl_xcomp_after_morecore_hook value: $erl_xcomp_after_morecore_hook]);;
1863
if test "x$erts_cv___after_morecore_hook_can_track_malloc" = "xyes"; then
1864
AC_DEFINE(ERTS___AFTER_MORECORE_HOOK_CAN_TRACK_MALLOC, 1, \
1865
[Define if __after_morecore_hook can track malloc()s core memory use.])
2113
case $erts_cv___after_morecore_hook_can_track_malloc in
2114
yes) AC_DEFINE(ERTS___AFTER_MORECORE_HOOK_CAN_TRACK_MALLOC, 1, \
2115
[Define if __after_morecore_hook can track malloc()s core memory use.]);;
2116
cross) AC_MSG_WARN([result no guessed because of cross compilation]);;
1868
2120
if test "x$ac_cv_func_sbrk" = "xyes"; then
1869
2121
AC_CACHE_CHECK([types of sbrk()s return value and argument],
2117
2369
erts_cv_brk_wrappers_can_track_malloc=yes,
2118
2370
erts_cv_brk_wrappers_can_track_malloc=no,
2119
erts_cv_brk_wrappers_can_track_malloc=no)])
2120
if test $erts_cv_brk_wrappers_can_track_malloc = yes; then
2372
case X$erl_xcomp_dlsym_brk_wrappers in
2373
X) erts_cv_brk_wrappers_can_track_malloc=cross;;
2374
Xyes|Xno) erts_cv_brk_wrappers_can_track_malloc=$erl_xcomp_dlsym_brk_wrappers;;
2375
*) AC_MSG_ERROR([Bad erl_xcomp_dlsym_brk_wrappers value: $erl_xcomp_dlsym_brk_wrappers]);;
2378
case $erts_cv_brk_wrappers_can_track_malloc in
2121
2380
AC_DEFINE(ERTS_BRK_WRAPPERS_CAN_TRACK_MALLOC, 1, \
2122
[Define if sbrk()/brk() wrappers can track malloc()s core memory use])
2381
[Define if sbrk()/brk() wrappers can track malloc()s core memory use]);;
2383
AC_MSG_WARN([result no guessed because of cross compilation]);;
2126
2388
dnl Restore LIBS
2133
2395
ERL_TIME_CORRECTION
2134
2396
AC_CHECK_PROG(M4, m4, m4)
2135
2397
dnl check to auto-enable hipe here...
2136
if test X${enable_hipe} != Xno; then
2398
if test "$cross_compiling" != "yes" && test X${enable_hipe} != Xno; then
2137
2399
if test -z "$M4"; then
2139
2401
AC_MSG_NOTICE([HiPE disabled as no valid m4 is found in PATH])
2141
2403
case "$ARCH-$OPSYS" in
2142
x86-linux|amd64-linux|ppc-linux|ppc-darwin|arm-linux|amd64-freebsd|x86-freebsd|x86-sol2|amd64-sol2|ultrasparc-linux)
2404
x86-linux|amd64-linux|x86-darwin*|amd64-darwin*|ppc-linux|ppc-darwin|arm-linux|amd64-freebsd|x86-freebsd|x86-sol2|amd64-sol2|ultrasparc-linux)
2143
2405
enable_hipe=yes
2411
case $ARCH-$OPSYS in
2412
amd64-darwin*|x86-darwin*)
2413
AC_MSG_CHECKING([For modern (leopard) style mcontext_t])
2416
#include <sys/types.h>
2418
#include <mach/mach.h>
2419
#include <pthread.h>
2420
#include <machine/signal.h>
2421
#include <ucontext.h>
2423
#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__)
2424
#define __DARWIN__ 1
2431
mcontext_t mc = NULL;
2432
int x = mc->__fs.__fpu_mxcsr;
2435
],darwin_mcontext_leopard=yes,
2436
darwin_mcontext_leopard=no)
2437
if test X"$darwin_mcontext_leopard" = X"yes"; then
2438
AC_DEFINE(DARWIN_MODERN_MCONTEXT,[],[Modern style mcontext_t in MacOSX])
2445
darwin_mcontext_leopard=no
2148
2448
if test X${enable_fp_exceptions} = Xauto ; then
2149
2449
if test X${enable_hipe} = Xyes; then
2150
2450
enable_fp_exceptions=yes
2549
2850
mc->ss.srr0 += 4;
2550
2851
mc->fs.fpscr = 0x80|0x40|0x10;
2854
#if defined(__x86_64__)
2855
mcontext_t mc = uc->uc_mcontext;
2856
struct x86_float_state64_t *fpstate = &mc->fs;
2857
fpstate->fpu_mxcsr = 0x1F80;
2858
*(unsigned short *)&fpstate->fpu_fsw &= ~0xFF;
2859
#elif defined(__i386__)
2860
mcontext_t mc = uc->uc_mcontext;
2861
x86_float_state32_t *fpstate = &mc->fs;
2862
fpstate->fpu_mxcsr = 0x1F80;
2863
*(unsigned short *)&fpstate->fpu_fsw &= ~0xFF;
2864
#elif defined(__ppc__)
2865
mcontext_t mc = uc->uc_mcontext;
2867
mc->fs.fpscr = 0x80|0x40|0x10;
2552
2870
#elif defined(__FreeBSD__) && defined(__x86_64__)
2553
2871
mcontext_t *mc = &uc->uc_mcontext;
2554
2872
struct savefpu *savefpu = (struct savefpu*)&mc->mc_fpstate;
2570
2888
struct fxsave64 *fxsave = uc->sc_fpstate;
2571
2889
fxsave->fx_mxcsr = 0x1F80;
2572
2890
fxsave->fx_fsw &= ~0xFF;
2891
#elif defined(__NetBSD__) && defined(__x86_64__)
2892
mcontext_t *mc = &uc->uc_mcontext;
2893
struct fxsave64 *fxsave = (struct fxsave64 *)&mc->__fpregs;
2894
fxsave->fx_mxcsr = 0x1F80;
2895
fxsave->fx_fsw &= ~0xFF;
2573
2896
#elif defined(__sun__) && defined(__x86_64__)
2574
2897
mcontext_t *mc = &uc->uc_mcontext;
2575
2898
struct fpchip_state *fpstate = &mc->fpregs.fp_reg_set.fpchip_state;
2644
2967
return do_check();
2646
], erl_ok=reliable, erl_ok=unreliable, erl_ok=unreliable)
2647
if test $erl_ok = unreliable; then
2648
AC_DEFINE(NO_FPE_SIGNALS,[],
2649
[Define if floating points exceptions are non-existing/not reliable])
2650
AC_MSG_RESULT([unreliable; testing in software instead])
2973
case X$erl_xcomp_reliable_fpe in
2975
Xyes|Xno) erl_ok=$erl_xcomp_reliable_fpe;;
2976
*) AC_MSG_ERROR([Bad erl_xcomp_reliable_fpe value: $erl_xcomp_reliable_fpe]);;
2980
if test $erl_ok = yes; then
2653
2982
AC_MSG_RESULT(reliable)
2985
AC_MSG_RESULT([unreliable; testing in software instead])
2986
AC_DEFINE(NO_FPE_SIGNALS,[],[Define if floating points exceptions are non-existing/not reliable])
2987
if test $erl_ok = cross; then
2988
AC_MSG_WARN([result unreliable guessed because of cross compilation])
2658
case $ARCH-$OPSYS in
2659
amd64-darwin*|x86-darwin*)
2660
AC_MSG_CHECKING([For modern (leopard) style mcontext_t])
2663
#include <sys/types.h>
2665
#include <mach/mach.h>
2666
#include <pthread.h>
2667
#include <machine/signal.h>
2668
#include <ucontext.h>
2670
#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__)
2671
#define __DARWIN__ 1
2678
mcontext_t mc = NULL;
2679
int x = mc->__fs.__fpu_mxcsr;
2682
],darwin_mcontext_leopard=yes,
2683
darwin_mcontext_leopard=no)
2684
if test X"$darwin_mcontext_leopard" = X"yes"; then
2685
AC_DEFINE(DARWIN_MODERN_MCONTEXT,[],[Modern style mcontext_t in MacOSX])
2692
darwin_mcontext_leopard=no
2815
# Check if we should use elib_malloc.
2818
if test X${enable_elib_malloc} = Xyes; then
2819
AC_DEFINE(ENABLE_ELIB_MALLOC,[],[Define to enable use of elib_malloc (a malloc() replacement)])
2820
AC_DEFINE(ELIB_HEAP_SBRK,[],[Elib sbrk])
2821
AC_DEFINE(ELIB_ALLOC_IS_CLIB,[],[Use elib malloc as clib])
2822
AC_DEFINE(ELIB_SORTED_BLOCKS,[],[Define to enable the use of sorted blocks when using elib_malloc])
2826
3113
# Check for working poll().
2828
3115
AC_MSG_CHECKING([for working poll()])
2829
if test "x$erl_xcomp_poll" != "x"; then
2830
poll_works=$erl_xcomp_poll
3116
if test "x$ac_cv_header_poll_h" != "xyes" -o "x$ac_cv_func_poll" != "xyes"; then
2833
3123
#include <poll.h>
2851
], poll_works=true, poll_works=false, poll_works=false)
3145
case X$erl_xcomp_poll in
3146
X) poll_works=cross;;
3147
Xyes|Xno) poll_works=$erl_xcomp_poll;;
3148
*) AC_MSG_ERROR([Bad erl_xcomp_poll value: $erl_xcomp_poll]);;
2855
AC_DEFINE(ERTS_USE_POLL, 1, [Define if poll() should be used instead of select()])
3154
case $poll_works-$host_os in
2860
3157
# The USE_SELECT define is used by the ssl application (should not
2861
3158
# be used by erts).
2863
3160
AC_DEFINE(USE_SELECT, 1, [Define if select() should be used instead of poll()])
2864
AC_MSG_RESULT(broken or based on select())
3161
if test $poll_works = cross; then
3162
AC_MSG_RESULT(cross)
3163
AC_MSG_WARN([result no guessed based on OS ($host_os) because of cross compilation])
3165
AC_MSG_RESULT([no; non-existing, broken, or based on select()])
3169
AC_DEFINE(ERTS_USE_POLL, 1, [Define if poll() should be used instead of select()])
3170
if test $poll_works = cross; then
3171
AC_MSG_RESULT(cross)
3172
AC_MSG_WARN([result yes guessed based on OS ($host_os) because of cross compilation])
2869
3180
# If kqueue() found, check that it can be selected or polled on...
2871
3182
if test $have_kernel_poll = kqueue; then
2872
if test $poll_works = true; then
3183
if test $poll_works = yes; then
2873
3184
kqueue_with=poll
2875
3186
kqueue_with=select
2993
], copying_putenv=yes, copying_putenv=no, copying_putenv=no)
2994
if test $copying_putenv = yes; then
2995
AC_DEFINE(HAVE_COPYING_PUTENV,[1],[Define if you have a putenv() that stores a copy of the key-value pair])
3321
case X$erl_xcomp_putenv_copy in
3322
X) copying_putenv=cross;;
3323
Xyes|Xno) copying_putenv=$erl_xcomp_putenv_copy;;
3324
*) AC_MSG_ERROR([Bad erl_xcomp_putenv_copy value: $erl_xcomp_putenv_copy]);;
2997
3328
AC_MSG_RESULT($copying_putenv)
3329
case $copying_putenv in
3331
AC_DEFINE(HAVE_COPYING_PUTENV,[1],\
3332
[Define if you have a putenv() that stores a copy of the key-value pair]);;
3334
AC_MSG_WARN([result no guessed because of cross compilation]);;
2999
3338
dnl ----------------------------------------------------------------------
3000
3339
dnl Stuff that should be moved into their respective application
3023
3362
#--------------------------------------------------------------------
3025
DED_INCLUDE="-I${ERL_TOP}/erts/emulator/beam -I${ERL_TOP}/erts/include -I${ERL_TOP}/erts/include/$host"
3364
DED_SYS_INCLUDE="-I${ERL_TOP}/erts/emulator/beam -I${ERL_TOP}/erts/include -I${ERL_TOP}/erts/include/$host -I${ERL_TOP}/erts/include/internal -I${ERL_TOP}/erts/include/internal/$host -I${ERL_TOP}/erts/emulator/sys/$ERLANG_OSTYPE"
3027
DED_CFLAGS="$DED_INCLUDE $CFLAGS $CPPFLAGS $EMU_THR_DEFS"
3366
if test "X$ETHR_DEFS" = "X"; then
3367
DED_THR_DEFS="-D_THREAD_SAFE -D_REENTRANT"
3369
DED_THR_DEFS="$ETHR_DEFS"
3371
DED_EMU_THR_DEFS=$EMU_THR_DEFS
3372
DED_CFLAGS="$CFLAGS $CPPFLAGS"
3028
3373
if test "x$GCC" = xyes; then
3029
3374
DED_CFLAGS="$DED_CFLAGS -fPIC"
3379
win32) DED_EXT=dll;;
3381
DED_CFLAGS="$DED_CFLAGS -fno-common"
3382
if test "X$STATIC_CFLAGS" = "X"; then
3383
STATIC_CFLAGS="-mdynamic-no-pic"
3034
# If DED_LD is set in environment, we expect all DED variables to be specified
3389
# If DED_LD is set in environment, we expect all DED_LD* variables
3390
# to be specified (cross compiling)
3036
3391
if test "x$DED_LD" = "x"; then
3038
if test "x$LD" = "x"; then
3043
3393
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="-R"
3045
3394
case $host_os in
3048
3397
DED_LDFLAGS="-dll"
3049
3398
DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
3078
3427
if test X${enable_darwin_universal} = Xyes; then
3079
3428
DED_LDFLAGS="-arch ppc -arch i386 $DED_LDFLAGS"
3081
DED_CFLAGS="$DED_CFLAGS -fno-common"
3083
DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
3084
STATIC_CFLAGS="-mdynamic-no-pic"
3431
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
3435
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
3088
3436
DED_LDFLAGS="-shared -Wl,-Bsymbolic"
3089
DED_LD_FLAG_RUNTIME_LIBRARY_PATH=
3090
3437
if test X${enable_m64_build} = Xyes; then
3091
3438
DED_LDFLAGS="-m64 $DED_LDFLAGS"
3440
if test X${enable_m32_build} = Xyes; then
3441
DED_LDFLAGS="-m32 $DED_LDFLAGS"
3446
DED_LD_FLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
3096
3447
DED_LDFLAGS="-shared"
3097
3448
if test X${enable_m64_build} = Xyes; then
3098
3449
DED_LDFLAGS="-m64 $DED_LDFLAGS"
3451
if test X${enable_m32_build} = Xyes; then
3452
DED_LDFLAGS="-m32 $DED_LDFLAGS"
3151
3517
AC_SUBST(SSL_INCLUDE)
3152
3518
AC_SUBST(SSL_ROOT)
3153
3519
AC_SUBST(SSL_LIBDIR)
3520
AC_SUBST(SSL_CC_RUNTIME_LIBRARY_PATH)
3521
AC_SUBST(SSL_LD_RUNTIME_LIBRARY_PATH)
3522
AC_SUBST(SSL_DED_LD_RUNTIME_LIBRARY_PATH)
3154
3523
AC_SUBST(SSL_DYNAMIC_ONLY)
3155
3524
AC_SUBST(SSL_LINK_WITH_KERBEROS)
3156
3525
AC_SUBST(STATIC_KERBEROS_LIBS)
3157
3526
AC_SUBST(SSL_LINK_WITH_ZLIB)
3158
3527
AC_SUBST(STATIC_ZLIB_LIBS)
3159
AC_SUBST(OPENSSL_CMD)
3529
std_ssl_locations="/usr/local /usr/sfw /opt/local /usr /usr/pkg /usr/local/openssl /usr/lib/openssl /usr/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl"
3161
3531
AC_ARG_WITH(ssl-zlib,
3162
[ --with-ssl-zlib=PATH specify location of ZLib to be used by OpenSSL
3163
--with-ssl-zlib link SSL with Zlib (default if found)
3164
--without-ssl-zlib don't link SSL with ZLib])
3532
AS_HELP_STRING([--with-ssl-zlib=PATH],
3533
[specify location of ZLib to be used by OpenSSL])
3534
AS_HELP_STRING([--with-ssl-zlib],
3535
[link SSL with Zlib (default if found)])
3536
AS_HELP_STRING([--without-ssl-zlib],
3537
[don't link SSL with ZLib]))
3167
3540
if test "x$with_ssl_zlib" = "xno"; then
3168
3541
SSL_LINK_WITH_ZLIB=no
3169
3542
STATIC_ZLIB_LIBS=
3170
elif test "x$with_ssl_zlib" = "xyes" -o "x$with_ssl_zlib" = "x" ;then
3171
if test "x$MIXED_CYGWIN" = "xyes"; then
3543
elif test "x$with_ssl_zlib" = "xyes" || test "x$with_ssl_zlib" = "x"; then
3544
if test $erl_xcomp_without_sysroot = yes; then
3545
AC_MSG_WARN([Cannot search for zlib; missing cross system root (erl_xcomp_sysroot).])
3546
SSL_LINK_WITH_ZLIB=no
3548
elif test "x$MIXED_CYGWIN" = "xyes"; then
3172
3549
SSL_LINK_WITH_ZLIB=no
3173
3550
STATIC_ZLIB_LIBS=
3175
3552
SSL_LINK_WITH_ZLIB=no
3176
3553
STATIC_ZLIB_LIBS=
3177
3554
AC_MSG_CHECKING(for static ZLib to be used by SSL in standard locations)
3178
for dir in /usr/local /usr/sfw /usr /usr/pkg \
3179
/usr/local/openssl /usr/lib/openssl /usr/openssl \
3180
/usr/local/ssl /usr/lib/ssl /usr/ssl
3555
for rdir in $std_ssl_locations; do
3556
dir="$erl_xcomp_sysroot$rdir"
3182
3557
if test "x$ac_cv_sizeof_void_p" = "x8"; then
3183
3558
if test -f "$dir/lib64/libz.a"; then
3184
3559
SSL_LINK_WITH_ZLIB=yes
3230
3605
AC_ARG_WITH(ssl,
3231
[ --with-ssl=PATH specify location of OpenSSL include and lib
3232
--with-ssl use SSL (default)
3233
--without-ssl don't use SSL])
3606
AS_HELP_STRING([--with-ssl=PATH], [specify location of OpenSSL include and lib])
3607
AS_HELP_STRING([--with-ssl], [use SSL (default)])
3608
AS_HELP_STRING([--without-ssl], [don't use SSL]))
3235
3610
AC_ARG_ENABLE(dynamic-ssl-lib,
3236
[ --enable-dynamic-ssl-lib enable using dynamic openssl libraries
3237
--disable-dynamic-ssl-lib disable using dynamic openssl libraries],
3611
AS_HELP_STRING([--disable-dynamic-ssl-lib],
3612
[disable using dynamic openssl libraries]),
3238
3613
[ case "$enableval" in
3239
3614
no) enable_dynamic_ssl=no ;;
3240
3615
*) enable_dynamic_ssl=yes ;;
3260
3635
SSL_DYNAMIC_ONLY=$enable_dynamic_ssl
3262
if test "x$with_ssl" = "xno"; then
3637
case "$erl_xcomp_without_sysroot-$with_ssl" in
3642
if test "$with_ssl" = "no"; then
3643
skip="User gave --without-ssl option"
3645
skip="Cannot search for ssl; missing cross system root (erl_xcomp_sysroot)."
3266
3647
for a in ssl crypto ssh; do
3267
echo "User gave --without-ssl option" > $ERL_TOP/lib/$a/SKIP
3648
echo "$skip" > $ERL_TOP/lib/$a/SKIP
3269
elif test "x$with_ssl" = "xyes" -o "x$with_ssl" = "x" ;then
3270
3652
# On windows, we could try to find the installation
3271
3653
# of Shining Light OpenSSL, which can be found by poking in
3272
3654
# the uninstall section in the registry, it's worth a try...
3295
3677
AC_MSG_CHECKING(for OpenSSL >= 0.9.7 in standard locations)
3296
for dir in $extra_dir /cygdrive/c/OpenSSL \
3297
/usr/local /usr/sfw /opt/local /usr /usr/pkg \
3298
/usr/local/openssl /usr/lib/openssl /usr/openssl \
3299
/usr/local/ssl /usr/lib/ssl /usr/ssl
3301
if test -f $dir/include/openssl/opensslv.h; then
3678
for rdir in $extra_dir /cygdrive/c/OpenSSL $std_ssl_locations; do
3679
dir="$erl_xcomp_sysroot$rdir"
3680
if test -f "$erl_xcomp_isysroot$rdir/include/openssl/opensslv.h"; then
3302
3681
is_real_ssl=yes
3303
3682
SSL_ROOT="$dir"
3304
3683
if test "x$MIXED_CYGWIN" = "xyes" ; then
3305
if test -f "$dir/lib/VC/ssleay32.lib" -o \
3306
-f "$dir/lib/VC/openssl.lib"; then
3684
if test -f "$dir/lib/VC/ssleay32.lib" || \
3685
test -f "$dir/lib/VC/openssl.lib"; then
3686
SSL_RUNTIME_LIBDIR="$rdir/lib/VC"
3307
3687
SSL_LIBDIR="$dir/lib/VC"
3308
elif test -f "$dir/lib/ssleay32.lib" -o \
3309
-f "$dir/lib/openssl.lib"; then
3688
elif test -f "$dir/lib/ssleay32.lib" || \
3689
test -f "$dir/lib/openssl.lib"; then
3690
SSL_RUNTIME_LIBDIR="$rdir/lib"
3310
3691
SSL_LIBDIR="$dir/lib"
3315
3696
if test "x$ac_cv_sizeof_void_p" = "x8"; then
3316
3697
if test -f "$dir/lib64/libcrypto.a"; then
3698
SSL_RUNTIME_LIBDIR="$rdir/lib64"
3317
3699
SSL_LIBDIR="$dir/lib64"
3318
3700
elif test -f "$dir/lib/64/libcrypto.a"; then
3701
SSL_RUNTIME_LIBDIR="$rdir/lib/64"
3319
3702
SSL_LIBDIR="$dir/lib/64"
3320
3703
elif test -f "$dir/lib64/libcrypto.so"; then
3704
SSL_RUNTIME_LIBDIR="$rdir/lib64"
3321
3705
SSL_LIBDIR="$dir/lib64"
3322
3706
elif test -f "$dir/lib/64/libcrypto.so"; then
3707
SSL_RUNTIME_LIBDIR="$rdir/lib/64"
3323
3708
SSL_LIBDIR="$dir/lib/64"
3710
SSL_RUNTIME_LIBDIR="$rdir/lib"
3325
3711
SSL_LIBDIR="$dir/lib"
3714
SSL_RUNTIME_LIBDIR="$rdir/lib"
3328
3715
SSL_LIBDIR="$dir/lib"
3331
3718
if test '!' -f $SSL_LIBDIR/libcrypto.a; then
3332
3719
SSL_DYNAMIC_ONLY=yes
3334
SSL_BINDIR="$dir/bin"
3335
dnl Should one use EXEEXT or ac_exeext?
3336
if test -f "$SSL_BINDIR/openssl$EXEEXT"; then
3337
if "$SSL_BINDIR/openssl" version > /dev/null 2>&1; then
3338
OPENSSL_CMD="$SSL_BINDIR/openssl"
3721
SSL_BINDIR="$rdir/bin"
3345
3722
if test "x$is_real_ssl" = "xyes" ; then
3346
3723
SSL_INCLUDE="-I$dir/include"
3347
3724
old_CPPFLAGS=$CPPFLAGS
3397
3774
case $host_os in
3399
if test -f /usr/include/openssl/opensslv.h; then
3776
if test -f "$erl_xcomp_isysroot/usr/include/openssl/opensslv.h"; then
3400
3777
# Trust OpenBSD to have everything the in the correct locations.
3402
3779
ssl_linkable=yes
3403
SSL_ROOT="/usr/sbin"
3780
SSL_ROOT="$erl_xcomp_sysroot/usr"
3404
3781
AC_MSG_RESULT([$SSL_ROOT])
3782
SSL_RUNTIME_LIB="/usr/lib"
3783
SSL_LIB="$erl_xcomp_sysroot/usr/lib"
3406
3784
SSL_BINDIR="/usr/sbin"
3407
OPENSSL_CMD="$SSL_BINDIR/openssl"
3408
3785
dnl OpenBSD requires us to link with -L and -l
3409
3786
SSL_DYNAMIC_ONLY="yes"
3462
3839
echo "No usable OpenSSL found" > $ERL_TOP/lib/$a/SKIP
3466
3844
# Option given with PATH to package
3467
3845
if test ! -d "$with_ssl" ; then
3468
3846
AC_MSG_ERROR(Invalid path to option --with-ssl=PATH)
3470
3848
SSL_ROOT="$with_ssl"
3471
if test "x$MIXED_CYGWIN" = "xyes" -a -d "$with_ssl/lib/VC"; then
3849
if test "x$MIXED_CYGWIN" = "xyes" && test -d "$with_ssl/lib/VC"; then
3472
3850
SSL_LIBDIR="$with_ssl/lib/VC"
3473
3851
elif test "x$ac_cv_sizeof_void_p" = "x8"; then
3474
3852
if test -f "$with_ssl/lib64/libcrypto.a"; then
3509
3891
AC_MSG_RESULT([yes])
3510
3892
ssl_krb5_enabled=yes
3511
3893
if test "x$SSL_DYNAMIC_ONLY" != "xyes"; then
3512
if test -f $SSL_LIBDIR/libkrb5.a; then
3894
if test -f "$SSL_LIBDIR/libkrb5.a"; then
3513
3895
SSL_LINK_WITH_KERBEROS=yes
3514
3896
STATIC_KERBEROS_LIBS="$SSL_LIBDIR/libkrb5.a"
3515
if test -f $SSL_LIBDIR/libkrb5support.a; then
3897
if test -f "$SSL_LIBDIR/libkrb5support.a"; then
3516
3898
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libkrb5support.a"
3518
if test -f $SSL_LIBDIR/libk5crypto.a; then
3900
if test -f "$SSL_LIBDIR/libk5crypto.a"; then
3519
3901
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libk5crypto.a"
3521
if test -f $SSL_LIBDIR/libresolv.a; then
3903
if test -f "$SSL_LIBDIR/libresolv.a"; then
3522
3904
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libresolv.a"
3524
if test -f $SSL_LIBDIR/libcom_err.a; then
3906
if test -f "$SSL_LIBDIR/libcom_err.a"; then
3525
3907
STATIC_KERBEROS_LIBS="$STATIC_KERBEROS_LIBS $SSL_LIBDIR/libcom_err.a"
3547
3929
SSL_KRB5_INCLUDE=
3548
3930
if test "x$ssl_krb5_enabled" = "xyes" ; then
3549
3931
AC_MSG_CHECKING(for krb5.h in standard locations)
3550
for dir in $extra_dir $SSL_ROOT/include $SSL_ROOT/include/openssl \
3551
$SSL_ROOT/include/kerberos /cygdrive/c/kerberos/include \
3552
/usr/local/kerberos/include /usr/kerberos/include \
3932
for dir in $extra_dir "$SSL_ROOT/include" "$SSL_ROOT/include/openssl" \
3933
"$SSL_ROOT/include/kerberos" \
3934
"$erl_xcomp_isysroot/cygdrive/c/kerberos/include" \
3935
"$erl_xcomp_isysroot/usr/local/kerberos/include" \
3936
"$erl_xcomp_isysroot/usr/kerberos/include" \
3937
"$erl_xcomp_isysroot/usr/include"
3555
3939
if test -f "$dir/krb5.h" ; then
3556
3940
SSL_KRB5_INCLUDE="$dir"
3576
3960
done # while test ssl_done != yes
3962
SSL_CC_RUNTIME_LIBRARY_PATH=
3963
SSL_LD_RUNTIME_LIBRARY_PATH=
3964
SSL_DED_LD_RUNTIME_LIBRARY_PATH=
3965
cc_rflg="$CFLAG_RUNTIME_LIBRARY_PATH"
3966
ld_rflg="$LDFLAG_RUNTIME_LIBRARY_PATH"
3967
ded_ld_rflg="$DED_LD_FLAG_RUNTIME_LIBRARY_PATH"
3969
if test "$SSL_APP" != "" && test "$SSL_DYNAMIC_ONLY" = "yes" && \
3970
{ test "$cc_rflg" != "" || test "$ld_rflg" != "" || test "$ded_ld_rflg" != ""; } ; then
3972
AC_MSG_CHECKING(for ssl runtime library path to use)
3976
if test "$ac_cv_sizeof_void_p" = "8"; then
3980
case "$SSL_RUNTIME_LIBDIR" in
3981
*/lib/64 | */lib/64/ ) dir_lib_64=yes;;
3982
*/lib64 | */lib64/ ) dir_lib64=yes;;
3986
for dir in $std_ssl_locations; do
3987
test $dir_lib_64 = no &&
3988
test -d "$erl_xcomp_sysroot$dir/lib/64" &&
3990
test $dir_lib64 = no &&
3991
test -d "$erl_xcomp_sysroot$dir/lib64" &&
3995
test $dir_lib_64 = yes && libdirs="/lib/64 $libdirs"
3996
test $dir_lib64 = yes && libdirs="/lib64 $libdirs"
3999
for type in std x_std curr; do
4001
cc_rpath="$cc_rflg$SSL_RUNTIME_LIBDIR"
4002
ld_rpath="$ld_rflg$SSL_RUNTIME_LIBDIR"
4003
ded_ld_rpath="$ded_ld_rflg$SSL_RUNTIME_LIBDIR"
4004
rpath="$SSL_RUNTIME_LIBDIR"
4006
if test $type != curr; then
4007
for ldir in $libdirs; do
4008
for dir in $std_ssl_locations; do
4009
test "$SSL_LIBDIR" != "$dir$ldir" || continue
4010
test $type != x_std || test -d "$dir$ldir" || continue
4011
test "$cc_rflg" = "" ||
4012
cc_rpath="$cc_rpath $cc_rflg$dir$ldir"
4013
test "$ld_rflg" = "" ||
4014
ld_rpath="$ld_rpath $ld_rflg$dir$ldir"
4015
test "$ded_ld_rflg" = "" ||
4016
ded_ld_rpath="$ded_ld_rpath $ded_ld_rflg$dir$ldir"
4017
rpath="$rpath:$dir$ldir"
4022
saveCFLAGS="$CFLAGS"
4023
saveLDFLAGS="$LDFLAGS"
4025
CFLAGS="$CFLAGS $SSL_INCLUDE"
4026
LDFLAGS="$LDFLAGS $ld_rpath -L$SSL_LIBDIR"
4030
#include <openssl/hmac.h>
4036
[rpath_success=yes],
4038
CFLAGS="$saveCFLAGS"
4039
LDFLAGS="$saveLDFLAGS"
4042
test "$rpath_success" = "yes" && break
4045
test "$rpath_success" = "yes" || { cc_rpath=; ld_rpath=; ded_ld_rpath=; rpath=; }
4047
SSL_CC_RUNTIME_LIBRARY_PATH="$cc_rpath"
4048
SSL_LD_RUNTIME_LIBRARY_PATH="$ld_rpath"
4049
SSL_DED_LD_RUNTIME_LIBRARY_PATH="$ded_ld_rpath"
4051
AC_MSG_RESULT([$rpath])
4052
test "$rpath" != "" || AC_MSG_WARN([Cannot set run path during linking])
3578
4055
#--------------------------------------------------------------------
3579
4056
# Os mon stuff.
3580
4057
#--------------------------------------------------------------------
3604
4086
/bin/rm -f $ERL_TOP/lib/$a/SKIP
3607
AC_CHECK_PROGS(JAVAC, javac.sh javac guavac gcj jikes bock)
4089
if test "X$with_javac" = "Xno"; then
4090
for a in $need_java ; do
4091
echo "Java compiler disabled by user" > $ERL_TOP/lib/$a/SKIP
4094
else # begin - try to find javac
4096
if test "X$with_javac" != "Xyes" -a "X$with_javac" != "X"; then
4097
check_javac=$with_javac
4099
check_javac="javac.sh javac guavac gcj jikes bock"
4102
AC_CHECK_PROGS(JAVAC, $check_javac)
3608
4103
if test -n "$JAVAC"; then
3609
4104
dnl Make sure it's at least JDK 1.5
3610
4105
AC_CACHE_CHECK(for JDK version 1.5,
4126
fi # end - try to find javac
3627
4129
dnl Orber has a c++ example, this isn't the right way to check for
3628
4130
dnl it, but....
3631
4132
AC_SUBST(CXXFLAGS)
3632
4133
dnl this deliberately does not believe that 'gcc' is a C++ compiler
3633
AC_CHECK_PROGS(CXX, $CCC c++ g++ CC cxx cc++ cl, false)
4134
AC_CHECK_TOOLS(CXX, [$CCC c++ g++ CC cxx cc++ cl], false)
3635
4136
# Remove SKIP file from previous run
3636
4137
/bin/rm -f $ERL_TOP/lib/orber/SKIP
3762
4263
../lib/ic/c_src/$host/Makefile:../lib/ic/c_src/Makefile.in
3763
4264
../lib/os_mon/c_src/$host/Makefile:../lib/os_mon/c_src/Makefile.in
3764
4265
../lib/ssl/c_src/$host/Makefile:../lib/ssl/c_src/Makefile.in
3765
../lib/ssl/examples/certs/$host/Makefile:../lib/ssl/examples/certs/Makefile.in
3766
4266
../lib/crypto/c_src/$host/Makefile:../lib/crypto/c_src/Makefile.in
3767
4267
../lib/orber/c_src/$host/Makefile:../lib/orber/c_src/Makefile.in
3768
4268
../lib/runtime_tools/c_src/$host/Makefile:../lib/runtime_tools/c_src/Makefile.in
3769
4269
../lib/tools/c_src/$host/Makefile:../lib/tools/c_src/Makefile.in
3770
../lib/asn1/c_src/$host/Makefile:../lib/asn1/c_src/Makefile.in