From 5d612eb3a73c70308ce2e2af448a26e9a45955c6 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 27 Jan 2008 16:13:04 +0100 Subject: [PATCH] Integrate bindings subdirectory into the build process. * 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 Signed-off-by: Florian Forster --- Makefile.am | 2 +- bindings/Makefile.am | 31 +++++++++++++++++++++++++++++++ configure.ac | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 bindings/Makefile.am diff --git a/Makefile.am b/Makefile.am index af71b84..af22243 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 0000000..498b7f6 --- /dev/null +++ b/bindings/Makefile.am @@ -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 + diff --git a/configure.ac b/configure.ac index 85c2b9e..583bb73 100644 --- a/configure.ac +++ b/configure.ac @@ -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) -- 2.11.0