-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
79 lines (65 loc) · 2.48 KB
/
configure.ac
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
AC_INIT
AC_CONFIG_SRCDIR([main.c])
AC_PROG_CC
AC_LANG([C])
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_EGREP
AC_SYS_LARGEFILE
AC_ARG_WITH(libuseful, [ --with-libuseful use system-wide libUseful (default=auto) ], cf_system_libuseful=$withval )
AC_ARG_ENABLE(ssl, [ --enable-ssl only needed if statically linked libuseful is linked against openssl ], cf_use_ssl=$enableval, cf_use_ssl="no" )
AC_ARG_ENABLE(zlib, [ --enable-zlib only needed if statically linked libuseful is linked against zlib], cf_use_zlib=$enableval, cf_use_zlib="no")
AC_CHECK_FUNCS(prctl)
AC_CHECK_HEADERS([sys/prctl.h])
if test "$cf_system_libuseful" != "no"
then
AC_CHECK_LIB([Useful-5],GetToken,[cf_have_libUseful5=yes],[cf_have_libUseful5=no])
if test "$cf_have_libUseful5" = "yes"
then
AC_CHECK_HEADERS([libUseful-5/libUseful.h])
else
AC_CHECK_LIB([Useful-4],GetToken,[cf_have_libUseful4=yes],[cf_have_libUseful4=no])
AC_CHECK_HEADERS([libUseful-4/libUseful.h])
fi
fi
if test "$cf_have_libUseful5" = "yes"
then
echo "installed libUseful-5 found, using that instead of bundled libUseful."
echo "if you want to use bundled libUseful, force it with --with-libuseful=no"
AC_SUBST(LIBUSEFUL_BUNDLED,"")
AC_DEFINE(HAVE_LIBUSEFUL5)
dnl Default behavior of AC_CHECK_LIB is to add the library to the LIBS variable
dnl previous AC_CHECK_LIB don't do this, because an action is supplied for them
AC_CHECK_LIB([Useful-5],GetToken)
cf_use_ssl="yes"
elif test "$cf_have_libUseful4" = "yes"
then
echo "installed libUseful-4 found, using that instead of bundled libUseful."
echo "if you want to use bundled libUseful, force it with --with-libuseful=no"
AC_SUBST(LIBUSEFUL_BUNDLED,"")
AC_DEFINE(HAVE_LIBUSEFUL4)
dnl Default behavior of AC_CHECK_LIB is to add the library to the LIBS variable
dnl previous AC_CHECK_LIB don't do this, because an action is supplied for them
AC_CHECK_LIB([Useful-4],GetToken)
cf_use_ssl="yes"
else
AC_DEFINE(HAVE_LIBUSEFUL5)
AC_SUBST(LIBUSEFUL_BUNDLED,"libUseful-5/libUseful.a")
AC_CONFIG_SUBDIRS([libUseful-5])
fi
if test "$cf_use_ssl" = "yes"
then
dnl openssl isn't really needed, but if it exists and we're using a system-wide libUseful, then that will
dnl likely be linked against it
AC_CHECK_LIB(ssl,SSL_library_init,,)
AC_CHECK_LIB(ssl,OPENSSL_init_ssl,,)
AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init,,)
cf_use_zlib="yes"
fi
if test "$cf_use_zlib" = "yes"
then
AC_CHECK_LIB(z,deflate,,)
fi
dnl read Makefile.in and write Makefile
AC_CONFIG_FILES([Makefile])
AC_OUTPUT