From: Sebastian Harl Date: Sun, 27 Jan 2008 15:13:04 +0000 (+0100) Subject: Integrate bindings subdirectory into the build process. X-Git-Tag: Net-Oping-1.02~5^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d612eb3a73c70308ce2e2af448a26e9a45955c6;p=liboping.git 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 --- 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)