[PATCH 01/25] fix check for libdir in ldconfig paths

2011-06-01 Thread Jameson Graef Rollins
On Wed, 01 Jun 2011 16:22:19 -0700, Carl Worth  wrote:
> Thanks for the patch. I was intrigued about what was actually broken
> here, so tracked down the problem and fixed it with an alternate patch
> (see below).

Cool.  Yeah, that issue took a while to track down.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCH 01/25] fix check for libdir in ldconfig paths

2011-06-01 Thread Carl Worth
On Sat, 28 May 2011 14:51:36 -0700, Jameson Graef Rollins  wrote:
> The configure script tries to check that the libdir is included in the
> ldconfig paths, and then sets the RPATH compiler flag if it's not.
> This check was broken, and was always setting RPATH.  This fixes the
> path check.

Thanks for the patch. I was intrigued about what was actually broken
here, so tracked down the problem and fixed it with an alternate patch
(see below).

-Carl

commit 574f408816e636f677b14384c18cc2e388991411
Author: Carl Worth 
Date:   Wed Jun 1 13:02:58 2011 -0700

configure: Fix detection of libdir in ldconfig configuration

Ever since commit b4b5e9ce4dac62111ec11da6d22b7e618056801f the
detection of libdir in the ldconfig configuration has been broken,
resulting in RPATH being set when not needed and not wanted.

The cause was a change from an IFS setting of:

IFS="$(printf '\n\t')"

to a new setting of:

IFS="$(printf '\n')"

That looks desirable since we want to split the output of ldconfig
based on newlines, (and not split on any filename that might have an
embedded tab in it). The subtle bug in the above is that the shell
trims any trailing newlines when performing command substitution so
the final statement above was equivalent to:

IFS=''

which prevented any splitting of the ldconfig output at all.

Fix this by avoiding command substitution and just using a literal
newline in the source file for setting this variable.

diff --git a/configure b/configure
index bbf30cd..cf525c9 100755
--- a/configure
+++ b/configure
@@ -355,17 +355,30 @@ elif [ $uname = "Linux" ] ; then
 printf "Linux\n"
 platform=LINUX
 linker_resolves_library_dependencies=1
+
+printf "Checking for $libdir_expanded in ldconfig... "
 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 
's,^\(/.*\):\( (.*)\)\?$,\1,p')
 # Separate ldconfig_paths only on newline (not on any potential
-# embedded space characters in any filenames).
+# embedded space characters in any filenames). Note, we use a
+# literal newline in the source here rather than something like:
+#
+#  IFS=$(printf '\n')
+#
+# because the shell's command substitution deletes any trailing newlines.
 OLD_IFS=$IFS
-IFS="$(printf '\n')"
+IFS="
+"
 for path in $ldconfig_paths; do
if [ "$path" = "$libdir_expanded" ]; then
libdir_in_ldconfig=1
fi
 done
 IFS=$OLD_IFS
+if [ "$libdir_in_ldconfig" = '0' ]; then
+   printf "No (will set RPATH)\n"
+else
+   printf "Yes\n"
+fi
 else
 printf "Unknown.\n"
 cat 


Re: [PATCH 01/25] fix check for libdir in ldconfig paths

2011-06-01 Thread Carl Worth
On Sat, 28 May 2011 14:51:36 -0700, Jameson Graef Rollins 
jroll...@finestructure.net wrote:
 The configure script tries to check that the libdir is included in the
 ldconfig paths, and then sets the RPATH compiler flag if it's not.
 This check was broken, and was always setting RPATH.  This fixes the
 path check.

Thanks for the patch. I was intrigued about what was actually broken
here, so tracked down the problem and fixed it with an alternate patch
(see below).

-Carl

commit 574f408816e636f677b14384c18cc2e388991411
Author: Carl Worth cwo...@cworth.org
Date:   Wed Jun 1 13:02:58 2011 -0700

configure: Fix detection of libdir in ldconfig configuration

Ever since commit b4b5e9ce4dac62111ec11da6d22b7e618056801f the
detection of libdir in the ldconfig configuration has been broken,
resulting in RPATH being set when not needed and not wanted.

The cause was a change from an IFS setting of:

IFS=$(printf '\n\t')

to a new setting of:

IFS=$(printf '\n')

That looks desirable since we want to split the output of ldconfig
based on newlines, (and not split on any filename that might have an
embedded tab in it). The subtle bug in the above is that the shell
trims any trailing newlines when performing command substitution so
the final statement above was equivalent to:

