-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
198 lines (158 loc) · 4.99 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([mcrypt], [2.6.8])
dnl AC_CONFIG_HEADER(config.h)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([])
AM_CONFIG_HEADER(config.h)
AC_DEFINE_UNQUOTED(T_CPU, "$target_cpu", [target CPU])
AC_DEFINE_UNQUOTED(T_VENDOR, "$target_vendor", [Vendor])
AC_DEFINE_UNQUOTED(T_OS, "$target_os", [OS])
AC_PROG_LIBTOOL
AC_PROG_CC
AM_PATH_LIBMCRYPT( 2.5.0,,
AC_MSG_ERROR([[*** libmcrypt was not found]])
)
AC_CHECK_LIB(mhash, mhash_keygen, LIBS="${LIBS} -lmhash",
AC_MSG_ERROR("You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"))
AC_MSG_CHECKING([whether mhash >= 0.8.15])
AC_TRY_RUN([
#include <mhash.h>
int main() {
if (MHASH_API_VERSION >= 20020524)
exit(0);
else
exit(-1);
}
],
dnl ************ CASE >= 0.8.15
AC_MSG_RESULT(yes)
,
dnl ************ CASE < 0.8.15
AC_MSG_RESULT(no)
AC_MSG_ERROR("You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/")
,
AC_MSG_RESULT(cross compiling)
)
dnl For GNU gettext
ALL_LINGUAS="el cs pl de es_AR"
AM_GNU_GETTEXT([external])
AC_CHECK_LIB(z, compress,,AC_MSG_WARN(
***
*** ZLIB was not found. You will not be able to use ZLIB compression
*** in OpenPGP packets.))
LIBS="${LIBS} ${LIBMCRYPT_LIBS}"
CFLAGS="${CFLAGS} ${LIBMCRYPT_CFLAGS} -Wall"
AC_C_CONST
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PATH_PROG(RM,rm)
case "${target}" in
*-cygwin*)
;;
*-mingw*)
;;
*)
AC_PATH_PROG(GZIP,gzip)
AC_DEFINE_UNQUOTED(GZIP, "$GZIP", [gzip pathname])
AC_PATH_PROG(BZIP2, bzip2)
AC_DEFINE_UNQUOTED(BZIP2, "$BZIP2", [bzip2 pathname])
;;
esac
dnl AC_PROG_MAKE_SET
dnl From GNUPG
AC_MSG_CHECKING([whether use of /dev/random is requested])
AC_ARG_ENABLE(dev-random,
[ --disable-dev-random disable the use of dev random],
try_dev_random=$enableval, try_dev_random=yes)
AC_MSG_RESULT($try_dev_random)
opt_static_link=no
AC_MSG_CHECKING([whether static link is requested])
AC_ARG_ENABLE(static-link,
[ --enable-static-link link mcrypt statically (libmcrypt must also be a static library))],
opt_static_link=$enableval)
AC_MSG_RESULT($opt_static_link)
opt_maintainer_mode=no
AC_MSG_CHECKING([whether in maintanance mode])
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable maintainer mode],
opt_maintainer_mode=$enableval)
AC_MSG_RESULT($opt_maintainer_mode)
AC_MSG_CHECKING([whether included getpass is requested])
AC_ARG_ENABLE(included-getpass,
[ --disable-included-getpass disable-included-getpass],
try_getpass=$enableval, try_getpass=yes)
AC_MSG_RESULT($try_getpass)
if test "$try_getpass" != yes ; then
AC_DEFINE(NO_GETPASS, 1, [whether getpass was requested])
fi
case "${target}" in
*-openbsd*)
NAME_OF_DEV_RANDOM="/dev/srandom"
NAME_OF_DEV_URANDOM="/dev/urandom"
;;
*-cygwin*)
AC_DEFINE(WIN32, 1, [win32])
NAME_OF_DEV_RANDOM=""
NAME_OF_DEV_URANDOM=""
;;
*-mingw*)
AC_DEFINE(WIN32, 1, [win32])
NAME_OF_DEV_RANDOM=""
NAME_OF_DEV_URANDOM=""
;;
*)
NAME_OF_DEV_RANDOM="/dev/random"
NAME_OF_DEV_URANDOM="/dev/urandom"
;;
esac
AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM", [path of random])
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM", [path of urandom])
dnl check whether we have a random device
if test "$try_dev_random" = yes ; then
AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
[if test -c "/dev/random" && test -c "$NAME_OF_DEV_URANDOM" ; then
ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
if test "$ac_cv_have_dev_random" = yes; then
AC_DEFINE(HAVE_DEV_RANDOM, 1, [whether /dev/random exists])
else
AC_MSG_WARN(No random device found. No real random data can be used.)
fi
else
AC_MSG_CHECKING(for random device)
ac_cv_have_dev_random=no
AC_MSG_RESULT(has been disabled)
AC_MSG_WARN(Support for random device was disabled. No real random data can be used.)
fi
if test $ac_cv_c_compiler_gnu = yes; then
if test $opt_maintainer_mode = yes; then
CFLAGS=" -Wall -Wpointer-arith -O0 -ggdb3"
fi
fi
if test "$opt_static_link" = yes; then
if test -n "$GCC" || test "$ac_cv_c_compiler_gnu" = "yes"; then
LDFLAGS="-static $LDFLAGS"
fi
fi
AC_C_BIGENDIAN
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF(unsigned long int, 4)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned short int, 2)
AC_CHECK_SIZEOF(unsigned char, 1)
AC_CHECK_TYPE( off_t,
AC_DEFINE( HAVE_OFF_T, 1, [have off_t type]),,
)
AC_SYS_LARGEFILE
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h pwd.h locale.h strings.h mcrypt.h ctype.h)
AC_CHECK_HEADERS(sys/stat.h sys/types.h fcntl.h sys/wait.h)
AC_CHECK_HEADERS(utime.h signal.h)
AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
AC_CHECK_FUNCS(bzero signal sigaction memset fsync siglongjmp strlcpy,,)
AC_CHECK_FUNCS(umask utime memmove bcopy getpwuid waitpid kill ftime,,)
AC_CHECK_FUNCS(lstat stat fseeko,,)
AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile po/Makefile.in])
AC_CONFIG_COMMANDS([default],[[]],[[]])
AC_OUTPUT