Skip to content

Commit

Permalink
appneta#185 detect OS X SDK, update libopts
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Klassen authored and Fred Klassen committed Jun 11, 2015
1 parent 1da2f48 commit 56a9e4c
Show file tree
Hide file tree
Showing 81 changed files with 8,196 additions and 8,784 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ else
SUBDIRS = $(KERNEL_DIR) scripts lib src
endif

DIST_SUBDIRS = scripts lib libopts src docs test kernel
DIST_SUBDIRS = scripts lib libopts src docs test $(KERNEL_DIR)
.PHONY: manpages docs test man2html


Expand Down
73 changes: 69 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

dnl $Id$

AC_INIT(tcpreplay)
AC_PREREQ([2.69])
AC_INIT([tcpreplay],[4.1.0],[https://github.com/appneta/tcpreplay/issues],[tcpreplay],[http://tcpreplay.sourceforge.net/])
AC_CONFIG_SRCDIR([src/tcpreplay.c])
AM_CONFIG_HEADER([src/config.h])
AC_CONFIG_AUX_DIR(config)
Expand Down Expand Up @@ -49,6 +50,70 @@ fi
AC_SUBST(CROSS_ARCH)
AC_SUBST(CROSS_LD)

dnl ============================================
dnl MacOSX build and runtime environment options
dnl ============================================

AC_ARG_WITH(macosx-sdk,
AS_HELP_STRING([--with-macosx-sdk],
[Use a specific SDK for building.])
[
Usage: --with-macosx-sdk=<version>
e. g.: --with-macosx-sdk=10.8
],
,)


dnl ===========================
dnl Check OS X SDK and compiler
dnl ===========================

case "$host_os" in
darwin*) # Mac OS X or iOS
# If no --with-macosx-sdk option is given, look for one

# The intent is that for "most" Mac-based developers, a suitable
# SDK will be found automatically without any configure options.

# For developers with a current Xcode, the lowest-numbered SDK
# higher than or equal to the minimum required should be found.

AC_MSG_CHECKING([what Mac OS X SDK to use])

for _macosx_sdk in $with_macosx_sdk 10.8 10.9 10.10; do
MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
if test -d "$MACOSX_SDK_PATH"; then
with_macosx_sdk="${_macosx_sdk}"
break
else
MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
if test -d "$MACOSX_SDK_PATH"; then
with_macosx_sdk="${_macosx_sdk}"
break
fi
fi
done
if test ! -d "$MACOSX_SDK_PATH"; then
AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK])
fi

AC_MSG_CHECKING([what compiler to use])
CC="`xcrun -find clang` -m64 -isysroot $MACOSX_SDK_PATH"
INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
AR=`xcrun -find ar`
NM=`xcrun -find nm`
STRIP=`xcrun -find strip`
LIBTOOL=`xcrun -find libtool`
RANLIB=`xcrun -find ranlib`
AC_MSG_RESULT([$CC])

;;

esac

AC_SUBST(MACOSX_SDK_PATH)
AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool

have_cygwin=no
AC_MSG_CHECKING([for cygwin development environment])
if test `echo $target | grep -c cygwin` -gt 0 ; then
Expand Down Expand Up @@ -469,7 +534,7 @@ AC_ARG_WITH(libpcap,
fi
done
],[
for testdir in /usr/local /opt/local /usr /wpdpack ; do
for testdir in /usr/local /opt/local /usr /wpdpack $MACOSX_SDK_PATH/usr /usr ; do
if test -f "${testdir}/include/pcap.h" -a $foundpcap = no ; then
LPCAPINC="${testdir}/include/pcap.h"
LPCAPINCDIR="${testdir}/include"
Expand Down Expand Up @@ -1201,7 +1266,7 @@ if test $have_cygwin = no ; then
AC_HELP_STRING([--with-libdnet=DIR], [Use libdnet in DIR]),
[trydnetdir=$withval])

for testdir in $trydnetdir /usr/local /opt/local /usr ; do
for testdir in $trydnetdir /usr/local /opt/local $MACOSX_SDK_PATH/usr /usr ; do
if test -x ${testdir}/bin/dnet-config -a $founddnet = no ; then
LDNETINC="`$testdir/bin/dnet-config --cflags`"
LDNETLIB="`$testdir/bin/dnet-config --libs`"
Expand Down Expand Up @@ -1660,7 +1725,7 @@ Linux/BSD netmap: ${have_netmap}

case $host in
*-apple-darwin*)
AC_MSG_WARN([Apple OS X versions prior to 10.5 (Leopard) has a serious problem!
AC_MSG_WARN([Apple OS X versions prior to 10.5 (Leopard) have a serious problem!
Please see: http://tcpreplay.synfin.net/trac/ticket/142 for more details])
;;

Expand Down
1 change: 0 additions & 1 deletion libopts/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions libopts/COPYING.gplv3
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (c) 1992-2012 by Bruce Korb - all rights reserved
Copyright (C) 1992-2014 by Bruce Korb - all rights reserved
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
copyright (c) by Bruce Korb - all rights reserved
Copyright (C) by Bruce Korb - all rights reserved

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

<program> copyright (c) by Bruce Korb - all rights reserved
<program> Copyright (C) by Bruce Korb - all rights reserved
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
Expand Down
Loading

0 comments on commit 56a9e4c

Please sign in to comment.