Code

Integrate bindings subdirectory into the build process.
authorSebastian Harl <sh@tokkee.org>
Sun, 27 Jan 2008 15:13:04 +0000 (16:13 +0100)
committerFlorian Forster <octo@verplant.org>
Sun, 27 Jan 2008 15:16:09 +0000 (16:16 +0100)
 * Added bindings/Makefile.am.
 * Added support for the variable PERL, which specifies the Perl interpreter
   command, to the configure script.
 * Added the --with-perl-bindings option to the configure script. Any argument
   (except "yes" and "no") will be passed as options to "perl Makefile.PL".

Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@verplant.org>
Makefile.am
bindings/Makefile.am [new file with mode: 0644]
configure.ac

index af71b84b3b6f04b44a754ffb70e350a311a24885..af22243598002a2585f1d8437352f6b6cc50c636 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = src
+SUBDIRS = src bindings
 
 dist-hook:
        find $(distdir) -type d -name '.svn' | xargs rm -rf
diff --git a/bindings/Makefile.am b/bindings/Makefile.am
new file mode 100644 (file)
index 0000000..498b7f6
--- /dev/null
@@ -0,0 +1,31 @@
+EXTRA_DIST = perl/Changes perl/MANIFEST perl/META.yml perl/Makefile.PL \
+               perl/Oping.xs perl/README perl/lib/Net/Oping.pm perl/t/Oping.t \
+               perl/typemap
+
+all-local: @BINDINGS@
+
+install-exec-local:
+       [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) install )
+
+clean-local:
+       [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) realclean )
+
+test:
+       [ ! -f perl/Makefile ] || ( cd perl && $(MAKE) test )
+
+perl-bindings: perl/Makefile
+       cd perl && $(MAKE)
+
+perl/Makefile: perl/Makefile.PL $(top_builddir)/config.status
+       if test ! -d perl; then \
+               for file in $(EXTRA_DIST); do \
+                       mkdir -p `dirname $$file`; \
+                       cp $(srcdir)/$$file `dirname $$file`; \
+               done \
+       fi
+       
+       cd perl && @PERL@ Makefile.PL PREFIX=$(prefix) @PERL_BINDINGS_OPTIONS@
+
+
+.PHONY: perl-bindings
+
index 85c2b9eed69fd25f0d4f520be4b4e00926524399..583bb731bc3558ef6dca575a98a75e425623561b 100644 (file)
@@ -16,6 +16,12 @@ AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
 
+if test "x$PERL" = "x"
+then
+       PERL="perl"
+fi
+AC_ARG_VAR(PERL, [Perl interpreter command])
+
 #
 # configure libtool
 #
@@ -163,4 +169,31 @@ AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debuggi
 ], [])
 AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
 
-AC_OUTPUT(Makefile src/Makefile src/mans/Makefile)
+AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
+[
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               PERL_BINDINGS_OPTIONS="$withval"
+               with_perl_bindings="yes"
+       else
+               PERL_BINDINGS_OPTIONS=""
+               with_perl_bindings="$withval"
+       fi
+],
+[
+       PERL_BINDINGS_OPTIONS=""
+       with_perl_bindings="yes"
+])
+
+if test "x$with_perl_bindings" = "xyes"
+then
+       BINDINGS="perl-bindings"
+else
+       BINDINGS=""
+fi
+
+AC_SUBST(PERL_BINDINGS_OPTIONS)
+
+AC_SUBST(BINDINGS)
+
+AC_OUTPUT(Makefile src/Makefile src/mans/Makefile bindings/Makefile)