You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2001/09/22 10:24:42 UTC

new autoconf/libtool

Hey all,

I've been working with Mo's patch and trying to get this stuff to work. I've
got it, but I had to work around a libtool bug to do so.

There were also quite a few changes over Mo's patch that I made (his patch
did not reference the .la files directly, but libtool 1.4 was meant to do
exactly that; thus no need for -L -l pairs).

The bug is related to libtool's desire to relink libraries at install time.
It does this to adjust the --rpath stuff (when you compile it, --rpath
points into the build dir; at install time, it is relinked to toss that).
When it does the relink, it improperly does a "cd" which then screws up the
following commands. My patch was to rewrite the .la files to include proper
relink commands. Mebbe if I was smarter, we could patch the generated
"libtool" script.

Anyways... since I feel this is a bit tweaky, I wanted to post before
committing. Especially if anybody knows some fixes for the relink problem.

I'm using libtool 1.4.2 and autoconf 2.52

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: new autoconf/libtool

Posted by Greg Stein <gs...@lyra.org>.
On Mon, Sep 24, 2001 at 07:36:09AM +0200, Daniel Stenberg wrote:
> On Sun, 23 Sep 2001, Mo DeJong wrote:
> > > That said, I might look into seeing how we can support *both* versions of
> > > autoconf and libtool.
> >
> > That would be a big mistake.
> 
> I'm agreeing with Mo here. We're talking about developers here. SVN
> developers already have to use the correct version of Apache, APR, Neon and
> Berkely DB. Why not just add a (least) required version of autoconf and
> libtool?

I'd like some more opinions from the other developers...

Personally, I have no problem with it since I've already got the upgraded
autoconf and libtool.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: new autoconf/libtool

Posted by Daniel Stenberg <da...@haxx.se>.
On Sun, 23 Sep 2001, Mo DeJong wrote:

> > That said, I might look into seeing how we can support *both* versions of
> > autoconf and libtool.
>
> That would be a big mistake.

I'm agreeing with Mo here. We're talking about developers here. SVN
developers already have to use the correct version of Apache, APR, Neon and
Berkely DB. Why not just add a (least) required version of autoconf and
libtool?

-- 
      Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: new autoconf/libtool

Posted by Mo DeJong <su...@bayarea.net>.
On Sun, 23 Sep 2001 16:13:54 -0700
Greg Stein <gs...@lyra.org> wrote:

> On Sun, Sep 23, 2001 at 02:03:55PM -0700, Mo DeJong wrote:
> >...
> > > 3) Change the INSTALL targets so they do a cd before installing.
> >...
> > I decided to take a shot at implementing option #3 since it seems the most simple course
> > of action. This patch will do a cd to the directory in question before calling libtool to
> > actually do the install. I have double checked it and this works around the problem
> > without having to patch libtool or any generated files.
> 
> Cool.
> 
> > The one catch is that this
> > patch will need to be merged with Greg's other patches by hand since it changes
> > the same lines.
> 
> Not a problem. I can just merge it into my code base and then resubmit the
> patch.

Great.

> >...
> >        ofile.write('\ninstall-mods-static: %s\n'
> >                    '\t$(MKDIR) %s\n'
> > -                  % (string.join(la_tweaked + s_files),
> > -                     os.path.join('$(APACHE_TARGET)', '.libs')))
> > +                  % (string.join(la_tweaked + s_files), '$(APACHE_TARGET)'))
> 
> Stop screwing around with the .libs for the static install. I don't recall
> where I said it, but you can't just remove the .libs stuff here. That is a
> *target* directory that we're constructing. This isn't a reference to our
> own .libs. You're just blindly removing references to .libs, and it is wrong
> in this case.

That was why I mentioned the need for a hand merge.

> But no matter... I'll get the "cd" stuff incorporated into my WC here,
> tested, and then resubmit a patch to the list.
> 
> Note that submitting the patch to the list is merely for people to try out.
> I'm not sure that we want to switch over to it just yet. I had a bitch
> trying to find a pair of libtool and autoconf RPMs. And the autoconf RPM had
> a bug in it(!).  (go to rpmfind.net and you'll see the lack...)

I don't know about RPMs, but the source is not hard to find.

ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.52.tar.gz
ftp://ftp.gnu.org/gnu/libtool/libtool-1.4.2.tar.gz

> What I'm saying is... converting to the new autoconf/libtool might be neat,
> but I think it will mostly just cause a pain for developers trying to get
> the most recent packages.
> 
> That said, I might look into seeing how we can support *both* versions of
> autoconf and libtool. APR is at that point right now, and I see no reason
> that we couldn't do the same (although, it is harder for us, as an app).

That would be a big mistake. We already talked about the tradeoffs here.
Upgrading to autoconf 2.50 and libtool 1.4 solves a lot of problems. It
also provides some features that are not currently easy to do (like
cross compiling). Requiring that developers have the most recent
stable release of autoconf and libtool is not too much to ask. I am
not going to claim that everyone will be happy, but I do claim that
upgrading now will lead to less unhappiness in the long run. If you
try to support two build systems, it will lead to many wasted man
hours hunting down bugs that may be caused by incompatibilities
between the old and new version of autoconf and libtool. It will only
take a developer 5-10 minutes to build and install the most current
stable releases of autoconf and libtool.

cheers
Mo

(old thread that talks about this)
http://subversion.tigris.org/servlets/BrowseList?listName=dev&by=thread&from=2548

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: new autoconf/libtool

Posted by Greg Stein <gs...@lyra.org>.
On Sun, Sep 23, 2001 at 02:03:55PM -0700, Mo DeJong wrote:
>...
> > 3) Change the INSTALL targets so they do a cd before installing.
>...
> I decided to take a shot at implementing option #3 since it seems the most simple course
> of action. This patch will do a cd to the directory in question before calling libtool to
> actually do the install. I have double checked it and this works around the problem
> without having to patch libtool or any generated files.

