~ubuntu-branches/ubuntu/saucy/rrdtool/saucy-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2010-07-22 08:07:01 UTC
  • mfrom: (1.2.8 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100722080701-k46mgdfz6euxwqsm
Tags: 1.4.3-1ubuntu1
* Merge from debian unstable, Remaining changes:
  - debian/control: Don't build against ruby1.9 as we don't want
    it in main.
* require libdbi >= 0.8.3 to prevent aborts when using dbi datasources

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl RRDtool AutoConf script ... 
2
2
dnl ---------------------------
 
3
dnl $Id: configure.ac 2044 2010-03-22 17:02:55Z oetiker $
3
4
dnl
4
5
dnl Created by Jeff Allen, Tobi Oetiker, Blair Zajac
5
6
dnl
7
8
 
8
9
dnl tell automake the this script is for rrdtool
9
10
 
 
11
dnl Minimum Autoconf version required.
 
12
AC_PREREQ(2.59)
 
13
 
10
14
dnl the official version number is
11
15
dnl a.b.c
12
 
AC_INIT([rrdtool],[1.3.8])
 
16
AC_INIT([rrdtool],[1.4.3])
13
17
 
14
18
dnl for testing a numberical version number comes handy
15
19
dnl the released version are
16
20
dnl a.bccc
17
21
dnl the devel versions will be something like
18
22
dnl a.b999yymmddhh 
19
 
NUMVERS=1.3008
 
23
NUMVERS=1.4003
20
24
AC_SUBST(NUMVERS)
21
25
 
22
26
dnl for the linker to understand which versions the library are compatible with
27
31
dnl
28
32
dnl see http://sourceware.org/autobook/autobook/autobook_91.html
29
33
dnl 
30
 
LIBVERS=4:7:0
 
34
LIBVERS=5:3:1
31
35
AC_SUBST(LIBVERS)
32
36
 
33
37
AC_CANONICAL_TARGET
 
38
m4_version_prereq(2.60, [AC_USE_SYSTEM_EXTENSIONS], [#])
34
39
AM_INIT_AUTOMAKE
35
40
AM_MAINTAINER_MODE
36
 
 
 
41
# Enable silent build rules by default, requires at least
 
42
# Automake-1.11. Disable by either passing --disable-silent-rules to
 
43
# configure or passing V=1 to make
 
44
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
45
AC_CONFIG_HEADERS([rrd_config.h])
37
46
AC_CONFIG_MACRO_DIR([m4])
38
 
AC_CONFIG_HEADERS([rrd_config.h])
39
47
 
40
48
dnl all our local stuff like install scripts and include files
41
49
dnl is in there
45
53
 
46
54
AC_SUBST(VERSION)
47
55
 
48
 
AC_PREFIX_DEFAULT( /usr/local/rrdtool-$PACKAGE_VERSION )
49
 
 
50
 
dnl Minimum Autoconf version required.
51
 
AC_PREREQ(2.59)
 
56
AC_PREFIX_DEFAULT( /opt/rrdtool-$PACKAGE_VERSION )
52
57
 
53
58
dnl At the TOP of the HEADER
54
59
 
80
85
#  include <malloc/malloc.h>
81
86
#endif
82
87
 
83
 
#include <rrd_config_bottom.h>
 
88
#include "src/rrd_config_bottom.h"
84
89
 
85
90
#endif
86
91
])
94
99
AC_DEFINE_UNQUOTED(RRDGRAPH_YLEGEND_ANGLE,${RRDGRAPH_YLEGEND_ANGLE:-90.0},
95
100
 [Vertical label angle: -90.0 (default) or 90.0])
96
101
 
97
 
AC_ARG_ENABLE(rrdcgi,[  --disable-rrdcgi        disable building of rrdcgi],
 
102
AC_ARG_ENABLE(rrdcgi,AS_HELP_STRING([--disable-rrdcgi],[disable building of rrdcgi]),
98
103
[],[enable_rrdcgi=yes])
99
104
 
100
105
dnl Check if we run on a system that has fonts
110
115
 
111
116
dnl Use mmap in rrd_update instead of seek+write
112
117
AC_ARG_ENABLE([mmap],
113
 
[  --disable-mmap          disable mmap in rrd_update, use seek+write instead],
 
118
AS_HELP_STRING([--disable-mmap],[disable mmap in rrd_update, use seek+write instead]),
114
119
[],
115
120
[enable_mmap=yes])
116
121
 
117
 
AC_ARG_ENABLE(pthread,[  --disable-pthread       disable multithread support],
 
122
AC_ARG_ENABLE(pthread,AS_HELP_STRING([--disable-pthread],[disable multithread support]),
118
123
[],[enable_pthread=yes])
119
124
 
120
125
AC_ARG_ENABLE(static-programs,
121
 
     [  --enable-static-programs  Build static programs],
 
126
     AS_HELP_STRING([--enable-static-programs],[Build static programs]),
122
127
     [case "${enableval}" in
123
128
       yes) staticprogs=yes ;;
124
129
       no)  staticprogs=no ;;
131
136
 
132
137
 
133
138
dnl Check for the compiler and static/shared library creation.
 
139
AC_PROG_CPP
134
140
AC_PROG_CC
135
 
AC_PROG_CPP
 
141
AM_PROG_CC_C_O
136
142
AC_PROG_LIBTOOL
137
143
 
138
144
dnl Try to detect/use GNU features
139
145
CFLAGS="$CFLAGS -D_GNU_SOURCE"
140
146
 
 
147
dnl check for -Werror separatly
 
148
dnl (quite a few autotool checks do not work with -Werror; also, the
 
149
dnl check for -Werror fails after checking and adding the other flags)
 
150
AC_CACHE_CHECK([if gcc likes the -Werror flag], rd_cv_gcc_flag__Werror,
 
151
  [AC_COMPILE_IFELSE(
 
152
    [AC_LANG_PROGRAM([[]], [[return 0 ]])],
 
153
    [rd_cv_gcc_flag__Werror="yes"],
 
154
    [rd_cv_gcc_flag__Werror="no"])])
 
155
if test "x$rd_cv_gcc_flag__Werror" = "xyes"; then
 
156
  WERROR="-Werror"
 
157
else
 
158
  WERROR=""
 
159
fi
 
160
AC_SUBST(WERROR)
 
161
 
141
162
dnl which flags does the compiler support?
142
163
if test "x$GCC" = "xyes"; then
143
164
  for flag in -fno-strict-aliasing -Wall -std=c99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W; do
161
182
dnl Checks for header files.
162
183
AC_HEADER_STDC
163
184
AC_HEADER_DIRENT
164
 
AC_CHECK_HEADERS(libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
 
185
AC_CHECK_HEADERS(langinfo.h stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
165
186
 
166
187
dnl Checks for typedefs, structures, and compiler characteristics.
167
188
AC_C_CONST
188
209
dnl for each function found we get a definition in config.h 
189
210
dnl of the form HAVE_FUNCTION
190
211
 
191
 
AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
 
212
AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getuid strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
192
213
 
193
214
AC_FUNC_STRERROR_R
194
215
 
203
224
dnl if there is no fdatasync we may get lucky with fsync
204
225
AC_CHECK_FUNCS(fsync)
205
226
 
 
227
dnl check for socket and nsl solaris again ... we need this for the new rrd_daemon stuff
 
228
 
 
229
AC_CHECK_FUNCS(socket, [],  AC_CHECK_LIB(socket, socket, [LIBS="${LIBS} -lsocket"; AC_DEFINE(HAVE_SOCKET)],[]))
 
230
AC_CHECK_FUNCS(getaddrinfo, [],  AC_CHECK_LIB(nsl, getaddrinfo, [LIBS="${LIBS} -lnsl"; AC_DEFINE(HAVE_GETADDRINFO)],[]))
 
231
 
 
232
 
206
233
 
207
234
dnl XXX: dunno about windows.. add AC_CHECK_FUNCS(munmap) there too?
208
235
if test "x$enable_mmap" = "xyes"; then
246
273
 
247
274
CONFIGURE_PART(Libintl Processing)
248
275
 
249
 
 
250
 
dnl gettext
251
 
GETTEXT_PACKAGE=rrdtool
252
 
AC_SUBST(GETTEXT_PACKAGE)
253
 
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package])
254
 
 
255
 
AM_GLIB_GNU_GETTEXT()
256
 
 
257
 
AC_ARG_ENABLE(libintl,[  --disable-libintl        i18n support (libintl)],
258
 
[],[enable_libintl=yes])
259
 
 
260
 
if test x$enable_libintl = xyes; then
261
 
  IT_PROG_INTLTOOL([0.35.0],[no-xml])
262
 
fi
263
 
 
264
 
if test x$enable_libintl = xyes -a x$MSGFMT = xno; then
265
 
  AC_MSG_WARN(I could not find msgfmt. Diabeling libintl build.)
266
 
  enable_libintl=no
267
 
fi
268
 
 
269
 
if test x$enable_libintl = xyes; then
270
 
  AC_CHECK_HEADERS(libintl.h,[],[AC_MSG_RESULT(disabeling libintl build); enable_libintl=no])
271
 
fi
272
 
 
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"])
277
 
fi
278
 
 
279
 
dnl use for linking rrdupdate
280
 
AC_SUBST(LIB_LIBINTL)
281
 
 
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])
284
 
 
285
 
if test x$enable_libintl = xyes; then
286
 
   AC_DEFINE([BUILD_LIBINTL], [], [Use this in code sections to mark them for libintl build])
287
 
fi
 
276
AM_GNU_GETTEXT_VERSION(0.17)
 
277
AM_GNU_GETTEXT()
288
278
 
289
279
CONFIGURE_PART(IEEE Math Checks)
290
280
 
331
321
esac])
332
322
])
333
323
 
