1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
|
dnl
dnl configure.ac
dnl $Id: configure.ac,v 1.51 2004/12/25 02:35:34 johnh Exp $
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(lavaps,2.7)
AC_CONFIG_SRCDIR(src/blob.cc)
AM_INIT_AUTOMAKE
AC_PREFIX_PROGRAM(lavaps)
AM_CONFIG_HEADER(config.h)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_LANG_CPLUSPLUS
AC_PATH_PROGS(PERL,perl5 perl,false)
AC_PATH_PROG(POD2MAN,pod2man,false)
AC_PATH_PROG(POD2TEXT,pod2text,false)
AC_PATH_PROG(POD2HTML,pod2html,false)
if test "x$PERL" = xfalse -o "x$POD2MAN" = xfalse -o "x$POD2TEXT" = xfalse -o "x$POD2HTML" = xfalse
then
AC_MSG_RESULT([ perl and the pod2x programs are only needed to rebuild the documentation.])
fi
dnl early check for toolkit flavor
AC_PATH_PROG(TCLSH,tclsh,false)
AC_PATH_PROG(PKG_CONFIG,pkg-config,false)
dnl check for recent g++ (and libraries)
dnl (thanks to Ted Faber for finding how to test this)
dnl and Murray Smigel for pointing out that the test fails with 3.0
if test "x$GXX" = "xyes" ; then
AC_MSG_CHECKING(that $CXX is recent)
AC_TRY_COMPILE(,
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
error
#endif
,AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
AC_MSG_ERROR([[$CXX does not appear to have a version number > 2.7. lavaps requires a newer version of C++ to compile, please upgrade. If you have a newer version installed, set the environment variable CXX to refer to it and re-run configure.]])
)
fi
dnl Checks for libraries.
AC_PATH_XTRA
AM_WITH_DMALLOC
dnl
dnl Checks for header files.
dnl check tcl/tk later
dnl
dnl
dnl stl is a pain:
dnl someone decided to use namespaces
dnl
dnl MIPSpro Compiler: Version 7.2.1 on Irix 6.5
dnl wants "use namespace stl"
dnl
dnl The standard seems to be "use namespace std"
dnl (supposedly gcc 3.0 works this way).
dnl
dnl Sigh.
dnl
stl_namespace=no
dnl
if test x$stl_namespace = xno
then
AC_MSG_CHECKING(if STL works without any namespace)
AC_TRY_COMPILE(
#include <list>
,
list<int> test;
,
AC_MSG_RESULT(yes)
stl_namespace="none"
,
AC_MSG_RESULT(no)
)
fi
dnl
if test x$stl_namespace = xno
then
AC_MSG_CHECKING(if STL works with namespace std)
AC_TRY_COMPILE(
#include <list>
using namespace std;
,
list<int> test;
,
AC_MSG_RESULT(yes)
stl_namespace=std
,
AC_MSG_RESULT(no)
)
fi
dnl
if test x$stl_namespace = xno
then
AC_MSG_CHECKING(if STL works with namespace stl)
AC_TRY_COMPILE(
#include <list>
using namespace std;
,
list<int> test;
,
AC_MSG_RESULT(yes)
stl_namespace=stl
,
AC_MSG_RESULT(no)
)
fi
if test x$stl_namespace = xno
then
AC_MSG_ERROR([Test cases failed to compile with STL. Turn on your bat-signal and contact your local autoconf expert. ])
fi
if test x$stl_namespace != xnone
then
AC_DEFINE(LAVAPS_STL_REQUIRES_NAMESPACE,1,[does stl need a namespace?])
fi
LAVAPS_STL_NAMESPACE=$stl_namespace
AC_SUBST(LAVAPS_STL_NAMESPACE)
dnl I clearly don't get the key arguement to AH_VERBATIM...
AH_BOTTOM([
/* Requires -DLAVAPS_STL_NAMESPACE in the Makefile as well. */
#ifdef LAVAPS_STL_REQUIRES_NAMESPACE
using namespace LAVAPS_STL_NAMESPACE;
#endif /* LAVAPS_STL_NAMESPACE */
])
dnl
dnl Checks for library functions.
dnl
AC_CHECK_HEADERS([stdio.h popt.h])
AC_CHECK_FUNCS(setenv snprintf)
dnl
dnl allow user to add their own stuff
dnl
AC_ARG_WITH(additional-includes, --with-additional-includes=path, ADDITIONAL_INCLUDES=$withval,ADDITIONAL_INCLUDES="")
AC_ARG_WITH(additional-libs, --with-additional-libs=path, ADDITIONAL_LIBS=$withval,ADDITIONAL_LIBS="")
AC_SUBST(ADDITIONAL_INCLUDES)
AC_SUBST(ADDITIONAL_LIBS)
dnl
dnl libraries are below
dnl
dnl System-specific stuff:
AC_CANONICAL_HOST
PLATFORM_SOURCES=""
PLATFORM_INCLUDES=""
PLATFORM_LIBS=""
PLATFORM_SUBDIRS=""
dnl if job must be setuid/setgid
PLATFORM_OWN="none"
PLATFORM_GRP="none"
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=none
platform=$host
AC_MSG_CHECKING([for OS-specific process-scan code])
dnl *** Please keep platforms alphabetized, execept that Linux goes
dnl *** first since it's simplest and is a good place to copy from.
case "${platform}" in
*-*-*linux*)
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=none
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_LINUX_PROC -Ilinux"
PLATFORM_LIBS="-Llinux/proc -lproc"
PLATFORM_SUBDIRS=linux
AC_MSG_RESULT([yes---Linux])
;;
*-*-*aix*)
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=none
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_AIX"
PLATFORM_SPECIFIC_TCLTK_DL_LIB=""
PLATFORM_LIBS=""
PLATFORM_SUBDIRS=""
AC_MSG_RESULT([yes---AIX])
;;
*-apple-*darwin*)
PLATFORM_SPECIFIC_TCLTK_INCLUDES="-I/sw/include -L/sw/lib"
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=none
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_MACH"
PLATFORM_SPECIFIC_TCLTK_DL_LIB=""
PLATFORM_LIBS=""
PLATFORM_SUBDIRS=""
dnl Apparently macs must run setuid root. Ick.
PLATFORM_OWN="root"
AC_MSG_RESULT([yes---Mach/MacOS-X])
;;
*-*-*bsd*)
PLATFORM_SPECIFIC_TCLTK_INCLUDES="-I/usr/local/include/tk$TK_DOTTED_HI_VERS -I/usr/local/include/tcl$TCL_DOTTED_HI_VERS -L/usr/local/lib"
case "${platform}" in
*-*-*darwin*)
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=dot
TCLTK_LIB_SUFFIX_TYPE=dot
AC_MSG_ERROR([no---Darwin support not complete yet])
;;
*) PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=nodot;;
esac
PLATFORM_SPECIFIC_TCLTK_DL_LIB="no"
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_BSD"
PLATFORM_LIBS="-lkvm"
PLATFORM_SUBDIRS=""
PLATFORM_GRP="kmem"
AC_MSG_RESULT([yes---*BSD])
dnl
dnl This next check is a hack to work around a problem
dnl Ted Faber found in FreeBSD 3.2 with newer versions of egcs.
dnl
AC_MSG_CHECKING(whether $CXX can include sys/user.h without -fpermissive)
AC_TRY_COMPILE(
extern "C" {
#include <stdio.h>
#include <err.h>
#include <string.h>
#include <vis.h>
#include <limits.h>
#include <sys/param.h>
#include <sys/sysctl.h> // KERN_PROC_ALL
#include <sys/types.h>
#include <sys/user.h>
#include <fcntl.h>
#include <kvm.h>
}
,
int i; /* no real function body */
,
AC_MSG_RESULT(yes),
PLATFORM_INCLUDES="$PLATFORM_INCLUDES -fpermissive"
,
AC_MSG_RESULT(no)
)
;;
*-*-*irix*)
PLATFORM_SPECIFIC_TCLTK_LIB_SUFFIX_TYPE=none
dnl xxx: this stuff is in progress
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_IRIX -I/usr/freeware/lib32"
PLATFORM_LIBS="-L/usr/lib32 -L/usr/freeware/lib32"
PLATFORM_SUBDIRS=""
AC_MSG_RESULT([yes---Irix])
;;
*-*-*solaris*)
case `uname -r` in
3.*|4.*|5.1|5.2|5.3|5.4)
AC_MSG_ERROR([no---Solaris 2.4 or earlier not supported])
;;
5.5*)
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_SOLARIS_2_5"
AC_MSG_RESULT([yes---Solaris 2.5])
;;
*)
AC_MSG_RESULT([yes---Solaris 2.6 or later])
PLATFORM_INCLUDES="-DUSE_PROCESS_SCAN_SOLARIS"
;;
esac
PLATFORM_DEFAULT_TCLTK_LIB_SUFFIX_TYPE=none
PLATFORM_SPECIFIC_TCLTK_DL_LIB=""
PLATFORM_LIBS=""
PLATFORM_SUBDIRS=""
;;
*)
AC_MSG_ERROR([no
Don't know about your host (${platform})
and so will not know how to read process information.])
;;
esac
dnl
dnl FIGURE OUT THE TOOLKIT
dnl
GUI_TOOLKIT=none
DEFAULT_GUI_TOOLKIT=none
dnl default GUI is whatever comes LAST!
test $TCLSH != false && DEFAULT_GUI_TOOLKIT=tcltk
test $PKG_CONFIG != false && DEFAULT_GUI_TOOLKIT=gtk
AC_ARG_WITH(tcltk,--with-tcltk to use the tcl/tk GUI, GUI_TOOLKIT=tcltk)
AC_ARG_WITH(gtk,--with-gtk to use the Gtk/Gnome GUI, GUI_TOOLKIT=gtk)
AC_MSG_CHECKING([preferred GUI toolkit])
if test $GUI_TOOLKIT != none
then
AC_MSG_RESULT([$GUI_TOOLKIT selected])
else
if test $DEFAULT_GUI_TOOLKIT = none
then
AC_MSG_ERROR([no default GUI toolkit; specify --with-tcltk or --with-gtk])
fi
GUI_TOOLKIT=$DEFAULT_GUI_TOOLKIT
AC_MSG_RESULT([$GUI_TOOLKIT defaulted])
fi
AC_SUBST(GUI_TOOLKIT)
dnl
dnl suck in tcl/tk-specific autoconf
dnl
use_gettext=no
if test $GUI_TOOLKIT = tcltk
then
builtin(include,configure.tcltk.ac)
GUI_INCLUDES="-DUSE_TCL_BLOB $TCLTK_INCLUDES"
GUI_LIBS=$TCLTK_LIBS
use_gettext=no
fi
AM_CONDITIONAL([COND_GT], [test "$use_gettext" = yes])
if test $GUI_TOOLKIT = gtk
then
builtin(include,configure.gtk.ac)
GUI_INCLUDES="-DUSE_GTK_BLOB $GTK_INCLUDES"
GUI_LIBS=$GTK_LIBS
use_gettext=yes
fi
USE_GETTEXT=$use_gettext
AC_SUBST(USE_GETTEXT)
AC_SUBST(GUI_INCLUDES)
AC_SUBST(GUI_LIBS)
if test x$USE_GETTEXT != xyes
then
# manually make a po Makefile
echo 'all install:' >po/Makefile
fi
dnl Older versions of the X11 headers are not compatible with the ANSI C++
dnl prototype checking done by recent egcs/g++ releases. (Solaris is one
dnl platform known to need the -fpermissive flag for g++)
if test "x$GXX" = "xyes" ; then
AC_MSG_CHECKING(if we need to add -fpermissive for $CXX to include X11/Xlib.h)
AC_TRY_COMPILE(
extern "C" {
#include <X11/Xlib.h>
}
,
int i; /* no real function body */
,
AC_MSG_RESULT(no),
PLATFORM_INCLUDES="$PLATFORM_INCLUDES -fpermissive"
AC_MSG_RESULT(yes))
fi
AC_SUBST(PLATFORM_SOURCES)
AC_SUBST(PLATFORM_INCLUDES)
AC_SUBST(PLATFORM_LIBS)
AC_SUBST(PLATFORM_SUBDIRS)
AC_SUBST(PLATFORM_OWN)
AC_SUBST(PLATFORM_GRP)
if test x$GXX = xyes
then
LAVAPS_GXX_FLAGS="-Wall"
else
LAVAPS_GXX_FLAGS=""
fi
AC_SUBST(LAVAPS_GXX_FLAGS)
AC_OUTPUT([Makefile
lavaps.spec
doc/Makefile
po/Makefile.in
src/Makefile
src/linux/Makefile
src/freebsd/port/Makefile
tcl2cc/Makefile
])
|