forked from RNCryptor/RNCryptor-C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
executable file
·160 lines (132 loc) · 3.54 KB
/
configure.in
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
dnl --------------------------------------------------------------------
dnl Process this file with autoconf to produce a configure script.
dnl muquit@muquit.com Feb-08-2014
dnl --------------------------------------------------------------------
AC_INIT(rncryptor_c.h)
AC_PROG_RANLIB
AC_PROG_MAKE_SET
dnl Checks for programs.
AC_PROG_CC
test "$GCC" = yes && CFLAGS="$CFLAGS -Wall"
AC_PROG_INSTALL
AC_CANONICAL_HOST
dnl I hate config.h. I like to see all the defines while compiling
dnl AC_CONFIG_HEADERS(config.h)
AC_STDC_HEADERS
AC_CHECK_HEADERS(string.h strings.h memory.h malloc.h unistd.h ctype.h)
AC_CHECK_HEADERS(stdint.h sys/types.h stdlib.h fcntl.h sys/file.h)
AC_CHECK_HEADERS(limits.h sys/syslimits.h)
AC_PATH_TOOL([STRIP], [strip])
AC_CHECK_FUNC(rand_r, AC_DEFINE(HAVE_RAND_R))
AC_CHECK_FUNCS(socket)
AC_CHECK_FUNC(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO))
AC_SEARCH_LIBS([clock_gettime], [rt])
PAM_LIBDIR=/lib
case "$host" in
[i[3456]86-*])
AC_CHECK_SIZEOF([void *])
if test $ac_cv_sizeof_void_p = 8; then
arch=x86_64
PAM_LIBDIR=/lib64
else
arch=x86_32
fi
;;
x86_64-*|amd64-*)
AC_CHECK_SIZEOF([void *])
if test $ac_cv_sizeof_void_p = 8; then
arch=x86_64
PAM_LIBDIR=/lib64
else
arch=x86_32
fi
;;
alpha*-*)
arch=alpha
;;
powerpc-*|powerpc64-*)
arch=powerpc
;;
mips-*|mipsel-*|mips64-*|mips64el-*)
arch=mips
;;
ia64-*)
PAM_LIBDIR=/lib64
arch=ia64
;;
*)
arch=unknown
;;
esac
AC_MSG_CHECKING([architecture type])
AC_MSG_RESULT($arch)
AC_SUBST(PAM_LIBDIR)
OPENSSL_LIBS=""
AC_MSG_CHECKING(for OpenSSL)
OPENSSL_DO_IT_ALL
if test ."$OPENSSL_DIR" != . -a ."$OPENSSL_INC" != . -a ."$OPENSSL_LIBS" != . ; then
AC_DEFINE(HAVE_OPENSSL)
AC_MSG_RESULT(yes)
use_open_ssl="yes"
MKEY_HEX="a02abc222"
OPENSSL_LIBS="-L$OPENSSL_DIR/lib -lssl -lcrypto"
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([no OpenSSL found.
Specify Path of OpenSSL with --with-openssl
Example:
--with-openssl=/usr
--with-openssl=/usr/local/ssl
--with-openssl=/usr/local/foo
etc.])
fi
DL_LIB=""
if test ".$use_open_ssl" = ".yes"; then
dnl following borrowed from bind 9.3.2's configure.in
AC_MSG_CHECKING(whether linking with OpenSSL requires -ldl)
AC_TRY_LINK([
#include <openssl/err.h>],
[ DSO_METHOD_dlfcn(); ],
[AC_MSG_RESULT(no)],
[LIBS="$LIBS $OPENSSL_LIBS -ldl"
AC_TRY_LINK([
#include <openssl/err.h>
],[ DSO_METHOD_dlfcn(); ],
[AC_MSG_RESULT(yes)
OPENSSL_LIBS="-L$OPENSSL_DIR/lib -lssl -lcrypto -ldl"
],
[AC_MSG_RESULT(unknown)
AC_MSG_RESULT(OpenSSL has unsupported dynamic loading)],
[AC_MSG_RESULT(assuming it does work on target platform)])
],
[AC_MSG_RESULT(assuming it does work on target platform)]
)
fi
AC_SUBST(OPENSSL_LIBS)
AC_SUBST(DL_LIB)
AC_PATH_PROG(AR, ar)
ARFLAGS="cruv"
AC_SUBST(AR)
AC_SUBST(ARFLAGS)
PWD=`pwd`
LIBMUTILS_DIR=$PWD/libs/libmutils
AC_SUBST(LIBMUTILS_DIR)
LIBSLL_DIR=$PWD/libs/libsll
AC_SUBST(LIBSLL_DIR)
LIBEVENT2_DIR=$PWD/libs/libevent2
AC_SUBST(LIBEVENT2_DIR)
LIBMUTILS=${LIBMUTILS_DIR}/libmutils.a
AC_SUBST(LIBMUTILS)
LIBSLL=${LIBSLL_DIR}/libsll.a
AC_SUBST(LIBSLL)
LIBTACPLUSAUTH_DIR=$PWD/libs/libtacpluscauth
LIBTACPLUSAUTH_LIB=$LIBTACPLUSAUTH_DIR/libtacpluscauth.a
AC_SUBST(LIBTACPLUSAUTH_DIR)
AC_SUBST(LIBTACPLUSAUTH_LIB)
A=a
AC_SUBST(A)
AC_SUBST(OPENSSL_INC)
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT