ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/configure.in
Revision: 1.38
Committed: Sun Oct 19 02:03:02 2003 UTC (21 years ago) by ats
Branch: MAIN
Changes since 1.37: +10 -2 lines
Log Message:
Initial support for NetBSD. This adds NetBSD support for everything
except diskio stats (since they're even more disturbingly complex to get
at on NetBSD than the three OSs we already support). Tested against
NetBSD 1.6 on i386.

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 ats 1.38 # $Id: configure.in,v 1.37 2003/10/12 14:46:06 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.36 AC_INIT(libstatgrab, 0.6.1, bugs@i-scream.org)
10     AM_INIT_AUTOMAKE(libstatgrab, 0.6.1)
11 tdb 1.1
12 tdb 1.4 # Revision number (automatically updated)
13 ats 1.38 AC_REVISION($Revision: 1.37 $)
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 tdb 1.4
37 tdb 1.35 # Default needing setgid to false
38     AM_CONDITIONAL(SETGIDBINS, false)
39    
40 tdb 1.4 # Set things up for different OS's
41     # We define the name of the OS so the code can act accordingly
42     # We also need to add the right LDFLAGS
43 tdb 1.1 case $host_os in
44 tdb 1.8 solaris2.[[6-7]])
45     AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])])
46     AC_DEFINE(SOLARIS, , [Building on Solaris 2.x])
47     AC_DEFINE(SOL7, , [Building on Solaris 2.7])
48 tdb 1.29 LINKFLAGS="-lkstat"
49 tdb 1.8 ;;
50 tdb 1.1 solaris2.*)
51 tdb 1.4 AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])])
52 tdb 1.1 AC_DEFINE(SOLARIS, , [Building on Solaris 2.x])
53 tdb 1.29 LINKFLAGS="-lkstat"
54 tdb 1.1 ;;
55     freebsd4.*)
56 ats 1.38 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
57 tdb 1.34 AC_DEFINE(FREEBSD, , [Building on FreeBSD])
58 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
59 tdb 1.34 LINKFLAGS="-lkvm -ldevstat"
60     ;;
61     freebsd5.*)
62 ats 1.38 AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
63 tdb 1.34 AC_DEFINE(FREEBSD, , [Building on FreeBSD])
64     AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x])
65 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
66 tdb 1.29 LINKFLAGS="-lkvm -ldevstat"
67 ats 1.38 ;;
68     netbsdelf1.*)
69     AC_DEFINE(ALLBSD, , [Building on a BSD-derived system])
70     AC_DEFINE(NETBSD, , [Building on NetBSD])
71     AM_CONDITIONAL(SETGIDBINS, true)
72     LINKFLAGS="-lkvm"
73 tdb 1.1 ;;
74     linux-gnu)
75     AC_DEFINE(LINUX, , [Building on GNU/Linux])
76     ;;
77     *)
78     AC_MSG_ERROR([Cannot build on unknown OS: $host_os])
79     ;;
80     esac
81 tdb 1.29
82 tdb 1.31 # User specified curses/ncurses prefix
83     AC_ARG_WITH([curses-prefix],
84     [ --with-curses-prefix=PATH curses (or ncurses) is in PATH],
85     [
86     if test -d "$withval/lib"; then
87     SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}"
88     fi
89     if test -d "$withval/include"; then
90 tdb 1.32 SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}"
91 tdb 1.31 fi
92     ]
93     )
94    
95     # Check if user wants to disable statgrab
96     AM_CONDITIONAL(STATGRAB, true)
97     AC_ARG_ENABLE(statgrab,
98     [ --disable-statgrab disable building of statgrab],
99     [
100     if test "x$enableval" = "xno" ; then
101     AM_CONDITIONAL(STATGRAB, false)
102     fi
103     ]
104     )
105    
106     # Check if user wants to disable saidar
107     AM_CONDITIONAL(SAIDAR, true)
108     AC_ARG_ENABLE(saidar,
109     [ --disable-saidar disable building of saidar],
110     [
111     if test "x$enableval" = "xno" ; then
112     AM_CONDITIONAL(SAIDAR, false)
113     fi
114     ],
115     [
116     # saidar needs curses
117     # (if we don't find curses we disable saidar)
118     MP_WITH_CURSES
119     ]
120     )
121    
122     # Check if the user would prefer not to build examples
123     AM_CONDITIONAL(EXAMPLES, true)
124     AC_ARG_ENABLE(examples,
125     [ --disable-examples disable building of examples],
126     [
127     if test "x$enableval" = "xno" ; then
128     AM_CONDITIONAL(EXAMPLES, false)
129     fi
130     ]
131     )
132    
133     # Check if user wants to install manpages
134     AM_CONDITIONAL(MANPAGES, true)
135     AC_ARG_ENABLE(manpages,
136     [ --disable-manpages disable installation of manpages],
137     [
138     if test "x$enableval" = "xno" ; then
139     AM_CONDITIONAL(MANPAGES, false)
140     fi
141     ]
142 tdb 1.35 )
143    
144     # Check if the user wants to turn off setgid binaries
145     # (only really relevant on FreeBSD)
146     AC_ARG_ENABLE(setgid-binaries,
147     [ --disable-setgid-binaries disable binaries being setgid],
148     [
149     if test "x$enableval" = "xno" ; then
150     AM_CONDITIONAL(SETGIDBINS, false)
151     fi
152     ]
153 tdb 1.31 )
154    
155     # The LIBS and CPPFLAGS that saidar needs
156     AC_SUBST(SAIDARLIBS)
157     AC_SUBST(SAIDARCPPFLAGS)
158    
159     # The flags needed to link to libstatgrab
160     # (ie. our dependencies)
161 tdb 1.29 AC_SUBST(LINKFLAGS)
162 tdb 1.1
163 tdb 1.4 # And finish by changing these files
164 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])
165 tdb 1.4
166     AC_OUTPUT