summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 5d5ab1801f9ea25df04a46b97f3e0302236d7287 (plain)
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
# Process this file with autoconf to produce a configure script.

############################################################
# Autoconf requirements
############################################################

AC_PREREQ(2.59)
AC_INIT([openida], [0.0.1], [nocbos@gmail.com])

AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
AM_SILENT_RULES

AM_GNU_GETTEXT_VERSION([0.17])
AM_GNU_GETTEXT([external])

AC_CONFIG_SRCDIR([src/editor.c])


############################################################
# Information on the package
############################################################

#--- Checks for programs

AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL


#--- Checks for libraries

AC_CHECK_LIB([dl], [dlopen])


#--- Checks for header files

AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_HEADERS([stdlib.h])
AC_CHECK_HEADERS([string.h])
AC_CHECK_HEADERS([unistd.h])


#--- Checks for types

AC_TYPE_SIZE_T


#--- Checks for structures

AC_STRUCT_TM


#--- Checks for compiler characteristics

AC_C_CONST


#--- Checks for library functions

AC_FUNC_CLOSEDIR_VOID
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STAT
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF

AC_CHECK_FUNCS([pow])
AC_CHECK_FUNCS([regcomp])
AC_CHECK_FUNCS([strdup])
AC_CHECK_FUNCS([strerror])
AC_CHECK_FUNCS([strndup])
AC_CHECK_FUNCS([strrchr])


#--- Checks for system services



#--- Autoheader Macros

AH_TEMPLATE([VERSION], [Define the version number of the program for the about box.])
AH_TEMPLATE([PACKAGE_DATA_DIR], [Define the directory where the associated data will be installed.])
AH_TEMPLATE([PACKAGE_SOURCE_DIR], [Define the directory where the code source is waiting for being compiled.])
AH_TEMPLATE([PLUGINS_DIR], [Define the directory where the plugins are installed.])
AH_TEMPLATE([LOCALE_DIR], [Define the directory where the message catalogs are installed.])


AC_DEFINE_UNQUOTED(VERSION, AC_PACKAGE_VERSION)

if test "x${datadir}" = 'x${prefix}/share'; then
   if test "x${prefix}" = "xNONE"; then
      AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
   else
      AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
   fi
elif test "x${datadir}" = 'x${datarootdir}'; then
   if test "x${datarootdir}" = 'x${prefix}/share'; then
      if test "x${prefix}" = "xNONE"; then
         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
      else
         AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
      fi
   else
      AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datarootdir}/${PACKAGE}")
   fi 
else
   AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
fi

packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")

AC_DEFINE_UNQUOTED(PLUGINS_DIR, PACKAGE_DATA_DIR "/plugins")

if test "x${prefix}" = "xNONE"; then
   AC_DEFINE_UNQUOTED(LOCALE_DIR, "${ac_default_prefix}/share/locale")
else
   AC_DEFINE_UNQUOTED(LOCALE_DIR, "${prefix}/share/locale")
fi


############################################################
# Compilation options
############################################################

AC_ARG_ENABLE(debug,        [  --enable-debug          compile with debugging support [def=no]],            [enable_debug=yes],     [enable_debug=no])


#--- Is debug mode needed ?

if test "x$enable_debug" = "xyes"; then
   DEBUG_CFLAGS="$DEBUG_CFLAGS -ggdb -gdwarf-2 -DDEBUG"
fi

AC_SUBST(DEBUG_CFLAGS)

#-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes

WARNING_FLAGS="-Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes"

#-Wcast-qual -Wconversion -Wsign-compare -Wdisabled-optimization

AC_SUBST(WARNING_FLAGS)

# _XOPEN_SOURCE: strdup, snprintf
# _ISOC99_SOURCE: INFINITY; NAN
# GTK_DISABLE_DEPRECATED: on reste conforme au C99
COMPLIANCE_FLAGS="-D_GNU_SOURCE "
#-DGTK_DISABLE_DEPRECATED"

AC_SUBST(COMPLIANCE_FLAGS)

#--- Checks for GTK 2.0

PKG_CHECK_MODULES(LIBGTK,gtk+-2.0 >= 2.4.3,[libgtk_found=yes],[libgtk_found=no])

if test "$libgtk_found" = "yes"; then
   libgtk_version=`pkg-config gtk+-2.0 --modversion`
