trim libtool gcc's search path.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

trim libtool gcc's search path.

Marc Espie-2
On OpenBSD at least, once gcc is built and installed, there is no need
to look at potential directories...

This reduces libtool search path from 10 entries to 2 on a typical OpenBSD
system...

considering that this can be used in some tight loops, this is a worthwhile
optimisation...

No idea whether this makes sense on other systems, or should be limited to the
case openbsd part of the configure script...

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile
--- Makefile 16 Dec 2005 23:03:35 -0000 1.46
+++ Makefile 18 Dec 2005 16:24:41 -0000
@@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
 
 VERSION= 1.5.20
 DISTNAME= libtool-${VERSION}
-PKGNAME= ${DISTNAME}p3
+PKGNAME= ${DISTNAME}p4
 PKGNAME-ltdl= libltdl-${VERSION}p1
 CATEGORIES= devel
 MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-configure,v
retrieving revision 1.1
diff -u -p -r1.1 patch-configure
--- patches/patch-configure 16 Dec 2005 23:03:35 -0000 1.1
+++ patches/patch-configure 18 Dec 2005 16:24:41 -0000
@@ -1,7 +1,21 @@
 $OpenBSD: patch-configure,v 1.1 2005/12/16 23:03:35 espie Exp $
---- configure.orig Thu Dec 15 19:34:34 2005
-+++ configure Thu Dec 15 19:34:56 2005
-@@ -8646,6 +8646,7 @@ nto-qnx*)
+--- configure.orig Wed Aug 31 20:54:29 2005
++++ configure Sun Dec 18 15:26:14 2005
+@@ -8240,6 +8240,13 @@ if test "$GCC" = yes; then
+ else
+   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ fi
++tmp="$sys_lib_search_path_spec"
++sys_lib_search_path_spec=""
++for i in $tmp
++do
++    test -d $i && sys_lib_search_path_spec="$sys_lib_search_path_spec $i"
++done
++
+ need_lib_prefix=unknown
+ hardcode_into_libs=no
+
+@@ -8646,6 +8653,7 @@ nto-qnx*)
 
  openbsd*)
    version_type=sunos

Reply | Threaded
Open this post in threaded view
|

Re: trim libtool gcc's search path.

Ralf Wildenhues
Hi Marc,

* Marc Espie wrote on Sun, Dec 18, 2005 at 05:28:03PM CET:
> On OpenBSD at least, once gcc is built and installed, there is no need
> to look at potential directories...
>
> This reduces libtool search path from 10 entries to 2 on a typical
> OpenBSD system...
>
> considering that this can be used in some tight loops, this is a
> worthwhile optimisation...

Yep.

> No idea whether this makes sense on other systems, or should be
> limited to the case openbsd part of the configure script...

Probably even ok for other systems as well.  For 'libtool' scripts that
don't leave the build tree this looks like a very good idea; for
/usr/bin/libtool this would not be so good -- people expect to create
those directories and not have to reinstall libtool.

You could even go a bit further and strip out duplicates.

Since not strictly a bugfix, I'll play safe though and won't consider
this for 1.5.22, which I'm trying to get done today..

Cheers,
Ralf

> +@@ -8240,6 +8240,13 @@ if test "$GCC" = yes; then
> + else
> +   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
> + fi
> ++tmp="$sys_lib_search_path_spec"
> ++sys_lib_search_path_spec=""
> ++for i in $tmp
> ++do
> ++    test -d $i && sys_lib_search_path_spec="$sys_lib_search_path_spec $i"
> ++done
> ++
> + need_lib_prefix=unknown
> + hardcode_into_libs=no
> +