-
Notifications
You must be signed in to change notification settings - Fork 101
/
configure.ac
136 lines (116 loc) · 4.02 KB
/
configure.ac
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
# MALHEUR - Automatic Analysis of Malware Behavior
# Copyright (c) 2009-2015 Konrad Rieck ([email protected])
# University of Goettingen, Berlin Institute of Technology
#
# Malheur version
AC_INIT([malheur], [0.6.0], [[email protected]])
AC_PREFIX_DEFAULT("/usr/local")
# Defines (suitable for loading and saving versioned files)
AC_DEFINE(MALHEUR_MAJOR, 0, Major version number)
AC_DEFINE(MALHEUR_MINOR, 6, Minor version number)
AC_DEFINE(MALHEUR_PATCH, 0, Patch version number)
echo
echo " > MALHEUR - Automatic Analysis of Malware Behavior"
echo " Copyright (c) 2009-2015 Konrad Rieck ([email protected])"
echo " University of Goettingen, Berlin Institute of Technology"
echo
# Init automake
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
# Check for important programs
AC_PROG_CC
AC_PROG_LD
AC_PROG_INSTALL
# Libtool stuff
AC_CONFIG_MACRO_DIR(m4)
AC_PROG_LIBTOOL
# By default remove assert statements
CFLAGS="$CFLAGS -DNDEBUG"
# By default we include the math library
LIBS="$LIBS -lm"
# Set GCC and C99 flags if present
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -std=c99 -fgnu89-inline -Wall -fPIC"
fi
# Optional packages
AC_ARG_WITH([libarchive], [AS_HELP_STRING([--with-libarchive],
[support for reading archives @<:@default=check@:>@])],
[], [with_libarchive=check])
AC_ARG_WITH([openmp], [AS_HELP_STRING([--with-openmp],
[support for multi-processing @<:@default=check@:>@])],
[], [with_openmp=check])
# Check for zlib (required)
AC_CHECK_HEADERS([zlib.h], HEADER_ZLIB="yes")
AC_CHECK_LIB([z], gzopen, LIBRARY_ZLIB="yes")
if test "x$LIBRARY_ZLIB" != "x" && test "x$HEADER_ZLIB" != "x" ; then
LIBS="-lz $LIBS"
AC_DEFINE([HAVE_ZLIB], [1], [Define if you have zlib])
HAVE_ZLIB=yes
else
HAVE_ZLIB=no
AC_MSG_FAILURE([libz not found. see README.md])
fi
# Check for libarchive (optional)
AC_CHECK_HEADERS([archive.h], HEADER_LIBARCHIVE="yes")
AC_CHECK_LIB([archive], archive_read_new, LIBRARY_LIBARCHIVE="yes")
if test "x$LIBRARY_LIBARCHIVE" != "x" && \
test "x$HEADER_LIBARCHIVE" != "x" && \
test "x$with_libarchive" != "xno" ; then
AC_DEFINE([HAVE_LIBARCHIVE], [1], [Define if you have libarchive])
LIBS="-larchive $LIBS"
HAVE_LIBARCHIVE=yes
else
HAVE_LIBARCHIVE=no
if test "x$with_libarchive" == "xyes" ; then
AC_MSG_FAILURE([libarchive not found. see README.md])
fi
fi
# Check for libconfig (required)
AC_CHECK_HEADERS([libconfig.h], HEADER_LIBCONFIG="yes")
PKG_CHECK_MODULES([PKGCONFIG], [libconfig >= 1.3.2], LIBRARY_LIBCONFIG="yes")
if test "x$LIBRARY_LIBCONFIG" != "x" && \
test "x$HEADER_LIBCONFIG" != "x" ; then
CFLAGS="$CFLAGS $PKGCONFIG_CFLAGS"
LIBS="$LIBS $PKGCONFIG_LIBS"
AM_CPPFLAGS="$AM_CPPFLAGS `pkg-config --cflags-only-I libconfig`"
HAVE_LIBCONFIG=yes
AC_DEFINE([HAVE_LIBCONFIG], [1], [Define if you have libconfig])
else
HAVE_LIBCONFIG=no
AC_MSG_FAILURE([libconfig not found. see README.md])
fi
# Check for OpenMP (optional)
AC_CHECK_HEADERS([omp.h], HEADER_OPENMP="yes")
AX_OPENMP(LIBRARY_OPENMP="yes")
if test "x$LIBRARY_OPENMP" != "x" && \
test "x$HEADER_OPENMP" != "x" && \
test "x$with_openmp" != "xno" ; then
CFLAGS="$CFLAGS $OPENMP_CFLAGS"
HAVE_OPENMP=yes
AC_DEFINE([HAVE_OPENMP], [1], [Define if you have OpenMP])
else
HAVE_OPENMP=no
if test "x$with_openmp" == "xyes" ; then
AC_MSG_FAILURE([no openmp support. see README.md])
fi
fi
# Check headers
AC_CHECK_HEADERS([getopt.h string.h strings.h])
AC_CHECK_HEADERS([uthash.h uthash/uthash.h], HEADER_UTHASH="yes")
# Check functions
AC_CHECK_FUNC(round, AC_DEFINE(HAVE_FUNC_ROUND, 1,
[Define to 1 if you have the function round]))
AC_CHECK_FUNC(log2, AC_DEFINE(HAVE_FUNC_LOG2, 1,
[Define to 1 if you have the function log2]))
AC_SUBST([AM_CPPFLAGS])
AC_CONFIG_FILES([
Makefile \
src/Makefile \
doc/Makefile \
tests/Makefile \
])
AC_OUTPUT
echo
echo " > Optional packages"
echo " Support reading archives (--with-libarchive): $HAVE_LIBARCHIVE"
echo " Support for multi-processing (--with-openmp): $HAVE_OPENMP"