else
   libgtk_version='-'
fi

AC_SUBST(LIBGTK_CFLAGS)
AC_SUBST(LIBGTK_LIBS)


#--- Checks for libxml2

PKG_CHECK_MODULES(LIBXML,libxml-2.0 >= 2.6.11,[libxml_found=yes],[libxml_found=no])

if test "$libxml_found" = "yes"; then
   libxml_version=`pkg-config libxml-2.0 --modversion`
else
   libxml_version='-'
fi

AC_SUBST(LIBXML_CFLAGS)
AC_SUBST(LIBXML_LIBS)


#--- Checks for Python

LIBPYTHON_CFLAGS=`python-config --cflags`
LIBPYTHON_LIBS=`python-config --libs`

AC_SUBST(LIBPYTHON_CFLAGS)
AC_SUBST(LIBPYTHON_LIBS)


#--- Checks for Graphviz

PKG_CHECK_MODULES(LIBGRAPH,libgvc >= 0.20.2,[libgraph_found=yes],[libgraph_found=no])

if test "$libgraph_found" = "yes"; then
   libgraph_version=`pkg-config libgvc --modversion`
else
   libgraph_version='-'
fi

AC_SUBST(LIBGRAPH_CFLAGS)
AC_SUBST(LIBGRAPH_LIBS)


############################################################
# Outputting files
############################################################

AC_CONFIG_FILES([stamp-h po/Makefile.in], [echo timestamp > stamp-h])

AC_CONFIG_COMMANDS([marshal], [echo -e "VOID:UINT64,UINT64\nVOID:INT,UINT64,INT\nVOID:OBJECT\nVOID:OBJECT,OBJECT" > src/gtkext/iodamarshal.list])

AC_CONFIG_FILES([Makefile
                 pixmaps/Makefile
                 plugins/Makefile
                 plugins/dexresolver/Makefile
                 plugins/govm/Makefile
                 plugins/pyoida/Makefile
                 plugins/pyoida/analysis/Makefile
                 plugins/pyoida/arch/Makefile
                 plugins/pyoida/format/Makefile
                 plugins/python/Makefile
                 plugins/python/apkfiles/Makefile
                 plugins/stackvars/Makefile
                 plugins/theseus/Makefile
                 src/Makefile
                 src/analysis/Makefile
                 src/analysis/decomp/Makefile
                 src/analysis/disass/Makefile
                 src/arch/Makefile
                 src/arch/arm/Makefile
                 src/arch/dalvik/Makefile
                 src/arch/dalvik/decomp/Makefile
                 src/arch/dalvik/opcodes/Makefile
                 src/arch/dalvik/operands/Makefile
                 src/arch/dalvik/pseudo/Makefile
                 src/arch/jvm/Makefile
                 src/arch/mips/Makefile
                 src/arch/x86/Makefile
                 src/common/Makefile
                 src/debug/Makefile
                 src/debug/jdwp/Makefile
                 src/debug/jdwp/misc/Makefile
                 src/debug/jdwp/sets/Makefile
                 src/debug/remgdb/Makefile
                 src/decomp/Makefile
                 src/decomp/expr/Makefile
                 src/decomp/expr/dalvik/Makefile
                 src/decomp/instr/Makefile
                 src/decomp/lang/Makefile
                 src/dialogs/Makefile
                 src/format/Makefile
                 src/format/dex/Makefile
                 src/format/dwarf/Makefile
                 src/format/elf/Makefile
                 src/format/java/Makefile
                 src/format/mangling/Makefile
                 src/format/pe/Makefile
                 src/glibext/Makefile
                 src/graph/Makefile
                 src/gtkext/Makefile
                 src/gui/Makefile
                 src/gui/menus/Makefile
                 src/gui/panels/Makefile
                 src/gui/tb/Makefile
                 src/panels/Makefile
                 src/plugins/Makefile
                 src/plugins/overjump/Makefile
                 src/plugins/pyoida/Makefile])

AC_OUTPUT


echo
echo $PACKAGE $VERSION

echo
echo The GNU Image Manipulation Program Toolkit... : $libgtk_version
echo The XML C parser and toolkit of Gnome........ : $libxml_version
echo The graph library from Graphviz.............. : $libgraph_version

echo
echo Print debugging messages..................... : $enable_debug

echo
echo configure complete, now type \'make\'
echo