File: configure.in

package info (click to toggle)
ganglia-monitor-core 2.5.7-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,300 kB
  • ctags: 3,900
  • sloc: ansic: 27,889; sh: 8,492; makefile: 148
file content (383 lines) | stat: -rw-r--r-- 13,857 bytes parent folder | download | duplicates (4)
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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
dnl
dnl $Id: configure.in,v 1.38.2.1 2004/09/14 16:18:25 sacerdoti Exp $
dnl
dnl "Copyright (c) 2001 by Matt Massie and The Regents of the University
dnl  of California.  All rights reserved."
dnl
dnl Permission to use, copy, modify, and distribute this software and its
dnl documentation for any purpose, without fee, and without written agreement is
dnl hereby granted, provided that the above copyright notice and the following
dnl two paragraphs appear in all copies of this software.
dnl 
dnl IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
dnl DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
dnl OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
dnl CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl 
dnl THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
dnl INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
dnl AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
dnl ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
dnl PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
dnl

AC_REVISION([$Revision: 1.38.2.1 $])
AC_INIT(gmond/gmond.c)
AC_CONFIG_AUX_DIR(config)

###############################
# Package info

# On making releases:
#   GANGLIA_MICRO_VERSION += 1;
#   GANGLIA_INTERFACE_AGE += 1;
#   GANGLIA_BINARY_AGE += 1;
# if any functions have been added, set GANGLIA_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set GANGLIA_BINARY_AGE _and_ GANGLIA_INTERFACE_AGE to 0.
GANGLIA_MAJOR_VERSION=2
GANGLIA_MINOR_VERSION=5
GANGLIA_MICRO_VERSION=7
GANGLIA_INTERFACE_AGE=7
GANGLIA_BINARY_AGE=7
GANGLIA_VERSION=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION.$GANGLIA_MICRO_VERSION

echo
echo "---------------------------------------------------------------------"
echo " Welcome to Ganglia $GANGLIA_VERSION"
echo " Copyright (c) 2003 University of California, Berkeley"
echo "====================================================================="
echo

AM_INIT_AUTOMAKE(ganglia-monitor-core, $GANGLIA_VERSION)

AC_SUBST(GANGLIA_MAJOR_VERSION)
AC_SUBST(GANGLIA_MINOR_VERSION)
AC_SUBST(GANGLIA_MICRO_VERSION)
AC_SUBST(GANGLIA_VERSION)
AC_SUBST(GANGLIA_INTERFACE_AGE)
AC_SUBST(GANGLIA_BINARY_AGE)

