ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/configure.in
Revision: 1.35
Committed: Thu Oct 9 10:37:41 2003 UTC (20 years, 6 months ago) by tdb
Branch: MAIN
CVS Tags: LIBSTATGRAB_0_6
Changes since 1.34: +18 -2 lines
Log Message:
Enable binaries being setgid kmem on FreeBSD. Will set this based on
the operating system, but is overridable using a configure flag.

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.35 # $Id: configure.in,v 1.34 2003/10/08 17:49:21 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.30 AC_INIT(libstatgrab, 0.6, bugs@i-scream.org)
10     AM_INIT_AUTOMAKE(libstatgrab, 0.6)
11 tdb 1.1
12 tdb 1.4 # Revision number (automatically updated)
13 tdb 1.35 AC_REVISION($Revision: 1.34 $)
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 tdb 1.34 AC_DEFINE(FREEBSD, , [Building on FreeBSD])
57 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
58 tdb 1.34 LINKFLAGS="-lkvm -ldevstat"
59     ;;
60     freebsd5.*)
61     AC_DEFINE(FREEBSD, , [Building on FreeBSD])
62     AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x])
63 tdb 1.35 AM_CONDITIONAL(SETGIDBINS, true)
64 tdb 1.29 LINKFLAGS="-lkvm -ldevstat"
65 tdb 1.1 ;;
66     linux-gnu)
67     AC_DEFINE(LINUX, , [Building on GNU/Linux])
68     ;;
69     *)
70     AC_MSG_ERROR([Cannot build on unknown OS: $host_os])
71     ;;
72     esac
73 tdb 1.29
74 tdb 1.31 # User specified curses/ncurses prefix
75     AC_ARG_WITH([curses-prefix],
76     [ --with-curses-prefix=PATH curses (or ncurses) is in PATH],
77     [
78     if test -d "$withval/lib"; then
79     SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}"
80     fi
81     if test -d "$withval/include"; then
82 tdb 1.32 SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}"
83 tdb 1.31 fi
84     ]
85     )
86    
87     # Check if user wants to disable statgrab
88     AM_CONDITIONAL(STATGRAB, true)
89     AC_ARG_ENABLE(statgrab,
90     [ --disable-statgrab disable building of statgrab],
91     [
92     if test "x$enableval" = "xno" ; then
93     AM_CONDITIONAL(STATGRAB, false)
94     fi
95     ]
96     )
97    
98     # Check if user wants to disable saidar
99     AM_CONDITIONAL(SAIDAR, true)
100     AC_ARG_ENABLE(saidar,
101     [ --disable-saidar disable building of saidar],
102     [
103     if test "x$enableval" = "xno" ; then
104     AM_CONDITIONAL(SAIDAR, false)
105     fi
106     ],
107     [
108     # saidar needs curses
109     # (if we don't find curses we disable saidar)
110     MP_WITH_CURSES
111     ]
112     )
113    
114     # Check if the user would prefer not to build examples
115     AM_CONDITIONAL(EXAMPLES, true)
116     AC_ARG_ENABLE(examples,
117     [ --disable-examples disable building of examples],
118     [
119     if test "x$enableval" = "xno" ; then
120     AM_CONDITIONAL(EXAMPLES, false)
121     fi
122     ]
123     )
124    
125     # Check if user wants to install manpages
126     AM_CONDITIONAL(MANPAGES, true)
127     AC_ARG_ENABLE(manpages,
128     [ --disable-manpages disable installation of manpages],
129     [
130     if test "x$enableval" = "xno" ; then
131     AM_CONDITIONAL(MANPAGES, false)
132     fi
133     ]
134 tdb 1.35 )
135    
136     # Check if the user wants to turn off setgid binaries
137     # (only really relevant on FreeBSD)
138     AC_ARG_ENABLE(setgid-binaries,
139     [ --disable-setgid-binaries disable binaries being setgid],
140     [
141     if test "x$enableval" = "xno" ; then
142     AM_CONDITIONAL(SETGIDBINS, false)
143     fi
144     ]
145 tdb 1.31 )
146 tdb 1.33
147     # User specified pkgconfig dir
148     AC_ARG_WITH([pkgconfig-dir],
149     [ --with-pkgconfig-dir=PATH pkgconfig lib directory (PREFIX/lib/pkgconfig)],
150     [ PKGCONFIG_DIR=$withval ],
151     [ PKGCONFIG_DIR="\$(libdir)/pkgconfig" ]
152     )
153     AC_SUBST(PKGCONFIG_DIR)
154 tdb 1.31
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