247
274
CONFIGURE_PART(Libintl Processing)
251
GETTEXT_PACKAGE=rrdtool
252
AC_SUBST(GETTEXT_PACKAGE)
253
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package])
255
AM_GLIB_GNU_GETTEXT()
257
AC_ARG_ENABLE(libintl,[ --disable-libintl i18n support (libintl)],
258
[],[enable_libintl=yes])
260
if test x$enable_libintl = xyes; then
261
IT_PROG_INTLTOOL([0.35.0],[no-xml])
264
if test x$enable_libintl = xyes -a x$MSGFMT = xno; then
265
AC_MSG_WARN(I could not find msgfmt. Diabeling libintl build.)
269
if test x$enable_libintl = xyes; then
270
AC_CHECK_HEADERS(libintl.h,[],[AC_MSG_RESULT(disabeling libintl build); enable_libintl=no])
273
if test x$enable_libintl = xyes ; then
274
dnl it seems bsd synstems need to link against libintl
275
dnl when compiling rrdupdate. lets check
276
AC_CHECK_LIB(intl, libintl_gettext,[LIB_LIBINTL="-lintl"])
279
dnl use for linking rrdupdate
280
AC_SUBST(LIB_LIBINTL)
282
dnl do not touch the po stuff if we are not going to build intl
283
AM_CONDITIONAL(BUILD_LIBINTL,[test x$enable_libintl = xyes])
285
if test x$enable_libintl = xyes; then
286
AC_DEFINE([BUILD_LIBINTL], [], [Use this in code sections to mark them for libintl build])
276
AM_GNU_GETTEXT_VERSION(0.17)
289
279
CONFIGURE_PART(IEEE Math Checks)
468
dnl is time_t 32 of 64 bit ?
469
AC_DEFINE([TIME_T_IS_32BIT], [], [time_t is 32bit])
470
AC_DEFINE([TIME_T_IS_64BIT], [], [time_t is 64bit])
471
AC_MSG_CHECKING([the type of time_t])
474
[[#include <time.h>]],
475
[[if (sizeof(time_t) != 4) return 1; ]]
477
[ AC_MSG_RESULT([time_t is 32 bit])
478
AC_DEFINE([TIME_T_IS_32BIT])
482
[[#include <time.h>]],
483
[[if (sizeof(time_t) != 8) return 1; ]]
486
AC_MSG_RESULT([time_t is 64 bit])
487
AC_DEFINE([TIME_T_IS_64BIT])
489
[AC_MSG_ERROR([can not figure type of time_t])]
473
496
CONFIGURE_PART(Find 3rd-Party Libraries)
498
AC_ARG_ENABLE(libdbi,AS_HELP_STRING([--disable-libdbi],[do not build in support for libdbi]),[have_libdbi=no],[
500
LIBS="$LIBS -ldbi -ldl"
501
AC_MSG_CHECKING(for libdbi)
503
[AC_LANG_PROGRAM([[#include <dbi/dbi.h>]],
504
[[dbi_initialize(NULL)]]
506
],[AC_DEFINE(HAVE_LIBDBI,[1],[have got libdbi installed])
515
AM_CONDITIONAL(BUILD_LIBDBI,[test $have_libdbi != no])
476
517
AM_CONDITIONAL(BUILD_RRDCGI,[test $enable_rrdcgi != no])
486
527
EX_CHECK_ALL(cairo, cairo_svg_surface_create, cairo-svg.h, cairo-svg, 1.4.6, http://cairographics.org/releases/, "")
487
528
EX_CHECK_ALL(cairo, cairo_pdf_surface_create, cairo-pdf.h, cairo-pdf, 1.4.6, http://cairographics.org/releases/, "")
488
529
EX_CHECK_ALL(cairo, cairo_ps_surface_create, cairo-ps.h, cairo-ps, 1.4.6, http://cairographics.org/releases/, "")
489
dnl EX_CHECK_ALL(glib-2.0, glib_check_version, glib.h, glib-2.0, 2.12.12, ftp://ftp.gtk.org/pub/glib/2.12/, "")
530
EX_CHECK_ALL(glib-2.0, glib_check_version, glib.h, glib-2.0, 2.12.12, ftp://ftp.gtk.org/pub/glib/2.12/, "")
490
531
EX_CHECK_ALL(pango-1.0, pango_cairo_context_set_font_options, pango/pango.h, pangocairo, 1.17, http://ftp.gnome.org/pub/GNOME/sources/pango/1.17, "")
491
532
EX_CHECK_ALL(xml2, xmlParseFile, libxml/parser.h, libxml-2.0, 2.6.31, http://xmlsoft.org/downloads.html, /usr/include/libxml2)
551
592
AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
553
594
# Options to pass when configuring perl module
555
test "$ppref" = 'NONE' && ppref=$ac_default_prefix
596
test "$langpref" = '$(DESTDIR)NONE' && langpref='$(DESTDIR)'$ac_default_prefix
597
test "$langpref" = "NONE" && langpref=$ac_default_prefix
557
PERL_MAKE_OPTIONS="PREFIX="'$(DESTDIR)'"$ppref LIB="'$(DESTDIR)'"$ppref/lib/perl/$PERL_VERSION"
599
PERL_MAKE_OPTIONS="PREFIX=$langpref LIB=$langpref/lib/perl/$PERL_VERSION"
559
601
dnl pass additional perl options when generating Makefile from Makefile.PL
560
602
AC_ARG_ENABLE(perl-site-install,
561
[ --enable-perl-site-install by default the rrdtool perl modules are installed
562
together with rrdtool in $prefix/lib/perl. You have to
563
put a 'use lib qw($prefix/lib/perl)' into your scripts
564
when you want to use them. When you set this option
565
the perl modules will get installed wherever
566
your perl setup thinks it is best.],
603
AS_HELP_STRING([--enable-perl-site-install],[by default the rrdtool perl modules are installed together with rrdtool in $prefix/lib/perl. You have to put a 'use lib qw($prefix/lib/perl)' into your scripts when you want to use them. When you set this option the perl modules will get installed wherever your perl setup thinks it is best.]),
567
604
[PERL_MAKE_OPTIONS=],[])
569
606
if test ! -z "$PERLCC"; then
640
671
AC_SUBST(COMP_RUBY)
674
AC_PATH_PROG(LUA, lua, no)
676
AC_ARG_ENABLE(lua,AS_HELP_STRING([--disable-lua],[do not build the lua modules]),
680
if test "$LUA" = "no" -o "$enable_lua" = "no"; then
683
AC_MSG_CHECKING(for lua >= 5.0)
684
read LUA_MAJOR LUA_MINOR LUA_POINT <<LUA_EOF
685
$($LUA -v 2>&1 | cut -f2 -d' ' | sed -e 's/\./ /g')
687
if test 0$LUA_MAJOR -lt 5; then
688
AC_MSG_RESULT([no, version found is $LUA_MAJOR.$LUA_MINOR])
690
AC_MSG_RESULT([$LUA_MAJOR.$LUA_MINOR found])
691
lua_vdot=$LUA_MAJOR.$LUA_MINOR
692
lua_vndot=$LUA_MAJOR$LUA_MINOR
693
lua_version=$LUA_MAJOR.$LUA_MINOR.$LUA_POINT
694
AC_CHECK_HEADERS(lua$lua_vndot/lua.h,
695
[AC_CHECK_HEADERS(lua$lua_vndot/lualib.h,
696
[AC_CHECK_HEADER(lua$lua_vndot/lauxlib.h,
697
[lua_headerdir=lua$lua_vndot],
700
[AC_CHECK_HEADERS(lua$lua_vdot/lua.h,
701
[AC_CHECK_HEADERS(lua$lua_vdot/lualib.h,
702
[AC_CHECK_HEADER(lua$lua_vdot/lauxlib.h,
703
[lua_headerdir=lua$lua_vdot],
706
[AC_CHECK_HEADERS(lua.h,
707
[AC_CHECK_HEADERS(lualib.h,
708
[AC_CHECK_HEADER(lauxlib.h,
710
[lua_headerdir="no"])],
714
if test "$lua_headerdir" = "no"; then
720
if test "$COMP_LUA" != "lua"; then
722
AC_MSG_WARN([Lua $lua_vdot found but not lua.h, lualib.h and lauxlib.h! Please install the -dev packages for Lua $lua_vdot])
724
# OK, headers found, let's check the libraries (LIBS is not used)
727
LUA_HAVE_COMPAT51=DONT_HAVE_COMPAT51
728
AC_SEARCH_LIBS(lua_call, lua$lua_vdot lua$lua_vndot lua,
729
[AC_SEARCH_LIBS(luaL_register, lua$lua_vdot lua$lua_vndot lua,
730
[lua_havelib=LUA$lua_vndot],
731
[AC_SEARCH_LIBS(luaL_module, lualib$lua_vndot lualib$lua_vdot lualib,
732
[lua_havelib=$lua_vndot; $LUA -l compat-5.1 2>/dev/null;
733
test "$?" = "0" && LUA_HAVE_COMPAT51=HAVE_COMPAT51],
734
[AC_SEARCH_LIBS(luaL_openlib, lualib$lua_vdot lualib$lua_vndot lualib,
735
[lua_havelib=$lua_vndot],
736
[COMP_LUA=], [-lm])], [-lm])], [-lm])],
741
# Options to pass when configuring Lua module
742
if test "$lua_havelib" != "no"; then
743
# OK, headers and libs found. Try to set lua flags
744
# and modules installation dirs with pkg-config
745
if test "$PKGCONFIG" != "no"; then
746
if test "$lua_vndot" = "50"; then
747
lua_pkg_prefix=lualib
751
# try with dot, without dot and finally without version
752
for f in $lua_pkg_prefix$lua_vdot $lua_pkg_prefix$lua_vndot $lua_pkg_prefix; do
753
lua_exec_prefix=`$PKGCONFIG --variable=prefix $f 2>/dev/null`
755
if test "$lua_exec_prefix/bin/lua" = "$LUA"; then
756
# OK, found CFLAGS. Get Lua LFLAGS and modules install dir
757
LUA_CFLAGS=`$PKGCONFIG --cflags $f 2>/dev/null`
758
LUA_LFLAGS=`$PKGCONFIG --libs $f 2>/dev/null`
759
LUA_INSTALL_CMOD=`$PKGCONFIG --variable=INSTALL_CMOD $f 2>/dev/null`
760
LUA_INSTALL_LMOD=`$PKGCONFIG --variable=INSTALL_LMOD $f 2>/dev/null`
766
LUA_RRD_LIBDIR="$langpref/lib/lua/$lua_vdot"
767
# if lua 5.0 can't find compat-5.1, force installation of
768
# compat-5.1.lua together with RRDtool.
769
if test "$lua_vdot" = "5.0" -a "$LUA_HAVE_COMPAT51" != "HAVE_COMPAT51"; then
771
LUA_INSTALL_LMOD="$LUA_RRD_LIBDIR"
774
# if not set with pkg-config, use default values in src packages compat-5.1, lua 5.1
775
if test "$LUA_CFLAGS" = ""; then
776
AC_MSG_WARN(Setting Lua include and lib flags to defaults in compat-5.1 and lua 5.1 sources)
777
LUA_CFLAGS="-I/usr/local/include -I/usr/local/include/lua -I/usr/local/include/lua/$lua_vdot"
778
LUA_LFLAGS="-L/usr/local/lib -L/usr/local/lib/lua -L/usr/local/lib/lua/$lua_vdot $lua_libs"
779
LUA_INSTALL_CMOD="/usr/local/lib/lua/$lua_vdot"
782
dnl pass additional lua options
783
dnl if lua-site-install is not set, overwrite LUA_INSTALL_CMOD already
784
dnl found and install together with RRDtool, under $langpref.
785
AC_ARG_ENABLE(lua-site-install,
786
AS_HELP_STRING([--enable-lua-site-install],[by default the lua module is installed together with rrdtool in $prefix/lib/lua/$lua_version. You have to add $prefix/lib/lua/$lua_version/?.so to package.cpath for lua to find 'rrd.so'. For lua 5.0 you may also need to change LUA_PATH to the same dir, to require 'compat-5.1'. When you set this option the lua modules will get installed wherever your Lua setup thinks it is best. WARNING: if you set this option, system lua modules compat-5.1.lua and rrd.so, if any, may be overwritten.]),
788
[LUA_INSTALL_CMOD="$LUA_RRD_LIBDIR"; LUA_INSTALL_LMOD="$LUA_RRD_LIBDIR"])
790
LUA_DEFINES="-DLUA$lua_vndot -D$LUA_HAVE_COMPAT51"
793
AC_SUBST(LUA_INSTALL_CMOD)
794
AC_SUBST(LUA_INSTALL_LMOD)
797
AC_SUBST(LUA_DEFINES)
800
AC_MSG_RESULT([Lua headers found but not the libraries! Please reinstall the dev packages for Lua $LUA_MAJOR.$LUA_MINOR])
805
dnl If Lua 5.0, we need compat-5.1. Add ours unless already
806
dnl integrated as in Debian/Ubuntu 5.0 -dev packages.
807
AM_CONDITIONAL(LUA_NEED_OUR_COMPAT51,
808
[test "$lua_vdot" = "5.0" -a "$LUA_HAVE_COMPAT51" != "HAVE_COMPAT51"])
809
AM_CONDITIONAL(LUA_SITE_CINSTALL, [test "$LUA_INSTALL_CMOD" != "$LUA_RRD_LIBDIR"])
810
AM_CONDITIONAL(LUA_SITE_LINSTALL, [test "$LUA_INSTALL_LMOD" != "$LUA_RRD_LIBDIR"])
811
AM_CONDITIONAL(LUA50, [test "$lua_vndot" = "50"])
812
AM_CONDITIONAL(BUILD_LUA, [test "$enable_lua" = "yes"])
643
814
enable_tcl_site=no
645
AC_ARG_ENABLE(tcl,[ --disable-tcl do not build the tcl modules],
816
AC_ARG_ENABLE(tcl,AS_HELP_STRING([--disable-tcl],[do not build the tcl modules]),
646
817
[],[enable_tcl=yes])
648
819
if test "$enable_tcl" = "yes"; then
727
898
AC_CONFIG_FILES([examples/4charts.pl])
728
899
AC_CONFIG_FILES([examples/perftest.pl])
729
900
AC_CONFIG_FILES([examples/Makefile])
901
AC_CONFIG_FILES([examples/rrdcached/Makefile])
730
902
AC_CONFIG_FILES([doc/Makefile])
731
AC_CONFIG_FILES([po/Makefile.in])
903
AC_CONFIG_FILES([po/Makefile.in])
904
AC_CONFIG_FILES([intl/Makefile])
732
905
AC_CONFIG_FILES([src/Makefile])
733
906
AC_CONFIG_FILES([src/librrd.sym.in])
734
AC_CONFIG_FILES([src/librrd.pc])
907
AC_CONFIG_FILES([src/librrd.pc])
735
908
AC_CONFIG_FILES([bindings/Makefile])
736
909
AC_CONFIG_FILES([bindings/tcl/Makefile])
737
910
AC_CONFIG_FILES([bindings/tcl/ifOctets.tcl])
738
911
AC_CONFIG_FILES([Makefile])
912
AC_CONFIG_FILES([bindings/lua/Makefile])
740
914
AC_CONFIG_COMMANDS([default],[[ chmod +x examples/*.pl]],[[]])
916
dnl intl requires our config to be called config.h. indulge it.
917
AC_CONFIG_COMMANDS_POST([ test -f config.h || ln -s rrd_config.h config.h ])
743
921
AC_MSG_CHECKING(in)