# libtool versioning
LT_RELEASE=$GANGLIA_MAJOR_VERSION.$GANGLIA_MINOR_VERSION
LT_CURRENT=`expr $GANGLIA_MICRO_VERSION - $GANGLIA_INTERFACE_AGE`
LT_REVISION=$GANGLIA_INTERFACE_AGE
LT_AGE=`expr $GANGLIA_BINARY_AGE - $GANGLIA_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
# Define version stuff
AC_DEFINE_UNQUOTED(GANGLIA_MAJOR_VERSION, $GANGLIA_MAJOR_VERSION, GANGLIA_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GANGLIA_MINOR_VERSION, $GANGLIA_MINOR_VERSION, GANGLIA_MINOR_VERSION)
AC_DEFINE_UNQUOTED(GANGLIA_MICRO_VERSION, $GANGLIA_MICRO_VERSION, GANGLIA_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GANGLIA_INTERFACE_AGE, $GANGLIA_INTERFACE_AGE, GANGLIA_INTERFACE_AGE)
AC_DEFINE_UNQUOTED(GANGLIA_BINARY_AGE,    $GANGLIA_BINARY_AGE,    GANGLIA_BINARY_AGE)


########################
AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)

dnl Install with /usr are the root by default
AC_PREFIX_DEFAULT(/usr)

dnl The following cpu_vendor_os string goes into config.h.
dnl
AC_DEFINE_UNQUOTED(HOST_OS, "$host_os", HOST_OS)
AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$host", CPU_VENDOR_OS)
AC_CYGWIN

dnl ##################################################################
dnl Checks for programs.
dnl
AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_LIBTOOL

dnl ##################################################################
dnl Special parameters
dnl

AC_ARG_WITH( gmetad,
[  --with-gmetad           compile and install the Ganglia Meta Daemon],
if test "$withval" = yes; then gmetad=yes; fi)

AM_CONDITIONAL(BUILD_GMETAD, test x$gmetad = xyes)

AC_ARG_ENABLE(debug,
[
  --enable-debug          turn on debugging output and compile options],
[ CFLAGS="$CFLAGS -ggdb"
  AC_DEFINE(DEBUG, 1, DEBUG)])
# Turn off optimizations when debugging.
#[ CFLAGS="$CFLAGS -O2" 
#  AC_DEFINE(DEBUG, 0, DEBUG)])

AC_ARG_ENABLE(gexec,
[  --enable-gexec          turn on gexec support (platform-specific) ],
AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC), AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC))

AC_ARG_ENABLE(pedantic,   
[  --enable-pedantic       turn on pedantic mode during compile],     
[ CFLAGS="$CFLAGS --pedantic" ],)

AC_ARG_ENABLE(memcheck,
[  --enable-memcheck       turn on memory checking during compile
                           note: requires mpatrol from
                           http://www.cbmamiga.demon.co.uk/mpatrol/],
[ enable_memcheck="yes" ])

dnl ##################################################################
dnl Checks for libraries.
dnl The order of these tests is the *reverse* order of the libraries in
dnl the LIBS variable that is constructed: each new one gets prepended,
dnl not appended.
dnl
AC_CHECK_LIB(pthread, pthread_create)
dnl if test "$ac_cv_lib_pthread_pthread_create" = yes ; then
dnl    CFLAGS="$CFLAGS -D_REENTRANT"
dnl else
AC_CHECK_LIB(pthreads, pthread_create)
dnl    if test "$ac_cv_lib_pthreads_pthread_create" = yes ; then
dnl       CFLAGS="$CFLAGS -D_REENTRANT"
dnl    fi
dnl fi

if test "$gmetad" = yes ; then
   AC_CHECK_LIB(rrd, rrd_create, [echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.com/)"], [echo "rrd lib not found"], [-lm])
   AC_CHECK_HEADERS(rrd.h)
   if test "$ac_cv_lib_rrd_rrd_create" != yes; then
      echo
      echo "The Ganglia Meta Daemon uses the Round-Robin Database Tool (rrdtool)"
      echo "for storing historical information.  You have chosen to compile the "
      echo "monitoring core with gmetad but librrd.a could not be found.  Please"
      echo "visit http://www.rrdtool.com/, download rrdtool and then try again"
      echo
      echo "NOTE: the rrdtool library (librrd) will NOT need to be installed on "
      echo "every machine running gmetad only the machine you are compiling gmetad"
      echo "on since librrd is statically linked."
      echo
      exit;
   fi
fi

AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, inet_addr)
AC_CHECK_LIB(nsl, gethostbyaddr_r)
AC_CHECK_LIB(resolv, inet_aton)
AC_CHECK_LIB(kstat, kstat_open)
AC_CHECK_LIB(kvm, kvm_open)
AC_CHECK_LIB(odm, odm_initialize)
AC_CHECK_LIB(cfg, _system_configuration)
AC_CHECK_LIB(pmapi, pm_cycles)
AC_CHECK_LIB(dl, dlopen)
dnl AC_CHECK_LIB(crypto, RSA_sign)
dnl if test "$ac_cv_lib_crypto_RSA_sign" = no; then
dnl    echo "$PACKAGE $VERSION requires IPv4 OpenSSL."
dnl    echo "See http://www.openssl.org/."
dnl    exit;
dnl fi


dnl ##################################################################
dnl Checks for header files.
dnl

dnl Check for stdlib.h stdarg.h string.h float.h
AC_HEADER_STDC

AC_CHECK_HEADERS(syslog.h pthread.h fcntl.h signal.h sys/time.h sys/types.h sys/stat.h sys/socket.h sys/ioctl.h netinet/in.h arpa/inet.h net/if.h netinet/tcp.h unistd.h stropts.h sys/sockio.h ctype.h errno.h netdb.h stdio.h sys/uio.h sys/wait.h sys/un.h sys/select.h sys/filio.h getopt.h net/if_dl.h net/raw.h poll.h)
AC_CHECK_HEADERS(inttypes.h limits.h sys/param.h sys/mount.h sys/vfs.h sys/statfs.h sys/statvfs.h)



# For libdnet
if test "$CYGWIN" = yes ; then
   AC_CHECK_HEADERS(Iphlpapi.h winsock2.h)
else
   AC_CHECK_HEADERS(fcntl.h unistd.h)
   AC_CHECK_HEADERS(sys/bufmod.h sys/dlpi.h sys/dlpihdr.h sys/dlpi_ext.h \
       sys/ioctl.h sys/mib.h sys/ndd_var.h sys/socket.h sys/sockio.h \
       sys/sysctl.h sys/time.h)
   AC_CHECK_HEADERS(net/bpf.h net/if.h net/if_arp.h net/if_dl.h \
       net/pfvar.h netinet/ip_fw.h )
   AC_CHECK_HEADERS(ip_fil_compat.h netinet/ip_fil_compat.h ip_compat.h \
       netinet/ip_compat.h ip_fil.h netinet/ip_fil.h)
   AC_CHECK_HEADERS(hpsecurity.h)
fi


dnl ##################################################################
dnl Checks for typedefs.
dnl
dnl AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl AC_SEARCH_TYPE is a custom macro in acinclude.m4
AC_SEARCH_TYPE(uchar_t,   unsigned char)
AC_SEARCH_TYPE(int8_t,    signed char)
AC_SEARCH_TYPE(uint8_t,   unsigned char)
AC_SEARCH_TYPE(int16_t,   signed short)
AC_SEARCH_TYPE(uint16_t,  unsigned short)
AC_SEARCH_TYPE(int32_t,   signed int)
AC_SEARCH_TYPE(uint32_t,  unsigned int)
AC_SEARCH_TYPE(size_t,    unsigned int)
AC_SEARCH_TYPE(ssize_t,   signed int)
AC_SEARCH_TYPE(socklen_t, unsigned int)

dnl AC_CHECK_SIZEOF(char)
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(long)
dnl AC_CHECK_SIZEOF(void *)

dnl ##################################################################
dnl Check for structure definitions.
dnl   
if test "$ac_cv_header_sys_socket_h" = yes ; then
   AC_DNET_SOCKADDR_SA_LEN
fi

dnl Check for Ethernet interface.
if test "$ac_cv_header_Iphlpapi_h" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-win32.o"
elif test "$ac_cv_dnet_bsd_bpf" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-bsd.o"
elif test "$ac_cv_dnet_linux_pf_packet" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-linux.o"
elif test "$ac_cv_header_net_raw_h" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-snoop.o"
elif test "$ac_cv_header_sys_ndd_var_h" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-ndd.o"
elif test "$ac_cv_header_sys_dlpi_h" = yes || \
     test "$ac_cv_header_sys_dlpihdr_h" = yes ; then
   DNET_OBJS="$DNET_OBJS eth-dlpi.o"
else
   DNET_OBJS="$DNET_OBJS eth-none.o"
fi

dnl Check for network interface interface.
if test "$ac_cv_header_Iphlpapi_h" = yes ; then
   DNET_OBJS="$DNET_OBJS intf-win32.o"
else
   DNET_OBJS="$DNET_OBJS intf.o"
fi

AC_SUBST(DNET_OBJS)


dnl ##################################################################
dnl Check the compiler characteristics
dnl
dnl Don't need this now that all data is send in XDR
AC_C_BIGENDIAN

dnl ##################################################################
dnl Checks for library functions.
dnl
dnl AC_FUNC_MEMCMP

dnl ##################################################################
dnl Check for function prototypes in headers.
dnl
AC_CHECK_FUNCS(getopt_long inet_ntop)
dnl AC_CHECK_FUNC(getopt_long)
dnl AC_CHECK_FUNC(pthread_rwlock_rdlock,
dnl   [AC_DEFINE(HAVE_PTHREAD_RWLOCK, 1)])

dnl ##################################################################
dnl Check for system services.

dnl ##################################################################
dnl If the compiler is gcc, enable all warnings.  Main purpose is to
dnl catch any function call where the function has not been prototyped.
dnl
dnl Add "-Wcast-qual again later"...
dnl if test "$ac_cv_prog_gcc" = yes; then
if test "$ac_cv_gcc" = yes; then
   CFLAGS="$CFLAGS -Wall -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes"
fi

if test "$enable_memcheck" = yes; then
   echo "Setting up for memory checking via mpatrol"
   CFLAGS="$CFLAGS -fcheck-memory-usage "
   LDFLAGS="$LDFLAGS -lmpatrol -lbfd -liberty "
fi

dnl Always use -Wall, even though its annoying. Like eating your vegetables.
CFLAGS="$CFLAGS -Wall"

dnl Some system-specific stuff ...
dnl Some operating systems require additional flags in order to get all
dnl the definitions that we're looking for in some system headers.

case "$host" in
*linux*)
                metric_source="linux.c"
                CFLAGS="$CFLAGS -D_REENTRANT"
                AC_DEFINE(LINUX, 1, LINUX)
                AC_DNET_LINUX_PROCFS   
dnl
dnl For fsusage.c - disk usage.
dnl
                AC_DEFINE(STAT_STATVFS, 1, STAT_STATVFS)
                AC_DEFINE(SUPPORT_GEXEC, 1, SUPPORT_GEXEC)
                ;;
*ia64-*hpux*)		metric_source="hpux.c"
		CFLAGS="$CFLAGS -D_PSTAT64 -D_HPUX_SOURCE" 
      LIBS="-lpthread $LIBS"
		AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
      AC_DEFINE(IA64,1,IA64)
      AC_DEFINE(HPUX,1,HPUX);;
*aix*)		metric_source="aix.c"
                CFLAGS="$CFLAGS -D_ALL_SOURCE -DAIX"
                AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
		if test "$ac_cv_lib_pmapi_pm_cycles" = yes ; then
			CFLAGS="$CFLAGS -DHAVE_PMAPI" 
		else
			echo "PMAPI not detected."
			echo "For AIX 4.3, you can download PMAPI at http://alphaworks.ibm.com/tech/pmapi"
			echo "AIX 5 has PMAPI installed in bos.pmapi"
		fi
                AC_DEFINE(AIX, 1, AIX);;
*hpux*)		metric_source="hpux.c"
		CFLAGS="$CFLAGS -D_HPUX_SOURCE" 
      LIBS="-lpthread $LIBS"
		AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
      AC_DEFINE(HPUX,1,HPUX);;
*irix*)         metric_source="irix.c"
		AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
                CFLAGS="$CFLAGS -D_IRIX_SOURCE"
                AC_DEFINE(IRIX,1,IRIX);;
*osf*)	 	metric_source="osf.c"	
		CFLAGS="$CFLAGS -D_SOCKADDR_LEN" 
                AC_DEFINE(OSF,1,OSF);;
*darwin*) 	metric_source="darwin.c"	
                AC_DEFINE(DARWIN,1,DARWIN);;
*solaris*)	metric_source="solaris.c"	
                echo " *** WARNING:  Please make sure you use a 64-bit compiler, linker and *** "
                echo " *** library set if you are running a 64-bit Solaris kernel!  This    *** "
                echo " *** applies if you are running Solaris 7 or later!                   *** "
		AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
		if test "$ac_cv_prog_gcc" = yes; then
		   CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_POSIX_C_SOURCE=199506L -DHAVE_STRERROR"
		else
		   CFLAGS="$CFLAGS -D__STDC__ -D_POSIX_C_SOURCE=199506L -DHAVE_STRERROR"
		fi 
                AC_DEFINE(SOLARIS,1,SOLARIS);;
*freebsd*)      metric_source="freebsd.c" 
                CFLAGS="-pthread $CFLAGS -D_REENTRANT" 
		AC_DEFINE(SUPPORT_GEXEC, 0, SUPPORT_GEXEC)
                AC_DEFINE(FREEBSD, 1, FREEBSD);; 
*cygwin*)      	metric_source="cygwin.c" 
		AC_DEFINE(CYGWIN,1,CYGWIN)
esac

AC_LINK_FILES(gmond/machines/${metric_source}, gmond/machine.c)

AC_OUTPUT(Makefile ganglia.spec gmetad/Makefile lib/Makefile gmond/Makefile gmond/gstat/Makefile gmetric/Makefile)

echo ""
echo "-- Ganglia $VERSION --"
echo "Type \"make\" to compile."