334
 
dnl the test does not seem to work on solaris 2.8/9
 
324
dnl the test does not seem to work on solaris 2.8
335
325
dnl so lets fix this by hand
336
326
case "${target}" in
337
327
  *-solaris2.8) ac_cv_have_broken_isfinite=yes ;;
355
345
 
356
346
CHECK_FOR_WORKING_MS_ASYNC
357
347
 
 
348
dnl do we have nl_langinfo(_NL_TIME_WEEK_1STDAY)
 
349
AC_CHECK_FUNCS(_NL_TIME_WEEK_1STDAY, ,
 
350
  [AC_MSG_CHECKING([for nl_langinfo(_NL_TIME_WEEK_1STDAY) with langinfo.h])
 
351
    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[nl_langinfo(_NL_TIME_WEEK_1STDAY)]])],[AC_MSG_RESULT(yes)
 
352
      AC_DEFINE(HAVE__NL_TIME_WEEK_1STDAY)],[AC_MSG_RESULT(no)])])
 
353
 
358
354
dnl Do we need getopt_long
359
355
 
360
356
dnl even when including our own getopt implementation
468
464
      )
469
465
    ]  
470
466
)
 
467
 
 
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])
 
472
AC_RUN_IFELSE(
 
473
    AC_LANG_PROGRAM(
 
474
        [[#include <time.h>]],
 
475
        [[if (sizeof(time_t) != 4) return 1; ]]
 
476
        ),
 
477
    [ AC_MSG_RESULT([time_t is 32 bit])
 
478
      AC_DEFINE([TIME_T_IS_32BIT])
 
479
    ],
 
480
    [ AC_RUN_IFELSE(
 
481
        AC_LANG_PROGRAM(
 
482
        [[#include <time.h>]],
 
483
        [[if (sizeof(time_t) != 8) return 1; ]]
 
484
        ),
 
485
        [
 
486
          AC_MSG_RESULT([time_t is 64 bit])
 
487
          AC_DEFINE([TIME_T_IS_64BIT])
 
488
        ],
 
489
        [AC_MSG_ERROR([can not figure type of time_t])]
 
490
      )
 
491
    ]  
 
492
)
 
493
 
471
494
AC_LANG_POP(C)
472
495
 
473
496
CONFIGURE_PART(Find 3rd-Party Libraries)
474
497
 
 
498
AC_ARG_ENABLE(libdbi,AS_HELP_STRING([--disable-libdbi],[do not build in support for libdbi]),[have_libdbi=no],[
 
499
  XXX=$LIBS
 
500
  LIBS="$LIBS -ldbi -ldl"
 
501
  AC_MSG_CHECKING(for libdbi)
 
502
  AC_LINK_IFELSE(
 
503
    [AC_LANG_PROGRAM([[#include <dbi/dbi.h>]], 
 
504
                     [[dbi_initialize(NULL)]]
 
505
                    )
 
506
    ],[AC_DEFINE(HAVE_LIBDBI,[1],[have got libdbi installed])
 
507
       AC_MSG_RESULT([yes])
 
508
       have_libdbi=yes
 
509
    ],[LIBS=$XXX
 
510
       AC_MSG_RESULT([no])
 
511
       have_libdbi=no
 
512
    ]
 
513
  )
 
514
])
 
515
AM_CONDITIONAL(BUILD_LIBDBI,[test $have_libdbi != no])
475
516
 
476
517
AM_CONDITIONAL(BUILD_RRDCGI,[test $enable_rrdcgi != no])
477
518
 
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)
492
533
 
510
551
AC_PATH_PROG(POD2HTML, pod2html, no)
511
552
 
512
553
 
513
 
AC_ARG_ENABLE(perl,[  --disable-perl          do not build the perl modules],
 
554
AC_ARG_ENABLE(perl,AS_HELP_STRING([--disable-perl],[do not build the perl modules]),
514
555
[],[enable_perl=yes])
515
556
 
516
557
 
517
 
AC_ARG_VAR(PERLCC, [[] C compiler for Perl modules])
518
 
AC_ARG_VAR(PERLCCFLAGS, [[] CC flags for Perl modules])
519
 
AC_ARG_VAR(PERLLD, [[same as PERLCC] Linker for Perl modules])
520
 
AC_ARG_VAR(PERLLDFLAGS, [[] LD flags for Perl modules])
 
558
AC_ARG_VAR(PERLCC, [C compiler for Perl modules])
 
559
AC_ARG_VAR(PERLCCFLAGS, [CC flags for Perl modules])
 
560
AC_ARG_VAR(PERLLD, [Linker for Perl modules])
 
561
AC_ARG_VAR(PERLLDFLAGS, [LD flags for Perl modules])
521
562
 
522
563
if test "x$PERL" = "xno" -o  x$enable_perl = xno; then
523
564
        COMP_PERL=
551
592
AC_MSG_RESULT(${COMP_PERL:-No Perl Modules will be built})
552
593
 
553
594
# Options to pass when configuring perl module
554
 
ppref=$prefix
555
 
test "$ppref" = 'NONE' && ppref=$ac_default_prefix
 
595
langpref=$prefix
 
596
test "$langpref" = '$(DESTDIR)NONE' && langpref='$(DESTDIR)'$ac_default_prefix
 
597
test "$langpref" = "NONE" && langpref=$ac_default_prefix
556
598
 
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"
558
600
 
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=],[])
568
605
 
569
606
if test ! -z "$PERLCC"; then
598
635
dnl Check for Ruby.
599
636
AC_PATH_PROG(RUBY, ruby, no)
600
637
 
601
 
AC_ARG_ENABLE(ruby,[  --disable-ruby          do not build the ruby modules],
 
638
AC_ARG_ENABLE(ruby,AS_HELP_STRING([--disable-ruby],[do not build the ruby modules]),
602
639
[],[enable_ruby=yes])
603
640
 
604
641
AC_MSG_CHECKING(if ruby modules can be built)
616
653
        fi                              
617
654
fi
618
655
 
619
 
rpref=$prefix
620
 
test "$rpref" = 'NONE' && rpref=$ac_default_prefix
621
 
 
622
656
dnl pass additional ruby options when generating Makefile from Makefile.PL
623
657
AC_ARG_ENABLE(ruby-site-install,
624
 
[  --enable-ruby-site-install   by default the rrdtool ruby modules are installed
625
 
                          together with rrdtool in $prefix/lib/ruby. You have to
626
 
                          add $prefix/lib/ruby/$ruby_version/$sitearch to you $: variable
627
 
                          for ruby to find the RRD.so file.],
628
 
[RUBY_MAKE_OPTIONS=],[RUBY_MAKE_OPTIONS="sitedir="'$(DESTDIR)'"$rpref/lib/ruby"])
 
658
AS_HELP_STRING([--enable-ruby-site-install],[by default the rrdtool ruby modules are installed together with rrdtool in $prefix/lib/ruby. You have to add $prefix/lib/ruby/$ruby_version/$sitearch to your $: variable for ruby to find the RRD.so file.]),
 
659
[RUBY_MAKE_OPTIONS=],[RUBY_MAKE_OPTIONS="sitedir=$langpref/lib/ruby"])
629
660
 
630
661
    
631
662
AC_ARG_WITH(ruby-options,
639
670
AC_SUBST(RUBY)
640
671
AC_SUBST(COMP_RUBY)
641
672
 
 
673
dnl Check for Lua.
 
674
AC_PATH_PROG(LUA, lua, no)
 
675
 
 
676
AC_ARG_ENABLE(lua,AS_HELP_STRING([--disable-lua],[do not build the lua modules]),
 
677
[],[enable_lua=yes])
 
678
 
 
679
COMP_LUA=
 
680
if test "$LUA" = "no" -o "$enable_lua" = "no"; then
 
681
  enable_lua=no
 
682
else
 
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')
 
686
LUA_EOF
 
687
  if test 0$LUA_MAJOR -lt 5; then
 
688
    AC_MSG_RESULT([no, version found is $LUA_MAJOR.$LUA_MINOR])
 
689
  else
 
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],
 
698
          [])],
 
699
        [])],
 
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],
 
