1 Star 0 Fork 1

sddpszz/lorcon-old

forked from LiuSJdudu/lorcon-old 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
configure.in 7.24 KB
一键复制 编辑 原始数据 按行查看 历史
Daniel Halperin 提交于 2015-07-16 00:44 . Initial import of lorcon-old,
dnl Blah blah standard autoconf
AC_INIT(Makefile.in)
dnl Host type
AC_CANONICAL_HOST
dnl Check for standard tools
AC_PROG_CC
AC_PROG_LIBTOOL
# 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.
#
CFLAGS="-no-cpp-precomp $CFLAGS"
AC_MSG_RESULT(Apple GCC - added -no-cpp-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)
;;
openbsd*)
AC_MSG_RESULT(none needed)
AC_DEFINE(SYS_OPENBSD, 1, Compiling for OpenBSD)
;;
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.
#
CFLAGS="-no-cpp-precomp $CFLAGS"
AC_MSG_RESULT(Apple GCC - added -no-cpp-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)
;;
openbsd*)
AC_MSG_RESULT(none needed)
AC_DEFINE(SYS_OPENBSD, 1, Compiling for OpenBSD)
;;
cygwin*)
# Adding -mno-cygwin uses the MingW linking process, precluding the use
# of cygwin.dll; linking to cygwin.dll forces GPL
CFLAGS="-mno-cygwin $CFLAGS"
AC_MSG_RESULT(none needed)
AC_DEFINE(SYS_CYGWIN, 1, Compiling for Cygwin)
cygwin="yes"
;;
*)
AC_MSG_RESULT(none needed)
;;
esac
fi
dnl Check for endian
AC_C_BIGENDIAN
dnl Check for headers and such
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h net/if_arp.h sys/socket.h)
dnl Look for linux kernel wireless headers
if test "$linux" = "yes"; then
AC_MSG_CHECKING(that linux/wireless.h is what we expect)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <sys/types.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/resource.h>
#include <asm/types.h>
#include <linux/if.h>
#include <linux/wireless.h>
]], [[
struct iwreq wrq;
wrq.u.essid.flags = 0;
]])],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LINUX_WIRELESS, 1, Linux wireless extentions present)
],[
AC_MSG_RESULT(no)
AC_MSG_ERROR(*** Missing working Linux wireless kernel extensions ***)
])
fi # linux
dnl Look for airpcap under cygwin
if test "$cygwin" = "yes"; then
AC_ARG_ENABLE(airpcap, [ --disable-airpcap disable checking for CACE airpcap],,wantairpcap=yes)
if test "$wantairpcap" = "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
dnl set the lib flags to refer to the devpack files
LDFLAGS="$LDFLAGS -L$airpcap_devpack/WinPcap_Devpack/Lib -L$airpcap_devpack/Airpcap_Devpack/Lib"
dnl set the CPP flags to refer to the devpack files
CPPFLAGS="$CPPFLAGS -I$airpcap_devpack/WinPcap_Devpack/Include -I$airpcap_devpack/Airpcap_Devpack/include"
AC_CHECK_LIB([wpcap], [pcap_open_live],
AC_DEFINE(HAVE_LIBWPCAP, 1, libwpcap library),
AC_MSG_ERROR(Could not link libwpcap check airpcap-devpack path))
AC_CHECK_LIB([wpcap], [pcap_get_airpcap_handle],,
AC_MSG_ERROR(Could not use pcap_get_airpcap_handle are you using the CACE airpcap libwpcap))
#AC_CHECK_LIB([airpcap], [AirpcapSetLinkType],
# AC_DEFINE(HAVE_LIBAIRPCAP, 1, libairpcap library),
# AC_MSG_ERROR(Could not link libairpcap check airpcap-devpack path))
AC_CHECK_HEADER([pcap.h],
AC_DEFINE(HAVE_PCAP_H, 1, pcap.h present),
AC_MSG_ERROR(Could not find pcap.h check airpcap-devpack path))
AC_CHECK_HEADER([airpcap.h],
AC_DEFINE(HAVE_AIRPCAP_H, 1, airpcap.h preset),
AC_MSG_ERROR(Could not find airpcap.h check airpcap-devpack path))
LIBS="$LIBS -lwpcap -lairpcap"
fi # waitairpcap
fi # cygwin
havenetlink=no
if test "$linux" = "yes"; then
havenetlink=yes
OLIBS="$LIBS"
AC_CHECK_HEADERS([asm/types.h netlink/genl/genl.h netlink/genl/family.h netlink/genl/ctrl.h netlink/msg.h netlink/attr.h linux/nl80211.h linux/if_arp.h linux/wireless.h],
AC_DEFINE(HAVE_NETLINKHEADERS, 1, Netlink headers are there),
havenetlink=no)
if test "$havenetlink" = "yes"; then
AC_CHECK_LIB([nl], [nl_handle_alloc],
AC_DEFINE(HAVE_LIBNL, 1, libnl netlink library), havenetlink=no)
else
AC_MSG_WARN(Missing libnl or libnl too old support will not be able to control mac80211 vaps)
fi
if test "$havenetlink" = "yes"; then
LIBS="$LIBS -lnl"
AC_MSG_CHECKING(For mac80211 support in netlink library)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <asm/types.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/family.h>
#include <netlink/genl/ctrl.h>
#include <netlink/msg.h>
#include <netlink/attr.h>
#include <linux/nl80211.h>
#include <linux/if_arp.h>
#include <linux/wireless.h>
]], [[
NL80211_IFTYPE_MONITOR;
return 0;
]])],[havenetlink=yes],[havenetlink=no])
else
AC_MSG_WARN(Missing libnl netlink library will not be able to control mac80211 vaps)
fi
if test "$havenetlink" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LINUX_NETLINK, 1, Netlink works)
else
LIBS="$OLIBS"
AC_MSG_RESULT(no netlink support for mac80211 will not be able to control mac80211 vaps)
fi # netlink checks
fi # netlink total
AC_CHECK_LIB([m], [pow],
AC_DEFINE(HAVE_LIBM, 1, Math lib) LIBS="$LIBS -lm",
AC_MSG_ERROR(*** Missing working libm math lib ***)
)
AC_CONFIG_HEADER(config.h)
CFLAGS=" -DHAVE_CONFIG_H $CFLAGS"
dnl Write it
AC_OUTPUT(Makefile)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sddpszz/lorcon-old.git
git@gitee.com:sddpszz/lorcon-old.git
sddpszz
lorcon-old
lorcon-old
master

搜索帮助