~ubuntu-branches/ubuntu/maverick/ntop/maverick

« back to all changes in this revision

Viewing changes to ntop/acinclude.m4.in

  • Committer: Bazaar Package Importer
  • Author(s): Dennis Schoen
  • Date: 2002-04-12 11:38:47 UTC
  • Revision ID: james.westby@ubuntu.com-20020412113847-4k4yydw0pzybc6g8
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
3
# local automake definitions for ntop
 
4
## (this file is processed with 'automake' to produce Makefile.in)
 
5
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
6
#
 
7
# Copyright (c) 1998, 2000 Luca Deri <deri@ntop.org>
 
8
# Updated 1Q 2000 Rocco Carbone <rocco@ntop.org>
 
9
#
 
10
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
11
#
 
12
# This program is free software; you can redistribute it and/or modify
 
13
# it under the terms of the GNU General Public License as published by
 
14
# the Free Software Foundation; either version 2 of the License, or
 
15
# (at your option) any later version.
 
16
#
 
17
# This program is distributed in the hope that it will be useful,
 
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
20
# GNU General Public License for more details.
 
21
#
 
22
# You should have received a copy of the GNU General Public License
 
23
# along with this program; if not, write to the Free Software
 
24
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
25
#
 
26
 
 
27
dnl>
 
28
dnl>  Check for an ANSI C typedef in a header
 
29
dnl>
 
30
dnl>  configure.in:
 
31
dnl>    AC_CHECK_TYPEDEF(<typedef>, <header>)
 
32
dnl>  acconfig.h:
 
33
dnl>    #undef HAVE_<typedef>
 
34
dnl>
 
35
 
 
36
AC_DEFUN(AC_CHECK_TYPEDEF,[dnl
 
37
AC_REQUIRE([AC_HEADER_STDC])dnl
 
38
AC_MSG_CHECKING(for typedef $1)
 
39
AC_CACHE_VAL(ac_cv_typedef_$1,
 
40
[AC_EGREP_CPP(dnl
 
41
changequote(<<,>>)dnl
 
42
<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl
 
43
changequote([,]), [
 
44
#include <$2>
 
45
], ac_cv_typedef_$1=yes, ac_cv_typedef_$1=no)])dnl
 
46
AC_MSG_RESULT($ac_cv_typedef_$1)
 
47
if test $ac_cv_typedef_$1 = yes; then
 
48
    AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]))
 
49
fi
 
50
])
 
51
 
 
52
 
 
53
dnl>
 
54
dnl>  Check whether compiler option works
 
55
dnl>
 
56
dnl>  configure.in:
 
57
dnl>    AC_COMPILER_OPTION(<name>, <display>, <option>,
 
58
dnl>                       <action-success>, <action-failure>)
 
59
dnl>
 
60
 
 
61
AC_DEFUN(AC_COMPILER_OPTION,[dnl
 
62
AC_MSG_CHECKING(for compiler option $2)
 
63
AC_CACHE_VAL(ac_cv_compiler_option_$1,[
 
64
cat >conftest.$ac_ext <<EOF
 
65
int main() { return 0; }
 
66
EOF
 
67
${CC-cc} -c $CFLAGS $CPPFLAGS $3 conftest.$ac_ext 1>conftest.out 2>conftest.err
 
68
if test $? -ne 0 -o -s conftest.err; then
 
69
     ac_cv_compiler_option_$1=no
 
70
else
 
71
     ac_cv_compiler_option_$1=yes
 
72
fi
 
73
rm -f conftest.$ac_ext conftest.out conftest.err
 
74
])dnl
 
75
if test ".$ac_cv_compiler_option_$1" = .yes; then
 
76
    ifelse([$4], , :, [$4])
 
77
else
 
78
    ifelse([$5], , :, [$5])
 
79
fi
 
80
AC_MSG_RESULT([$ac_cv_compiler_option_$1])
 
81
])dnl
 
82
 
 
83
 
 
84
dnl>
 
85
dnl>  Debugging Support
 
86
dnl>
 
87
dnl>  configure.in:
 
88
dnl>    AC_CHECK_DEBUGGING
 
89
dnl>
 
