This repository has been archived by the owner on Jan 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
acinclude.m4.ntop
207 lines (198 loc) · 6.7 KB
/
acinclude.m4.ntop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# local automake definitions for ntop
## (this file is processed with 'automake' to produce Makefile.in)
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
# Copyright (c) 1998-2003 Luca Deri <[email protected]>
# Updated 1Q 2000 Rocco Carbone <[email protected]>
# Rewrite 1Q 2003 Burton M. Strauss III <[email protected]>
#
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
dnl>
dnl> Check for an ANSI C typedef in a header
dnl>
dnl> configure.in:
dnl> AC_CHECK_TYPEDEF(<typedef>, <header>)
dnl> acconfig.h:
dnl> #undef HAVE_<typedef>
dnl>
AC_DEFUN([AC_CHECK_TYPEDEF],[dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_MSG_CHECKING(for typedef $1)
AC_CACHE_VAL(ac_cv_typedef_$1,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
changequote([,]), [
#include <$2>
], ac_cv_typedef_$1=yes, ac_cv_typedef_$1=no)])dnl
AC_MSG_RESULT($ac_cv_typedef_$1)
if test $ac_cv_typedef_$1 = yes; then
AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
fi
])
dnl>
dnl> Appends values to $CPPFLAGS, $LDFLAGS and $LIBS
dnl> Also: Allows us to automate for those OSes which DO NOT check subdirectories.
dnl> Allows us to strip dups.
dnl>
# NTOP_APPENDS(Ivalue, Lvalue, lvalue)
# ----------------------------------------------
AC_DEFUN([NTOP_APPENDS],
[dnl
# Expansion of NTOP_APPENDS($1, $2, $3)
if test ".$1" != "."; then
rc=`(echo $CPPFLAGS | grep '$1 ' > /dev/null 2> /dev/null; echo $?)`
if [[ $rc -eq 1 ]]; then
CPPFLAGS="$CPPFLAGS -I$1"
fi
rc=`(echo $INCS | grep '$1' > /dev/null 2> /dev/null; echo $?)`
if [[ $rc -eq 1 ]]; then
INCS="$INCS -I$1"
fi
fi
if test ".$2" != "."; then
rc=`(echo $LDFLAGS | grep '$2 ' > /dev/null 2> /dev/null; echo $?)`
if [[ $rc -eq 1 ]]; then
case "${DEFINEOS}" in
DARWIN )
LDFLAGS="$LDFLAGS -L$2 -L$2/lib"
;;
* )
LDFLAGS="$LDFLAGS -L$2"
;;
esac
fi
fi
if test ".$3" != "."; then
rc=`(echo $LIBS | grep '\-l$3 ' > /dev/null 2> /dev/null; echo $?)`
if [[ $rc -eq 1 ]]; then
LIBS="$LIBS -l$3"
fi
fi
# Finished expansion of NTOP_APPENDS()
])
dnl>
dnl> Report location
dnl>
# NTOP_RPT_LOC(item, lib, include)
# ----------------------------------------------
AC_DEFUN([NTOP_RPT_LOC],
[dnl
# Expansion of NTOP_RPT_LOC($1 $2 $3)
if test ".$3" = "."; then
echo "$1 .h : standard system headers"
else
echo "$1 .h : $3"
fi
if test ".$2" = "."; then
echo "$1 library : standard system libraries"
else
echo "$1 library : $2"
fi
# Finished expansion of NTOP_RPT_LOC()
])
# NTOP_SET_LIBINC(item)
# ----------------------------------------------
AC_DEFUN([NTOP_SET_LIBINC],
[dnl
# Expansion of NTOP_SET_LIBINC($1)
if test ".${$1_DIRECTORY}" != "."; then
if test ".${$1_LIB}" = "."; then
if test -d ${$1_DIRECTORY}/lib; then
$1_LIB="${$1_DIRECTORY}/lib"
else
$1_LIB="${$1_DIRECTORY}"
fi
fi
if test ".${$1_INCLUDE}" = "."; then
if test -d ${$1_DIRECTORY}/include; then
$1_INCLUDE="${$1_DIRECTORY}/include"
else
$1_INCLUDE="${$1_DIRECTORY}"
fi
fi
fi
# Finished expansion of NTOP_SET_LIBINC()
])
# NTOP_SUGGESTION(item, version)
# ----------------------------------------------
AC_DEFUN([NTOP_SUGGESTION],
[dnl
# Expansion of NTOP_SUGGESTION($1, $2, $3)
echo "*??? Suggestion - Install a private copy of $1 $2."
echo "*??? It's quite easy and does NOT require root:"
echo "*"
echo "* Download $1 $2 from gnu"
echo "* \$ wget http://ftp.gnu.org/gnu/$1/$1-$2.tar.gz"
echo "*"
echo "* Untar it"
echo "* \$ tar xfvz $1-$2.tar.gz"
echo "*"
echo "* Make it"
echo "* \$ cd $1-$2"
echo "* \$ ./configure --prefix=/home/<whatever>/$1$3"
echo "* \$ make"
echo "* \$ make install"
echo "*"
echo "* Add it to your path. Under bash do this:"
echo "* \$ PATH=/home/<whatever>/$1$3/bin:\$PATH"
echo "* \$ export PATH"
echo "*"
# Finished expansion of NTOP_SUGGESTION()
])
# NTOPCONFIGDEBUG_SETTINGS(where)
# ----------------------------------------------
AC_DEFUN([NTOPCONFIGDEBUG_SETTINGS],
[dnl
# Expansion of NTOPCONFIGDEBUG_SETTINGS()
if test ".${NTOPCONFIGDEBUG}" = ".yes"; then
echo "DEBUG: $1"
echo " AWK.................'${AWK}'"
echo " AS..................'${AS}'"
echo " ACLOCAL.............'${ACLOCAL}'"
echo " AUTOCONF............'${AUTOCONF}'"
echo " AUTOHEADER..........'${AUTOHEADER}'"
echo " AUTOMAKE............'${AUTOMAKE}'"
echo " CC..................'${CC}'"
echo " gcc?.............'${GCC}'"
echo " CCLD................'${CCLD}'"
echo " CFLAGS..............'${CFLAGS}'"
echo " CPP.................'${CPP}'"
echo " CPPFLAGS............'${CPPFLAGS}'"
echo " DEFS................'${DEFS}'"
echo " DEPDIR..............'${DEPDIR}'"
echo " DLLTOOL.............'${DLLTOOL}'"
echo " DYN_FLAGS...........'${DYNFLAGS}'"
echo " EXEEXT..............'${EXEEXT}'"
echo " INCS................'${INCS}'"
echo " LDFLAGS.............'${LDFLAGS}'"
echo " LIBS................'${LIBS}'"
echo " LN_S................'${LN_S}'"
echo " MYRRD...............'${MYRRD}'"
echo " OBJDUMP.............'${OBJDUMP}'"
echo " OBJEXT..............'${OBJEXT}'"
echo " RANLIB..............'${RANLIB}'"
echo " SO_VERSION_PATCH....'${SO_VERSION_PATCH}'"
echo " build...............'${build}'"
echo " host................'${host}'"
echo " target..............'${target}'"
fi
# Finished expansion of NTOPCONFIGDEBUG_SETTINGS()
])