/[MITgcm]/MITgcm_contrib/mpack_src/mpack-1.6-4/cmulocal/libpcap.m4
ViewVC logotype

Contents of /MITgcm_contrib/mpack_src/mpack-1.6-4/cmulocal/libpcap.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sat Feb 23 20:13:31 2008 UTC (17 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
- get new version from: http://packages.qa.debian.org/m/mpack.html
  (files: mpack_1.6.orig.tar.gz, mpack_1.6-4.diff.gz, mpack_1.6-4.dsc)
  and apply patch 'mpack_1.6-4.diff' to original dir: mpack_1.6/
- this fix the MD5 coding on 64.bit platforms (well, seems to).
- added in Contrib to allow separate test (since building mpack seems fishy)

1 dnl libpcap.m4--PCAP libraries and includes
2 dnl Derrick Brashear
3 dnl from KTH krb and Arla
4 dnl $Id: libpcap.m4,v 1.7 2002/12/21 18:44:24 cg2v Exp $
5
6 AC_DEFUN(CMU_PCAP_INC_WHERE1, [
7 ac_cv_found_pcap_inc=no
8 if test -f "$1/pcap.h" ; then
9 ac_cv_found_pcap_inc=yes
10 fi
11 ])
12
13 AC_DEFUN(CMU_PCAP_INC_WHERE, [
14 for i in $1; do
15 AC_MSG_CHECKING(for pcap header in $i)
16 CMU_PCAP_INC_WHERE1($i)
17 if test "$ac_cv_found_pcap_inc" = "yes"; then
18 ac_cv_pcap_where_inc=$i
19 AC_MSG_RESULT(found)
20 break
21 else
22 AC_MSG_RESULT(no found)
23 fi
24 done
25 ])
26
27 AC_DEFUN(CMU_PCAP_LIB_WHERE1, [
28 saved_LIBS=$LIBS
29 LIBS="$saved_LIBS -L$1 -lpcap"
30 AC_TRY_LINK(,
31 [pcap_lookupdev("");],
32 [ac_cv_found_pcap_lib=yes],
33 ac_cv_found_pcap_lib=no)
34 LIBS=$saved_LIBS
35 ])
36
37 AC_DEFUN(CMU_PCAP_LIB_WHERE, [
38 for i in $1; do
39 AC_MSG_CHECKING(for pcap library in $i)
40 CMU_PCAP_LIB_WHERE1($i)
41 CMU_TEST_LIBPATH($i, pcap)
42 if test "$ac_cv_found_pcap_lib" = "yes" ; then
43 ac_cv_pcap_where_lib=$i
44 AC_MSG_RESULT(found)
45 break
46 else
47 AC_MSG_RESULT(no found)
48 fi
49 done
50 ])
51
52 AC_DEFUN(CMU_PCAP, [
53 AC_ARG_WITH(pcap,
54 [ --with-pcap=PREFIX Compile with PCAP support],
55 [if test "X$with_pcap" = "X"; then
56 with_pcap=yes
57 fi])
58 AC_ARG_WITH(pcap-lib,
59 [ --with-pcap-lib=dir use pcap libraries in dir],
60 [if test "$withval" = "yes" -o "$withval" = "no"; then
61 AC_MSG_ERROR([No argument for --with-pcap-lib])
62 fi])
63 AC_ARG_WITH(pcap-include,
64 [ --with-pcap-include=dir use pcap headers in dir],
65 [if test "$withval" = "yes" -o "$withval" = "no"; then
66 AC_MSG_ERROR([No argument for --with-pcap-include])
67 fi])
68
69 if test "X$with_pcap" != "X"; then
70 if test "$with_pcap" != "yes"; then
71 ac_cv_pcap_where_lib=$with_pcap/lib
72 ac_cv_pcap_where_inc=$with_pcap/include
73 fi
74 fi
75
76 if test "X$with_pcap_lib" != "X"; then
77 ac_cv_pcap_where_lib=$with_pcap_lib
78 fi
79 if test "X$ac_cv_pcap_where_lib" = "X"; then
80 CMU_PCAP_LIB_WHERE(/usr/ng/lib /usr/lib /usr/local/lib)
81 fi
82
83 if test "X$with_pcap_include" != "X"; then
84 ac_cv_pcap_where_inc=$with_pcap_include
85 fi
86 if test "X$ac_cv_pcap_where_inc" = "X"; then
87 CMU_PCAP_INC_WHERE(/usr/ng/include /usr/include /usr/local/include)
88 fi
89
90 AC_MSG_CHECKING(whether to include pcap)
91 if test "X$ac_cv_pcap_where_lib" = "X" -a "X$ac_cv_pcap_where_inc" = "X"; then
92 ac_cv_found_pcap=no
93 AC_MSG_RESULT(no)
94 else
95 ac_cv_found_pcap=yes
96 AC_MSG_RESULT(yes)
97 PCAP_INC_DIR=$ac_cv_pcap_where_inc
98 PCAP_LIB_DIR=$ac_cv_pcap_where_lib
99 PCAP_INC_FLAGS="-I${PCAP_INC_DIR}"
100 PCAP_LIB_FLAGS="-L${PCAP_LIB_DIR} -lpcap"
101 if test "X$RPATH" = "X"; then
102 RPATH=""
103 fi
104 case "${host}" in
105 *-*-linux*)
106 if test "X$RPATH" = "X"; then
107 RPATH="-Wl,-rpath,${PCAP_LIB_DIR}"
108 else
109 RPATH="${RPATH}:${PCAP_LIB_DIR}"
110 fi
111 ;;
112 *-*-hpux*)
113 if test "X$RPATH" = "X"; then
114 RPATH="-Wl,+b${PCAP_LIB_DIR}"
115 else
116 RPATH="${RPATH}:${PCAP_LIB_DIR}"
117 fi
118 ;;
119 *-*-irix*)
120 if test "X$RPATH" = "X"; then
121 RPATH="-Wl,-rpath,${PCAP_LIB_DIR}"
122 else
123 RPATH="${RPATH}:${PCAP_LIB_DIR}"
124 fi
125 ;;
126 *-*-solaris2*)
127 if test "$ac_cv_prog_gcc" = yes; then
128 if test "X$RPATH" = "X"; then
129 RPATH="-Wl,-R${PCAP_LIB_DIR}"
130 else
131 RPATH="${RPATH}:${PCAP_LIB_DIR}"
132 fi
133 else
134 RPATH="${RPATH} -R${PCAP_LIB_DIR}"
135 fi
136 ;;
137 esac
138 AC_SUBST(RPATH)
139 fi
140 ])

  ViewVC Help
Powered by ViewVC 1.1.22