-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
289 lines (264 loc) · 9.42 KB
/
configure.ac
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
# --- BEGIN COPYRIGHT BLOCK ---
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
#
# This library 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA
#
# Copyright (C) 2007 Red Hat, Inc.
# All rights reserved.
# --- END COPYRIGHT BLOCK ---
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([nuxwdog], [1.0.0], [http://bugzilla.redhat.com/])
# AC_CONFIG_HEADER must be called right after AC_INIT.
AC_CONFIG_HEADERS([config.h])
#AC_CONFIG_SUBDIRS([lib/perl/Nuxwdogclient])
#added by alee for versioning?
GENERIC_LIBRARY_NAME=nuxwdog
GENERIC_MAJOR_VERSION=1
GENERIC_MINOR_VERSION=0
GENERIC_MICRO_VERSION=0
GENERIC_API_VERSION=1.0
AC_SUBST(GENERIC_API_VERSION)
GENERIC_LIBRARY_VERSION=0:0:0
AC_SUBST(GENERIC_LIBRARY_VERSION)
PACKAGE=$GENERIC_LIBRARY_NAME
AC_SUBST(GENERIC_LIBRARY_NAME)
GENERIC_VERSION=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION.$GENERIC_MICRO_VERSION
GENERIC_RELEASE=$GENERIC_MAJOR_VERSION.$GENERIC_MINOR_VERSION
AC_SUBST(GENERIC_RELEASE)
AC_SUBST(GENERIC_VERSION)
VERSION=$GENERIC_VERSION
#AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
# end of addition by alee
AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
AM_MAINTAINER_MODE
AM_PROG_GCJ
AC_CANONICAL_HOST
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AM_PROG_CC_C_O
# disable static libs by default - we only use a couple
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STAT
AC_C_CONST
AC_HEADER_STDBOOL
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([setrlimit endpwent ftruncate getcwd gethostbyname inet_ntoa localtime_r memmove memset mkdir munmap putenv rmdir socket strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strstr strtol tzset])
# Establish an optional "--enable-64bit" flag
AC_MSG_CHECKING(for --enable-64bit)
AC_ARG_ENABLE(64bit, [ --enable-64bit Enable 64-bit features],
[
AC_MSG_RESULT(yes)
USE_64=1
],
[
AC_MSG_RESULT(no)
USE_64=
])
# For historical reasons, establish various "--enable-debug" flags
# for both DeBuG (yes) and OPTimized (no) builds
AC_MSG_CHECKING(for --enable-debug)
AC_ARG_ENABLE(debug, [ --enable-debug Enable debug features],
[
AC_MSG_RESULT(yes)
debug_defs="-DDEBUG -UNDEBUG -DTRACING"
],
[
AC_MSG_RESULT(no)
debug_defs="-UDEBUG -DNDEBUG -DTRIMMED"
])
AC_SUBST([debug_defs])
AC_PREFIX_DEFAULT([/usr])
# installation paths - by default, configure will just
# use /usr as the prefix for everything, which means
# /usr/etc, /usr/opt, and /usr/var. FHS sez to use
# /etc, /opt, and /var.
ac_default_prefix=/usr
prefix=$ac_default_prefix
exec_prefix=$prefix
dnl as opposed to the default $prefix/etc
#sysconfdir='/etc'
dnl as opposed to the default $prefix/var
#localstatedir='/var'
# relative to prefix
licensedir=/doc
nuxwdog_jardir=/jars
AC_SUBST(licensedir)
AC_SUBST(nuxwdog_jardir)
# WINNT should be true if building on Windows system not using
# cygnus, mingw, or the like and using cmd.exe as the shell
AM_CONDITIONAL([WINNT], false)
# Deal with platform dependent defines
case $host in
*-*-linux*)
AC_DEFINE([XP_UNIX], [], [UNIX])
AC_DEFINE([linux], [1], [linux])
AC_DEFINE([Linux], [], [Linux])
AC_DEFINE([LINUX], [], [Linux])
AC_DEFINE([LINUX2_0], [], [Linux 2.6])
AC_DEFINE([LINUX2_2], [], [Linux 2.6])
AC_DEFINE([LINUX2_4], [], [Linux 2.6])
AC_DEFINE([LINUX2_6], [], [Linux 2.6])
# For historical reasons, establish various "DEFINES" for nuxwdog . . .
AC_DEFINE([_BSD_SOURCE], [1], [_BSD_SOURCE])
AC_DEFINE([_POSIX_SOURCE], [1], [_POSIX_SOURCE])
AC_DEFINE([_POSIX_C_SOURCE], [199506L], [_POSIX_C_SOURCE])
AC_DEFINE([_PR_NEED_FAKE_POLL], [], [_PR_NEED_FAKE_POLL])
AC_DEFINE([_REENTRANT], [], [_REENTRANT])
AC_DEFINE([_SVID_SOURCE], [1], [_SVID_SOURCE])
AC_DEFINE([HAVE_SIGNED_CHAR], [], [HAVE_SIGNED_CHAR])
AC_DEFINE([HAVE_SYS_BITYPES_H], [], [HAVE_SYS_BITYPES_H])
AC_DEFINE([NEED_ENDIAN_H], [], [NEED_ENDIAN_H])
AC_DEFINE([NEED_GETOPT_H], [], [NEED_GETOPT_H])
AC_DEFINE([NEED_IOCTL_H], [], [NEED_IOCTL_H])
AC_DEFINE([NEED_SYS_TIME_H], [], [NEED_SYS_TIME_H])
AC_DEFINE([NEED_UINT_T], [], [NEED_UINT_T])
AC_DEFINE([NET_SSL], [], [NET_SSL])
AC_DEFINE([NO_INT64_T], [], [NO_INT64_T])
AC_DEFINE([SW_THREADS], [], [SW_THREADS])
AC_DEFINE([USE_NODL_TABS], [], [USE_NODL_TABS])
platform="linux"
;;
ia64-hp-hpux*)
AC_DEFINE([XP_UNIX], [], [UNIX])
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
AC_DEFINE([CPU_ia64], [], [cpu type ia64])
AC_DEFINE([OS_hpux], [1], [OS HP-UX])
AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
AC_DEFINE([_HPUX_SOURCE], [], [_HPUX_SOURCE])
platform="hpux"
;;
hppa*-hp-hpux*)
AC_DEFINE([XP_UNIX], [], [UNIX])
AC_DEFINE([hpux], [1], [HP-UX])
AC_DEFINE([HPUX], [], [HP-UX])
AC_DEFINE([HPUX11], [1], [HP-UX 11])
AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
AC_DEFINE([hppa], [], [HP-UX pa-risc])
AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
AC_DEFINE([OS_hpux], [1], [OS HP-UX])
AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
AC_DEFINE([_HPUX_SOURCE], [], [_HPUX_SOURCE])
# For historical reasons, establish various "DEFINES" for nuxwdog . . .
AC_DEFINE([HPUX_SOURCE], [], [HPUX_SOURCE])
AC_DEFINE([HAVE_STRERROR], [], [HAVE_STRERROR])
AC_DEFINE([NET_SSL], [], [NET_SSL])
AC_DEFINE([SW_THREADS], [], [SW_THREADS])
platform="hpux"
;;
sparc-sun-solaris*)
AC_DEFINE([XP_UNIX], [], [UNIX])
AC_DEFINE([SVR4], [], [SVR4])
AC_DEFINE([__svr4], [], [SVR4])
AC_DEFINE([__svr4__], [], [SVR4])
AC_DEFINE([_SVID_GETTOD], [], [SVID_GETTOD])
AC_DEFINE([SOLARIS], [], [SOLARIS])
AC_DEFINE([CPU_sparc], [], [cpu type sparc])
AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
AC_DEFINE([sunos5], [1], [SunOS5])
AC_DEFINE([OSVERSION], [509], [OS version])
AC_DEFINE([_REENTRANT], [], [_REENTRANT])
dnl socket nsl and dl are required to link several programs
LIBSOCKET=-lsocket
AC_SUBST([LIBSOCKET], [$LIBSOCKET])
LIBNSL=-lnsl
AC_SUBST([LIBNSL], [$LIBNSL])
LIBDL=-ldl
AC_SUBST([LIBDL], [$LIBDL])
dnl Cstd and Crun are required to link any C++ related code
LIBCSTD=-lCstd
AC_SUBST([LIBCSTD], [$LIBCSTD])
LIBCRUN=-lCrun
AC_SUBST([LIBCRUN], [$LIBCRUN])
# For historical reasons, establish various "DEFINES" for nuxwdog . . .
AC_DEFINE([_PR_NTHREAD], [], [_PR_NTHREAD])
AC_DEFINE([HAVE_WEAK_IO_SYMBOLS], [], [HAVE_WEAK_IO_SYMBOLS])
AC_DEFINE([NET_SSL], [], [NET_SSL])
AC_DEFINE([NS_USE_NATIVE], [], [NS_USE_NATIVE])
AC_DEFINE([NSPR], [], [NSPR])
AC_DEFINE([NSPR20], [], [NSPR20])
AC_DEFINE([SOLARIS_55_OR_GREATER], [], [SOLARIS_55_OR_GREATER])
AC_DEFINE([SYSV], [], [SYSV])
platform="solaris"
;;
*)
platform=""
;;
esac
AM_CONDITIONAL(LINUX,test "$platform" = "linux")
AM_CONDITIONAL(HPUX,test "$platform" = "hpux")
AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
# Check for library dependencies
m4_include(m4/nuxwdog.m4)
m4_include(m4/nspr.m4)
m4_include(m4/libkeyutils.m4)
# write out paths for binary components
AC_SUBST(jni_inc)
AC_SUBST(nuxwdog_inc)
AC_SUBST(nuxwdog_jars)
AC_SUBST(nspr_inc)
AC_SUBST(nspr_lib)
AC_SUBST(nspr_libdir)
# libtool on fedora/rhel contains some gcc-isms which cause problems
# if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
# we remove them here
if test "$GCC" != yes ; then
AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
cp -p libtool libtool.orig
cp -p libtool libtool.tmp
# dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
# we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
# perl produced write-only code . . .
sed -e '/^gcc_dir/ d' \
-e '/^gcc_ver/ d' \
-e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
-e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
-e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
-e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
libtool > libtool.tmp
cp -p libtool.tmp libtool
rm -f libtool.tmp
fi
AC_CONFIG_FILES([Makefile lib/perl/Nuxwdogclient/Makefile])
AC_OUTPUT