90
 
 
91
AC_DEFUN(AC_CHECK_DEBUGGING,[dnl
 
92
AC_ARG_ENABLE(debug,dnl
 
93
[  --enable-debug          build for debugging (default=no)],
 
94
[dnl
 
95
if test ".$ac_cv_prog_gcc" = ".yes"; then
 
96
    case "$CFLAGS" in
 
97
        *-O* ) ;;
 
98
           * ) CFLAGS="$CFLAGS -O2" ;;
 
99
    esac
 
100
    case "$CFLAGS" in
 
101
        *-g* ) ;;
 
102
           * ) CFLAGS="$CFLAGS -g" ;;
 
103
    esac
 
104
    case "$CFLAGS" in
 
105
        *-pipe* ) ;;
 
106
              * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
 
107
    esac
 
108
    AC_COMPILER_OPTION(ggdb3, -ggdb3, -ggdb3, CFLAGS="$CFLAGS -ggdb3")
 
109
    case $PLATFORM in
 
110
        *-*-freebsd*|*-*-solaris* ) CFLAGS="$CFLAGS -pedantic" ;;
 
111
    esac
 
112
    CFLAGS="$CFLAGS -Wall"
 
113
    WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
 
114
    WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
 
115
    AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CFLAGS="$CFLAGS $WMORE")
 
116
else
 
117
    case "$CFLAGS" in
 
118
        *-g* ) ;;
 
119
           * ) CFLAGS="$CFLAGS -g" ;;
 
120
    esac
 
121
fi
 
122
msg="enabled"
 
123
AC_DEFINE(DEBUG)
 
124
],[
 
125
if test ".$ac_cv_prog_gcc" = ".yes"; then
 
126
case "$CFLAGS" in
 
127
    *-pipe* ) ;;
 
128
          * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
 
129
esac
 
130
fi
 
131
case "$CFLAGS" in
 
132
    *-g* ) CFLAGS=`echo "$CFLAGS" |\
 
133
                   sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
 
134
esac
 
135
case "$CXXFLAGS" in
 
136
    *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
 
137
                     sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
 
138
esac
 
139
msg="disabled"
 
140
])dnl
 
141
AC_MSG_CHECKING(for compilation debug mode)
 
142
AC_MSG_RESULT([$msg])
 
143
if test ".$msg" = .enabled; then
 
144
    enable_shared=no
 
145
fi
 
146
])
 
147
 
 
148
dnl>
 
149
dnl>  Optimization Support
 
150
dnl>
 
151
dnl>  configure.in:
 
152
dnl>    AC_CHECK_OPTIMIZE
 
153
dnl>
 
154
 
 
155
AC_DEFUN(AC_CHECK_OPTIMIZE,[dnl
 
156
AC_ARG_ENABLE(optimize,dnl
 
157
[  --enable-optimize       build with optimization (default=no)],
 
158
[dnl
 
159
if test ".$ac_cv_prog_gcc" = ".yes"; then
 
160
    #  compiler is gcc
 
161
    case "$CFLAGS" in
 
162
        *-O* ) ;;
 
163
        * ) CFLAGS="$CFLAGS -O2" ;;
 
164
    esac
 
165
    case "$CFLAGS" in
 
166
        *-pipe* ) ;;
 
167
        * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
 
168
    esac
 
169
    OPT_CFLAGS='-funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math'
 
170
    AC_COMPILER_OPTION(optimize_std, [-f<xxx> for optimizations], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS")
 
171
    case $PLATFORM in
 
172
        i?86*-*-*|?86*-*-* )
 
173
            OPT_CFLAGS='-malign-functions=4 -malign-jumps=4 -malign-loops=4'
 
174
            AC_COMPILER_OPTION(optimize_x86, [-f<xxx> for Intel x86 CPU], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS")
 
175
            ;;
 
176
    esac
 
177
else
 
178
    #  compiler is NOT gcc
 
179
    case "$CFLAGS" in
 
180
        *-O* ) ;;
 
181
           * ) CFLAGS="$CFLAGS -O" ;;
 
182
    esac
 
183
    case $PLATFORM in
 
184
        *-*-solaris* )
 
185
            AC_COMPILER_OPTION(fast, -fast, -fast, CFLAGS="$CFLAGS -fast")
 
186
            ;;
 
187
    esac
 
188
fi
 
189
msg="enabled"
 
190
],[
 
191
msg="disabled"
 
192
])dnl
 
193
AC_MSG_CHECKING(for compilation optimization mode)
 
194
AC_MSG_RESULT([$msg])
 
195
])