From patchwork Wed Feb 2 14:59:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 81460 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]) by ozlabs.org (Postfix) with SMTP id 4BAFFB7113 for ; Thu, 3 Feb 2011 02:00:25 +1100 (EST) Received: (qmail 20657 invoked by alias); 2 Feb 2011 15:00:14 -0000 Received: (qmail 20630 invoked by uid 22791); 2 Feb 2011 15:00:10 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, SPF_FAIL, TW_SV X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO gbenson.demon.co.uk) (80.177.220.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Feb 2011 15:00:04 +0000 Date: Wed, 2 Feb 2011 14:59:59 +0000 From: Gary Benson To: java@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Richard Guenther , Gerald Pfeifer , Tom Tromey Subject: Re: Another Python namespace pollution (was: r147958 - in /trunk/libstdc++-v3: ChangeLog Mak...) Message-ID: <20110202145959.GA28926@redhat.com> Mail-Followup-To: java@gcc.gnu.org, gcc-patches@gcc.gnu.org, Richard Guenther , Gerald Pfeifer , Tom Tromey References: <20090528171422.508.qmail@sourceware.org> <20110127103801.GA5165@redhat.com> <20110127105952.GC5165@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110127105952.GC5165@redhat.com> 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 Gary Benson wrote: > Richard Guenther wrote: > > On Thu, Jan 27, 2011 at 11:38 AM, Gary Benson wrote: > > > Gerald Pfeifer wrote: > > > > I noticed that coming from the Java side of things we also > > > > have two files that are installed in common namespace: > > > > > > > > share/python/aotcompile.py > > > > share/python/classfile.py > > > > > > I'm on the hook to fix this, but it's been a while since I > > > worked on this stuff so I'm a little out of touch with GCC. > > > Can you tell me what you mean by "common namespace", and > > > what the alternative should be? > > > > The files should reside in a directory that is private to gcc or > > at least mangled with the gcc version it comes from. Otherwise > > multiple parallel gcc installations conflict. > > Ah, ok, that shouldn't be too hard. I'll get working on a patch. Ha ha, famous last words, I've been fighting this for days. Ok, attached is a patch that causes the two Python modules to be installed in a versioned directory. Also attached is a separate patch, orthogonal to the first, which changes how the modules are made available to the aot-compile scripts. What is currently in svn adds the directory to the _end_ of the path, so if the modules exist elsewhere then the other versions will take priority. The attached patch changes it to add the directory to the start of the path. If the patches are ok then could someone please commit them for me? I thought I had commit access, but I couldn't seem to check out a tree using ssh, so maybe it was revoked for inactivity :) Cheers, Gary Index: libjava/configure.ac =================================================================== --- libjava/configure.ac (revision 169331) +++ libjava/configure.ac (working copy) @@ -1842,21 +1842,18 @@ # We get this from the environment. AC_SUBST(GCJFLAGS) +default_python_dir="/share/gcc-`cat ${srcdir}/../gcc/BASE-VER`/python/libjava" AC_ARG_WITH([python-dir], AS_HELP_STRING([--with-python-dir], [the location to install Python modules. This path should NOT include the prefix.]), - [with_python_dir=$withval], [with_python_dir=""]) + [with_python_dir=$withval], [with_python_dir="${default_python_dir}"]) -if test "x${with_python_dir}" = "x" -then - # Needed for installing Python modules during make install. - python_mod_dir="\${prefix}/share/python" - # Needed for substituting into aot-compile* - python_mod_dir_expanded="${expanded_prefix}/share/python" -else - python_mod_dir="\${prefix}${with_python_dir}" - python_mod_dir_expanded="${expanded_prefix}${with_python_dir}" -fi +# Needed for installing Python modules during make install. +python_mod_dir="\${prefix}${with_python_dir}" + +# Needed for substituting into aot-compile* +python_mod_dir_expanded="${expanded_prefix}${with_python_dir}" + AC_MSG_RESULT(Python modules dir: ${python_mod_dir_expanded}); AC_SUBST(python_mod_dir) AC_SUBST(python_mod_dir_expanded) Index: libjava/configure =================================================================== --- libjava/configure (revision 169331) +++ libjava/configure (working copy) @@ -24649,25 +24649,22 @@ # We get this from the environment. +default_python_dir="/share/gcc-`cat ${srcdir}/../gcc/BASE-VER`/python/libjava" # Check whether --with-python-dir was given. if test "${with_python_dir+set}" = set; then : withval=$with_python_dir; with_python_dir=$withval else - with_python_dir="" + with_python_dir="${default_python_dir}" fi -if test "x${with_python_dir}" = "x" -then - # Needed for installing Python modules during make install. - python_mod_dir="\${prefix}/share/python" - # Needed for substituting into aot-compile* - python_mod_dir_expanded="${expanded_prefix}/share/python" -else - python_mod_dir="\${prefix}${with_python_dir}" - python_mod_dir_expanded="${expanded_prefix}${with_python_dir}" -fi +# Needed for installing Python modules during make install. +python_mod_dir="\${prefix}${with_python_dir}" + +# Needed for substituting into aot-compile* +python_mod_dir_expanded="${expanded_prefix}${with_python_dir}" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Python modules dir: ${python_mod_dir_expanded}" >&5 $as_echo "Python modules dir: ${python_mod_dir_expanded}" >&6; };