ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/configure.in
Revision: 1.47
Committed: Tue Jan 6 16:02:15 2004 UTC (20 years, 10 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_8
Changes since 1.46: +4 -4 lines
Log Message:
We're going with 0.8.

File Contents

# User Rev Content
1 tdb 1.4 # -*- Autoconf -*-
2     # Process this file with autoconf to produce a configure script.
3     #
4     # configure.in for libstatgrab
5 tdb 1.47 # $Id: configure.in,v 1.46 2003/12/12 09:48:20 tdb Exp $
6 tdb 1.4 #
7 tdb 1.1
8 tdb 1.4 # Change these to change the package name and version
9 tdb 1.47 AC_INIT(libstatgrab, 0.8, bugs@i-scream.org)
10     AM_INIT_AUTOMAKE(libstatgrab, 0.8)
11 tdb 1.1
12 tdb 1.4 # Revision number (automatically updated)
13 tdb 1.47 AC_REVISION($Revision: 1.46 $)
14 tdb 1.1
15 tdb 1.4 # 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     AM_CONFIG_HEADER([config.h])
20    
21     # Checks for programs
22 tdb 1.1 AC_PROG_CC
23     AC_PROG_INSTALL
24 tdb 1.2 AC_PROG_LIBTOOL
25 tdb 1.1
26 tdb 1.4 # Checks for header files
27 tdb 1.1 AC_HEADER_STDC
28    
29 tdb 1.4 # Checks for typedefs, structures, and compiler characteristics
30     AC_C_CONST
31 tdb 1.1
32 tdb 1.4 # Checks for library functions
33     AC_FUNC_MALLOC
34     AC_FUNC_REALLOC
35 tdb 1.17 AC_CHECK_FUNCS(atoll)
36 ats 1.39
37     # Disk IO read and write statistics are only present on recent NetBSD.
38     AC_CHECK_MEMBER(struct disk_sysctl.dk_rbytes,
39     [AC_DEFINE(HAVE_DK_RBYTES, , [New-style NetBSD stats])],
40     [],
41     [#include <sys/disk.h>])
42 tdb 1.4
43 tdb 1.46 # Default needing setgid/setuid to false
44 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, false)
45 tdb 1.46 AM_CONDITIONAL(SETUIDBINS, false)
46 tdb 1.35
47 tdb 1.4 # Set things up for different OS's
48     # We define the name of the OS so the code can act accordingly
49     # We also need to add the right LDFLAGS
50 tdb 1.1 case $host_os in
51 tdb 1.8 solaris2.[[6-7]])
52     AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])])
53     AC_DEFINE(SOLARIS, , [Building on Solaris 2.x])
54     AC_DEFINE(SOL7, , [Building on Solaris 2.7])
55 tdb 1.46 AM_CONDITIONAL(SETUIDBINS, true)
56 tdb 1.45 LINKFLAGS="-lkstat -ldevinfo"
57 tdb 1.8 ;;
58 tdb 1.1 solaris2.*)
59 tdb 1.4 AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])])
60 tdb 1.1 AC_DEFINE(SOLARIS, , [Building on Solaris 2.x])
61 tdb 1.46 AM_CONDITIONAL(SETUIDBINS, true)
62 tdb 1.45 LINKFLAGS="-lkstat -ldevinfo"
63 tdb 1.1 ;;
64     freebsd4.*)
65 ats 1.38 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
66 tdb 1.34 AC_DEFINE(FREEBSD, , [Building on FreeBSD])
67 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
68 tdb 1.34 LINKFLAGS="-lkvm -ldevstat"
69     ;;
70     freebsd5.*)
71 ats 1.38 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
72 tdb 1.34 AC_DEFINE(FREEBSD, , [Building on FreeBSD])
73     AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x])
74 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
75 tdb 1.29 LINKFLAGS="-lkvm -ldevstat"
76 ats 1.38 ;;
77 tdb 1.42 netbsdelf*)
78 ats 1.38 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
79     AC_DEFINE(NETBSD, , [Building on NetBSD])
80     AM_CONDITIONAL(SETGIDBINS, true)
81     LINKFLAGS="-lkvm"
82 tdb 1.1 ;;
83     linux-gnu)
84     AC_DEFINE(LINUX, , [Building on GNU/Linux])
85 tdb 1.43 ;;
86     cygwin)
87     AC_DEFINE(CYGWIN, , [Building on Cygwin])
88 tdb 1.1 ;;
89     *)
90     AC_MSG_ERROR([Cannot build on unknown OS: $host_os])
91     ;;
92     esac
93 tdb 1.29
94 tdb 1.31 # User specified curses/ncurses prefix
95     AC_ARG_WITH([curses-prefix],
96     [ --with-curses-prefix=PATH curses (or ncurses) is in PATH],
97     [
98     if test -d "$withval/lib"; then
99     SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}"
100     fi
101     if test -d "$withval/include"; then
102 tdb 1.32 SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}"
103 tdb 1.31 fi
104     ]
105     )
106    
107     # Check if user wants to disable statgrab
108     AM_CONDITIONAL(STATGRAB, true)
109     AC_ARG_ENABLE(statgrab,
110     [ --disable-statgrab disable building of statgrab],
111     [
112     if test "x$enableval" = "xno" ; then
113     AM_CONDITIONAL(STATGRAB, false)
114     fi
115     ]
116     )
117    
118     # Check if user wants to disable saidar
119     AM_CONDITIONAL(SAIDAR, true)
120     AC_ARG_ENABLE(saidar,
121     [ --disable-saidar disable building of saidar],
122     [
123     if test "x$enableval" = "xno" ; then
124     AM_CONDITIONAL(SAIDAR, false)
125     fi
126     ],
127     [
128     # saidar needs curses
129     # (if we don't find curses we disable saidar)
130     MP_WITH_CURSES
131     ]
132     )
133    
134     # Check if the user would prefer not to build examples
135     AM_CONDITIONAL(EXAMPLES, true)
136     AC_ARG_ENABLE(examples,
137     [ --disable-examples disable building of examples],
138     [
139     if test "x$enableval" = "xno" ; then
140     AM_CONDITIONAL(EXAMPLES, false)
141     fi
142     ]
143     )
144    
145     # Check if user wants to install manpages
146     AM_CONDITIONAL(MANPAGES, true)
147     AC_ARG_ENABLE(manpages,
148     [ --disable-manpages disable installation of manpages],
149     [
150     if test "x$enableval" = "xno" ; then
151     AM_CONDITIONAL(MANPAGES, false)
152     fi
153     ]
154 tdb 1.35 )
155    
156     # Check if the user wants to turn off setgid binaries
157     AC_ARG_ENABLE(setgid-binaries,
158     [ --disable-setgid-binaries disable binaries being setgid],
159     [
160     if test "x$enableval" = "xno" ; then
161     AM_CONDITIONAL(SETGIDBINS, false)
162 tdb 1.46 fi
163     ]
164     )
165    
166     # Check if the user wants to turn off setuid binaries
167     AC_ARG_ENABLE(setuid-binaries,
168     [ --disable-setuid-binaries disable binaries being setuid],
169     [
170     if test "x$enableval" = "xno" ; then
171     AM_CONDITIONAL(SETUIDBINS, false)
172 tdb 1.35 fi
173     ]
174 tdb 1.31 )
175    
176     # The LIBS and CPPFLAGS that saidar needs
177     AC_SUBST(SAIDARLIBS)
178     AC_SUBST(SAIDARCPPFLAGS)
179    
180     # The flags needed to link to libstatgrab
181     # (ie. our dependencies)
182 tdb 1.29 AC_SUBST(LINKFLAGS)
183 tdb 1.1
184 tdb 1.4 # And finish by changing these files
185 tdb 1.31 AC_CONFIG_FILES([Makefile src/Makefile src/libstatgrab/Makefile src/statgrab/Makefile docs/Makefile examples/Makefile libstatgrab.pc src/statgrab/statgrab-make-mrtg-config src/statgrab/statgrab-make-mrtg-index src/saidar/Makefile])
186 tdb 1.4
187     AC_OUTPUT