Changeset 808a478 for configure.in


Ignore:
Timestamp:
04/21/05 09:54:40 (17 years ago)
Author:
Daniel Lawson <dlawson@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
4b30586
Parents:
7bb7dda
Message:

Ported to OpenBSD

Changes were mostly with header changes, although openbsd's pcap doesn't have pcap_open_dead, so we provide our own. To this end, I fixed the libreplace shit that wasn't working at all well, and ended up putting strndup.c and pcap_open_dead.c into lib/, and adding @LTLIBOBJS@ to the libtrace source file line. Seems to work fine now!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    r48a6c51 r808a478  
    44AM_INIT_AUTOMAKE(libtrace,2.0.16)
    55
    6 AC_CONFIG_FILES([Makefile replace/Makefile lib/Makefile])
     6AC_CONFIG_FILES([Makefile lib/Makefile])
    77dnl GNU C library
    88dnl AC_GNU_SOURCE
     
    2020AC_HEADER_STDC
    2121dnl AC_CHECK_HEADERS(errno.h stdlib.h stdio.h assert.h string.h netinet/in.h assert.h errno.h fcntl.h net/ethernet.h netdb.h pcap.h stdio.h stdlib.h string.h sys/stat.h sys/types.h sys/socket.h sys/un.h unistd.h time.h sys/ioctl.h net/bpf.h pcap.h zlib.h pcap-bpf.h)
    22 AC_CHECK_HEADERS(pcap.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h inttypes.h limits.h dagapi.h )
     22AC_CHECK_HEADERS(pcap.h pcap-int.h pcap-bpf.h net/bpf.h zlib.h sys/limits.h stddef.h inttypes.h limits.h dagapi.h net/ethernet.h )
     23
     24AC_CHECK_HEADERS(netinet/in.h)
     25
     26AC_CHECK_HEADER(net/if.h,
     27                AC_DEFINE(HAVE_NET_IF_H,1,[We have net/if.h]), [],
     28[#include <sys/types.h>
     29 #include <sys/socket.h>
     30])
     31
     32
     33AC_CHECK_HEADER(netinet/if_ether.h,
     34                AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[We have netinet/if_ether.h]), [],
     35[
     36 #include <sys/types.h>
     37 #include <sys/socket.h>
     38 #include <netinet/in.h>
     39 #include <net/if.h>
     40])
     41
     42AC_CHECK_HEADER(net/if_arp.h,
     43                AC_DEFINE(HAVE_NET_IF_ARP_H,1,[We have net/if_arp.h]), [],
     44[
     45 #include <sys/types.h>
     46 #include <sys/socket.h>
     47 #include <netinet/in.h>
     48 #include <net/if.h>
     49])
     50
    2351       
    2452# Checking for the right bpf header to include
     
    4270
    4371
     72# *BSD doesn't have strndup. Currently provide our own.
    4473AC_REPLACE_FUNCS(strndup)
     74
     75# Earlier versions of pcap don't have pcap_open_dead. EG: the one OpenBSD
     76# ships with. Even Debian Woody is more up to date.
     77AC_CHECK_LIB(pcap,pcap_open_dead,[],[AC_REPLACE_FUNCS([pcap_open_dead])])
     78   
    4579
    4680# Checks for typedefs, structures, and compiler characteristics.
     
    149183
    150184if test x"$ac_cv_use_pcap" != xno; then
    151         ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
    152         ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
    153 
     185    ADD_LIBS="$ADD_LIBS  -l$ac_cv_use_pcap"
     186   
    154187    pcap_lib_file="${ac_cv_use_pcap_path}/lib${ac_cv_use_pcap}.so"
    155     if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then
    156         AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
    157         AC_MSG_ERROR([Exiting]);
    158     fi 
     188   
     189    # if the library is in /usr/lib, then just use
     190    # AC_CHECK_LIB.
     191    if test x"${ac_cv_use_pcap_path}" != x"/usr/lib"; then
     192            AC_CHECK_LIB(${ac_cv_use_pcap},pcap_open_live,
     193                         have_libpcap=yes,
     194                         have_libpcap=no)
     195
     196            if test x"${have_libpcap}" != xno; then
     197                AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
     198                AC_MSG_ERROR([Exiting]);
     199            fi
     200    else
     201        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_pcap_path"
     202        # if it's not in /usr/lib/, check manually. This isn't nice,
     203        # and will probably break.
     204        if test ! -r "$ac_cv_use_pcap_path" -o ! -r "$pcap_lib_file"; then
     205                AC_MSG_NOTICE([Cannot find pcap library $pcap_lib_file.])
     206                AC_MSG_ERROR([Exiting]);
     207        fi 
     208    fi
    159209    AC_DEFINE(HAVE_PCAP,1,[Conditional for building PCAP support])
    160210else
     
    176226
    177227if test "$ac_cv_use_zlib" != no; then
    178         ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
     228    ADD_LIBS="$ADD_LIBS -l$ac_cv_use_zlib"
     229   
     230    zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
     231
     232    # if the library is in /usr/lib/, then just use AC_CHECK_LIB
     233    if test x"${ac_cv_use_zlib_path}" != x"/usr/lib"; then
     234            AC_CHECK_LIB(${ac_cv_use_zlib}, gzopen,
     235                         have_libzlib=yes,
     236                         have_libzlib=no)
     237            if test x"{have_libzlib}" != xno; then
     238                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
     239                AC_MSG_ERROR([Exiting]);
     240            fi
     241    else
    179242        ADD_LDFLAGS="$ADD_LDFLAGS -L$ac_cv_use_zlib_path"
    180    
    181     zlib_lib_file="${ac_cv_use_zlib_path}/lib${ac_cv_use_zlib}.so"
    182    
    183     if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then
    184         AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
    185         AC_MSG_ERROR([Exiting]);
     243        # if it's not in /usr/lib/, check manually. This isn't nice
     244        # and will probably break.
     245        if test ! -r "$ac_cv_use_zlib_path" -o ! -r "$zlib_lib_file"; then
     246                AC_MSG_NOTICE([Cannot find zlib library $zlib_lib_file.])
     247                AC_MSG_ERROR([Exiting]);
     248        fi
    186249    fi
    187    
    188250    AC_DEFINE(HAVE_ZLIB,1,[Conditional for building zlib support])
    189251else
Note: See TracChangeset for help on using the changeset viewer.