IFS=''

which prevented any splitting of the ldconfig output at all.

Fix this by avoiding command substitution and just using a literal
newline in the source file for setting this variable.

diff --git a/configure b/configure
index bbf30cd..cf525c9 100755
--- a/configure
+++ b/configure
@@ -355,17 +355,30 @@ elif [ $uname = Linux ] ; then
 printf Linux\n
 platform=LINUX
 linker_resolves_library_dependencies=1
+
+printf Checking for $libdir_expanded in ldconfig... 
 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2/dev/null | sed -n -e 
's,^\(/.*\):\( (.*)\)\?$,\1,p')
 # Separate ldconfig_paths only on newline (not on any potential
-# embedded space characters in any filenames).
+# embedded space characters in any filenames). Note, we use a
+# literal newline in the source here rather than something like:
+#
+#  IFS=$(printf '\n')
+#
+# because the shell's command substitution deletes any trailing newlines.
 OLD_IFS=$IFS
-IFS=$(printf '\n')
+IFS=
+
 for path in $ldconfig_paths; do
if [ $path = $libdir_expanded ]; then
libdir_in_ldconfig=1
fi
 done
 IFS=$OLD_IFS
+if [ $libdir_in_ldconfig = '0' ]; then
+   printf No (will set RPATH)\n
+else
+   printf Yes\n
+fi
 else
 printf Unknown.\n
 cat EOF


pgpRuTR6KWaIN.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 01/25] fix check for libdir in ldconfig paths

2011-06-01 Thread Jameson Graef Rollins
On Wed, 01 Jun 2011 16:22:19 -0700, Carl Worth cwo...@cworth.org wrote:
 Thanks for the patch. I was intrigued about what was actually broken
 here, so tracked down the problem and fixed it with an alternate patch
 (see below).

Cool.  Yeah, that issue took a while to track down.

jamie.


pgpWidel4eYpy.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 01/25] fix check for libdir in ldconfig paths

2011-05-28 Thread Jameson Graef Rollins
The configure script tries to check that the libdir is included in the
ldconfig paths, and then sets the RPATH compiler flag if it's not.
This check was broken, and was always setting RPATH.  This fixes the
path check.
---
 configure |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index bbf30cd..f735c1d 100755
--- a/configure
+++ b/configure
@@ -358,14 +358,14 @@ elif [ $uname = "Linux" ] ; then
 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2>/dev/null | sed -n -e 
's,^\(/.*\):\( (.*)\)\?$,\1,p')
 # Separate ldconfig_paths only on newline (not on any potential
 # embedded space characters in any filenames).
-OLD_IFS=$IFS
-IFS="$(printf '\n')"
 for path in $ldconfig_paths; do
if [ "$path" = "$libdir_expanded" ]; then
libdir_in_ldconfig=1
fi
 done
-IFS=$OLD_IFS
+if [ "$libdir_in_ldconfig" = '0' ]; then
+   printf "\tlibdir not found in ldconfig paths.  RPATH variable will be 
set.\n"
+fi
 else
 printf "Unknown.\n"
 cat <

[PATCH 01/25] fix check for libdir in ldconfig paths

2011-05-28 Thread Jameson Graef Rollins
The configure script tries to check that the libdir is included in the
ldconfig paths, and then sets the RPATH compiler flag if it's not.
This check was broken, and was always setting RPATH.  This fixes the
path check.
---
 configure |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index bbf30cd..f735c1d 100755
--- a/configure
+++ b/configure
@@ -358,14 +358,14 @@ elif [ $uname = Linux ] ; then
 ldconfig_paths=$(/sbin/ldconfig -N -X -v 2/dev/null | sed -n -e 
's,^\(/.*\):\( (.*)\)\?$,\1,p')
 # Separate ldconfig_paths only on newline (not on any potential
 # embedded space characters in any filenames).
-OLD_IFS=$IFS
-IFS=$(printf '\n')
 for path in $ldconfig_paths; do
if [ $path = $libdir_expanded ]; then
libdir_in_ldconfig=1
fi
 done
-IFS=$OLD_IFS
+if [ $libdir_in_ldconfig = '0' ]; then
+   printf \tlibdir not found in ldconfig paths.  RPATH variable will be 
set.\n
+fi
 else
 printf Unknown.\n
 cat EOF
-- 
1.7.4.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch