-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
344 lines (301 loc) · 8.67 KB
/
configure.in
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#
# configure.in --
#
# Process this file with autoconf to produce a configure script.
#
# Copyright (c) 1999-2008 Frank Strauss, Technical University of Braunschweig.
#
# See the file "COPYING" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# @(#) $Id: configure.in 8090 2008-04-18 12:56:29Z strauss $
#
AC_INIT(tools/smilint.c)
LIBSMI_MAJOR=0
LIBSMI_MINOR=4
LIBSMI_PATCHLEVEL=8
LIBTOOL_VERSION=2
LIBTOOL_REVISION=27
LIBTOOL_AGE=0
VERSION_STRING="$LIBSMI_MAJOR.$LIBSMI_MINOR.$LIBSMI_PATCHLEVEL"
VERSION_LIBTOOL="$LIBTOOL_VERSION:$LIBTOOL_REVISION:$LIBTOOL_AGE"
AM_INIT_AUTOMAKE(libsmi,$VERSION_STRING)
AM_CONFIG_HEADER(config.h)
AC_DEFINE([MAX_LEX_DEPTH], 30,
[The maximum module import recursion depth.])
AC_DEFINE([DEFAULT_ERRORLEVEL], 3,
[The default error level at libsmi initialization.])
AC_ARG_WITH(cflags,
[ --with-cflags=FLAGS use FLAGS for CFLAGS],
CFLAGS="$withval")
AC_PROG_CC
AC_ARG_WITH(cc,
[ --with-cc=CC use CC as the C compiler],
CC="$withval")
AC_MSG_CHECKING([for additional required compiler flags])
AC_TRY_RUN([#include <stdio.h>
main() {
#ifdef __SUNPRO_C
exit(0);
#else
exit(1);
#endif
}
], ADDCFLAGS="-DYY_USE_PROTOS", ADDCFLAGS="", ADDCFLAGS="")
echo $ADDCFLAGS
CFLAGS="$CFLAGS $ADDCFLAGS"
AC_CHECK_FUNCS(strtoll strtoull strtoq strtouq)
AC_CHECK_FUNCS(timegm)
AC_CHECK_FUNCS(vsnprintf snprintf asprintf asnprintf vasprintf vasnprintf)
AC_CHECK_HEADERS(pwd.h unistd.h regex.h stdint.h limits.h)
# In case regex is not in libc
AC_CHECK_LIB(c,regexec,LDFLAGS="$LDFLAGS",
[
AC_CHECK_LIB(rxspencer,regexec,LDFLAGS="$LDFLAGS -lrxspencer",
[
AC_CHECK_LIB(regex,regexec,LDFLAGS="$LDFLAGS -lregex")
])
])
if test "x$prefix" = "xNONE" ; then
prefix=/usr/local
fi
AC_ARG_WITH(mibdir,
[ --with-mibdir=DIR use DIR to install libsmi MIB modules [DATADIR/mibs]],
mibdir="$withval", mibdir="$prefix/share/mibs")
AC_ARG_WITH(pibdir,
[ --with-pibdir=DIR use DIR to install libsmi PIB modules [DATADIR/pibs]],
pibdir="$withval", pibdir="$prefix/share/pibs")
AC_ARG_WITH(smipath,
[ --with-smipath=DIR:DIR default DIRs to search for MIB/PIB modules [MIBDIR...]],
smipath="$withval", smipath="$mibdir/ietf:$mibdir/iana:$mibdir/irtf:$mibdir/site:$mibdir/tubs:$pibdir/ietf:$pibdir/site:$pibdir/tubs")
AC_DEFINE_UNQUOTED([DEFAULT_SMIPATH], "$smipath",
[The default search path to lookup SMI module files.])
AC_ARG_WITH(pathseparator,
[ --with-pathseparator=C use C as the path separator [: on UNIX, ; on WIN32]],
pathseparator="$withval", pathseparator="")
AC_ARG_WITH(dirseparator,
[ --with-dirseparator=C use C as the dir separator [/ on UNIX, \\ on WIN32]],
dirseparator="$withval", dirseparator="")
AC_MSG_CHECKING([for path separator character])
if test "$pathseparator" = "" ; then
AC_TRY_RUN([#include <stdio.h>
main() {
#ifdef _WIN32
exit(0);
#else
exit(1);
#endif
}
], pathseparator=";", pathseparator=":", pathseparator=":")
fi
echo $pathseparator
AC_MSG_CHECKING([for dir separator character])
if test "$dirseparator" = "" ; then
AC_TRY_RUN([#include <stdio.h>
main() {
#ifdef _WIN32
exit(0);
#else
exit(1);
#endif
}
], dirseparator="\\\\", dirseparator="/", dirseparator="/")
fi
echo $dirseparator
AC_DEFINE_UNQUOTED([PATH_SEPARATOR], '$pathseparator',
[The default path separator character.])
AC_DEFINE_UNQUOTED([DIR_SEPARATOR], '$dirseparator',
[The default path separator character.])
AC_MSG_CHECKING([for 64 bit types])
#
# Note that int64_min is defined as -9223372036854775807LL and NOT as
# -9223372036854775808LL. gcc (version 2.95.4 and others) complains with
# "warning: decimal constant is so large that it is unsigned"
# if used with the (correct) value -9223372036854775808LL.
#
AC_TRY_RUN([#include <stdio.h>
main() {
long long ll;
unsigned long long ull;
exit(0);
}
],
uint64_type="unsigned long long"; int64_type="long long";
uint64_format="%llu"; int64_format="%lld";
uint64_max="18446744073709551615ULL";
int64_min="-9223372036854775807LL"; int64_max="9223372036854775807LL"
,
uint64_type="unsigned long"; int64_type="long";
uint64_format="%lu"; int64_format="%ld";
uint64_max="4294967295";
int64_min="-2147483648"; int64_max="2147483647"
,
uint64_type="unsigned long long"; int64_type="long long";
uint64_format="%llu"; int64_format="%lld";
uint64_max="18446744073709551615ULL";
int64_min="-9223372036854775807LL"; int64_max="9223372036854775807LL"
)
echo $int64_type/$int64_format, etc.
UINT64_TYPE=$uint64_type
INT64_TYPE=$int64_type
AC_DEFINE_UNQUOTED([UINT64_FORMAT], "$uint64_format",
[The unsigned 64 bit integer format conversion specification string.])
AC_DEFINE_UNQUOTED([INT64_FORMAT], "$int64_format",
[The signed 64 bit integer format conversion specification string.])
AC_DEFINE_UNQUOTED([LIBSMI_UINT64_MAX], $uint64_max,
[The unsigned 64 bit integer maximum value.])
AC_DEFINE_UNQUOTED([LIBSMI_INT64_MIN], $int64_min,
[The unsigned 64 bit integer minimum value.])
AC_DEFINE_UNQUOTED([LIBSMI_INT64_MAX], $int64_max,
[The signed 64 bit integer maximum value.])
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc enable dmalloc debugging (www.dmalloc.com)],
LIBS="$LIBS -ldmalloc"
AC_DEFINE([HAVE_DMALLOC_H], 1, ""))
AC_DEFINE(BACKEND_SMI, 1, "")
AC_ARG_ENABLE(smi,
[ --disable-smi disable SMIv1/v2 parser support],
AC_DEFINE(BACKEND_SMI, 1, ""))
AC_ARG_ENABLE(sming,
[ --enable-sming enable SMIng parser support],
AC_DEFINE(BACKEND_SMING, 0, ""))
AC_PATH_PROG(FLEX, "flex")
if test -z "${FLEX}" ; then
echo "NOTE: We will not be able to build scanner C code from flex sources."
fi
AC_PATH_PROG(BISON, "bison")
if test -z "${BISON}" ; then
echo "NOTE: We will not be able to build parser C code from bison sources."
fi
AC_PATH_PROG(BASH, "bash")
AC_PATH_PROG(SH, "sh")
AC_PATH_PROG(AWK, awk)
AC_PATH_PROG(WGET, wget)
AC_PATH_PROGS(DIFF, gdiff diff)
$DIFF --version >/dev/null 2>&1
if test $? -eq 0 ; then
DIFF="$DIFF --ignore-matching-lines='generated by smidump' --ignore-matching-lines='\$Id.*\$' --ignore-matching-lines='@author.*smidump'"
fi
AC_EXEEXT
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_DEFINE_UNQUOTED([DEFAULT_GLOBALCONFIG], "${sysconfdir}/smi.conf",
[The full pathname of the global configuration file.])
AC_DEFINE([DEFAULT_USERCONFIG], ".smirc",
[The basename of the per-user configuration file searched in $HOME.])
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
STATIC=-static
else
STATIC=
fi
AC_SUBST(STATIC)
AC_SUBST(LIBSMI_MAJOR)
AC_SUBST(LIBSMI_MINOR)
AC_SUBST(LIBSMI_PATCHLEVEL)
AC_SUBST(LIBTOOL_VERSION)
AC_SUBST(LIBTOOL_REVISION)
AC_SUBST(LIBTOOL_AGE)
AC_SUBST(VERSION_STRING)
AC_SUBST(VERSION_LIBTOOL)
AC_SUBST(UINT64_TYPE)
AC_SUBST(INT64_TYPE)
AC_SUBST(EXEEXT)
AC_SUBST(BASH)
AC_SUBST(SH)
AC_SUBST(AWK)
AC_SUBST(WGET)
AC_SUBST(DIFF)
AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(srcdir)
AC_SUBST(mibdir)
AC_SUBST(pibdir)
AC_SUBST(smipath)
AC_OUTPUT([
Makefile
lib/Makefile
tools/Makefile
mibs/Makefile
mibs/iana/Makefile
mibs/ietf/Makefile
mibs/irtf/Makefile
mibs/tubs/Makefile
mibs/site/Makefile
pibs/Makefile
pibs/ietf/Makefile
pibs/tubs/Makefile
pibs/site/Makefile
test/Makefile
test/mibs/Makefile
test/smidiff/Makefile
test/dumps/Makefile
test/dumps/corba/Makefile
test/dumps/imports/Makefile
test/dumps/jax/Makefile
test/dumps/netsnmp/Makefile
test/dumps/mosy/Makefile
test/dumps/orig-smiv2/Makefile
test/dumps/smilint-smiv2/Makefile
test/dumps/sming/Makefile
test/dumps/smiv1/Makefile
test/dumps/smiv2/Makefile
test/dumps/smiv2-smiv2/Makefile
test/dumps/tree/Makefile
test/dumps/types/Makefile
test/dumps/identifiers/Makefile
test/dumps/metrics/Makefile
test/dumps/xml/Makefile
test/dumps/cm/Makefile
test/dumps/python/Makefile
test/dumps/yang/Makefile
doc/Makefile
lib/smi.h
lib/libsmi.3
lib/smi_macro.3
lib/smi_module.3
lib/smi_node.3
lib/smi_type.3
lib/smi_config.3
lib/smi_render.3
lib/smi_util.3
lib/smi_class.3
lib/smi_attribute.3
lib/smi_event.3
lib/smi_identity.3
tools/smistrip
tools/smicache
tools/smiquery.1
tools/smilint.1
tools/smidump.1
tools/smidiff.1
tools/smistrip.1
tools/smicache.1
tools/smixlate.1
tools/mib2svg.cgi
test/parser.test
test/smidump-corba.test
test/smidump-jax.test
test/smidump-netsnmp.test
test/smidump-imports.test
test/smidump-mosy.test
test/smidump-orig-smiv2.test
test/smidump-sming.test
test/smidump-yang.test
test/smidump-smiv1.test
test/smidump-smiv2-smiv2.test
test/smidump-smiv2.test
test/smidump-tree.test
test/smidump-types.test
test/smidump-identifiers.test
test/smidump-metrics.test
test/smidump-xml.test
test/smidump-cm.test
test/smidump-python.test
test/smilint-smiv2.test
test/smidiff.test
libsmi.pc
win/config.h],
chmod a+x test/*.test
)