1 |
dnl Process this file with autoconf to produce a configure script. |
2 |
AC_INIT() |
3 |
dnl AC_CONFIG_HEADER(config.h) |
4 |
|
5 |
AC_PREFIX_DEFAULT(/usr/local) |
6 |
|
7 |
AC_CANONICAL_SYSTEM |
8 |
AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu") |
9 |
AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor") |
10 |
AC_DEFINE_UNQUOTED(T_OS, "$target_os") |
11 |
|
12 |
|
13 |
AM_INIT_AUTOMAKE(mcrypt, 2.5.4) |
14 |
AM_CONFIG_HEADER(config.h) |
15 |
|
16 |
|
17 |
AC_PROG_CC |
18 |
|
19 |
dnl For GNU gettext |
20 |
ALL_LINGUAS="el cz pl" |
21 |
AM_GNU_GETTEXT |
22 |
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
23 |
dnl used in old gettexts |
24 |
|
25 |
|
26 |
AC_C_CONST |
27 |
|
28 |
dnl Checks for programs. |
29 |
AC_PROG_INSTALL |
30 |
AC_PROG_LN_S |
31 |
AC_PATH_PROG(RM,rm) |
32 |
AC_PATH_PROG(GZIP,gzip) |
33 |
AC_DEFINE_UNQUOTED(GZIP, "$GZIP") |
34 |
AC_PATH_PROG(BZIP2, bzip2) |
35 |
AC_DEFINE_UNQUOTED(BZIP2, "$BZIP2") |
36 |
|
37 |
dnl AC_PROG_MAKE_SET |
38 |
|
39 |
dnl From GNUPG |
40 |
AC_MSG_CHECKING([whether use of /dev/random is requested]) |
41 |
AC_ARG_ENABLE(dev-random, |
42 |
[ --disable-dev-random disable the use of dev random], |
43 |
try_dev_random=$enableval, try_dev_random=yes) |
44 |
AC_MSG_RESULT($try_dev_random) |
45 |
|
46 |
AC_CHECK_LIB(mhash, mhash_keygen, :, |
47 |
AC_MSG_ERROR("You need libmhash 0.7.0 to compile this program. http://schumann.cx/mhash/")) |
48 |
|
49 |
|
50 |
AC_MSG_CHECKING([whether fcntl-locking is requested]) |
51 |
AC_ARG_ENABLE(fcntl-locking, |
52 |
[ --disable-fcntl-locking disable-fcntl-locking], |
53 |
try_fcntl_lock=$enableval, try_fcntl_lock=yes) |
54 |
AC_MSG_RESULT($try_fcntl_lock) |
55 |
|
56 |
if test "$try_fcntl_lock" != yes ; then |
57 |
AC_DEFINE(NO_FCNTL_LOCK) |
58 |
fi |
59 |
|
60 |
dnl opt_static_link=no |
61 |
dnl AC_MSG_CHECKING([whether static link is requested]) |
62 |
dnl AC_ARG_ENABLE(static-link, |
63 |
dnl [ --enable-static-link link mcrypt statically], |
64 |
dnl opt_static_link=$enableval) |
65 |
dnl AC_MSG_RESULT($opt_static_link) |
66 |
|
67 |
opt_maintainer_mode=no |
68 |
AC_MSG_CHECKING([whether in maintanance mode]) |
69 |
AC_ARG_ENABLE(maintainer-mode, |
70 |
[ --enable-maintainer-mode enable maintainer mode], |
71 |
opt_maintainer_mode=$enableval) |
72 |
AC_MSG_RESULT($opt_maintainer_mode) |
73 |
|
74 |
|
75 |
AC_MSG_CHECKING([whether included getpass is requested]) |
76 |
AC_ARG_ENABLE(included-getpass, |
77 |
[ --disable-included-getpass disable-included-getpass], |
78 |
try_getpass=$enableval, try_getpass=yes) |
79 |
AC_MSG_RESULT($try_getpass) |
80 |
|
81 |
if test "$try_getpass" != yes ; then |
82 |
AC_DEFINE(NO_GETPASS) |
83 |
fi |
84 |
|
85 |
case "${target}" in |
86 |
*-openbsd*) |
87 |
NAME_OF_DEV_RANDOM="/dev/srandom" |
88 |
NAME_OF_DEV_URANDOM="/dev/urandom" |
89 |
;; |
90 |
*) |
91 |
NAME_OF_DEV_RANDOM="/dev/random" |
92 |
NAME_OF_DEV_URANDOM="/dev/urandom" |
93 |
;; |
94 |
esac |
95 |
|
96 |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM") |
97 |
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM") |
98 |
|
99 |
dnl check whether we have a random device |
100 |
if test "$try_dev_random" = yes ; then |
101 |
AC_CACHE_CHECK(for random device, ac_cv_have_dev_random, |
102 |
[if test -c "/dev/random" && test -c "$NAME_OF_DEV_URANDOM" ; then |
103 |
ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi]) |
104 |
if test "$ac_cv_have_dev_random" = yes; then |
105 |
AC_DEFINE(HAVE_DEV_RANDOM) |
106 |
else |
107 |
AC_MSG_WARN(No random device found. No real random data can be used.) |
108 |
fi |
109 |
else |
110 |
AC_MSG_CHECKING(for random device) |
111 |
ac_cv_have_dev_random=no |
112 |
AC_MSG_RESULT(has been disabled) |
113 |
AC_MSG_WARN(Support for random device was disabled. No real random data can be used.) |
114 |
fi |
115 |
|
116 |
|
117 |
if test $ac_cv_prog_gcc = yes; then |
118 |
CFLAGS="${CFLAGS} -ffast-math" |
119 |
|
120 |
if test $opt_maintainer_mode = yes; then |
121 |
CFLAGS="${CFLAGS} -Wall -Wpointer-arith" |
122 |
fi |
123 |
fi |
124 |
|
125 |
dnl if test "$opt_static_link" = yes; then |
126 |
dnl if test -n "$GCC" || test "$ac_cv_prog_gcc" = "yes"; then |
127 |
dnl LDFLAGS="$LDFLAGS -static" |
128 |
dnl fi |
129 |
dnl AC_CHECK_LIB(dl, dlopen) |
130 |
dnl fi |
131 |
|
132 |
AC_C_BIGENDIAN |
133 |
AC_TYPE_SIGNAL |
134 |
AC_CHECK_SIZEOF(unsigned long int, 4) |
135 |
AC_CHECK_SIZEOF(unsigned int, 4) |
136 |
AC_CHECK_SIZEOF(unsigned short int, 2) |
137 |
AC_CHECK_SIZEOF(unsigned char, 1) |
138 |
|
139 |
AC_HEADER_STDC |
140 |
AC_CHECK_HEADERS(unistd.h pwd.h locale.h strings.h mcrypt.h ctype.h) |
141 |
AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h sys/wait.h) |
142 |
AC_CHECK_HEADERS(utime.h signal.h) |
143 |
AC_CHECK_HEADERS(termios.h termio.h sgtty.h) |
144 |
AC_CHECK_FUNCS(bzero signal sigaction memset fcntl fsync siglongjmp strlcpy,,) |
145 |
AC_CHECK_FUNCS(lstat stat umask utime memmove bcopy getpwuid waitpid,,) |
146 |
|
147 |
opt_oldmcrypt=no |
148 |
AC_CHECK_LIB(mcrypt-nm, mcrypt_generic_init, |
149 |
LIBS="${LIBS} -lmcrypt-nm" |
150 |
AC_DEFINE(LIBMCRYPT_22) |
151 |
opt_oldmcrypt=yes |
152 |
) |
153 |
|
154 |
if test $opt_oldmcrypt = no; then |
155 |
AC_CHECK_LIB(dl, dlopen) |
156 |
AC_CHECK_LIB(mcrypt, mcrypt_module_open, |
157 |
LIBS="${LIBS} -lmcrypt" |
158 |
opt_oldmcrypt=no, |
159 |
[ |
160 |
AC_CHECK_LIB(dld, dld_init) |
161 |
AC_CHECK_LIB(ltdl, lt_dlinit) |
162 |
AC_CHECK_LIB(mcrypt, mcrypt_enc_get_key_size, |
163 |
LIBS="${LIBS} -lmcrypt" |
164 |
opt_oldmcrypt=no, |
165 |
AC_MSG_ERROR("You need libmcrypt 2.4.x or libmcrypt-nm to compile this program. http://mcrypt.hellug.gr")) |
166 |
] |
167 |
) |
168 |
fi |
169 |
AC_MSG_CHECKING([libmcrypt to use]) |
170 |
if test "$opt_oldmcrypt" = yes; then |
171 |
AC_MSG_RESULT("nm") |
172 |
AC_DEFINE_UNQUOTED(LIBMCRYPT_VERSION, "nm") |
173 |
dnl AC_CHECK_LIB(mcrypt-nm, mcrypt_generic_init) |
174 |
else |
175 |
AC_MSG_RESULT("2.4.x") |
176 |
AC_DEFINE_UNQUOTED(LIBMCRYPT_VERSION, "2.4") |
177 |
dnl AC_CHECK_LIB(mcrypt, mcrypt_module_open) |
178 |
fi |
179 |
|
180 |
|
181 |
AC_OUTPUT([Makefile doc/Makefile src/Makefile intl/Makefile po/Makefile.in], |
182 |
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) |