ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/ihost/configure.in
Revision: 1.34
Committed: Sat Sep 24 13:30:40 2005 UTC (18 years, 7 months ago) by tdb
Branch: MAIN
Changes since 1.33: +8 -2 lines
Log Message:
Add WIN32 support via MINGW. We'll need to add stuff to the README file
about what this requires to build.

All the hard work done by: skel

File Contents

# User Rev Content
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.34 # $Id: configure.in,v 1.33 2004/05/31 13:53:40 tdb Exp $
6 tdb 1.9 #
7    
8     # Change these to change the package name and version
9 tdb 1.33 AC_INIT(ihost, 1.5.9, bugs@i-scream.org)
10     AM_INIT_AUTOMAKE(ihost, 1.5.9)
11 tdb 1.5
12 tdb 1.9 # Revision number (automatically updated)
13 tdb 1.34 AC_REVISION($Revision: 1.33 $)
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    
25 tdb 1.9 # User specified libstatgrab prefix
26     AC_ARG_WITH([libstatgrab-prefix],
27     [ --with-libstatgrab-prefix=PATH libstatgrab is in PATH],
28     [
29     if test -d "$withval/lib"; then
30 tdb 1.13 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
31 tdb 1.9 fi
32     if test -d "$withval/include"; then
33     CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
34     fi
35     ]
36     )
37    
38 tdb 1.18 # User specified libukcprog prefix
39     AC_ARG_WITH([libukcprog-prefix],
40     [ --with-libukcprog-prefix=PATH libukcprog is in PATH],
41     [
42     if test -d "$withval/lib"; then
43     LDFLAGS="-L${withval}/lib ${LDFLAGS}"
44     fi
45     if test -d "$withval/include"; then
46     CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
47     fi
48     ]
49     )
50    
51 tdb 1.9 # Checks for header files
52 tdb 1.1 AC_HEADER_STDC
53 tdb 1.9 AC_CHECK_HEADERS(statgrab.h,,[AC_MSG_ERROR([need statgrab.h])])
54 tdb 1.18 AC_CHECK_HEADERS(ukcprog.h,,[AC_MSG_ERROR([need ukcprog.h])])
55 tdb 1.9
56     # Checks for typedefs, structures, and compiler characteristics
57     AC_C_CONST
58 tdb 1.1
59 tdb 1.9 # Checks for library functions
60     AC_FUNC_MALLOC
61     AC_FUNC_REALLOC
62     AC_FUNC_FORK
63 tdb 1.12 AC_CHECK_FUNCS(strlcat)
64 tdb 1.1
65 tdb 1.9 # Figure out details about the host - we need the OS
66 tdb 1.1 AC_CANONICAL_HOST
67    
68 tdb 1.9 # Default needing setgid kmem to false
69 tdb 1.6 AM_CONDITIONAL(SETGIDKMEM, false)
70 tdb 1.4
71 tdb 1.9 # Set things up for different OS's
72     # We define the name of the OS so the code can act accordingly
73     # We also need to add the right LDFLAGS
74 tdb 1.1 case $host_os in
75     solaris2.*)
76 tdb 1.22 AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])],[-lnsl -lsocket])
77 tdb 1.1 AC_DEFINE(SOLARIS, , [Building on Solaris 2.x])
78 tdb 1.30 LIBS="$LIBS -lnsl -lsocket -lkstat -ldevinfo -lstatgrab -lukcprog"
79 tdb 1.1 ;;
80 tdb 1.29 freebsd*)
81 tdb 1.22 AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])])
82 tdb 1.29 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
83     AC_DEFINE(FREEBSD, , [Building on FreeBSD])
84 tdb 1.30 LIBS="$LIBS -lstatgrab -lkvm -ldevstat -lukcprog"
85 tdb 1.9 # FreeBSD needs ihost to be setgid kmem
86 tdb 1.6 AM_CONDITIONAL(SETGIDKMEM, true)
87 tdb 1.1 ;;
88 tdb 1.29 netbsdelf*)
89     AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])])
90     AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
91     AC_DEFINE(NETBSD, , [Building on NetBSD])
92 tdb 1.30 LIBS="$LIBS -lstatgrab -lkvm -lukcprog"
93 tdb 1.29 AM_CONDITIONAL(SETGIDKMEM, true)
94     ;;
95 tdb 1.1 linux-gnu)
96 tdb 1.22 AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])])
97 tdb 1.7 AC_DEFINE(LINUX, , [Building on GNU/Linux])
98 tdb 1.30 LIBS="$LIBS -lstatgrab -lukcprog"
99 tdb 1.1 ;;
100 tdb 1.29 cygwin)
101 tdb 1.30 AC_MSG_ERROR([libstatgrab doesn't fully support cygwin, yet])
102 tdb 1.34 ;;
103     mingw32)
104     AC_CHECK_LIB(ukcprog, fpgetline,[:],[AC_MSG_ERROR([need libukcprog])])
105     AC_DEFINE(MINGW, , [Building on MinGW])
106     AC_DEFINE(WINVER, 0x0500, [Building for Windows 2000])
107     LIBS="$LIBS -lstatgrab -lukcprog -lws2_32 -lpdh -lIphlpapi -lpsapi -lnetapi32"
108 tdb 1.29 ;;
109 tdb 1.1 *)
110 tdb 1.7 AC_MSG_ERROR([Cannot build on unknown OS: $host_os])
111 tdb 1.1 ;;
112     esac
113 tdb 1.29
114     # Check for libstatgrab
115 tdb 1.32 AC_CHECK_LIB(statgrab, sg_get_host_info,[:],[AC_MSG_ERROR([need libstatgrab])])
116 tdb 1.18
117 tdb 1.9 # Check for the --with-pid-file option
118 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]])
119 tdb 1.3 AC_DEFINE_UNQUOTED([PID_FILE], ["$pidfile"], [Location of PID file])
120 tdb 1.2
121 tdb 1.9 # Check for the --with-max-udp-size option
122 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]])
123 tdb 1.9 AC_DEFINE_UNQUOTED([MAX_UDP_PACKET_SIZE], [$max_udp_size], [Maximum size of UDP packets in kilobytes])
124    
125     # Check for the --with-log-file option
126     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]])
127     AC_DEFINE_UNQUOTED([LOG_FILE], ["$logfile"], [Location of log file])
128 tdb 1.28
129     # Check for the --with-server-name option
130     AC_ARG_WITH([server-name], [ --with-server-name=NAME default server name (default: i-scream)], [servername=$withval], [servername=[i-scream]])
131     AC_DEFINE_UNQUOTED([DEF_SERVER_NAME], ["$servername"], [Default Server Name])
132    
133     # Check for the --with-server-port option
134     AC_ARG_WITH([server-port], [ --with-server-port=PORT default server port (default: 4567)], [serverport=$withval], [serverport=[4567]])
135     AC_DEFINE_UNQUOTED([DEF_SERVER_PORT], [$serverport], [Default Server Port])
136 tdb 1.9
137     # And finish by changing these files
138 tdb 1.18 AC_CONFIG_FILES([Makefile])
139 tdb 1.2
140 tdb 1.9 AC_OUTPUT