| 168 | | # some funky macro to be backwards compatible with earlier autoconfs |
|---|
| 169 | | # in current they have AC_CHECK_DECLS |
|---|
| 170 | | |
|---|
| 171 | | AC_DEFUN(SN_CHECK_DECL,[ |
|---|
| 172 | | AC_MSG_CHECKING([whether $1 must be declared]) |
|---|
| 173 | | AC_CACHE_VAL(sn_cv_decl_needed_$1, |
|---|
| 174 | | [AC_TRY_COMPILE([ |
|---|
| 175 | | #include <stdio.h> |
|---|
| 176 | | #ifdef HAVE_STRING_H |
|---|
| 177 | | #include <string.h> |
|---|
| 178 | | #endif |
|---|
| 179 | | #ifdef HAVE_STRINGS_H |
|---|
| 180 | | #include <strings.h> |
|---|
| 181 | | #endif |
|---|
| 182 | | #ifdef HAVE_STDLIB_H |
|---|
| 183 | | #include <stdlib.h> |
|---|
| 184 | | #endif |
|---|
| 185 | | #ifdef HAVE_UNISTD_H |
|---|
| 186 | | #include <unistd.h> |
|---|
| 187 | | #endif |
|---|
| 188 | | #include <sys/types.h> |
|---|
| 189 | | #include <sys/socket.h> |
|---|
| 190 | | #ifndef HAVE_PCAP_BPF_H |
|---|
| 191 | | #ifdef HAVE_NET_BPF_H |
|---|
| 192 | | #include <net/bpf.h> |
|---|
| 193 | | #endif |
|---|
| 194 | | #else |
|---|
| 195 | | #include <pcap.h> |
|---|
| 196 | | #endif |
|---|
| 197 | | ], |
|---|
| 198 | | [char *(*pfn) = (char *(*)) $1], |
|---|
| 199 | | eval "sn_cv_decl_needed_$1=no",eval "sn_cv_decl_needed_$1=yes") ]) |
|---|
| 200 | | |
|---|
| 201 | | if eval "test \"`echo '$sn_cv_decl_needed_'$1`\" != no"; then |
|---|
| 202 | | AC_MSG_RESULT(yes) |
|---|
| 203 | | ifelse([$2], , :, [$2]) |
|---|
| 204 | | else |
|---|
| 205 | | AC_MSG_RESULT(no) |
|---|
| 206 | | ifelse([$3], , ,[$3]) |
|---|
| 207 | | fi |
|---|
| 208 | | ])dnl |
|---|
| 209 | | |
|---|
| 210 | | AC_DEFUN(SN_CHECK_DECLS, |
|---|
| 211 | | [for sn_decl in $1 |
|---|
| 212 | | do |
|---|
| 213 | | sn_def_decl=`echo $sn_decl | tr [a-z] [A-Z]` |
|---|
| 214 | | SN_CHECK_DECL($sn_decl, |
|---|
| 215 | | [ |
|---|
| 216 | | AC_DEFINE_UNQUOTED(NEED_DECL_$sn_def_decl, 1, |
|---|
| 217 | | [you have this cuz autoheader is dumb]) |
|---|
| 218 | | $2], $3)dnl |
|---|
| 219 | | done |
|---|
| 220 | | ]) |
|---|
| 221 | | |
|---|
| 222 | | # some stuff for declarations which were missed on sunos4 platform too. |
|---|
| 223 | | # |
|---|
| 224 | | # add `#undef NEED_DECL_FUNCTIONAME to acconfig.h` because autoheader |
|---|
| 225 | | # fails to work properly with custom macroses. |
|---|
| 226 | | # you will see also #undef for each SN_CHECK_DECLS macros invocation |
|---|
| 227 | | # because autoheader doesn't execute shell script commands. |
|---|
| 228 | | # it is possible to make loops using m4 but the code would look even |
|---|
| 229 | | # more confusing.. |
|---|
| 230 | | SN_CHECK_DECLS(printf fprintf fopen fclose fwrite fflush getopt \ |
|---|
| 231 | | bzero bcopy memset strtol strerror perror socket sendto \ |
|---|
| 232 | | snprintf strtoul) |
|---|
| | 318 | AC_ARG_WITH(cpuemu, |
|---|
| | 319 | [ --with-cpuemu Perform shellcode analysis in x86 CPU emulation]) |
|---|
| | 320 | AM_CONDITIONAL(BUILD_CPUEMU_PLUGIN, test x$with_cpuemu = xyes) |
|---|
| | 321 | if test "$with_cpuemu" = "yes"; then |
|---|
| | 322 | AC_ARG_WITH(libemu_includes, |
|---|
| | 323 | [ --with-libemu-includes=DIR libemu include directory], |
|---|
| | 324 | [with_libemu_includes="$withval"],[with_libemu_includes=no]) |
|---|
| | 325 | |
|---|
| | 326 | AC_ARG_WITH(libemu_libraries, |
|---|
| | 327 | [ --with-libemu-libraries=DIR libemu library directory], |
|---|
| | 328 | [with_libemu_libraries="$withval"],[with_libemu_libraries=no]) |
|---|
| | 329 | |
|---|
| | 330 | if test "$with_libemu_includes" != "no"; then |
|---|
| | 331 | CPPFLAGS="${CPPFLAGS} -I${with_libemu_includes}" |
|---|
| | 332 | fi |
|---|
| | 333 | AC_CHECK_HEADER(emu/emu.h,,[AC_ERROR(emu.h not found.)]) |
|---|
| | 334 | |
|---|
| | 335 | if test "$with_libemu_libraries" != "no"; then |
|---|
| | 336 | LDFLAGS="${LDFLAGS} -L${with_libemu_libraries}" |
|---|
| | 337 | fi |
|---|
| | 338 | LEMU="yes" |
|---|
| | 339 | # AC_CHECK_LIB(emu, emu_getpc_check,, LEMU="no") |
|---|
| | 340 | |
|---|
| | 341 | if test "$LEMU" = "no"; then |
|---|
| | 342 | echo |
|---|
| | 343 | echo " ERROR! Libemu library/headers not found. Install it or use the" |
|---|
| | 344 | echo " --with-libemu-* options, if you have it installed in unusual place." |
|---|
| | 345 | echo |
|---|
| | 346 | exit |
|---|
| | 347 | fi |
|---|
| | 348 | |
|---|
| | 349 | else |
|---|
| | 350 | with_cpuemu="no" |
|---|
| | 351 | fi |
|---|
| | 352 | |
|---|
| | 353 | |
|---|