Code

fix various problems with the tcl bindings -- Peter Breitenlohner
[rrdtool-all.git] / program / bindings / tcl / Makefile.am
2 EXTRA_DIST = README tclrrd.c
4 VERSION = @VERSION@
6 AM_CFLAGS = @CFLAGS@
8 TCL_PREFIX = @TCL_PREFIX@
9 TCL_SHLIB_LD = @TCL_SHLIB_LD@
10 TCL_SHLIB_CFLAGS = @TCL_SHLIB_CFLAGS@
11 TCL_SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@
12 TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@
13 TCL_LD_SEARCH_FLAGS = @TCL_LD_SEARCH_FLAGS@
15 CLEANFILES = tclrrd.o tclrrd.so
17 SRC_DIR            = $(top_srcdir)/src
18 AM_CPPFLAGS        = -I$(TCL_PREFIX)/include -I$(SRC_DIR)
19 LIBDIRS            = -L$(top_builddir)/src/.libs -L$(top_builddir)/src -L$(libdir)
20 LIB_RUNTIME_DIR    = $(libdir)
22 pkglibdir = @TCL_PACKAGE_DIR@
24 if BUILD_TCL
26 # Automake doen't like `tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)' as
27 # library name. So we build and install this library `by hand'.
28 #
29 # We do, however, specify a lib_LIBRARIES target such that
30 # automake creates the directory (if neecessary).
31 #
32 TCL_RRD_LIB = tclrrd$(VERSION)$(TCL_SHLIB_SUFFIX)
34 lib_LIBRARIES =
36 all-local: $(TCL_RRD_LIB)
38 pkglib_DATA = pkgIndex.tcl
40 pkglib_SCRIPTS = ifOctets.tcl
42 $(TCL_RRD_LIB): tclrrd.o
43         $(TCL_SHLIB_LD) $(TCL_LD_SEARCH_FLAGS) $(LIBDIRS) $< -o $@ -lrrd -lm
45 tclrrd.o: tclrrd.c
46         $(CC) $(AM_CFLAGS) $(CFLAGS) $(TCL_SHLIB_CFLAGS) $(AM_CPPFLAGS) -c $< -DVERSION=\"$(VERSION)\"
48 pkgIndex.tcl:
49         echo "package ifneeded Rrd $(VERSION) \"load $(libdir)/tclrrd$(VERSION)[info sharedlibextension]\"" > $@
51 install-exec-local: $(TCL_RRD_LIB)
52         @$(NORMAL_INSTALL)
53         $(INSTALL_PROGRAM) $(TCL_RRD_LIB) $(DESTDIR)$(libdir)/$(TCL_RRD_LIB)
55 endif
57 diff:
58         cd .. ; diff -c -u -r -N --exclude Makefile --exclude html --exclude doc --exclude Makefile.in --exclude Makefile.old --exclude perl --exclude aclocal.m4 --exclude configure rrdtool-1.0.13 rrdtool-1.0.13-ibr > rrdtool-1.0.13-ibr.patch
59