From abedfaf366ac66d4c7936bf5e4f243c947d3df65 Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 19 Dec 2005 12:28:55 +0000 Subject: [PATCH] fix tcl issues ... build with pre tcl8.4 ... do not try to install into the tcl tree unless --enable-tcl-site is given -- tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@733 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/bindings/tcl/Makefile.am | 4 +++- program/bindings/tcl/tclrrd.c | 6 ++++++ program/configure.ac | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/program/bindings/tcl/Makefile.am b/program/bindings/tcl/Makefile.am index 22d661df..d4ea2102 100644 --- a/program/bindings/tcl/Makefile.am +++ b/program/bindings/tcl/Makefile.am @@ -20,7 +20,9 @@ AM_CPPFLAGS = -I$(TCL_PREFIX)/include -I$(SRC_DIR) -DUSE_TCL_STUBS LIBDIRS = -L$(top_builddir)/src/.libs -L$(top_builddir)/src -L$(libdir) LIB_RUNTIME_DIR = $(libdir) +if BUILD_TCL_SITE pkglibdir = @TCL_PACKAGE_DIR@ +endif # Automake doen't like `tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)' as # library name. So we build and install this library `by hand'. @@ -39,7 +41,7 @@ pkglib_DATA = pkgIndex.tcl pkglib_SCRIPTS = ifOctets.tcl $(TCL_RRD_LIB): tclrrd.o - $(TCL_SHLIB_LD) $(TCL_LD_SEARCH_FLAGS) $(LIBDIRS) $< -o $@ -lrrd_th -lm $(TCL_STUB_LIB_SPEC) $(LIBS) + $(TCL_SHLIB_LD) $(TCL_LD_SEARCH_FLAGS) $(LIBDIRS) $< -o $@ -lrrd_th -lm $(TCL_STUB_LIB_SPEC) $(LDFLAGS) $(LIBS) tclrrd.o: tclrrd.c $(CC) $(AM_CFLAGS) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(AM_CPPFLAGS) -c $< -DVERSION=\"$(VERSION)\" diff --git a/program/bindings/tcl/tclrrd.c b/program/bindings/tcl/tclrrd.c index 5d4e9b7e..6a5250c6 100644 --- a/program/bindings/tcl/tclrrd.c +++ b/program/bindings/tcl/tclrrd.c @@ -21,6 +21,12 @@ #include #include +/* support pre-8.4 tcl */ + +#ifndef CONST84 +# define CONST84 +#endif + extern int Tclrrd_Init(Tcl_Interp *interp); extern int Tclrrd_SafeInit(Tcl_Interp *interp); diff --git a/program/configure.ac b/program/configure.ac index ddff204f..eb3e5317 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -463,6 +463,8 @@ AC_SUBST(PERL) AC_SUBST(COMP_PERL) AC_SUBST(PERL_VERSION) +enable_tcl_site=no + AC_ARG_ENABLE(tcl,[ --disable-tcl do not build the tcl modules], [],[enable_tcl=yes]) @@ -489,9 +491,13 @@ if test "$enable_tcl" = "yes"; then . $tcl_config TCL_PACKAGE_DIR="$TCL_PACKAGE_PATH/tclrrd$VERSION" fi + AC_ARG_ENABLE(tcl,[ --enable-tcl-site install the tcl extension in the tcl tree], + [],[enable_tcl_site=yes]) + fi AM_CONDITIONAL(BUILD_TCL, test "$enable_tcl" = "yes" ) +AM_CONDITIONAL(BUILD_TCL_SITE, test "$enable_tcl_site" = "yes" ) AC_SUBST(TCL_PREFIX) AC_SUBST(TCL_SHLIB_CFLAGS) -- 2.30.2