42 |
LIBS="$pthread_libs $LIBS" |
LIBS="$pthread_libs $LIBS" |
43 |
fi |
fi |
44 |
|
|
45 |
|
# Check for ssl (take from the stunnel project) |
46 |
|
checkssldir() { : |
47 |
|
if test -f "$1/include/openssl/ssl.h"; then |
48 |
|
#AC_DEFINE([HAVE_OPENSSL]) |
49 |
|
ssldir="$1" |
50 |
|
return 0 |
51 |
|
fi |
52 |
|
if test -f "$1/include/ssl.h"; then |
53 |
|
ssldir="$1" |
54 |
|
return 0 |
55 |
|
fi |
56 |
|
return 1 |
57 |
|
} |
58 |
|
|
59 |
|
# Check for SSL directory (take from the stunnel project) |
60 |
|
AC_MSG_CHECKING([for SSL directory]) |
61 |
|
AC_ARG_WITH(ssl, |
62 |
|
[ --with-ssl=DIR location of installed SSL libraries/include files], |
63 |
|
[ |
64 |
|
dnl Check the specified localtion only |
65 |
|
checkssldir "$withval" |
66 |
|
], |
67 |
|
[ |
68 |
|
dnl Search default localtions of SSL library |
69 |
|
for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do |
70 |
|
for dir in $maindir $maindir/openssl $maindir/ssl; do |
71 |
|
checkssldir $dir && break 2 |
72 |
|
done |
73 |
|
done |
74 |
|
] |
75 |
|
) |
76 |
|
if test -z "$ssldir"; then |
77 |
|
AC_MSG_RESULT([Not found]) |
78 |
|
echo |
79 |
|
echo "Couldn't find your SSL library installation dir" |
80 |
|
echo "Use --with-ssl option to fix this problem" |
81 |
|
echo |
82 |
|
exit 1 |
83 |
|
fi |
84 |
|
AC_MSG_RESULT([$ssldir]) |
85 |
|
AC_SUBST(ssldir) |
86 |
|
#AC_DEFINE_UNQUOTED([ssldir], "$ssldir") |
87 |
|
|
88 |
|
# Add SSL includes and libraries |
89 |
|
if test "$ssldir" |
90 |
|
then |
91 |
|
CFLAGS="$CFLAGS -I$ssldir/include" |
92 |
|
LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto" |
93 |
|
fi |
94 |
|
|
95 |
|
|
96 |
# Checks for header files. |
# Checks for header files. |
97 |
AC_HEADER_STDC |
AC_HEADER_STDC |
98 |
AC_HEADER_SYS_WAIT |
AC_HEADER_SYS_WAIT |