-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathaclocal.m4
143 lines (133 loc) · 3.66 KB
/
aclocal.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
AC_DEFUN([CHECK_SNET],
[
AC_MSG_CHECKING(for snet)
snetdir="libsnet"
AC_ARG_WITH(snet,
AC_HELP_STRING([--with-snet=DIR], [path to snet]),
snetdir="$withval")
if test -f "$snetdir/snet.h"; then
found_snet="yes";
CPPFLAGS="$CPPFLAGS -I$snetdir";
fi
if test x_$found_snet != x_yes; then
AC_MSG_ERROR(cannot find snet libraries)
else
LIBS="$LIBS -lsnet";
LDFLAGS="$LDFLAGS -L$snetdir";
fi
AC_MSG_RESULT(yes)
])
AC_DEFUN([CHECK_SSL],
[
AC_MSG_CHECKING(for ssl)
ssldirs="/usr/local/openssl /usr/lib/openssl /usr/openssl \
/usr/local/ssl /usr/lib/ssl /usr/ssl \
/usr/pkg /usr/local /usr /sw /opt/sw"
AC_ARG_WITH(ssl,
AC_HELP_STRING([--with-ssl=DIR], [path to ssl]),
ssldirs="$withval")
for dir in $ssldirs; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
found_ssl="yes";
CPPFLAGS="$CPPFLAGS -I$ssldir/include";
break;
fi
if test -f "$dir/include/ssl.h"; then
found_ssl="yes";
CPPFLAGS="$CPPFLAGS -I$ssldir/include";
break
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_ERROR(cannot find ssl libraries)
else
AC_DEFINE(HAVE_LIBSSL)
LIBS="$LIBS -lssl -lcrypto";
LDFLAGS="$LDFLAGS -L$ssldir/lib";
fi
AC_MSG_RESULT(yes)
])
AC_DEFUN([CHECK_ZLIB],
[
AC_MSG_CHECKING(for zlib)
zlibdirs="/usr /usr/local /sw /opt/sw"
withval=""
AC_ARG_WITH(zlib,
[AC_HELP_STRING([--with-zlib=DIR], [path to zlib])],
[])
if test x_$withval != x_no; then
if test x_$withval != x_yes -a \! -z "$withval"; then
zlibdirs="$withval"
fi
for dir in $zlibdirs; do
zlibdir="$dir"
if test -f "$dir/include/zlib.h"; then
found_zlib="yes";
break;
fi
done
if test x_$found_zlib = x_yes; then
if test "$dir" != "/usr"; then
CPPFLAGS="$CPPFLAGS -I$zlibdir/include";
LDFLAGS="$LDFLAGS -L$zlibdir/lib";
ac_configure_args="$ac_configure_args --with-zlib=$dir";
fi
LIBS="$LIBS -lz";
AC_DEFINE(HAVE_ZLIB)
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
else
ac_configure_args="$ac_configure_args --with-zlib=no";
AC_MSG_RESULT(no)
fi
])
AC_DEFUN([SET_NO_SASL],
[
ac_configure_args="$ac_configure_args --with-sasl=no";
AC_MSG_RESULT(Disabled SASL)
])
AC_DEFUN([CHECK_UNIVERSAL_BINARIES],
[
AC_ARG_ENABLE(universal_binaries,
AC_HELP_STRING([--enable-universal-binaries], [build universal binaries (default=no)]),
,[enable_universal_binaries=no])
if test "${enable_universal_binaries}" = "yes"; then
case "${host_os}" in
darwin8*)
macosx_sdk="MacOSX10.4u.sdk"
arches="-arch i386 -arch ppc"
;;
darwin9*|darwin10*|darwin11*)
dep_target="-mmacosx-version-min=10.4"
macosx_sdk="MacOSX10.5.sdk"
arches="-arch i386 -arch x86_64 -arch ppc -arch ppc64"
LDFLAGS="$LDFLAGS -L/Developer/SDKs/$macosx_sdk/usr/lib"
;;
*)
AC_MSG_ERROR([Building universal binaries on ${host_os} is not supported])
;;
esac
echo ===========================================================
echo Setting up universal binaries for ${host_os}
echo ===========================================================
OPTOPTS="$OPTOPTS -isysroot /Developer/SDKs/$macosx_sdk $dep_target $arches"
fi
])
AC_DEFUN([MACOSX_MUTE_DEPRECATION_WARNINGS],
[
dnl Lion deprecates a system-provided OpenSSL. Build output
dnl is cluttered with useless deprecation warnings.
AS_IF([test x"$CC" = x"gcc"], [
case "${host_os}" in
darwin11*)
AC_MSG_NOTICE([muting deprecation warnings from compiler])
OPTOPTS="$OPTOPTS -Wno-deprecated-declarations"
;;
*)
;;
esac
])
])