sigar/configure.ac

164 lines
4.0 KiB
Plaintext
Raw Normal View History

2009-08-13 03:25:58 +08:00
dnl ... hmm ... we have to duplicate the data below again
2008-11-27 07:27:32 +08:00
AC_INIT(libsigar, 1.6.2)
AC_CONFIG_SRCDIR(src/sigar.c)
2009-08-13 03:25:58 +08:00
dnl AC_CONFIG_HEADERS(src/config.h)
AM_INIT_AUTOMAKE([foreign])
2008-11-27 07:27:32 +08:00
AC_CANONICAL_HOST
2009-08-13 03:25:58 +08:00
dnl for sigar_version_autoconf.c.in
VERSION_MAJOR=1
VERSION_MINOR=6
VERSION_MAINT=2
VERSION_BUILD=0
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_MAINT)
AC_SUBST(VERSION_BUILD)
2008-11-27 07:27:32 +08:00
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_MSG_CHECKING([for os type ($host_os)])
2009-08-13 03:25:58 +08:00
FRAMEWORK=
2008-11-27 07:27:32 +08:00
case $host_os in
*aix*)
SRC_OS="aix"
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_TEST_OS_AIX, [1], [for the tests])
LIBS="-lodm -lcfg -lperfstat -lpthreads"
2008-11-27 07:27:32 +08:00
;;
*darwin*)
SRC_OS="darwin"
2009-08-13 03:25:58 +08:00
AC_DEFINE(DARWIN,[],[running on MacOS X])
AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests])
SIGAR_INCLUDES="-I /Developer/Headers/FlatCarbon/"
SIGAR_LIBS="-framework IOKit -framework CoreServices"
;;
*netbsd*)
SRC_OS="darwin"
AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests])
SIGAR_LIBS="-lkvm"
;;
*openbsd*)
SRC_OS="darwin"
AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests])
SIGAR_LIBS="-lkvm"
2008-11-27 07:27:32 +08:00
;;
*freebsd*)
SRC_OS="darwin"
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_TEST_OS_DARWIN, [1], [for the tests])
SIGAR_LIBS="-lkvm"
2008-11-27 07:27:32 +08:00
;;
*hpux*)
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_HPUX,[],[running on HPUX])
2008-11-27 07:27:32 +08:00
SRC_OS="hpux"
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_TEST_OS_HPUX, [1], [for the tests])
SIGAR_LIBS="-lnm -lnsl"
2008-11-27 07:27:32 +08:00
;;
*linux*)
SRC_OS="linux"
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_TEST_OS_LINUX, [1], [for the tests])
2008-11-27 07:27:32 +08:00
;;
*solaris*)
2009-08-13 03:25:58 +08:00
AC_DEFINE(SOLARIS,[],[running on Solaris])
2008-11-27 07:27:32 +08:00
SRC_OS="solaris"
2009-08-13 03:25:58 +08:00
AC_DEFINE(SIGAR_TEST_OS_SOLARIS, [1], [for the tests])
SIGAR_LIBS="-lkstat -lsocket"
2008-11-27 07:27:32 +08:00
;;
*)
ac_system="unknown"
esac
AC_MSG_RESULT([$SRC_OS])
2009-08-13 03:25:58 +08:00
AC_CHECK_HEADERS(libproc.h valgrind/valgrind.h)
if test $ac_cv_header_libproc_h = yes; then
AC_DEFINE(DARWIN_HAS_LIBPROC_H, [1], [sigar named them DARWIN_HAS_... instead of HAVE_])
fi
INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/src/os/$SRC_OS $SIGAR_INCLUDES"
2008-11-27 07:27:32 +08:00
AC_SUBST(SRC_OS)
AC_SUBST(INCLUDES)
2009-08-13 03:25:58 +08:00
AC_SUBST(SIGAR_LIBS)
AM_CONDITIONAL(OS_WIN32, test x$SRC_OS = xwin32)
AM_CONDITIONAL(OS_MACOSX, test x$SRC_OS = xdarwin)
AM_CONDITIONAL(OS_LINUX, test x$SRC_OS = xlinux)
AM_CONDITIONAL(OS_HPUX, test x$SRC_OS = xhpux)
AM_CONDITIONAL(OS_AIX, test x$SRC_OS = xaix)
AM_CONDITIONAL(OS_SOLARIS, test x$SRC_OS = xsolaris)
AC_ARG_WITH(valgrind, [AC_HELP_STRING(
[--with-valgrind[=binary]],
[run the tests in valgrind to check for mem-leaks]
)],
[],
[with_valgrind=no])
AS_IF([test "x$with_valgrind" != xno],
[AS_IF([test "x$with_valgrind" = xyes],
[AC_CHECK_PROG(VALGRIND, valgrind)
AS_IF([test "x$VALGRIND" = x],
[AC_MSG_ERROR("--with-valgrind ... but no valgrind found")])
],
[VALGRIND="$with_valgrind"
AC_SUBST(VALGRIND)])
])
AM_CONDITIONAL(USE_VALGRIND, test "x$VALGRIND" != x)
dnl Check for lua
AC_MSG_CHECKING(if with lua)
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]),
[WITH_LUA=$withval],[WITH_LUA=no])
if test "$WITH_LUA" != "no"; then
AC_MSG_RESULT($WITH_LUA)
# try pkgconfig
if test "$WITH_LUA" = "yes"; then
LUAPC=lua
else
LUAPC=$WITH_LUA
fi
PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
],[
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
],[WITH_LUA=no])
])
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
fi
AM_CONDITIONAL([BUILD_LUA],[test "$WITH_LUA" != "no"])
2008-11-27 07:27:32 +08:00
AC_CONFIG_FILES([
Makefile
2009-08-13 03:25:58 +08:00
include/Makefile
2008-11-27 07:27:32 +08:00
src/Makefile
src/os/Makefile
src/os/aix/Makefile
src/os/darwin/Makefile
2009-08-13 03:25:58 +08:00
src/os/freebsd/Makefile
2008-11-27 07:27:32 +08:00
src/os/hpux/Makefile
2009-08-13 03:25:58 +08:00
src/os/linux/Makefile
src/os/netware/Makefile
src/os/osf1/Makefile
2008-11-27 07:27:32 +08:00
src/os/solaris/Makefile
2009-08-13 03:25:58 +08:00
src/os/stub/Makefile
src/os/win32/Makefile
2008-11-27 07:27:32 +08:00
examples/Makefile
2009-08-13 03:25:58 +08:00
src/sigar_version_autoconf.c
tests/Makefile
bindings/Makefile
bindings/lua/Makefile
2008-11-27 07:27:32 +08:00
])
AC_OUTPUT