704
            [])],
 
705
          [])],
 
706
        [AC_CHECK_HEADERS(lua.h,
 
707
          [AC_CHECK_HEADERS(lualib.h,
 
708
            [AC_CHECK_HEADER(lauxlib.h,
 
709
              [lua_headerdir=""],
 
710
              [lua_headerdir="no"])],
 
711
            [])],
 
712
          [])])])
 
713
 
 
714
    if test "$lua_headerdir" = "no"; then
 
715
      enable_lua=no
 
716
    else
 
717
      COMP_LUA=lua
 
718
    fi
 
719
 
 
720
    if test "$COMP_LUA" != "lua"; then
 
721
      enable_lua=no
 
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])
 
723
    else
 
724
      # OK, headers found, let's check the libraries (LIBS is not used)
 
725
      LIBS=
 
726
      lua_havelib=no
 
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])],
 
737
        [COMP_LUA=], [-lm])
 
738
      lua_libs=$LIBS
 
739
      LIBS=
 
740
 
 
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
 
748
          else
 
749
            lua_pkg_prefix=lua
 
750
          fi
 
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`
 
754
            # same binaries?
 
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`
 
761
                break
 
762
            fi
 
763
          done
 
764
        fi
 
765
 
 
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
 
770
          lua_need_compat51=1 
 
