From patchwork Fri Oct 31 17:02:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 405405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9C8CE14009A for ; Sat, 1 Nov 2014 04:07:56 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=aql+HBJrUYbd9CRKhqzi8hVfMuVdn7TWza4sKJOEUjspoS9zK+PuT mboO9H7Y2FVItuQo+0cfM31qqY83rppKeBU8ZSZP191wtd+waUxwoG32TQ4aRHa2 ohr+95jRBgJL7z6eHrkQQqucIv4HmNzQEoXtnYnkOwXV+dCojg2xvU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=uvbGVQ26onRREqVOkAmJLOsWsRw=; b=WAPCm7y4UsxLLDlSvtGd IhezGEh3eVYz6tcCam6LECg5n80JsI1k3z9l9Ozib+mxGLxXWcWjk2oFYGqxMLna 7AtoTCjQIsmWflNmGB2zt+49N1XkDr0gdymuCHMGpEIN35wfWKO4DgPuXAz1FhTw UVLWK6kRuLlu2JhKfhDxEeg= Received: (qmail 6598 invoked by alias); 31 Oct 2014 17:07:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6547 invoked by uid 89); 31 Oct 2014 17:07:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 31 Oct 2014 17:07:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9VH7Gtv008041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Oct 2014 13:07:17 -0400 Received: from surprise.redhat.com (vpn-236-100.phx2.redhat.com [10.3.236.100]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9VH7ES4008517; Fri, 31 Oct 2014 13:07:15 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 01/27] gcc: configure and Makefile changes needed by jit Date: Fri, 31 Oct 2014 13:02:34 -0400 Message-Id: <1414774977-25605-2-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1414774977-25605-1-git-send-email-dmalcolm@redhat.com> References: <1414774977-25605-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes An earlier version of this was posted as: "[PATCH 2/5] gcc: configure and Makefile changes needed by jit" https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01169.html Since then, I've eliminated the gcc_version, bindir, and pkgconfigdir additions, and added the FULL_DRIVER_NAME variable and symlink, to avoid the need to install when running the jit testsuite. gcc/ChangeLog: * Makefile.in (doc_build_sys): New variable, set to "sphinx" if sphinx is installed, falling back to "texinfo" otherwise. (FULL_DRIVER_NAME): New variable, adapted from the install-driver target. New target, a symlink within the builddir, linked to "xgcc", for use when running the JIT library from the builddir. (MOSTLYCLEANFILES): Add FULL_DRIVER_NAME. (install-driver): Use $(FULL_DRIVER_NAME) rather than spelling it out. * configure.ac (doc_build_sys): New variable, set to "sphinx" if sphinx is installed, falling back to "texinfo" otherwise. (GCC_DRIVER_NAME): Generate a gcc-driver-name.h file containing GCC_DRIVER_NAME for the benefit of jit/internal-api.c. * configure: Regenerate. --- gcc/Makefile.in | 20 +++++++++++++++++--- gcc/configure | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- gcc/configure.ac | 10 ++++++++++ 3 files changed, 77 insertions(+), 5 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index e2100ff..ded7471 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -316,6 +316,11 @@ write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) \ $(shell expr $(range) + $(write_entries_to_file_split) - 1), $(1))" \ | tr ' ' '\012' >> $(2))) +# The jit documentation looks better if built with sphinx, but can be +# built with texinfo if sphinx is not available. +# configure sets "doc_build_sys" to "sphinx" or "texinfo" accordingly +doc_build_sys=@doc_build_sys@ + # -------- # UNSORTED # -------- @@ -1504,6 +1509,9 @@ BACKEND = libbackend.a main.o @TREEBROWSER@ libcommon-target.a libcommon.a \ # front-end checking. TREECHECKING = @TREECHECKING@ +# The full name of the driver on installation +FULL_DRIVER_NAME=$(target_noncanonical)-gcc-$(version)$(exeext) + MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \ insn-attr.h insn-attr-common.h insn-attrtab.c insn-dfatab.c \ @@ -1511,7 +1519,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ tm-preds.h tm-constrs.h checksum-options gimple-match.c generic-match.c \ tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \ genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \ - xgcc$(exeext) cpp$(exeext) \ + xgcc$(exeext) cpp$(exeext) $(FULL_DRIVER_NAME) \ $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \ gcc-ranlib$(exeext) \ @@ -1520,6 +1528,12 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \ gengtype$(exeext) *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a \ libcommon-target.a libcommon.a libgcc.mk +# This symlink makes the full installation name of the driver be available +# from within the *build* directory, for use when running the JIT library +# from there (e.g. when running its testsuite). +$(FULL_DRIVER_NAME): ./xgcc + $(LN) -s $< $@ + # # Language makefile fragments. @@ -3280,9 +3294,9 @@ install-driver: installdirs xgcc$(exeext) -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext) -if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" ]; then \ - rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext); \ + rm -f $(DESTDIR)$(bindir)/$(FULL_DRIVER_NAME); \ ( cd $(DESTDIR)$(bindir) && \ - $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ); \ + $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \ fi -if [ ! -f gcc-cross$(exeext) ] \ && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \ diff --git a/gcc/configure b/gcc/configure index 16f128f..6779b2a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -743,6 +743,7 @@ CXXDEPMODE DEPDIR am__leading_dot CXXCPP +doc_build_sys AR NM BISON @@ -8069,6 +8070,47 @@ fi fi +# The jit documentation looks better if built with sphinx, but can be +# built with texinfo if sphinx is not available. +# Set "doc_build_sys" to "sphinx" or "texinfo" accordingly. +# Extract the first word of "sphinx-build", so it can be a program name with args. +set dummy sphinx-build; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_doc_build_sys+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$doc_build_sys"; then + ac_cv_prog_doc_build_sys="$doc_build_sys" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_doc_build_sys="sphinx" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_doc_build_sys" && ac_cv_prog_doc_build_sys="texinfo" +fi +fi +doc_build_sys=$ac_cv_prog_doc_build_sys +if test -n "$doc_build_sys"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doc_build_sys" >&5 +$as_echo "$doc_build_sys" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + # -------------------- # Checks for C headers @@ -18058,7 +18100,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18061 "configure" +#line 18103 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18164,7 +18206,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18167 "configure" +#line 18209 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -28175,6 +28217,12 @@ _ACEOF fi +# Generate gcc-driver-name.h containing GCC_DRIVER_NAME for the benefit +# of jit/jit-playback.c. +cat > gcc-driver-name.h < gcc-driver-name.h <