Cool.

> The one catch is that this
> patch will need to be merged with Greg's other patches by hand since it changes
> the same lines.

Not a problem. I can just merge it into my code base and then resubmit the
patch.

>...
>        ofile.write('\ninstall-mods-static: %s\n'
>                    '\t$(MKDIR) %s\n'
> -                  % (string.join(la_tweaked + s_files),
> -                     os.path.join('$(APACHE_TARGET)', '.libs')))
> +                  % (string.join(la_tweaked + s_files), '$(APACHE_TARGET)'))

Stop screwing around with the .libs for the static install. I don't recall
where I said it, but you can't just remove the .libs stuff here. That is a
*target* directory that we're constructing. This isn't a reference to our
own .libs. You're just blindly removing references to .libs, and it is wrong
in this case.

But no matter... I'll get the "cd" stuff incorporated into my WC here,
tested, and then resubmit a patch to the list.

Note that submitting the patch to the list is merely for people to try out.
I'm not sure that we want to switch over to it just yet. I had a bitch
trying to find a pair of libtool and autoconf RPMs. And the autoconf RPM had
a bug in it(!).  (go to rpmfind.net and you'll see the lack...)

What I'm saying is... converting to the new autoconf/libtool might be neat,
but I think it will mostly just cause a pain for developers trying to get
the most recent packages.

That said, I might look into seeing how we can support *both* versions of
autoconf and libtool. APR is at that point right now, and I see no reason
that we couldn't do the same (although, it is harder for us, as an app).

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: new autoconf/libtool

Posted by Mo DeJong <su...@bayarea.net>.
On Sat, 22 Sep 2001 16:44:04 -0700
Mo DeJong <su...@bayarea.net> wrote:

> On Sat, 22 Sep 2001 03:24:42 -0700
> Greg Stein <gs...@lyra.org> wrote:
> 
> > Hey all,
> > 
> > I've been working with Mo's patch and trying to get this stuff to work. I've
> > got it, but I had to work around a libtool bug to do so.

...

> > Anyways... since I feel this is a bit tweaky, I wanted to post before
> > committing. Especially if anybody knows some fixes for the relink problem.

...

> In the mean time, we have a couple of options:
> 
> 1) Disable shared builds.
> 2) Tell users to apply the above patch to the libtool 1.4.2 release.
> 3) Change the INSTALL targets so they do a cd before installing.
> 
> Option 3 might be the least painful. The build-outputs.mk file INSTALL
> targets would need to change:
> 
> $(INSTALL_MOD_STATIC) subversion/libsvn_delta/libsvn_delta.a $(APACHE_TARGET)/libsvn_delta.a
> 
> Would become:
> 
> cd subversion/libsvn_delta ; $(INSTALL_MOD_STATIC) libsvn_delta.a $(APACHE_TARGET)/libsvn_delta.a

I decided to take a shot at implementing option #3 since it seems the most simple course
of action. This patch will do a cd to the directory in question before calling libtool to
actually do the install. I have double checked it and this works around the problem
without having to patch libtool or any generated files. The one catch is that this
patch will need to be merged with Greg's other patches by hand since it changes
the same lines.

cheers
Mo DeJong

Index: gen-make.py
===================================================================
--- SVN/text-base/gen-make.py	Mon Sep 10 09:49:53 2001
+++ gen-make.py	Sun Sep 23 13:29:16 2001
@@ -192,16 +188,17 @@
 
       ofile.write('\ninstall-mods-static: %s\n'
                   '\t$(MKDIR) %s\n'
-                  % (string.join(la_tweaked + s_files),
-                     os.path.join('$(APACHE_TARGET)', '.libs')))
+                  % (string.join(la_tweaked + s_files), '$(APACHE_TARGET)'))
       for file in la_tweaked:
         dirname, fname = os.path.split(file)
         base = os.path.splitext(fname)[0]