771
          LUA_INSTALL_LMOD="$LUA_RRD_LIBDIR"
 
772
        fi
 
773
 
 
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"
 
780
        fi
 
781
 
 
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.]),
 
787
        [],
 
788
        [LUA_INSTALL_CMOD="$LUA_RRD_LIBDIR"; LUA_INSTALL_LMOD="$LUA_RRD_LIBDIR"])
 
789
 
 
790
        LUA_DEFINES="-DLUA$lua_vndot -D$LUA_HAVE_COMPAT51"
 
791
        AC_SUBST(LUA)
 
792
        AC_SUBST(COMP_LUA)
 
793
        AC_SUBST(LUA_INSTALL_CMOD)
 
794
        AC_SUBST(LUA_INSTALL_LMOD)
 
795
        AC_SUBST(LUA_CFLAGS)
 
796
        AC_SUBST(LUA_LFLAGS)
 
797
        AC_SUBST(LUA_DEFINES)
 
798
      else
 
799
        enable_lua=no
 
800
        AC_MSG_RESULT([Lua headers found but not the libraries! Please reinstall the dev packages for Lua $LUA_MAJOR.$LUA_MINOR])
 
801
      fi
 
802
    fi
 
803
  fi
 
804
fi
 
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"])
642
813
 
643
814
enable_tcl_site=no
644
815
 
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])
647
818
 
