From: Matt Wilson Subject: Re: [PATCH] tools: don't expand prefix and exec_prefix too early Date: Wed, 8 Aug 2012 08:10:37 -0700 Message-ID: <20120808151037.GE5592@US-SEA-R8XVZTX> References: <5022933B0200007800093A1F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5022933B0200007800093A1F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Jackson , Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org On Wed, Aug 08, 2012 at 07:26:35AM -0700, Jan Beulich wrote: > A comment in tools/configure says that it is intended for these to be > command line overridable, so they shouldn't get expanded at configure > time. I'm not sure which comment you're referencing, or which command line it's intended that you're able to override prefix/exec_prefix. Could you point it out? What's not working? > The patch is fixing tools/m4/default_lib.m4 as far as I can see myself > doing this, but imo it is flawed altogether and should rather be > removed: > - setting prefix and exec_prefix to default values is being done later > in tools/configure anyway > - setting LIB_PATH based on the (non-)existence of a lib64 directory > underneath ${exec_prefix} is plain wrong (it can obviously exist on a > 32-bit installation) > - I wasn't able to locate any use of LIB_PATH I believe that the LIB_PATH portions can now be removed. I also believe you're right that all of this can be removed. Did you attempt that as well? > (I did see IanC's comment in c/s 25594:ad08cd8e7097 that removing it > supposedly causes other problems, but I don't see how that would > happen). The tail of the thread where IanC had trouble is here: http://lists.xen.org/archives/html/xen-devel/2012-07/msg00268.html If we're going back into this code, I think that adding a lowercase prefix variable and removing default_lib.m4 altogether should resolve remaining problems. But we should probably only do that for 4.2 if something's very broken with what's in the tree now. > Signed-off-by: Jan Beulich > > --- > This will require tools/configure to be re-generated. This is typically part of the same commit. Matt > --- a/config/Tools.mk.in > +++ b/config/Tools.mk.in > @@ -1,5 +1,6 @@ > # Prefix and install folder > -PREFIX := @prefix@ > +prefix := @prefix@ > +PREFIX := $(prefix) > exec_prefix := @exec_prefix@ > LIBDIR := @libdir@ > > --- a/tools/m4/default_lib.m4 > +++ b/tools/m4/default_lib.m4 > @@ -1,14 +1,19 @@ > AC_DEFUN([AX_DEFAULT_LIB], > -[AS_IF([test "\${exec_prefix}/lib" = "$libdir"], > - [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"], > - [exec_prefix=$prefix]) > - AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix]) > - AS_IF([test -d "${exec_prefix}/lib64"], [ > +[AS_IF([test "\${exec_prefix}/lib" = "$libdir"], [ > + AS_IF([test "$prefix" = "NONE"], [prefix=$ac_default_prefix]) > + AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix='${prefix}']) > + AS_IF([eval test -d "${exec_prefix}/lib64"], [ > LIB_PATH="lib64" > ],[ > LIB_PATH="lib" > ]) > ], [ > LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}" > + AS_IF([test -z "${libdir##\$\{exec_prefix\}/*}"], [ > + LIB_PATH="${libdir:15}" > + ]) > + AS_IF([test -z "${libdir##\$exec_prefix/*}"], [ > + LIB_PATH="${libdir:13}" > + ]) > ]) > AC_SUBST(LIB_PATH)]) > > >