# vim:ft=automake
-# Copyright (c) 2007,2008,2009 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%: %.pl $(top_builddir)/config.status
$(top_builddir)/config.status --file=$@:$<
chmod a+x $@
-if CHECK_SCRIPTS_AT_BUILD
+if SYNTAX_CHECKS
@if test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $@ > $@.nouselib; \
$(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $@.nouselib || exit 1; \
rm $@.nouselib; \
+ else \
+ echo "skipping syntax check of $@ because perl packages are not compiled yet"; \
fi
endif
# and we'll need to clean up our generated files for distclean
DISTCLEANFILES += $(SCRIPTS_SHELL) $(SCRIPTS_PERL) $(SCRIPTS_AWK) $(SCRIPTS_INCLUDE)
-# syntax-check perl scripts on 'make check'
+# syntax-check perl scripts on an explicit 'make check', but only if
+# SYNTAX_CHECKS are enabled, as this is sensitive to the presence of perl
+# modules in the install tree, and can trip up unsuspecting users.
check-perl: $(SCRIPTS_PERL)
@SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
if test x"$(SKIP_CHECKS)" = x"" && \
test -f $(top_builddir)/perl/.libs/libCmdline.so -o -f $(top_builddir)/perl/libCmdline.so; then \
- if test -n "$(PERL)"; then \
- for perlobj in $$SCRIPTS_PERL; do \
- sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
- $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
- rm $$perlobj.nouselib; \
- done; \
- fi \
+ for perlobj in $$SCRIPTS_PERL; do \
+ sed "s,^use lib ['\"]$(amperldir)['\"],# use lib '$(amperldir)' # nouselib," < $$perlobj > $$perlobj.nouselib; \
+ $(PERL) $(CHECK_PERL_FLAGS) -I$(top_builddir)/perl -I$(top_builddir)/perl/.libs -I$(top_srcdir)/perl -c -w $$perlobj.nouselib || exit 1; \
+ rm $$perlobj.nouselib; \
+ done; \
fi
+if SYNTAX_CHECKS
check-local: check-perl
+endif
-# syntax-check perl scripts on 'make installcheck'
-installcheck-perl: $(SCRIPTS_PERL)
- @SCRIPTS_PERL="$(SCRIPTS_PERL)"; \
- if test x"$(SKIP_CHECKS)" = x"" && \
- test -n "$(PERL)"; then \
- for perlobj in $$SCRIPTS_PERL; do \
- $(PERL) $(CHECK_PERL_FLAGS) -c -w $$perlobj || exit 1; \
- done; \
- fi
-installcheck-local: installcheck-perl
-
-# syntax-check shell scripts on 'make check'
+# syntax-check shell scripts on an explicit 'make check'
check-shell: $(SCRIPTS_SHELL)
@SCRIPTS_SHELL="$(SCRIPTS_SHELL)"; \
if test x"$(SKIP_CHECKS)" = x"" && \
echo "No 'bash' available -- cannot syntax-check shell scripts"; \
fi; \
fi
+if SYNTAX_CHECKS
check-local: check-shell
+endif
# make sure that the sources for all shell and perl scripts get included
# in the distribution