1 |
tdb |
1.9 |
# -*- Autoconf -*- |
2 |
|
|
# Process this file with autoconf to produce a configure script. |
3 |
|
|
# |
4 |
|
|
# configure.in for i-scream ihost |
5 |
tdb |
1.13 |
# $Id: configure.in,v 1.12 2003/03/09 00:21:22 tdb Exp $ |
6 |
tdb |
1.9 |
# |
7 |
|
|
|
8 |
|
|
# Change these to change the package name and version |
9 |
tdb |
1.11 |
AC_INIT(ihost, 1.6, dev@i-scream.org.uk) |
10 |
|
|
AM_INIT_AUTOMAKE(ihost, 1.6) |
11 |
tdb |
1.5 |
|
12 |
tdb |
1.9 |
# Revision number (automatically updated) |
13 |
tdb |
1.13 |
AC_REVISION($Revision: 1.12 $) |
14 |
tdb |
1.5 |
|
15 |
tdb |
1.9 |
# Might work with older autoconfs... but tested on 2.57 |
16 |
|
|
AC_PREREQ(2.57) |
17 |
|
|
|
18 |
|
|
# The file we use to pass #define's to the source |
19 |
tdb |
1.6 |
AM_CONFIG_HEADER(config.h) |
20 |
tdb |
1.1 |
|
21 |
tdb |
1.9 |
# Checks for programs |
22 |
tdb |
1.1 |
AC_PROG_CC |
23 |
|
|
AC_PROG_INSTALL |
24 |
|
|
AC_PROG_RANLIB |
25 |
|
|
|
26 |
tdb |
1.9 |
# User specified libstatgrab prefix |
27 |
|
|
AC_ARG_WITH([libstatgrab-prefix], |
28 |
|
|
[ --with-libstatgrab-prefix=PATH libstatgrab is in PATH], |
29 |
|
|
[ |
30 |
|
|
if test -d "$withval/lib"; then |
31 |
tdb |
1.13 |
LDFLAGS="-L${withval}/lib ${LDFLAGS}" |
32 |
tdb |
1.9 |
fi |
33 |
|
|
if test -d "$withval/include"; then |
34 |
|
|
CPPFLAGS="-I${withval}/include ${CPPFLAGS}" |
35 |
|
|
fi |
36 |
|
|
] |
37 |
|
|
) |
38 |
|
|
|
39 |
|
|
# Checks for header files |
40 |
tdb |
1.1 |
AC_HEADER_STDC |
41 |
tdb |
1.9 |
AC_CHECK_HEADERS(statgrab.h,,[AC_MSG_ERROR([need statgrab.h])]) |
42 |
|
|
|
43 |
|
|
# Checks for typedefs, structures, and compiler characteristics |
44 |
|
|
AC_C_CONST |
45 |
tdb |
1.1 |
|
46 |
tdb |
1.9 |
# Checks for library functions |
47 |
|
|
AC_FUNC_MALLOC |
48 |
|
|
AC_FUNC_REALLOC |
49 |
|
|
AC_FUNC_FORK |
50 |
tdb |
1.12 |
AC_CHECK_FUNCS(strlcat) |
51 |
tdb |
1.13 |
AC_CHECK_LIB(statgrab, get_general_stats,[:],[AC_MSG_ERROR([need libstatgrab])]) |
52 |
tdb |
1.1 |
|
53 |
tdb |
1.9 |
# Figure out details about the host - we need the OS |
54 |
tdb |
1.1 |
AC_CANONICAL_HOST |
55 |
|
|
|
56 |
tdb |
1.9 |
# Default needing setgid kmem to false |
57 |
tdb |
1.6 |
AM_CONDITIONAL(SETGIDKMEM, false) |
58 |
tdb |
1.4 |
|
59 |
tdb |
1.9 |
# Set things up for different OS's |
60 |
|
|
# We define the name of the OS so the code can act accordingly |
61 |
|
|
# We also need to add the right LDFLAGS |
62 |
tdb |
1.1 |
case $host_os in |
63 |
|
|
solaris2.*) |
64 |
|
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
65 |
tdb |
1.13 |
LIBS="$LIBS -lnsl -lsocket -lkstat -Wl,-Bstatic -lstatgrab -Wl,-Bdynamic" |
66 |
tdb |
1.1 |
;; |
67 |
|
|
freebsd4.*) |
68 |
|
|
AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) |
69 |
tdb |
1.13 |
LIBS="$LIBS -lkvm -lstatgrab -static" |
70 |
tdb |
1.9 |
# FreeBSD needs ihost to be setgid kmem |
71 |
tdb |
1.6 |
AM_CONDITIONAL(SETGIDKMEM, true) |
72 |
tdb |
1.1 |
;; |
73 |
|
|
linux-gnu) |
74 |
tdb |
1.7 |
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
75 |
tdb |
1.13 |
LIBS="$LIBS -lstatgrab -static" |
76 |
tdb |
1.1 |
;; |
77 |
|
|
*) |
78 |
tdb |
1.7 |
AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) |
79 |
tdb |
1.1 |
;; |
80 |
|
|
esac |
81 |
|
|
|
82 |
tdb |
1.9 |
# Check for the --with-pid-file option |
83 |
tdb |
1.6 |
AC_ARG_WITH([pid-file], [ --with-pid-file=FILE location of PID file (default: /var/tmp/.ihost.pid)], [pidfile=$withval], [pidfile=[/var/tmp/.ihost.pid]]) |
84 |
tdb |
1.3 |
AC_DEFINE_UNQUOTED([PID_FILE], ["$pidfile"], [Location of PID file]) |
85 |
tdb |
1.2 |
|
86 |
tdb |
1.9 |
# Check for the --with-max-udp-size option |
87 |
tdb |
1.6 |
AC_ARG_WITH([max-udp-size], [ --with-max-udp-size=KB maximum size of UDP packets in kilobytes (default: 8192kb)], [max_udp_size=$withval], [max_udp_size=[8192]]) |
88 |
tdb |
1.9 |
AC_DEFINE_UNQUOTED([MAX_UDP_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes]) |
89 |
|
|
|
90 |
|
|
# Check for the --with-log-file option |
91 |
|
|
AC_ARG_WITH([log-file], [ --with-log-file=FILE location of log file (default: /var/log/ihost.log)], [logfile=$withval], [logfile=[/var/log/ihost.log]]) |
92 |
|
|
AC_DEFINE_UNQUOTED([LOG_FILE], ["$logfile"], [Location of log file]) |
93 |
|
|
|
94 |
|
|
# And finish by changing these files |
95 |
|
|
AC_CONFIG_FILES([Makefile libukcprog/Makefile]) |
96 |
tdb |
1.2 |
|
97 |
tdb |
1.9 |
AC_OUTPUT |