[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: $(top_srcdir) in Makefile.am
From:       Adriaan de Groot <adridg () cs ! kun ! nl>
Date:       2002-10-30 11:51:42
[Download RAW message or body]

On Tuesday 29 October 2002 22:54, Michael Matz wrote:
> On Tue, 29 Oct 2002, Adriaan de Groot wrote:
> > In many Makefile.am's I see constructions like the following:
>
> Many?  Which?  I see this construct in exactly three Makefile.am's, two of
> them being useless

One, two, many. Maybe I've just been staring at kdoctools too long (related to 
KDELIBS_UNINSTALLED=yes failures on FreeBSD). 

> > [2] Why aren't backticks `(cd $(top_srcdir)/kdoctools && pwd)`
> > sufficient?
>
> $(shell) is a GNU make function, whereas `` is a shell functionality.  The
> difference is, that you can use `` only in the shell functions (i.e. the
> commands invoked for creating a target), whereas you can use $(shell)
> anywhere in the Makefile.  Compare e.g.:

Yes, of course. Here - kdoctools - it doesn't matter, since the variable is 
only used in the commands used to create meinproc targets. 

> > [4] Unfortunately, it doesn't work that easily. It doesn't get
> > substituted automatically, as far as i can tell, and adding an
>
> This is an error in the fast-perl machinery.  It doesn't duplicate enough
> of the sed expressions, which also means, that it wasn't working with
> older autoconf versions (but probably something like 2.13).  I.e. this

Patches for admin/config.pl and kdelibs/kdoctools/Makefile.am attached. Tested 
under FBSD 4.7 with perl 5.005_03 only. My only concern is that this adds a 
backtick expression to config.pl, which will mean starting a shell again for 
every Makefile.in processed. That might slow things down again unacceptably. 
While perl has a chdir() function, I can't find a cwd or pwd in perl.

[ade]
["config-pl.patch" (text/x-diff)]

--- ./kdesdk/kapptemplate/admin/config.pl	Tue Sep 24 22:02:00 2002
+++ kde-common/admin/config.pl	Wed Oct 30 12:38:26 2002
@@ -38,7 +38,7 @@
 #print "ac_given_srcdir=$ac_given_srcdir\n";
 #print "ac_given_INSTALL=$ac_given_INSTALL\n";
 
-my ($srcdir, $top_srcdir);
+my ($srcdir, $top_srcdir, $abs_top_srcdir);
 my $INSTALL;
 my $bad_perl = ($] < 5.005);
 
@@ -153,6 +153,9 @@
 	$top_srcdir = $ac_dots.$ac_given_srcdir;
     }
 
+    $abs_top_srcdir=`cd $top_srcdir && pwd` ;
+    chomp $abs_top_srcdir;
+
     if ($ac_given_INSTALL) {
 	if ($ac_given_INSTALL =~ m%^/% ) {
 	    $INSTALL = $ac_given_INSTALL;
@@ -202,6 +205,7 @@
     $filedata =~ s%\@configure_input\@%$configure_input%g;
     $filedata =~ s%\@srcdir\@%$srcdir%g;
     $filedata =~ s%\@top_srcdir\@%$top_srcdir%g;
+    $filedata =~ s%\@abs_top_srcdir\@%$abs_top_srcdir%g;
     $filedata =~ s%\@INSTALL\@%$INSTALL%g;
 
     if ($bad_perl) {

["Makefile-am.patch" (text/x-makefile)]

--- Makefile.am.orig	Wed Oct 30 12:42:36 2002
+++ Makefile.am	Wed Oct 30 12:38:36 2002
@@ -3,7 +3,7 @@
 LDFLAGS = $(KDE_RPATH) $(LIBXML_RPATH) $(LIBXSLT_RPATH) $(all_libraries)
 
 
-AM_CPPFLAGS = -DSRCDIR="\"$(shell (cd $(top_srcdir)/kdoctools && pwd))\""
+AM_CPPFLAGS = -DSRCDIR="\"@abs_top_srcdir@\""
 
 noinst_LTLIBRARIES = libkbzipfilter_dummy.la
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic