-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.in
214 lines (184 loc) · 6.83 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
# basics
AC_INIT(pyflag.in)
# Store the configuration in this header
AC_CONFIG_HEADER([src/include/config.h])
AC_CONFIG_HEADER([src/filesystems/sleuthkit/sleuthkit-2.52/tsk/tsk_config.h])
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(pyflag, 0.87-pre1)
# check standard stuff
AC_PROG_LIBTOOL
AC_PROG_CC
# check headers
AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([You Must install zlib-dev to build pyflag]))
AC_CHECK_HEADER(magic.h,,AC_MSG_ERROR([You Must install libmagic-dev to build pyflag this may be part of file the package for some distros]))
## Are we running on windows?
AC_CHECK_HEADER(windows.h,have_windows=yes,have_windows=no)
## Allow users to disable optional libraries:
## Afflib needs some special libraries to link against - is that a bug in afflib?
ac_my_check_lib_save_LIBS=$LIBS
LIBS="-lz -lcrypto -lstdc++ $LIBS"
AC_ARG_ENABLE(afflib,
[ --disable-afflib Do not use AFFLIB even if it is installed],
# Action if they gave this argument
[ if test "x$enableval" = "xyes" ; then
AC_CHECK_LIB([afflib], [af_open], have_libafflib=yes, have_libafflib=no)
elif test "x$enableval" = "xno" ; then
have_libafflib=disabled
echo "Ignoring AFFLIB."
else
echo "Error: Unknown enable-afflib argument."
exit -1
fi
],
# if they did not specify aff, look for it
[AC_CHECK_LIB([afflib], [af_open], have_libafflib=yes, [
have_libafflib=no
AC_MSG_WARN([You must install libaff (http://www.afflib.org/) for AFF image support])
])]
)
## Now work out which version of AFFLIB it is:
libaff_version=unknown
if test $have_libafflib = yes; then
AC_CHECK_HEADER(afflib.h, libaff_version=1,)
if test $libaff_version = unknown; then
AC_CHECK_HEADER(afflib/afflib.h, libaff_version=3,)
fi
if test $libaff_version = unknown; then
AC_MSG_WARN([I cant seem to find afflib.h (do you need to install afflib-dev)])
have_libafflib=no
fi
fi
AC_SUBST(LIBAFFLIB_VERSION, $libaff_version)
LIBS=$ac_my_check_lib_save_LIBS
ac_my_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
AC_ARG_ENABLE(ewf,
[ --disable-ewf Do not use libewf even if it is installed],
# Action if they gave this argument
[ if test "x$enableval" = "xyes" ; then
AC_CHECK_LIB([ewf], [libewf_open], have_libewf=yes, [
have_libewf=no;
])
elif test "x$enableval" = "xno" ; then
have_libewf=disabled
echo "Ignoring LibEWF."
else
echo "Error: Unknown enable-ewf argument."
exit -1
fi
],
# if they did not specify ewf, look for it
[
AC_CHECK_LIB([ewf], [libewf_open], have_libewf=yes,
[
have_libewf=no
AC_MSG_WARN([You must install libewf (http://www.uitwisselplatform.nl/projects/libewf/) for Expert Witness Format (encase) support])
])
])
LIBS=$ac_my_check_lib_save_LIBS
## We only can use a later version than 20080501 - we compile a small
## program to check the version string:
if test $have_libewf = yes; then
## Save libs
ac_check_lib_save_LIBS=$LIBS
LIBS="-lewf -static $LIBS"
AC_RUN_IFELSE(
[
AC_LANG_PROGRAM([[#include "libewf.h"]],
[[return(strcmp("20080501", libewf_get_version())>0);]])
], have_libewf=yes ## If we succeeded we just do nothing
,[
have_libewf=no
AC_MSG_WARN([You libewf version must be more recent then 20080501.])
], have_libewf=yes ## Just compile it if cross compiling
)
## Restore the libs
LIBS=$ac_check_lib_save_LIBS
fi
AC_CHECK_HEADER(GeoIP.h,have_geoip=yes, [
have_geoip=no
AC_MSG_WARN([please install libgeoip-dev for ip geolocation])
])
AC_CHECK_HEADER(jpeglib.h,have_libjpeg=yes,AC_MSG_WARN([please install libjpeg62-dev for jpeg carving]))
## Conditionals for automake
AM_CONDITIONAL(HAVE_LIBAFFLIB, test "$have_libafflib" = yes)
AM_CONDITIONAL(HAVE_LIBEWF, test "$have_libewf" = yes)
AM_CONDITIONAL(HAVE_GEOIP, test "$have_geoip" = yes)
AM_CONDITIONAL(HAVE_LIBJPEG, test "$have_libjpeg" = yes)
AM_CONDITIONAL(HAVE_WINDOWS, test "$have_windows" = yes)
# python checks
# (requires autoconf 1.5+ and the macros in acinclude.m4)
AC_ARG_WITH(
windows_python,
AC_HELP_STRING([--with-windows-python@<:@=WINDOWS_PYTHON@:>@],
[Windows Python path (for cross compiling)]
),
[
AM_PATH_PYTHON([2.5])
AC_MSG_RESULT(Setting windows python for cross compiling $withval )
AC_PYTHON_XCOMPILE_WINDOWS($withval)
],
[
## Not specified - use the system python
AM_PATH_PYTHON([2.5])
AC_PYTHON_DEVEL()
AC_PYTHON_MODULE(MySQLdb, REQUIRED, [ You must install the python-mysql package ])
AC_PYTHON_MODULE(pexpect, REQUIRED, [ You must install the python-pexpect package ])
AC_PYTHON_MODULE(PIL, REQUIRED, [ You must install the python-imaging package ])
AC_PYTHON_MODULE(dateutil, REQUIRED, [ You must install the python-dateutil package ])
])
# check for binaries
#AC_PATH_PROG([MYSQL], mysql)
# try to find magic files
AC_ARG_WITH(magic, AC_HELP_STRING([--with-magic], [specify a colon-separated list of system magic files, default autodetect]),,[magic=$(file -v 2>&1 | tail -1 | awk '{print $4}')])
AC_SUBST(magic)
# defines and output
AC_DEFINE([__DEBUG__], [], [Debuging enabled])
# endianess support
AC_C_BIGENDIAN()
# Large file support
AC_SYS_LARGEFILE
AC_OUTPUT([
Makefile
src/Makefile
src/pyflag/Makefile
src/lib/Makefile
src/lib/pyewf/Makefile
src/lib/pyaff/Makefile
src/mmedia/Makefile
src/mailtools/Makefile
src/indextools_ng/Makefile
src/regtools/Makefile
src/network/Makefile
src/filesystems/Makefile
src/filesystems/sleuthkit/Makefile
src/filesystems/sleuthkit/python/Makefile
src/filesystems/magic/Makefile
src/distorm/Makefile
src/include/Makefile
src/include/crypto/Makefile
debian/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/base/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/img/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/vs/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/fs/Makefile
src/filesystems/sleuthkit/sleuthkit-2.52/tsk/hashdb/Makefile
])
# src/lib/libsgzip/Makefile
# src/lib/libiosubsys/Makefile
# src/filesystems/sleuthkit/auxtools/Makefile
# src/filesystems/sleuthkit/imgtools/Makefile
# src/filesystems/sleuthkit/fstools/Makefile
# src/filesystems/sleuthkit/mmtools/Makefile
## Tell the use what we found:
AC_MSG_NOTICE([])
AC_MSG_NOTICE([*****************************************])
AC_MSG_NOTICE([PyFlag ${PACKAGE} ${VERSION} configuration])
AC_MSG_NOTICE([EWF Support: $have_libewf ])
AC_MSG_NOTICE([AFF Support: $have_libafflib ])
AC_MSG_NOTICE([MaxMind GeoIP: $have_geoip ])
AC_MSG_NOTICE([Advanced JpegCarving: $have_libjpeg ])
AC_MSG_NOTICE([*****************************************])
AC_MSG_NOTICE([])