1 |
dnl Process this file with autoconf to produce a configure script. |
dnl Process this file with autoconf to produce a configure script. |
2 |
AC_INIT() |
AC_PREREQ(2.50) |
3 |
|
AC_INIT |
4 |
dnl AC_CONFIG_HEADER(config.h) |
dnl AC_CONFIG_HEADER(config.h) |
5 |
|
|
6 |
AC_PREFIX_DEFAULT(/usr/local) |
AC_PREFIX_DEFAULT(/usr/local) |
7 |
|
|
8 |
AC_CANONICAL_SYSTEM |
AC_CANONICAL_TARGET([]) |
9 |
AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu") |
AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu", [target CPU]) |
10 |
AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor") |
AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor", [Vendor]) |
11 |
AC_DEFINE_UNQUOTED(T_OS, "$target_os") |
AC_DEFINE_UNQUOTED(T_OS, "$target_os", [OS]) |
12 |
|
|
13 |
|
AM_INIT_AUTOMAKE(mcrypt, 2.6.4) |
14 |
|
|
|
AM_INIT_AUTOMAKE(mcrypt, 2.5.4) |
|
15 |
AM_CONFIG_HEADER(config.h) |
AM_CONFIG_HEADER(config.h) |
16 |
|
|
17 |
|
AC_PROG_LIBTOOL |
18 |
AC_PROG_CC |
AC_PROG_CC |
19 |
|
|
20 |
|
|
21 |
|
AM_PATH_LIBMCRYPT( 2.5.0,, |
22 |
|
AC_MSG_ERROR([[*** libmcrypt was not found]]) |
23 |
|
) |
24 |
|
|
25 |
|
AC_CHECK_LIB(mhash, mhash_keygen, LIBS="${LIBS} -lmhash", |
26 |
|
AC_MSG_ERROR("You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/")) |
27 |
|
|
28 |
|
AC_MSG_CHECKING([whether mhash >= 0.8.15]) |
29 |
|
AC_TRY_RUN([ |
30 |
|
#include <mhash.h> |
31 |
|
|
32 |
|
int main() { |
33 |
|
|
34 |
|
if (MHASH_API_VERSION >= 20020524) |
35 |
|
exit(0); |
36 |
|
else |
37 |
|
exit(-1); |
38 |
|
} |
39 |
|
], |
40 |
|
dnl ************ CASE >= 0.8.15 |
41 |
|
AC_MSG_RESULT(yes) |
42 |
|
, |
43 |
|
dnl ************ CASE < 0.8.15 |
44 |
|
AC_MSG_RESULT(no) |
45 |
|
AC_MSG_ERROR("You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/") |
46 |
|
, |
47 |
|
AC_MSG_RESULT(cross compiling) |
48 |
|
) |
49 |
|
|
50 |
|
|
51 |
dnl For GNU gettext |
dnl For GNU gettext |
52 |
ALL_LINGUAS="el cz pl" |
ALL_LINGUAS="el cs pl de es_AR" |
53 |
AM_GNU_GETTEXT |
|
54 |
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
AM_GNU_GETTEXT([external]) |
55 |
dnl used in old gettexts |
|
56 |
|
AC_CHECK_LIB(z, compress,,AC_MSG_WARN( |
57 |
|
*** |
58 |
|
*** ZLIB was not found. You will not be able to use ZLIB compression |
59 |
|
*** in OpenPGP packets.)) |
60 |
|
|
61 |
|
LIBS="${LIBS} ${LIBMCRYPT_LIBS}" |
62 |
|
CFLAGS="${CFLAGS} ${LIBMCRYPT_CFLAGS} -Wall" |
63 |
|
|
64 |
|
|
65 |
AC_C_CONST |
AC_C_CONST |
68 |
AC_PROG_INSTALL |
AC_PROG_INSTALL |
69 |
AC_PROG_LN_S |
AC_PROG_LN_S |
70 |
AC_PATH_PROG(RM,rm) |
AC_PATH_PROG(RM,rm) |
71 |
AC_PATH_PROG(GZIP,gzip) |
|
72 |
AC_DEFINE_UNQUOTED(GZIP, "$GZIP") |
case "${target}" in |
73 |
AC_PATH_PROG(BZIP2, bzip2) |
*-cygwin*) |
74 |
AC_DEFINE_UNQUOTED(BZIP2, "$BZIP2") |
;; |
75 |
|
*-mingw*) |
76 |
|
;; |
77 |
|
*) |
78 |
|
AC_PATH_PROG(GZIP,gzip) |
79 |
|
AC_DEFINE_UNQUOTED(GZIP, "$GZIP", [gzip pathname]) |
80 |
|
AC_PATH_PROG(BZIP2, bzip2) |
81 |
|
AC_DEFINE_UNQUOTED(BZIP2, "$BZIP2", [bzip2 pathname]) |
82 |
|
;; |
83 |
|
esac |
84 |
|
|
85 |
dnl AC_PROG_MAKE_SET |
dnl AC_PROG_MAKE_SET |
86 |
|
|
91 |
try_dev_random=$enableval, try_dev_random=yes) |
try_dev_random=$enableval, try_dev_random=yes) |
92 |
AC_MSG_RESULT($try_dev_random) |
AC_MSG_RESULT($try_dev_random) |
93 |
|
|
|
AC_CHECK_LIB(mhash, mhash_keygen, :, |
|
|
AC_MSG_ERROR("You need libmhash 0.7.0 to compile this program. http://schumann.cx/mhash/")) |
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether fcntl-locking is requested]) |
|
|
AC_ARG_ENABLE(fcntl-locking, |
|
|
[ --disable-fcntl-locking disable-fcntl-locking], |
|
|
try_fcntl_lock=$enableval, try_fcntl_lock=yes) |
|
|
AC_MSG_RESULT($try_fcntl_lock) |
|
94 |
|
|
95 |
if test "$try_fcntl_lock" != yes ; then |
opt_static_link=no |
96 |
AC_DEFINE(NO_FCNTL_LOCK) |
AC_MSG_CHECKING([whether static link is requested]) |
97 |
fi |
AC_ARG_ENABLE(static-link, |
98 |
|
[ --enable-static-link link mcrypt statically (libmcrypt must also be a static library))], |
99 |
dnl opt_static_link=no |
opt_static_link=$enableval) |
100 |
dnl AC_MSG_CHECKING([whether static link is requested]) |
AC_MSG_RESULT($opt_static_link) |
|
dnl AC_ARG_ENABLE(static-link, |
|
|
dnl [ --enable-static-link link mcrypt statically], |
|
|
dnl opt_static_link=$enableval) |
|
|
dnl AC_MSG_RESULT($opt_static_link) |
|
101 |
|
|
102 |
opt_maintainer_mode=no |
opt_maintainer_mode=no |
103 |
AC_MSG_CHECKING([whether in maintanance mode]) |
AC_MSG_CHECKING([whether in maintanance mode]) |
114 |
AC_MSG_RESULT($try_getpass) |
AC_MSG_RESULT($try_getpass) |
115 |
|
|
116 |
if test "$try_getpass" != yes ; then |
if test "$try_getpass" != yes ; then |
117 |
AC_DEFINE(NO_GETPASS) |
AC_DEFINE(NO_GETPASS, 1, [whether getpass was requested]) |
118 |
fi |
fi |
119 |
|
|
120 |
case "${target}" in |
case "${target}" in |
122 |
NAME_OF_DEV_RANDOM="/dev/srandom" |
NAME_OF_DEV_RANDOM="/dev/srandom" |
123 |
NAME_OF_DEV_URANDOM="/dev/urandom" |
NAME_OF_DEV_URANDOM="/dev/urandom" |
124 |
;; |
;; |
125 |
|
*-cygwin*) |
126 |
|
AC_DEFINE(WIN32, 1, [win32]) |
127 |
|
NAME_OF_DEV_RANDOM="" |
128 |
|
NAME_OF_DEV_URANDOM="" |
129 |
|
;; |
130 |
|
*-mingw*) |
131 |
|
AC_DEFINE(WIN32, 1, [win32]) |
132 |
|
NAME_OF_DEV_RANDOM="" |
133 |
|
NAME_OF_DEV_URANDOM="" |
134 |
|
;; |
135 |
*) |
*) |
136 |
NAME_OF_DEV_RANDOM="/dev/random" |
NAME_OF_DEV_RANDOM="/dev/random" |
137 |
NAME_OF_DEV_URANDOM="/dev/urandom" |
NAME_OF_DEV_URANDOM="/dev/urandom" |
138 |
;; |
;; |
139 |
esac |
esac |
140 |
|
|
141 |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM") |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM", [path of random]) |
142 |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM") |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM", [path of urandom]) |
143 |
|
|
144 |
dnl check whether we have a random device |
dnl check whether we have a random device |
145 |
if test "$try_dev_random" = yes ; then |
if test "$try_dev_random" = yes ; then |
147 |
[if test -c "/dev/random" && test -c "$NAME_OF_DEV_URANDOM" ; then |
[if test -c "/dev/random" && test -c "$NAME_OF_DEV_URANDOM" ; then |
148 |
ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi]) |
ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi]) |
149 |
if test "$ac_cv_have_dev_random" = yes; then |
if test "$ac_cv_have_dev_random" = yes; then |
150 |
AC_DEFINE(HAVE_DEV_RANDOM) |
AC_DEFINE(HAVE_DEV_RANDOM, 1, [whether /dev/random exists]) |
151 |
else |
else |
152 |
AC_MSG_WARN(No random device found. No real random data can be used.) |
AC_MSG_WARN(No random device found. No real random data can be used.) |
153 |
fi |
fi |
159 |
fi |
fi |
160 |
|
|
161 |
|
|
162 |
if test $ac_cv_prog_gcc = yes; then |
if test $ac_cv_c_compiler_gnu = yes; then |
|
CFLAGS="${CFLAGS} -ffast-math" |
|
163 |
|
|
164 |
if test $opt_maintainer_mode = yes; then |
if test $opt_maintainer_mode = yes; then |
165 |
CFLAGS="${CFLAGS} -Wall -Wpointer-arith" |
CFLAGS=" -Wall -Wpointer-arith -O0 -ggdb3" |
166 |
fi |
fi |
167 |
fi |
fi |
168 |
|
|
169 |
dnl if test "$opt_static_link" = yes; then |
if test "$opt_static_link" = yes; then |
170 |
dnl if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then |
if test -n "$GCC" || test "$ac_cv_c_compiler_gnu" = "yes"; then |
171 |
dnl LDFLAGS="$LDFLAGS -static" |
LDFLAGS="-static $LDFLAGS" |
172 |
dnl fi |
fi |
173 |
dnl AC_CHECK_LIB(dl, dlopen) |
fi |
|
dnl fi |
|
174 |
|
|
175 |
AC_C_BIGENDIAN |
AC_C_BIGENDIAN |
176 |
AC_TYPE_SIGNAL |
AC_TYPE_SIGNAL |
179 |
AC_CHECK_SIZEOF(unsigned short int, 2) |
AC_CHECK_SIZEOF(unsigned short int, 2) |
180 |
AC_CHECK_SIZEOF(unsigned char, 1) |
AC_CHECK_SIZEOF(unsigned char, 1) |
181 |
|
|
182 |
|
AC_CHECK_TYPE( off_t, |
183 |
|
AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),, |
184 |
|
) |
185 |
|
|
186 |
|
AC_SYS_LARGEFILE |
187 |
|
|
188 |
AC_HEADER_STDC |
AC_HEADER_STDC |
189 |
AC_CHECK_HEADERS(unistd.h pwd.h locale.h strings.h mcrypt.h ctype.h) |
AC_CHECK_HEADERS(unistd.h pwd.h locale.h strings.h mcrypt.h ctype.h) |
190 |
AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h sys/wait.h) |
AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h sys/wait.h) |
191 |
AC_CHECK_HEADERS(utime.h signal.h) |
AC_CHECK_HEADERS(utime.h signal.h) |
192 |
AC_CHECK_HEADERS(termios.h termio.h sgtty.h) |
AC_CHECK_HEADERS(termios.h termio.h sgtty.h) |
193 |
AC_CHECK_FUNCS(bzero signal sigaction memset fcntl fsync siglongjmp,,) |
AC_CHECK_FUNCS(bzero signal sigaction memset fsync siglongjmp strlcpy,,) |
194 |
AC_CHECK_FUNCS(lstat stat umask utime memmove bcopy getpwuid waitpid,,) |
AC_CHECK_FUNCS(umask utime memmove bcopy getpwuid waitpid kill ftime,,) |
195 |
|
AC_CHECK_FUNCS(lstat stat fseeko,,) |
|
AC_CHECK_LIB(mcrypt-nm, mcrypt_generic_init, |
|
|
LIBS="${LIBS} -lmcrypt-nm" |
|
|
AC_DEFINE(LIBMCRYPT_22) |
|
|
opt_oldmcrypt=yes, |
|
|
[AC_CHECK_LIB(dld, dld_init) |
|
|
AC_CHECK_LIB(ltdl, lt_dlinit) |
|
|
AC_CHECK_LIB(mcrypt, mcrypt_enc_get_key_size, |
|
|
LIBS="${LIBS} -lmcrypt" |
|
|
opt_oldmcrypt=no, |
|
|
AC_MSG_ERROR("You need libmcrypt 2.4.x or libmcrypt-nm to compile this program. http://mcrypt.hellug.gr")) |
|
|
] |
|
|
) |
|
|
|
|
|
AC_MSG_CHECKING([libmcrypt to use]) |
|
|
if test "$opt_oldmcrypt" = yes; then |
|
|
AC_MSG_RESULT("nm") |
|
|
AC_DEFINE_UNQUOTED(LIBMCRYPT_VERSION, "nm") |
|
|
dnl AC_CHECK_LIB(mcrypt-nm, mcrypt_generic_init) |
|
|
else |
|
|
AC_MSG_RESULT("2.4.x") |
|
|
AC_DEFINE_UNQUOTED(LIBMCRYPT_VERSION, "2.4") |
|
|
dnl AC_CHECK_LIB(mcrypt, mcrypt_module_open) |
|
|
fi |
|
196 |
|
|
197 |
|
|
198 |
AC_OUTPUT([Makefile doc/Makefile src/Makefile intl/Makefile po/Makefile.in], |
AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile po/Makefile.in m4/Makefile ]) |
199 |
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) |
AC_CONFIG_COMMANDS([default],[[]],[[]]) |
200 |
|
AC_OUTPUT |