--- /dev/null
+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
+
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
#
], [])
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)