+        # cd to dirname before install to work around libtool 1.4.2 bug.
         ofile.write('\t$(INSTALL_MOD_STATIC) %s %s\n'
-                    '\t$(INSTALL_MOD_STATIC) %s %s\n'
-                    % (os.path.join(dirname, '.libs', base + '.a'),
-                       os.path.join('$(APACHE_TARGET)', '.libs', base + '.a'),
-                       file,
+                    '\tcd %s ; $(INSTALL_MOD_STATIC) %s %s\n'
+                    % (os.path.join(dirname, base + '.a'),
+                       os.path.join('$(APACHE_TARGET)', base + '.a'),
+                       dirname,
+                       (base + '.la'),
                        os.path.join('$(APACHE_TARGET)', base + '.la')))
       for file in s_files:
         ofile.write('\t$(INSTALL_MOD_STATIC) %s %s\n'
@@ -215,10 +212,13 @@
                   '\t$(MKDIR) $(%sdir)\n'
                   % (area, string.join(files), area_var))
       for file in files:
-        ofile.write('\t$(INSTALL_%s) %s %s\n'
-                    % (string.upper(area_var), file,
-		       os.path.join('$(%sdir)' % area_var,
-		                    os.path.basename(file))))
+        # cd to dirname before install to work around libtool 1.4.2 bug.
+        dirname, fname = os.path.split(file)
+        ofile.write('\tcd %s ; $(INSTALL_%s) %s %s\n'
+                    % (dirname,
+                       string.upper(area_var),
+                       fname,
+		       os.path.join('$(%sdir)' % area_var, fname)))
       ofile.write('\n')
 
   includes, i_errors = _collect_paths(parser.get('includes', 'paths'))

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: new autoconf/libtool

Posted by Mo DeJong <su...@bayarea.net>.
On Sat, 22 Sep 2001 03:24:42 -0700
Greg Stein <gs...@lyra.org> wrote:

> Hey all,
> 
> I've been working with Mo's patch and trying to get this stuff to work. I've
> got it, but I had to work around a libtool bug to do so.
> 
> There were also quite a few changes over Mo's patch that I made (his patch
> did not reference the .la files directly, but libtool 1.4 was meant to do
> exactly that; thus no need for -L -l pairs).
> 
> The bug is related to libtool's desire to relink libraries at install time.
> It does this to adjust the --rpath stuff (when you compile it, --rpath
> points into the build dir; at install time, it is relinked to toss that).
> When it does the relink, it improperly does a "cd" which then screws up the
> following commands. My patch was to rewrite the .la files to include proper
> relink commands. Mebbe if I was smarter, we could patch the generated
> "libtool" script.
> 
> Anyways... since I feel this is a bit tweaky, I wanted to post before
> committing. Especially if anybody knows some fixes for the relink problem.
> 
> I'm using libtool 1.4.2 and autoconf 2.52
> 
> Cheers,
> -g


I have been able to reproduce this problem on my Linux box. This sort
of problem does not seem to show up when using automake since
it always works from the current directory. The reason this is blowing
up is because of an install line like so:

libtool --mode=install install -c  subdir/libdemo.la /tmp/demo/libdemo.la

If this libdemo depends on another libtool library it will blow up because
it does a cd to "subdir" and does no cd back to the current dir inside the
libtool script.

I have attached a very small example that reproduces this error,
the following files are included in the .tgz.

libtool (Generated under Linux: grab new one from svn/trunk on your system)
subdir
subdir/bug.c
subdir/demo.c
ltmain.sh
runlt.sh

This will try to create a libtool archive named subdir/libdemo.la and install
it (which fails).


I poked around in the libtool 1.4.2 release and created the following patch
to fix this problem.

--- copy_ltmain.in      Sat Sep 22 16:12:27 2001
+++ ltmain.in   Sat Sep 22 16:12:38 2001
@@ -4159,10 +4159,14 @@
        dir="$dir$objdir"
 
        if test -n "$relink_command"; then
+         # Save CWD in case the relink command changes it.
+         cwd=`pwd`
          $echo "$modename: warning: relinking \`$file'" 1>&2
          $show "$relink_command"
-         if $run eval "$relink_command"; then :
+         if $run eval "$relink_command"; then
+           cd $cwd
          else
+           cd $cwd
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
            continue
          fi


I am going to go ahead and send this to the libtool list so that it will
be incorporated into the next libtool release.

In the mean time, we have a couple of options:

1) Disable shared builds.
2) Tell users to apply the above patch to the libtool 1.4.2 release.
3) Change the INSTALL targets so they do a cd before installing.

Option 3 might be the least painful. The build-outputs.mk file INSTALL
targets would need to change:

$(INSTALL_MOD_STATIC) subversion/libsvn_delta/libsvn_delta.a $(APACHE_TARGET)/libsvn_delta.a

Would become:

cd subversion/libsvn_delta ; $(INSTALL_MOD_STATIC) libsvn_delta.a $(APACHE_TARGET)/libsvn_delta.a

cheers
Mo DeJong