648
819
if test  "$enable_tcl" = "yes"; then
671
842
          TCL_INCLUDE_SPEC="$TCL_INCLUDE_SPEC -I$TCL_INC_DIR"
672
843
        fi
673
844
  fi
674
 
  AC_ARG_ENABLE(tcl,[  --enable-tcl-site        install the tcl extension in the tcl tree],
 
845
  AC_ARG_ENABLE(tcl,AS_HELP_STRING([--enable-tcl-site],[install the tcl extension in the tcl tree]),
675
846
  [],[enable_tcl_site=yes])
676
847
 
677
848
fi
691
862
AC_SUBST(TCL_PACKAGE_DIR)
692
863
AC_SUBST(TCL_INCLUDE_SPEC)
693
864
 
694
 
AC_ARG_ENABLE(python,[  --disable-python        do not build the python modules],
 
865
AC_ARG_ENABLE(python,AS_HELP_STRING([--disable-python],[do not build the python modules]),
695
866
[],[enable_python=yes])
696
867
 
697
868
if test  "$enable_python" = "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])
739
913
 
740
914
AC_CONFIG_COMMANDS([default],[[ chmod +x examples/*.pl]],[[]])
 
915
 
 
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 ])
 
918
 
741
919
AC_OUTPUT
742
920
 
743
921
AC_MSG_CHECKING(in)
768
946
echo "          Ruby Modules: $COMP_RUBY"
769
947
echo "           Ruby Binary: $RUBY"
770
948
echo "          Ruby Options: $RUBY_MAKE_OPTIONS"
 
949
echo "    Build Lua Bindings: $enable_lua"
 
950
if test "$enable_lua" = "yes"; then
 
951
echo "            Lua Binary: $LUA"
 
952
echo "           Lua Version: $lua_version"
 
953
echo "     Lua C-modules dir: $LUA_INSTALL_CMOD"
 
954
if test "$lua_need_compat51" = "1"; then
 
955
echo "   Lua Lua-modules dir: $LUA_INSTALL_LMOD"
 
956
fi
 
957
fi
771
958
echo "    Build Tcl Bindings: $enable_tcl"
772
959
echo " Build Python Bindings: $enable_python"
773
960
echo "          Build rrdcgi: $enable_rrdcgi"
774
961
echo "       Build librrd MT: $enable_pthread"
775
 
echo "     Link with libintl: $enable_libintl"
 
962
echo "           Use gettext: $USE_NLS"
 
963
echo "           With libDBI: $have_libdbi"
776
964
echo
777
965
echo "             Libraries: $ALL_LIBS"
778
966
echo