# Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([kismet.h]) AC_PREREQ(2.57) # Check for host type AC_CANONICAL_HOST # Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_CPP # Liberated from ethereal's configure.in # # Add any platform-specific compiler flags needed. # AC_MSG_CHECKING(for platform-specific compiler flags) if test "x$GCC" = x then # # Not GCC - assume it's the vendor's compiler. # case "$host_os" in hpux*) # # HP's ANSI C compiler; flags suggested by Jost Martin. # "-Ae" for ANSI C plus extensions such as "long long". # "+O2", for optimization. XXX - works with "-g"? # CFLAGS="-Ae +O2 $CFLAGS" AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2) ;; darwin*) # # It may be called "cc", but it's really a GCC derivative # with a problematic special precompiler and precompiled # headers; turn off the special precompiler, as some # apparently-legal code won't compile with its precompiled # headers. # AC_DEFINE(SYS_DARWIN, 1, Compiling for Darwin/OSX) CFLAGS="-no-cpp-precomp $CFLAGS" LDFLAGS="$LDFLAGS -framework Foundation -framework CoreFoundation -F/System/Library/PrivateFrameworks -framework Apple80211 -framework IOKit" objc_link='$(OBJC_CONTROL_O)' AC_MSG_RESULT(Apple GCC - added Apple80211 frameworks and no-precomp) darwin="yes" ;; linux*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_LINUX, 1, Compiling for Linux OS) linux="yes" ;; freebsd*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_FREEBSD, 1, Compiling for FreeBSD) bsd="yes" ;; openbsd*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_OPENBSD, 1, Compiling for OpenBSD) bsd="yes" ;; netbsd*) AC_MSG_RESULT(adding pkgsrc locations) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -L/usr/pkg/lib" AC_DEFINE(SYS_NETBSD, 1, Compiling for NetBSD) bsd="yes" ;; cygwin*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_CYGWIN, 1, Compiling for Cygwin) cygwin="yes" ;; *) AC_MSG_RESULT(none needed) ;; esac else case "$host_os" in solaris*) # the X11 headers don't automatically include prototype info # and a lot don't include the return type CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15" AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15) ;; darwin*) # # See comments above about Apple's lovely C compiler. # AC_DEFINE(SYS_DARWIN, 1, Compiling for Darwin/OSX) CFLAGS="-no-cpp-precomp $CFLAGS" LDFLAGS="$LDFLAGS -framework Foundation -framework CoreFoundation -F/System/Library/PrivateFrameworks -framework Apple80211 -framework IOKit" objc_link='$(OBJC_CONTROL_O)' AC_MSG_RESULT(Apple GCC - added Apple80211 frameworks and no-precomp) darwin="yes" ;; linux*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_LINUX, 1, Compiling for Linux OS) linux="yes" ;; freebsd*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_FREEBSD, 1, Compiling for FreeBSD) bsd="yes" ;; openbsd*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_OPENBSD, 1, Compiling for OpenBSD) bsd="yes" ;; netbsd*) AC_MSG_RESULT(adding pkgsrc locations) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -L/usr/pkg/lib" AC_DEFINE(SYS_NETBSD, 1, Compiling for NetBSD) bsd="yes" ;; cygwin*) AC_MSG_RESULT(none needed) AC_DEFINE(SYS_CYGWIN, 1, Compiling for Cygwin) cygwin="yes" ;; *) AC_MSG_RESULT(none needed) ;; esac fi if test "$cygwin" = "yes"; then AC_MSG_CHECKING(cygwin compile flags) AC_MSG_RESULT(__MINGW32__) CXXFLAGS="$CXXFLAGS -D__MINGW32__" fi AC_CONFIG_SRCDIR([kismet_server.cc]) AC_CONFIG_HEADER([config.h]) # Config location for code to default to CONFFILE_DIR=$sysconfdir CONFFILE_DIR=`( test "$prefix" = NONE && prefix=$ac_default_prefix test "$exec_prefix" = NONE && exec_prefix=${prefix} eval echo "$CONFFILE_DIR" )` AC_DEFINE_UNQUOTED(SYSCONF_LOC, "$CONFFILE_DIR", system config directory) LOCALSTATE_DIR=$localstatedir LOCALSTATE_DIR=`( test "$prefix" = NONE && prefix=$ac_default_prefix test "$exec_prefix" = NONE && exec_prefix=${prefix} eval echo "$LOCALSTATE_DIR" )` AC_DEFINE_UNQUOTED(LOCALSTATE_DIR, "$LOCALSTATE_DIR", system state directory) BIN_DIR=$bindir BIN_DIR=`( test "$prefix" = NONE && prefix=$ac_default_prefix test "$exec_prefix" = NONE && exec_prefix=${prefix} eval echo "$BIN_DIR" )` AC_DEFINE_UNQUOTED(BIN_LOC, "$BIN_DIR", system binary directory) # Check for endian AC_C_BIGENDIAN # Checks for header files. AC_CHECK_HEADERS([errno.h stdlib.h string.h sys/socket.h sys/time.h sys/wait.h unistd.h sys/types.h netdb.h], AC_DEFINE(HAVE_SYSHEADERS, 1, System headers are there), AC_MSG_ERROR(Missing required system header)) AC_CHECK_HEADERS([getopt.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_HEADER_TIME AC_STRUCT_TM # Checks for library functions. AC_HEADER_STDC AC_TYPE_SIGNAL AC_FUNC_STAT AC_CHECK_FUNCS([gettimeofday memset select socket strcasecmp strftime strstr]) # Do we have getopt_long natively? AC_MSG_CHECKING([for system-level getopt_long()]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #ifdef HAVE_GETOPT_H #include #endif ]], [[ static struct option long_options[] = { /* options table */ { "null-arg", required_argument, 0, 'n' }, { 0, 0, 0, 0 } }; int s; int option_index; int argc; char **argv; s = getopt_long(argc, argv, "n:", long_options, &option_index); ]])],[sys_getopt=yes],[sys_getopt=no]) if test "$sys_getopt" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_GETOPT_LONG, 1, system defines getopt_long) else AC_MSG_RESULT([no]) fi # Look for something to define standard int types stdint=yes AC_CHECK_HEADER([stdint.h], AC_DEFINE(HAVE_STDINT_H, 1, stdint.h is present) stdint=yes, stdint=no) if test "$stdint" = "no"; then inttypes=no AC_CHECK_HEADER([inttypes.h], AC_DEFINE(HAVE_INTTYPES_H, 1, inttypes.h is present) inttypes=yes, inttypes=no) fi if test "$stdint" = "no"; then if test "$inttypes" = "no"; then AC_MSG_RESULT([failed]) AC_MSG_ERROR([could not find stdint.h or inttypes.h.]) fi fi # How does accept() work on this system? AC_MSG_CHECKING([for accept() addrlen type]) OCFL="$CFLAGS" CFLAGS="-Werror $CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include ]], [[ int s = 0; struct sockaddr *addr = NULL; socklen_t *addrlen = NULL; accept(s, addr, addrlen); return 0; ]])],[accept_socklen=yes],[accept_socklen=no]) if test "$accept_socklen" = "yes"; then AC_MSG_RESULT([socklen_t]) AC_DEFINE(HAVE_SOCKLEN_T, 1, accept() takes type socklen_t for addrlen) else AC_MSG_RESULT([int]) fi CFLAGS="$OCFL" # Do we have large file support? AC_SYS_LARGEFILE # Do we use libstdc++? AC_CHECK_LIB([uClibc++], [main], foundcxxl="uclibc" LIBS="$LIBS -luClibc++") # Do we use uclibc++? if test "$foundcxxl"x == "x"; then AC_CHECK_LIB([stdc++], [main], foundcxxl="stdc++" LIBS="$LIBS -lstdc++ -lm",,"-lm") fi if test "$foundcxxl"x == "x"; then AC_MSG_ERROR(Neither uclibc uClibc++ or standard gcc stdc++ libraries found.) fi AC_MSG_CHECKING([for group 'root']) if test "`grep -e ^root: /etc/group`" = ""; then AC_MSG_RESULT([no. Using 'wheel']) instgrp="wheel" else AC_MSG_RESULT([yes]) instgrp="root" fi AC_SUBST(instgrp) AC_MSG_CHECKING([for group 'man']) if test "`grep -e ^man: /etc/group`" = ""; then AC_MSG_RESULT([no. Using '$instgrp']) mangrp="$instgrp" else mangrp="man" fi AC_SUBST(mangrp) # Checks for libraries. # AC_CHECK_LIB([ibs], [main]) AC_ARG_ENABLE(curses, [ --disable-curses disable libcurses interface],,wantecurses=yes) buildcurses=no if test "$wantecurses" = "yes"; then AC_DEFINE(BUILD_CURSES, 1, Build curses-based UI) buildcurses=yes fi AC_ARG_ENABLE(panel, [ --disable-panel disable libpanels interface],,wantepanel=yes) ncurses=no wantpanel=no if test "$wantecurses" = "yes" -o "$wantepanel" = "yes"; then AC_CHECK_LIB([ncurses], [initscr], AC_DEFINE(HAVE_LIBNCURSES, 1, NCurses terminal lib) ncurses=yes curseaux="-lncurses", AC_MSG_WARN(Unable to find libncurses)) if test "$ncurses" = no; then AC_CHECK_LIB([curses], [initscr], AC_DEFINE(HAVE_LIBNCURSES, 1, NCurses terminal lib) AC_DEFINE(HAVE_LIBCURSES, 1, Curses terminal lib) curses=yes ncurses=yes curseaux="-lcurses", AC_MSG_ERROR(Unable to find libncurses or libcurses)) fi if test "$ncurses" = yes -a "$wantepanel" = yes; then AC_CHECK_LIB([panel], [new_panel], AC_DEFINE(HAVE_LIBPANEL, 1, Panel terminal lib) AC_DEFINE(BUILD_PANEL, 1, Build panel UI) panel=yes, AC_MSG_WARN(*** Unable to find libpanel - panel UI will not be built. ***), $curseaux) fi if test "$panel" = yes; then CLIBS="$CLIBS -lpanel" if test "$curses" = "yes"; then AC_CHECK_LIB([curses], [assume_default_colors], AC_DEFINE(HAVE_ASSUME_DEFAULT_COLORS, 1, AssumeDefaultColors present), AC_MSG_WARN(*** Your curses does not have assume_default_colors. ***)) else AC_CHECK_LIB([ncurses], [assume_default_colors], AC_DEFINE(HAVE_ASSUME_DEFAULT_COLORS, 1, AssumeDefaultColors present), AC_MSG_WARN(*** Your curses does not have assume_default_colors. ***)) fi fi if test "$ncurses" = yes; then if test "$curses" = yes; then CLIBS="$CLIBS -lcurses" else CLIBS="$CLIBS -lncurses" fi fi else AC_MSG_WARN(*** Neither ncurses or panel interface will be built. ***) fi AC_SUBST(CLIBS) AC_ARG_WITH(linuxheaders, [ --with-linuxheaders[=DIR] Custom location of the Linux kernel headers if the glibc copies are insufficient ], [ if test "$withval" != no -a "$withval" != "yes"; then CPPFLAGS="$CPPFLAGS -I$withval" fi ]) # ,[ # CPPFLAGS="$CPPFLAGS -I/lib/modules/$(uname -r)/build/include/" # ]) AC_ARG_ENABLE(netlink, [ --disable-netlink disable linux netlink socket capture],,wantnetlink=yes) AC_SUBST(wantnetlink) if test "$wantnetlink" = yes; then netlink=no AC_CHECK_HEADER([linux/netlink.h], [AC_DEFINE(HAVE_LINUX_NETLINK, 1, Linux netlink socket capture present) netlink=yes], [AC_MSG_WARN([*** Missing Linux netlink headers. wlanng_legacy source will not be built. ***])], [ #include #include #include ]) else AC_MSG_WARN([*** Compiling without Linux netlink headers. wlanng_legacy source will not be built. ***]) fi AC_ARG_ENABLE(wireless-extension, [ --disable-wireless-extension Disable linux wireless extensions even if found],, wantwireless=yes) AC_SUBST(wantwireless) if test "$wantwireless" = yes; then wireless=no AC_CHECK_HEADER([linux/wireless.h], [wireless=yes], [AC_MSG_WARN([*** Missing Linux Wireless kernel extentions. The majority of packet sources on Linux require this support and will not work without it. Make sure your kernel header packages are installed. If all else fails, try the --with-linuxheaders directive. ***])], [ #include #include #include #include ]) else AC_MSG_WARN(*** Missing Linux Wireless kernel extentions. The majority of packet sources on Linux require this support and will not work without it. Make sure your kernel header packages are installed. If all else fails, try the --with-linuxheaders directive. ***) fi if test "$wireless" = "yes"; then AC_MSG_CHECKING(that linux/wireless.h is what we expect) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include #include ]], [[ struct iwreq wrq; wrq.u.essid.flags = 0; ]])],[wireless=yes],[wireless=no]) if test "$wireless" = "no"; then AC_MSG_RESULT(no) AC_MSG_WARN(*** Missing working Linux Wireless kernel extentions. ***) else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LINUX_WIRELESS, 1, Linux wireless extentions present) # Check if we have 22+ (SIOCIWFIRSTPRIV) support wireless22=no AC_MSG_CHECKING(that wireless extentions support SIOCIWFIRSTPRIV) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include ]], [[ int x; x = SIOCIWFIRSTPRIV; ]])],[wireless22=yes],[wireless22=no]) if test "$wireless22" = "no"; then AC_MSG_RESULT(no) AC_MSG_WARN([*** Your wireless extentions version is old. This will almost certianly cause problems entering monitor mode and controlling channels. ***]); else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LINUX_WIRELESS22, 1, [Linux wireless extentions v22 or better present]) fi iwfreqflag=no AC_MSG_CHECKING(can we use iw_freq.flags) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include ]], [[ struct iwreq wrq; wrq.u.freq.flags = IW_FREQ_FIXED; ]])],[iwfreqflag=yes],[iwfreqflag=no]) if test "$iwfreqflag" = "no"; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_LINUX_IWFREQFLAG, 1, [Linux wireless iwfreq.flag]) fi fi fi if test "$cygwin" = yes; then AC_CHECK_HEADERS([windows.h Win32-Extensions.h]) AC_ARG_ENABLE(airpcap, [ --enable-airpcap enable checking for CACE airpcap],want_airpcap=yes) if test "$want_airpcap" = "yes"; then airpcap_devpack="none" AC_ARG_WITH(airpcap-devpack, [ --with-airpcap[=DIR] Location of the CACE AirPcap device pack NOTE cygwin appears to have link errors if the path is not within the current directory], [ airpcap_devpack="$withval" ]) if test "$airpcap_devpack" = "none"; then AC_MSG_ERROR(No airpcap path provided use --with-airpcap-devpack) fi # devpack none # Set the libs and includes LDFLAGS="$LDFLAGS -L$airpcap_devpack/WinPcap_Devpack/Lib -L$airpcap_devpack/Airpcap_Devpack/lib" CPPFLAGS="$CPPFLAGS -I$airpcap_devpack/WinPcap_Devpack/Include -I$airpcap_devpack/Airpcap_Devpack/include" fi # want_airpcap fi # cygwin AC_ARG_ENABLE(pcap, [ --disable-pcap disable libpcap (most sources) capture support],,wantpcap=yes) AC_SUBST(wantpcap) if test "$wantpcap" = yes; then foundsyspcap=no if test "$cygwin" = yes; then pcaplib="wpcap"; else pcaplib="pcap"; fi AC_CHECK_LIB([${pcaplib}], [pcap_open_live], AC_DEFINE(HAVE_LIBPCAP, 1, libpcap packet capture lib) foundsyspcap=yes, AC_MSG_WARN(Compiling without libpcap support.)) if test "$foundsyspcap" = yes; then ## if we don't have a pcap.h, do a search for pcap/pcap.h AC_CHECK_HEADER([pcap.h], AC_DEFINE(HAVE_PCAP_H, 1, libpcap header) foundsyspcaph=yes) if test "$foundsyspcaph" != yes; then AC_CHECK_HEADER([pcap/pcap.h], AC_DEFINE(HAVE_PCAP_H, 1, libpcap header) AC_DEFINE(HAVE_PCAPPCAP_H, 1, pcap/pcap.h), AC_MSG_ERROR([found libpcap but unable to find pcap.h])) fi # Look for the new PCAP stuff AC_CHECK_LIB([pcap], [pcap_setnonblock], AC_DEFINE(HAVE_PCAP_NONBLOCK, 1, Nonblocking-capable libpcap), AC_MSG_WARN(*** You don't appear to have a version of libpcap which supports non-blocking IO. We'll fake it, but you REALLY should upgrade your libpcap, as it may not support 802.11 capture sources, either. ***)) if test "$cygwin" != yes; then AC_CHECK_LIB([${pcaplib}], [pcap_get_selectable_fd], AC_DEFINE(HAVE_PCAP_GETSELFD, 1, Selectablefd-capable libpcap), AC_MSG_ERROR(installed libpcap version does not support features Kismet requires. Upgrade to a current version of libpcap)) else AC_CHECK_LIB([${pcaplib}], [pcap_fileno], AC_DEFINE(HAVE_PCAP_FILENO, 1, pcapfileno-capable libwpcap), AC_MSG_ERROR(installed libpcap version does not support features Kismet requires. Upgrade to a current version of libwpcap)) fi pcaplnk="-l${pcaplib}" AC_SUBST(pcaplnk) pcap="yes" fi fi if test "$wantpcap" != "yes" -o "$pcap" != "yes"; then AC_MSG_WARN(Compiling without libpcap support. Many capture sources will be disabled.) fi AC_SUBST(pcap) if test "$pcap" = "no" -a "$want_airpcap" = "yes"; then AC_MSG_WARN([*** Disabling AirPcap, libpcap not enabled ***]); want_airpcap=no; fi if test "$want_airpcap" = "yes" -a "$pcap" = "yes"; then foundairpcap=no AC_CHECK_LIB([airpcap], [AirpcapSetLinkType], AC_DEFINE(HAVE_LIBAIRPCAP, 1, libairpcap win32 control lib) foundairpcap=yes, AC_MSG_WARN(Compiling without airpcap support.)) if test "$foundairpcap" = yes; then ## if we don't have a pcap.h, do a search for pcap/pcap.h AC_CHECK_HEADER([airpcap.h], AC_DEFINE(HAVE_AIRPCAP_H, 1, libairpcap header) foundairpcaph=yes) fi if test "$foundairpcap" != "yes" -o "$foundairpcaph" != "yes"; then AC_MSG_WARN(Compiling without airpcap support) else airpcap="yes" LIBS="$LIBS -lairpcap" fi fi if test "$bsd" = yes; then AC_MSG_CHECKING(for net80211/radiotap support) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include #include #include #include #include ]], [[ ]])],[radiotap=yes],[radiotap=no]) else AC_MSG_WARN(Using local radiotap support on a non-bsd system) radiotap=yes fi if test "$radiotap" = yes; then AC_DEFINE(HAVE_RADIOTAP, 1, radiotap packet headers) fi AC_ARG_ENABLE(setuid, [ --disable-setuid disable setuid/privdrop ability (not reccomended)],,suid=yes) AC_ARG_ENABLE(viha, [ --disable-viha disable MacOSX Viha capture source (OSX only)],want_viha=no,) if test "$darwin" != "yes" -a "$want_viha" = "yes"; then AC_MSG_WARN([*** Disabling Viha on non-OSX system ***]); want_viha=no; fi if test "$want_viha" = "yes"; then AC_CHECK_HEADERS([WiFi/WLPacketSource.h WiFi/WLFrame.h WiFi/IEEE80211Frame.h WiFi/WFException.h], AC_DEFINE(HAVE_VIHAHEADERS, 1, Viha headers are there) foundviha=yes, AC_MSG_ERROR(Missing required viha headers. Did you install the Viha drivers?)) # Enable the ldflags and cxx flags if we found it... if test "$foundviha" = "yes"; then LDFLAGS="$LDFLAGS -framework WiFi" # Force suid disabled suid="no" AC_MSG_WARN(*** Disabling setuid capabilities. Viha must be controlled from the main process which makes setuid-dropping impossible. ***) fi fi # Evaluate suid if test "$cygwin" = "yes"; then suid="no" fi AC_SUBST(suid) if test "$suid" = yes; then AC_MSG_CHECKING(for setuid ) AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SUID, 1, setuid capable) else AC_MSG_CHECKING(for setuid) AC_MSG_RESULT(no) # Yell if we didn't already yell about viha if test "$foundviha" != "yes"; then AC_MSG_WARN(*** Not installing setuid capabilities. It is more secure to install Kismet as setuid-capable so it can drop privileges. Please consult the README file. ***) fi if test "$cygwin" = "yes"; then AC_MSG_WARN(*** Disabling setuid capabilities under Cygwin since they serve no purpose here. ***) fi fi wsp100=yes AC_ARG_ENABLE(wsp100, [ --disable-wsp100 disable wsp100 remote drone source],,wsp100=no) if test "$wsp100" = "yes"; then AC_DEFINE(HAVE_WSP100, 1, wsp100 remote sensor support) fi # Look for dbus PKG_CHECK_MODULES(DBUS, dbus-1, HAVE_DBUS="yes", HAVE_DBUS="no") if test "$HAVE_DBUS"x = "yesx"; then CXXFLAGS="$CFLAGS `pkg-config dbus-1 --cflags`" LIBS="$LIBS `pkg-config dbus-1 --libs`" AC_DEFINE(HAVE_DBUS, 1, dbus integration) fi local=no AC_ARG_ENABLE(local-dumper, [ --enable-local-dumper force use of local dump code even if Ethereal is available], local=yes,) AC_SUBST(local) libz="no" AC_DEFINE(USE_LOCAL_DUMP, 1, Use local dumper code) local=yes # gpsmap checks # We include GPS handling code regardless, for now. AC_DEFINE(HAVE_GPS, 1, GPS support will be built.) wantgpsmap=yes AC_ARG_ENABLE(gpsmap, [ --disable-gpsmap disable building gpsmap], wantgpsmap=no, wantgpsmap=yes) AC_SUBST(wantgpsmap) if test "$wantgpsmap" = "yes"; then # Check for expat expatl=no AC_CHECK_LIB([expat], [XML_GetCurrentLineNumber], AC_DEFINE(HAVE_EXPAT, 1, Expat XML library) expatl=yes, AC_MSG_WARN(*** Missing Expat XML library. gpsmap will not be built. ***)) # Check for libgmp gmpl=no AC_CHECK_HEADER([gmp.h], AC_DEFINE(HAVE_GMP, 1, GMP math library) gmpl=yes, AC_MSG_WARN(*** Missing GMP math library. gpsmap will not be built. ***)) # Check for imagemagick magickold=no save_cppflags="$CPPFLAGS" save_cxxflags="$CXXFLAGS" save_libs="$LIBS" save_ldflags="$LDFLAGS" AC_CHECK_PROG(magickconfig, [Magick-config --version], yes, no) if test "$magickconfig" = "yes"; then magickversion=`Magick-config --version` magickmajor=`echo $magickversion | cut -d '.' -f 1` magickminor=`echo $magickversion | cut -d '.' -f 2` magicktiny=`echo $magickversion | cut -d '.' -f 3` if test "$magickmajor" -lt 5; then magickold="yes"; elif test "$magickmajor" -eq 5 -a "$magickminor" -lt 4; then magickold="yes"; elif test "$magickmajor" -eq 5 -a "$magickminor" -eq 4 -a "$magicktiny" -lt 7; then magickold="yes"; fi fi if test "$magickold" = "yes"; then AC_MSG_WARN(*** Old version of ImageMagick ($magickversion) found. Please upgrade to 5.4.7 or newer. gpsmap will not be built. ***) elif test "$magickconfig" = "no"; then AC_MSG_WARN(*** Missing Magick-config (or it is not in the path). gpsmap will not be built. ***) else #CPPFLAGS="$CPPFLAGS `Magick-config --cppflags` -I`Magick-config --prefix`/include" CPPFLAGS="$CPPFLAGS `Magick-config --cppflags`" CXXFLAGS="$CXXFLAGS `Magick-config --cflags`" #CXXFLAGS="$CXXFLAGS `Magick-config --cflags` -I`Magick-config --prefix`/include" LDFLAGS="$LDFLAGS `Magick-config --ldflags`" LIBS="`Magick-config --libs`" AC_CHECK_HEADER(magick/api.h, magickhdr="yes", magickhdr="no") if test "$magickhdr" = "no"; then oldcppflags2="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I`Magick-config --prefix`/include"; AC_CHECK_HEADER(magick/api.h, magickhdr="yes", magickhdr="no") if test "$magickhdr" = "no"; then CPPFLAGS="$oldcppflags2"; AC_MSG_WARN(*** Missing ImageMagick. gpsmap will not be built. ***) fi fi if test "$magickhdr" = "yes"; then AC_CHECK_LIB([Magick], [WriteImage], AC_DEFINE(HAVE_IMAGEMAGICK, 1, Imagemagick image library) gpslc="\$(GPSL)", AC_MSG_WARN(*** Missing Imagemagick. gpsmap will not be built. ***)) fi fi CPPFLAGS="$save_cppflags" CXXFLAGS="$save_cxxflags" LIBS="$save_libs" LDFLAGS="$save_ldflags" if test "$expatl" = "no"; then if test "$gpslc" != ""; then AC_MSG_WARN(*** Disabling gpsmap because expat was not found. ***) gpslc="" fi fi if test "$gmpl" = "no"; then if test "$gpslc" != ""; then AC_MSG_WARN(*** Disabling gpsmap because GMP was not found. ***) gpslc="" fi fi if test "$gpslc" != ""; then CPPFLAGS="$CPPFLAGS `Magick-config --cppflags`" CXXFLAGS="$CXXFLAGS `Magick-config --cflags`" fi if test "$libz" = "no" -a "$gpslc" != ""; then AC_CHECK_LIB([z], [gzopen], AC_DEFINE(HAVE_LIBZ, 1, Libz compression lib) LIBS="$LIBS -lz" libz="yes", AC_MSG_WARN(Unable to find libz compression)) fi AC_CHECK_HEADER(pthread.h, AC_CHECK_LIB([pthread], [pthread_create], AC_DEFINE(HAVE_PTHREAD, 1, pthread threading library) pthr="yes", pthr="no"), pthr="no") if test "$pthr" = "no"; then AC_MSG_WARN(*** GPSMap will be built without pthread support. ***); threadlib="" else threadlib="-lpthread" fi # Update the companion to this... if test "$gpslc"x != "x"; then gpslco="\$(GPSLO)" fi AC_SUBST(gpslc) AC_SUBST(gpslco) else AC_MSG_WARN(*** --disable-gpsmap was specified. gpsmap will not be built ***) expatl="no" gmpl="no" gpslc="" pthr="no" fi # Not all OpenBSD archs have apm: if test "$bsd" = "yes"; then AC_CHECK_HEADERS([machine/apmvar.h]) fi # Substitute in the objc linkages if we need them AC_SUBST(objc_link) AC_ARG_ENABLE(optimization, [ --disable-optimization disable -Ox gcc optimization],,wantopto=yes) if test "$wantopto" != "yes"; then CPPFLAGS=`echo $CPPFLAGS | sed -e 's/-O.//g'` CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O.//g'` fi AC_SUBST(threadlib) sharedatadir=$datadir sharedatadir=`( test "$prefix" = NONE && prefix=$ac_default_prefix test "$exec_prefix" = NONE && exec_prefix=${prefix} eval echo "$sharedatadir" )` sharedatadir=${sharedatadir} AC_SUBST(sharedatadir) AC_CONFIG_FILES([Makefile extra/buzzme/Makefile extra/Makefile conf/kismet.conf conf/kismet_ui.conf]) AC_OUTPUT echo echo "Configuration complete: " echo " Compiling for: $host_os ($host_cpu)" echo " C++ Library: $foundcxxl" echo " Installing as group: $instgrp" echo " Man pages owned by: $mangrp" echo " Installing into: $prefix" echo -n " Setuid capable: " if test "$suid" = "yes"; then echo "yes" elif test "$cygwin" = "yes"; then echo "n/a (Cygwin/win32)" elif test "$want_viha" = "yes"; then echo "n/a (OSX with Viha)" else echo "no" fi echo -n " Terminal Control: " if test "$ncurses" = "yes"; then if test "$curses" = "yes"; then echo "curses" else echo "ncurses" fi else echo "none" fi echo -n " Curses interface: " if test "$buildcurses" = "yes"; then echo "yes" else echo "no" fi echo -n " Panels interface: " if test "$panel" = "yes"; then echo "yes" else echo "no" fi echo -n " Linux Netlink capture: " if test "$netlink" = "yes"; then echo "yes" elif test "$linux" != "yes"; then echo "n/a (only Linux)" else echo "no" fi echo -n " Linux wireless : " if test "$wireless" = "yes"; then echo "yes" elif test "$linux" != "yes"; then echo "n/a (only Linux)" else echo "no" fi echo -n " Linux wireless v.22+ : " if test "$wireless22" = "yes"; then echo "yes" elif test "$linux" != "yes"; then echo "n/a (only Linux)" else echo "no" fi echo -n " pcap capture: " if test "$pcap" = "yes"; then echo "yes" else echo "no" fi echo -n " airpcap control: " if test "$airpcap" = "yes"; then echo "yes" elif test "$cygwin" != "yes"; then echo "n/a (only Cygwin/Win32)" else echo "no" fi echo -n " WSP100 capture: " if test "$wsp100" = "yes"; then echo "yes"; else echo "no"; fi echo -n " Viha capture: " if test "$want_viha" = "yes"; then echo "yes"; elif test "$darwin" != "yes"; then echo "n/a (only Darwin)" else echo "no"; fi echo -n " OSX/Darwin capture : " if test "$darwin" = "yes"; then echo "yes" elif test "$darwin" != "yes"; then echo "n/a (only OSX/Darwin)" else echo "no" fi echo -n " Radiotap headers: " if test "$radiotap" = "yes"; then echo "yes"; else echo "no"; fi echo -n " Using local dump code: " if test "$local" = "yes"; then echo "yes" else echo "no" fi echo -n " DBUS Integration: " if test "$HAVE_DBUS" = "yes"; then echo "yes" else echo "no" fi # echo -n "Using ethereal wiretap: " # if test "$want_ethereal" = "no"; then # echo "no" # else # echo "$ethereal_dir" # fi echo -n " Imagemagick support: " if test "$gpslc" = ""; then if test "$wantgpsmap" = "no"; then echo "disabled" else echo "no" fi else echo "yes ($magickversion)" fi echo -n " Expat Library: " if test "$expatl" = "no"; then if test "$wantgpsmap" = "no"; then echo "disabled" else echo "no" fi else echo "yes" fi echo -n " GMP Library: " if test "$gmpl" = "no"; then if test "$wantgpsmap" = "no"; then echo "disabled" else echo "no" fi else echo "yes" fi echo -n " PThread Support: " if test "$pthr" = "no"; then if test "$wantgpsmap" = "no"; then echo "disabled" else echo "no" fi else echo "yes" fi echo -n " libz compression: " if test "$libz" = "yes"; then echo "yes" else if test "$wantgpsmap" = "no"; then echo "disabled" else echo "no" fi fi if test "$wireless" != "yes" -a "$linux" = "yes"; then echo "*** WARNING ***" echo "Linux Wireless Extensions were not found. This means that they are not" echo "turned on in your kernel or that your kernel source include paths on your" echo "distribution are broken (namely, that linux/wireless.h didn't exist or" echo "was unuseable). Without wireless extentions, most of the commonly used" echo "packet sources (such as Cisco, Orinoco, Madwifi, Prism54, and others)" echo "WILL NOT BE BUILT." echo "*** WARNING ***" fi if test "$pcap" != "yes" -a "$linux" = "yes"; then echo "*** WARNING ***" echo "LibPCAP was not found. Kismet previously included a local copy of this" echo "library, however it now expects libpcap to be provided by the system." echo "Kismet on Linux without LibPcap cannot capture data locally and will " echo "almost certainly NOT BE WHAT YOU WANT." echo "Your distribution should provide packages for libpcap, otherwise " echo "it can be downloaded from http://tcpdump.org" fi if test "`echo $host_os | grep linux`" = ""; then echo echo "Configuration complete. You are not running a linux-based system," echo "you will likely need to use 'gmake' instead of 'make'." echo "Run 'gmake dep' to generate dependencies and 'gmake' followed by" echo "'gmake install' to compile and install Kismet" echo "Kismet WILL NOT be installed suid-root by default. If you wish to install" echo "Kismet as a suid-root utility, READ THE DOCUMENTATION and run " echo "'make suidinstall'." echo "DO NOT INSTALL KISMET AS SUID-ROOT IF YOU HAVE UNTRUSTED USERS ON YOUR SYSTEM." else verminor=`uname -r | cut -d '.' -f 2` # Stupid redhat vertiny=`uname -r | cut -d '.' -f 3 | cut -f 1 -d-` if test "$verminor" = "4" -a "$vertiny" -lt 16 ; then AC_MSG_WARN(There have been a number of major improvements in the linux-wireless extentions and in the aironet drivers in recent versions. It is recomended that you run at least kernel version 2.4.16, otherwise you may experience difficulties.) fi echo echo "Configuration complete. Run 'make dep' to generate dependencies" echo "and 'make' followed by 'make install' to compile and install." fi