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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
|
-*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# Order is largely irrevellant, although it must start with AC_INIT and end with AC_OUTPUT
# See http://autotoolset.sourceforge.net/tutorial.html
# and http://www.openismus.com/documents/linux/automake/automake.shtml
AC_INIT([AFFLIB],[3.5.12],[bugs@afflib.org])
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
# Where we get installed
AC_PREFIX_PROGRAM
# Programs that we will be using
AC_PROG_CC
AC_PROG_INSTALL
# Turn off shared libraries during beta-testing, since they
# make the build process take too long.
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
# We are now threading
m4_include([m4/acx_pthread.m4])
m4_include([m4/acinclude.m4])
ACX_PTHREAD()
if test x"${cross_compiling}" = "xno" ; then
# Bring additional directories where things might be found into our
# search path. I don't know why autoconf doesn't do this by default
for spfx in /usr/local /opt/local /sw ${prefix} ; do
AC_MSG_NOTICE([checking ${spfx}/include])
if test -d ${spfx}/include; then
CPPFLAGS="-I${spfx}/include $CPPFLAGS"
LDFLAGS="-L${spfx}/lib $LDFLAGS"
AC_MSG_NOTICE([ *** ADDING ${spfx}/include to CPPFLAGS *** ])
AC_MSG_NOTICE([ *** ADDING ${spfx}/lib to LDFLAGS *** ])
fi
done
AC_MSG_NOTICE([ CPPFLAGS = ${CPPFLAGS} ])
AC_MSG_NOTICE([ LDFLAGS = ${LDFLAGS} ])
else
AC_MSG_NOTICE([Cross Compiling --- will not update CPPFALGS or LDFLAGS with /usr/local, /opt/local or /sw])
fi
AC_DEFINE([IN_AFFLIB],1,[Defined if we are inside AFFLIB])
# Special features that I use
AC_FUNC_ALLOCA
AC_FUNC_FSEEKO
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_SYS_LARGEFILE
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
# Specific headers that I plan to use
AC_CHECK_HEADERS([arpa/inet.h assert.h ctype.h dmalloc.h err.h errno.h fcntl.h getopt.h inttypes.h linux/fs.h malloc.h ncurses/term.h netinet/in.h regex.h signal.h stdio.h stdlib.h string.h sys/cdefs.h sys/disk.h sys/file.h sys/ioctl.h sys/ioctl.h sys/param.h sys/param.h sys/socket.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/vfs.h sysexits.h term.h time.h unistd.h zlib.h])
AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
[ AC_DEFINE(HAVE_SOCKADDR_SIN_LEN, 1, [Do we have sockaddr.sin_len?]) ],
[],
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
])
# Specific functions that we want to know about
AC_CHECK_FUNCS([getprogname strlcpy strlcat err_set_exit srandom srandomdev flock fstatfs valloc isdigit isalnum isalphanum isatty popen ftruncate memset mkdir putenv regcomp srandomdev strcasecmp strchr strdup strerror strrchr err errx warn warnx utimes unsetenv])
# Special features that can be enabled or disabled
AC_ARG_WITH([noopt], AC_HELP_STRING([--with-noopt],[Drop -O C flags]))
# C++ headers
AC_PROG_CXX
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([cstring])
AC_LANG_POP([C++])
################################################################
## LIBEWF support
dnl Function to test if a libewf_get_media_size takes value as an argument
AC_DEFUN([AFF_CHECK_LIBEWF_GET_MEDIA_SIZE],
[AC_CHECK_FUNC(
[libewf_get_media_size],
[AC_DEFINE(
[HAVE_LIBEWF_GET_MEDIA_SIZE],
[1],
[Define to 1 if you have the libewf_get_media_size function.])
AC_LANG_PUSH(C)
AC_MSG_CHECKING(
[if libewf_get_media_size takes size as an argument.])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <libewf.h>]],
[[libewf_get_media_size(NULL,NULL); ]] )],
[AC_MSG_RESULT(
[yes])
AC_DEFINE(
[HAVE_LIBEWF_GET_MEDIA_SIZE_ARGUMENT_VALUE],
[1],
[Define to 1 if libewf_get_media_size takes value as an argument.])],
[AC_MSG_RESULT(
[no])] )
AC_LANG_POP(C) ])
])
dnl Function to test if a libewf_get_chunk_size takes value as an argument
AC_DEFUN([AFF_CHECK_LIBEWF_GET_CHUNK_SIZE],
[AC_CHECK_FUNC(
[libewf_get_chunk_size],
[AC_DEFINE(
[HAVE_LIBEWF_GET_CHUNK_SIZE],
[1],
[Define to 1 if you have the libewf_get_chunk_size function.])
AC_LANG_PUSH(C)
AC_MSG_CHECKING(
[if libewf_get_chunk_size takes size as an argument.])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <libewf.h>]],
[[libewf_get_chunk_size(NULL,NULL); ]] )],
[AC_MSG_RESULT(
[yes])
AC_DEFINE(
[HAVE_LIBEWF_GET_CHUNK_SIZE_ARGUMENT_VALUE],
[1],
[Define to 1 if libewf_get_chunk_size takes value as an argument.])],
[AC_MSG_RESULT(
[no])] )
AC_LANG_POP(C) ])
])
dnl Function to test if a libewf_get_bytes_per_sector takes value as an argument
AC_DEFUN([AFF_CHECK_LIBEWF_GET_BYTES_PER_SECTOR],
[AC_CHECK_FUNC(
[libewf_get_bytes_per_sector],
[AC_DEFINE(
[HAVE_LIBEWF_GET_BYTES_PER_SECTOR],
[1],
[Define to 1 if you have the libewf_get_bytes_per_sector function.])
AC_LANG_PUSH(C)
AC_MSG_CHECKING(
[if libewf_get_bytes_per_sector takes size as an argument.])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <libewf.h>]],
[[libewf_get_bytes_per_sector(NULL,NULL); ]] )],
[AC_MSG_RESULT(
[yes])
AC_DEFINE(
[HAVE_LIBEWF_GET_BYTES_PER_SECTOR_ARGUMENT_VALUE],
[1],
[Define to 1 if libewf_get_bytes_per_sector takes value as an argument.])],
[AC_MSG_RESULT(
[no])] )
AC_LANG_POP(C) ])
])
AC_ARG_ENABLE([libewf],
AC_HELP_STRING([--enable-libewf=yes], [Use libewf for reading EnCase files(default yes)]),
[enable_libewf=$enableval], [enable_libewf=yes])
if test "${enable_libewf}" = "yes" ; then
AC_CHECK_HEADERS([libewf.h],,[enable_libewf=no])
fi
if test "${enable_libewf}" = "yes" ; then
AC_MSG_NOTICE([On linux, libewf has a dependency which forces linking with -luuid])
AC_MSG_NOTICE([so if we are running on linux and that version of libewf is installed,])
AC_MSG_NOTICE([make sure the libuuid is installed])
if test -r /usr/lib/libewf.la ; then
if grep luuid /usr/lib/libewf.la ; then
AC_MSG_NOTICE([Installed libewf requires libuuid.])
AC_CHECK_LIB([uuid],[uuid_generate_random],,[enable_libewf=no])
fi
fi
fi
if test "${enable_libewf}" = "yes" ; then
AC_CHECK_LIB([ewf],[libewf_get_version],,[enable_libewf=no])
fi
if test "${enable_libewf}" = "yes" ; then
AFF_CHECK_LIBEWF_GET_MEDIA_SIZE
AFF_CHECK_LIBEWF_GET_CHUNK_SIZE
AFF_CHECK_LIBEWF_GET_BYTES_PER_SECTOR
AC_DEFINE([USE_LIBEWF],1,[Use libewf to read EnCase files])
fi
################################################################
# For AFF tools
AC_CHECK_FUNCS(tputs tgoto tgetstr tgetnum gotorc beep endwin setupterm printw)
AC_CHECK_HEADERS([readline/readline.h])
AC_CHECK_HEADERS([curses.h termcap.h])
AC_CHECK_LIB([readline],[readline],, AC_MSG_RESULT([readline not installed]))
AC_CHECK_LIB([ncurses],[initscr],, AC_MSG_RESULT([ncurses not installed]))
AC_CHECK_LIB([z],[uncompress],, AC_MSG_ERROR([zlib not installed; cannot continue. Try adding zlib-dev or zlib1g-dev.]))
AC_CHECK_LIB([rt],[aio_error64])
################################################################
## Expat
## Required for S3 and Digital Signatures
##
AC_ARG_WITH(expat,
AS_HELP_STRING([--with-expat=PATH], [where libexpat is compiled (if it isn't installed); required for S3 and Digital Signatures]),
[LDFLAGS="-L${with_expat} $LDFLAGS" ;
CPPFLAGS="-I${with_expat}/lib $CPPFLAGS"])
have_expat=yes
AC_CHECK_HEADER([expat.h])
AC_CHECK_LIB([expat],[XML_ParserCreate],,[have_expat="no ";AC_MSG_WARN([expat not found; S3 and Digital Signatures not enabled])])
################################################################
## Amazon S3
## S3 requires curl and expat; otherwise we don't need them
AC_ARG_ENABLE(s3,
AC_HELP_STRING([--enable-s3=yes],
[Support for Amazon's S3 service. Requires CURL and Expat.]),
[enable_s3=$enableval], [enable_s3=no])
if test "x${enable_s3}" = "xyes" ; then
AC_MSG_NOTICE([S3 support requested. Looking for curl and expat...])
AC_PATH_PROG(CURL_CONFIG,curl-config)
AC_ARG_WITH(curl,
AC_HELP_STRING([--with-curl=PATH], [where libcurl is installed; required for S3]),
[CURL_CONFIG="${with_curl}/bin/curl-config"])
AC_CHECK_HEADER([curl/curl.h],,
AC_MSG_WARN([curl/curl.h not found; Disabling S3 Support.])
enable_s3=no)
AC_CHECK_LIB([curl],[curl_global_init],,
AC_MSG_WARN([Curl library corrupt; Disabling S3 Support.])
enable_s3=no)
fi
S3_BIN=
if test "x${enable_s3}" = "xyes" ; then
AC_DEFINE([USE_S3],1,[Enable support for Amazon S3])
S3_BIN='s3$(EXEEXT)'
fi
AC_SUBST(S3_BIN)
AM_CONDITIONAL([MAYBE_S3],[test "x${enable_s3}" = "xyes"]) # used by automake
################################################################
### QEMU
################################################################
AC_ARG_ENABLE([qemu])
echo "disable_qemu: " ${disable_qemu}
echo "enable_qemu: " ${enable_qemu}
if test x"${cross_compiling}" = "xyes" ; then
AC_MSG_NOTICE([cross-compiling: Disabling QEMU])
enable_qemu="no";
fi
if test "x${enable_qemu}" = "xno" ; then
enable_qemu="no"
AC_DEFINE([DISABLE_QEMU],1,[User has disabled QEMU support])
else
AC_DEFINE([USE_QEMU],1,[Use QEMU image drivers])
enable_qemu="yes"
fi
AM_CONDITIONAL([MAYBE_QEMU],[test "x${enable_qemu}" = "xyes"]) # used by automake
################################################################
### PyAFF
################################################################
# python checks
# (requires autoconf 1.5+ and the macros in acinclude.m4)
AC_ARG_ENABLE([python],
AC_HELP_STRING([--enable-python=no], [Build python bindings (pyaff)]),
[enable_python=$enableval], [enable_python=no])
if test "${enable_python}" = "yes" ; then
AM_PATH_PYTHON([2.5])
AC_PYTHON_DEVEL()
AC_DEFINE([HAVE_PYTHON],1,[Build Python bindings])
fi
AM_CONDITIONAL(HAVE_PYTHON, test "$enable_python" = yes)
##
################################################################
################################################################
## Crypto (must follow S3)
###
# If we are cross-compiling, then add the specail libs that OpenSSL requires
if test x"${cross_compiling}" == "xyes" ; then
LIBS="$LIBS -lws2_32 -lgdi32"
fi
AC_CHECK_LIB([crypto],[MD5_Update],,
AC_MSG_ERROR([OpenSSL developer library 'libcrypto' not installed; cannot continue.]))
AC_CHECK_LIB([ssl],[ssl3_new],,
AC_MSG_ERROR([OpenSSL developer library 'libssl-dev' or 'openssl-devel' not installed; cannot continue.]))
AC_CHECK_HEADERS([openssl/aes.h openssl/bio.h openssl/evp.h openssl/hmac.h openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h openssl/pem.h openssl/x509.h])
AC_CHECK_FUNCS([MD5 SHA1 AES_encrypt RAND_pseudo_bytes des_read_pw_string EVP_read_pw_string EVP_MD_size])
AC_CHECK_LIB([md],[MD5]) # if libmd is available, get it
AC_CHECK_FUNCS([PEM_read_bio_RSA_PUBKEY])
################################################################
## FUSE: Filesystem in Userspace
AC_ARG_ENABLE(fuse,
AC_HELP_STRING([--enable-fuse=yes],
[Support for FUSE, Filesystem in Userspace. (default yes)]),
[enable_fuse=$enableval], [enable_fuse=yes])
if test "x${enable_fuse}" = "xyes" ; then
AC_MSG_NOTICE([FUSE requested])
CPPFLAGS="-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 $CPPFLAGS"
if test `uname -s` = Darwin ; then
AC_MSG_NOTICE([FUSE IS NOT SUPPORTED ON MACOS])
enable_fuse=no
fi
AC_CHECK_HEADER([fuse.h],,
AC_MSG_NOTICE([fuse.h not found; Disabling FUSE support.])
enable_fuse=no)
AC_SUBST(FUSE_LIBS)
AC_SUBST(FUSE_CFLAGS)
fi
AFFUSE_BIN=
if test "${enable_fuse}" = "yes"; then
AC_DEFINE([USE_FUSE],1,[Use FUSE to mount AFF images])
AFFUSE_BIN='affuse$(EXEEXT)'
FUSE_LIBS=-lfuse
fi
AC_SUBST(AFFUSE_BIN)
AM_PROG_CC_C_O dnl for affuse
############## drop optimization flags if requeted ################
if test x"${AFF_NOOPT}" != "x" ; then
with_noopt="yes";
fi
if test "${with_noopt}" = "yes" ; then
CFLAGS=`echo "$CFLAGS" | sed s/-O[[0-9]]//` # note the double quoting!
CXXFLAGS=`echo "$CXXFLAGS" | sed s/-O[[0-9]]//`
fi
# I am a glutten for punishment and this is security-critical software
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -Wall"
CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -Wall"
################ drop threading if requested ################
AC_ARG_ENABLE(threading,
[ --disable-threading builds library without threading
--enable-threading use threading if available])
if test "x$disable_threading" != xno; then
PTHREAD_CFLAGS=""
PTHREAD_CXXFLAGS=""
PTHREAD_LDFLAGS=""
AC_DEFINE(DISABLE_PTHREAD,1,[User has disabled PTHREADING])
fi
AM_CONDITIONAL([THREADING], [test "x$enable_threading" != xno])
###### Tell user what flags we have #######
# see http://pre.plt-scheme.org/plt/src/mzscheme/configure.ac
#
AC_MSG_NOTICE([])
AC_MSG_NOTICE([*****************************************])
AC_MSG_NOTICE([AFFLIB ${PACKAGE_VERSION} configuration])
AC_MSG_NOTICE([Amazon S3 Support: ${enable_s3}])
AC_MSG_NOTICE([LZMA Compression: yes])
AC_MSG_NOTICE([LIBEWF: ${enable_libewf} (requires uuid-dev on Linux)])
AC_MSG_NOTICE([PYTHON Bindings: ${enable_python}])
AC_MSG_NOTICE([QEMU Image Drivers: ${enable_qemu}])
AC_MSG_NOTICE([FUSE: ${enable_fuse}])
AC_MSG_NOTICE([LIBEXPAT: ${have_expat} (needed for AFF signatures)])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([CFLAGS: ${CFLAGS}])
AC_MSG_NOTICE([CPPFLAGS: ${CPPFLAGS}])
AC_MSG_NOTICE([CXXFLAGS: ${CXXFLAGS}])
AC_MSG_NOTICE([LIBS: ${LIBS}])
AC_MSG_NOTICE([LDFLAGS: ${LDFLAGS}])
AC_MSG_NOTICE([*****************************************])
AC_MSG_NOTICE([])
# AC_PROG_RANLIB not needed if you are using AC_PROG_LIBTOOL
# AC_PROG_RANLIB
AC_CONFIG_FILES([Makefile lib/Makefile tools/Makefile lzma443/Makefile
tests/Makefile doc/Makefile pyaff/Makefile man/Makefile lib/version.h])
dnl Have configure make distribution specific files
AC_CONFIG_FILES([afflib.spec])
dnl Have configure write its configuration
AM_CONFIG_HEADER([affconfig.h])
AC_OUTPUT([afflib.pc])
|