From: Tom Hughes Date: Mon, 19 Dec 2005 12:48:03 +0000 (+0000) Subject: Check that noinst_PROGRAMS and noinst_LIBRARIES are not empty strings X-Git-Tag: svn/VALGRIND_3_2_0~491 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de29d2a03e6a3f9ed7abd373b7ec5de748cf58de;p=thirdparty%2Fvalgrind.git Check that noinst_PROGRAMS and noinst_LIBRARIES are not empty strings before trying to run a for loop over them as some versions of bash can't cope with being asked to loop over an empty list. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5373 --- diff --git a/Makefile.install.am b/Makefile.install.am index 38d7fff789..77887df691 100644 --- a/Makefile.install.am +++ b/Makefile.install.am @@ -10,17 +10,21 @@ # It then copies libcoregrind.a and libvex.a to the right places. install-exec-local: - for f in $(noinst_PROGRAMS); do \ - p=`echo $$f | sed -e 's/^[^-]*-//' -e 's/\..*$$//'`; \ - n=`echo $$f | sed -e 's/-[^-]\{1,\}-[^-.]\{1,\}//'`; \ - $(mkinstalldirs) $(DESTDIR)$(valdir)/$$p; \ - $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$p/$$n; \ - done ; \ - for f in $(noinst_LIBRARIES); do \ - if expr match $$f libcoregrind_ > /dev/null ; then \ - pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \ - pD=`echo $$pU | sed -e 's/_/-/g'` ; \ - $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \ - $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \ - fi ; \ - done + if [ -n "$(noinst_PROGRAMS)" ] ; then \ + for f in $(noinst_PROGRAMS); do \ + p=`echo $$f | sed -e 's/^[^-]*-//' -e 's/\..*$$//'`; \ + n=`echo $$f | sed -e 's/-[^-]\{1,\}-[^-.]\{1,\}//'`; \ + $(mkinstalldirs) $(DESTDIR)$(valdir)/$$p; \ + $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$p/$$n; \ + done ; \ + fi ; \ + if [ -n "$(noinst_LIBRARIES)" ] ; then \ + for f in $(noinst_LIBRARIES); do \ + if expr match $$f libcoregrind_ > /dev/null ; then \ + pU=`echo $$f | sed -e 's/libcoregrind_//g' -e 's/\.a//g'` ; \ + pD=`echo $$pU | sed -e 's/_/-/g'` ; \ + $(INSTALL_DATA) $$f $(DESTDIR)$(valdir)/$$pD/libcoregrind.a ; \ + $(INSTALL_DATA) @VEX_DIR@/libvex_$$pU.a $(DESTDIR)$(valdir)/$$pD/libvex.a ; \ + fi ; \ + done ; \ + fi