forked from StegHigh/steghide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
219 lines (192 loc) · 6.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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/main.cc)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(steghide, 0.5.1)
AM_CONFIG_HEADER(config.h)
dnl checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_LN_S
dnl GNU gettext
AC_CHECK_FUNCS(strchr)
AM_GNU_GETTEXT
AM_CONDITIONAL(USE_INTLDIR, test "$nls_cv_use_gnu_gettext" = yes)
dnl check if debugging support is requested
AC_MSG_CHECKING([wether to enable debugging])
AC_ARG_ENABLE(debug,[ --enable-debug enable debugging],
if test "$enableval" = yes ;
then
AC_MSG_RESULT([yes])
AC_DEFINE(DEBUG,1,[enable code used only for debugging])
CXXFLAGS="-O2 -Wall -g"
else
AC_MSG_RESULT([no])
CXXFLAGS="-O2 -Wall"
fi
,
AC_MSG_RESULT([no])
CXXFLAGS="-O2 -Wall"
)
dnl check if randomness should be disabled
AC_MSG_CHECKING([wether to disable randomness])
AC_ARG_ENABLE(randomness,[ --disable-randomness disable randomness making every run exactly reproducible],
if test "$enableval" = yes ;
then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AC_DEFINE(NORANDOM,1,[disable randomness making every run exactly reproducible])
fi
,
AC_MSG_RESULT([no])
)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h termios.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
dnl Check size of types
AC_CHECK_SIZEOF(unsigned long int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned short int)
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(unsigned char)
AC_CHECK_SIZEOF(signed char)
dnl searching for unsigned 32 bit integer
if test "$ac_cv_sizeof_unsigned_int" = 4;
then
AC_DEFINE(TYPE_UWORD32,[unsigned int],[type of unsigned word with 32 bits])
else
if test "$ac_cv_sizeof_unsigned_long_int" = 4;
then
AC_DEFINE(TYPE_UWORD32,[unsigned long int],[type of unsigned word with 32 bits])
else
AC_MSG_ERROR([[There is no unsigned integer type with a size of 32 bits on your system. Cannot compile.]])
fi
fi
dnl searching for signed 32 bit integer
if test "$ac_cv_sizeof_int" = 4;
then
AC_DEFINE(TYPE_SWORD32,[int],[type of signed word with 32 bits])
else
if test "$ac_cv_sizeof_long_int" = 4;
then
AC_DEFINE(TYPE_SWORD32,[long int],[type of signed word with 32 bits])
else
AC_MSG_ERROR([[There is no signed integer type with a size of 32 bits on your system. Cannot compile.]])
fi
fi
dnl searching for unsigned 16 bit integer
if test "$ac_cv_sizeof_unsigned_short_int" = 2;
then
AC_DEFINE(TYPE_UWORD16,[unsigned short int],[type of unsigned word with 16 bits])
else
if test "$ac_cv_sizeof_unsigned_int" = 2;
then
AC_DEFINE(TYPE_UWORD16,[unsigned int],[type of unsigned word with 16 bits])
else
AC_MSG_ERROR([[There is no unsigned integer type with a size of 16 bits on your system. Cannot compile.]])
fi
fi
dnl searching for signed 16 bit integer
if test "$ac_cv_sizeof_short_int" = 2;
then
AC_DEFINE(TYPE_SWORD16,[short int],[type of signed word with 16 bits])
else
if test "$ac_cv_sizeof_int" = 2;
then
AC_DEFINE(TYPE_SWORD16,[int],[type of signed word with 16 bits])
else
AC_MSG_ERROR([[There is no signed integer type with a size of 16 bits on your system. Cannot compile.]])
fi
fi
dnl searching for unsigned 8 bit character
if test "$ac_cv_sizeof_unsigned_char" = 1;
then
AC_DEFINE(TYPE_BYTE,[unsigned char],[type of unsigned byte])
else
AC_MSG_ERROR([[There is no unsigned character type with a size of 8 bits on your system. Cannot compile.]])
fi
dnl searching for signed 8 bit character
if test "$ac_cv_sizeof_signed_char" = 1;
then
AC_DEFINE(TYPE_SBYTE,[signed char],[type of signed byte])
else
AC_MSG_ERROR([[There is no signed character type with a size of 8 bits on your system. Cannot compile.]])
fi
dnl check for doxygen
AC_CHECK_PROG(ac_cv_prog_doxygen, "doxygen", yes, no)
AM_CONDITIONAL(HAVE_DOXYGEN, test "$ac_cv_prog_doxygen" = yes)
dnl check for perl
AC_CHECK_PROG(ac_cv_prog_perl, "perl", yes, no)
AM_CONDITIONAL(HAVE_PERL, test "$ac_cv_prog_perl" = yes)
dnl Check for random sources
AC_CHECK_FILE(/dev/urandom, [AC_DEFINE(HAVE_DEV_URANDOM,1,/dev/urandom is available)])
AC_CHECK_FILE(/dev/random, [AC_DEFINE(HAVE_DEV_RANDOM,1,/dev/random is available)])
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(tcgetattr tcsetattr strtoul)
dnl system-specific settings
case "${target}" in
*-cygwin*)
AC_DEFINE(WIN32,1,target system is win32)
;;
esac
dnl Check for zlib
AC_CHECK_LIB(z, zlibVersion)
AC_CHECK_HEADER(zlib.h)
dnl Check for libmhash
AC_CHECK_LIB(mhash, mhash_init)
AC_CHECK_HEADER(mhash.h)
dnl Check for libmcrypt
AC_CHECK_LIB(mcrypt, mcrypt_generic, , ,)
AC_CHECK_HEADER(mcrypt.h)
dnl Check for libjpeg
AC_CHECK_LIB(jpeg, jpeg_read_coefficients)
AC_CHECK_HEADER(jpeglib.h)
dnl evaluate library tests
if test "$ac_cv_header_jpeglib_h" = no || test "$ac_cv_lib_jpeg_jpeg_read_coefficients" = no ;
then
echo "**********";
echo "libjpeg could not be found on your system. Steghide will be compiled without";
echo "support for jpeg files. You will not be able to read or write jpeg files!";
echo "libjpeg can be downloaded from http://www.ijg.org/";
echo "**********";
else
AC_DEFINE(USE_LIBJPEG,1,[use the libjpeg library (header and lib are present)])
fi
if test "$ac_cv_header_mcrypt_h" = no || test "$ac_cv_lib_mcrypt_mcrypt_module_open" = no ;
then
echo "**********";
echo "libmcrypt could not be found on your system. Steghide will be compiled without";
echo "support for encryption. You will not be able to extract encrypted data!";
echo "libmcrypt can be downloaded from http://mcrypt.sourceforge.net/";
echo "**********";
else
AC_DEFINE(USE_LIBMCRYPT,1,[use the libmcrypt library (header and lib are present)])
fi
if test "$ac_cv_header_zlib_h" = no || test "$ac_cv_lib_z_zlibVersion" = no ;
then
echo "**********";
echo "zlib could not be found on your system. Steghide will be compiled without";
echo "the ability to compress and uncompress embedded data!";
echo "zlib can be downloaded from http://www.gzip.org/zlib/";
echo "**********";
else
AC_DEFINE(USE_ZLIB,1,[use the z compression library (header and lib are present)])
fi
if test "$ac_cv_header_mhash_h" = no || test "$ac_cv_lib_mhash_mhash_init" = no ;
then
echo "**********";
echo "libmhash could not be found on your system but is needed to compile steghide.";
echo "libmhash can be downloaded from http://mhash.sourceforge.net/.";
echo "**********";
AC_MSG_ERROR([[libmhash not found]])
fi
dnl create Makefiles
AC_OUTPUT([Makefile steghide.spec steghide.doxygen doc/Makefile po/Makefile.in src/Makefile tests/Makefile tests/data/Makefile m4/Makefile intl/Makefile])