From patchwork Mon Jul 21 00:02:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 2122 Received: (qmail 14280 invoked by alias); 21 Jul 2014 00:02:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 14229 invoked by uid 89); 21 Jul 2014 00:02:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: mail-ie0-f202.google.com Received: from mail-ie0-f202.google.com (HELO mail-ie0-f202.google.com) (209.85.223.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 21 Jul 2014 00:02:27 +0000 Received: by mail-ie0-f202.google.com with SMTP id rl12so2100238iec.5 for ; Sun, 20 Jul 2014 17:02:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=GTME5H1eOYe+ULtGUIP9hXGQpWHyUYJHZaXDrqqpCeA=; b=JBAvwY1ljdljHMbdyAf/MytsMlPqAOjrMgXrPLkPsHVLx6+gFHUzQOL3dLrsvzrPG7 wq5EK57wY3rgqic/5UbfKsI7/zx6bsp4kCfAom09zWGPp+A6gWfi1VQ4nksd3Up6CKo9 7LUL27QoqTcj1tFQWVeOlSJVaug+JEKefIlYyiYAA5hCRq8RH7vmXO/eWH74n47xP7bQ nhOq9jJN0TGy8CEBx2PAg3Y8zHCsLmVdZDI1zuHkx+i7c1BnvHAPQDvqWKdWmg08Yyqp 0x/eHhkzo0ga8FO0Gra3tgcvl5O6cHL08h5Hsl+/bdqUpXLtA9booIl90XlLoS3OJkuF qqcw== X-Gm-Message-State: ALoCoQkMhmglkGC+CxKyXU3D9D4zxfBglpqCcC37kKjjiPAqvFwJjg3N2kcsnrIZ84qYwEd4mME1 X-Received: by 10.182.95.40 with SMTP id dh8mr11118408obb.5.1405900944768; Sun, 20 Jul 2014 17:02:24 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id j43si920261yhh.5.2014.07.20.17.02.24 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 20 Jul 2014 17:02:24 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 381ED31C10D; Sun, 20 Jul 2014 17:02:24 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org, jan.kratochvil@redhat.com Subject: [PATCH] Fix build/17105: don't install guile/python if not configured Date: Sun, 20 Jul 2014 17:02:23 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. This patch fixes build/17105. Tested with/without guile,python on amd64-linux. I'm not sure we still have to deal with shells that can't handle empty for lists, but I played it safe. Otherwise this patch would be a lot smaller (though a diff -b will still show the real changes). 2014-07-19 Doug Evans PR build/17105 * configure.ac: Add AM_CONDITIONALs for HAVE_PYTHON, HAVE_GUILE. * configure: Regenerate. * data-directory/Makefile.in (PYTHON_FILE_LIST): Renamed from PYTHON_FILES. (PYTHON_FILES): New variable. (GUILE_FILE_LIST): Renamed from GUILE_FILES. (GUILE_FILES): New variable. (stamp-python, install-python, uninstall-python): Handle empty file list. (stamp-guile, install-guile, uninstall-guile): Ditto. diff --git a/gdb/configure.ac b/gdb/configure.ac index a2ac15f..3ce1a1d 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1053,6 +1053,7 @@ fi AC_SUBST(PYTHON_CFLAGS) AC_SUBST(PYTHON_CPPFLAGS) AC_SUBST(PYTHON_LIBS) +AM_CONDITIONAL(HAVE_PYTHON, test "${have_libpython}" != no) # -------------------- # # Check for libguile. # @@ -1217,6 +1218,7 @@ else fi AC_SUBST(GUILE_CPPFLAGS) AC_SUBST(GUILE_LIBS) +AM_CONDITIONAL(HAVE_GUILE, test "${have_libguile}" != no) # --------------------- # # Check for libmcheck. # diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in index b9fcc03..c7497db 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in @@ -55,7 +55,7 @@ SYSCALLS_FILES = \ PYTHON_DIR = python PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) -PYTHON_FILES = \ +PYTHON_FILE_LIST = \ gdb/__init__.py \ gdb/frames.py \ gdb/FrameIterator.py \ @@ -75,9 +75,12 @@ PYTHON_FILES = \ gdb/function/__init__.py \ gdb/function/strfns.py +@HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST) +@HAVE_PYTHON_FALSE@PYTHON_FILES = + GUILE_DIR = guile GUILE_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(GUILE_DIR) -GUILE_FILES = \ +GUILE_FILE_LIST = \ ./gdb.scm \ gdb/boot.scm \ gdb/experimental.scm \ @@ -86,6 +89,9 @@ GUILE_FILES = \ gdb/printing.scm \ gdb/types.scm +@HAVE_GUILE_TRUE@GUILE_FILES = $(GUILE_FILE_LIST) +@HAVE_GUILE_FALSE@GUILE_FILES = + SYSTEM_GDBINIT_DIR = system-gdbinit SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR) SYSTEM_GDBINIT_FILES = \ @@ -175,11 +181,13 @@ uninstall-syscalls: stamp-python: Makefile $(PYTHON_FILES) rm -rf ./$(PYTHON_DIR) files='$(PYTHON_FILES)' ; \ - for file in $$files ; do \ - dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \ - $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + $(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \ + $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \ + done ; \ + fi touch $@ .PHONY: clean-python @@ -190,33 +198,39 @@ clean-python: .PHONY: install-python install-python: files='$(PYTHON_FILES)' ; \ - for file in $$files ; do \ - dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \ - $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + $(INSTALL_DIR) $(PYTHON_INSTALL_DIR)/$$dir ; \ + $(INSTALL_DATA) ./$(PYTHON_DIR)/$$file $(PYTHON_INSTALL_DIR)/$$dir ; \ + done ; \ + fi .PHONY: uninstall-python uninstall-python: files='$(PYTHON_FILES)' ; \ - for file in $$files ; do \ - slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ - rm -f $(PYTHON_INSTALL_DIR)/$$file ; \ - while test "x$$file" != "x$$slashdir" ; do \ - rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \ - file="$$slashdir" ; \ - slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - done \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ + rm -f $(PYTHON_INSTALL_DIR)/$$file ; \ + while test "x$$file" != "x$$slashdir" ; do \ + rmdir 2>/dev/null "$(PYTHON_INSTALL_DIR)$$slashdir" ; \ + file="$$slashdir" ; \ + slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + done \ + done ; \ + fi stamp-guile: Makefile $(GUILE_FILES) rm -rf ./$(GUILE_DIR) files='$(GUILE_FILES)' ; \ - for file in $$files ; do \ - dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - $(INSTALL_DIR) ./$(GUILE_DIR)/$$dir ; \ - $(INSTALL_DATA) $(GUILE_SRCDIR)/$$file ./$(GUILE_DIR)/$$dir ; \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + $(INSTALL_DIR) ./$(GUILE_DIR)/$$dir ; \ + $(INSTALL_DATA) $(GUILE_SRCDIR)/$$file ./$(GUILE_DIR)/$$dir ; \ + done ; \ + fi touch $@ .PHONY: clean-guile @@ -227,24 +241,28 @@ clean-guile: .PHONY: install-guile install-guile: files='$(GUILE_FILES)' ; \ - for file in $$files ; do \ - dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - $(INSTALL_DIR) $(GUILE_INSTALL_DIR)/$$dir ; \ - $(INSTALL_DATA) ./$(GUILE_DIR)/$$file $(GUILE_INSTALL_DIR)/$$dir ; \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + $(INSTALL_DIR) $(GUILE_INSTALL_DIR)/$$dir ; \ + $(INSTALL_DATA) ./$(GUILE_DIR)/$$file $(GUILE_INSTALL_DIR)/$$dir ; \ + done ; \ + fi .PHONY: uninstall-guile uninstall-guile: files='$(GUILE_FILES)' ; \ - for file in $$files ; do \ - slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ - rm -f $(GUILE_INSTALL_DIR)/$$file ; \ - while test "x$$file" != "x$$slashdir" ; do \ - rmdir 2>/dev/null "$(GUILE_INSTALL_DIR)$$slashdir" ; \ - file="$$slashdir" ; \ - slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ - done \ - done + if test "x$$files" != x ; then \ + for file in $$files ; do \ + slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'` ; \ + rm -f $(GUILE_INSTALL_DIR)/$$file ; \ + while test "x$$file" != "x$$slashdir" ; do \ + rmdir 2>/dev/null "$(GUILE_INSTALL_DIR)$$slashdir" ; \ + file="$$slashdir" ; \ + slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \ + done \ + done ; \ + fi stamp-system-gdbinit: Makefile $(SYSTEM_GDBINIT_FILES) rm -rf ./$(SYSTEM_GDBINIT_DIR)