libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: support for linux-dietlibc


From: Gary V. Vaughan
Subject: Re: support for linux-dietlibc
Date: Sun, 28 Nov 2004 21:37:08 +0000
User-agent: Mozilla Thunderbird 0.9 (Macintosh/20041103)

Ralf Wildenhues wrote:
OK to apply the following two patches to HEAD and branch-2-0?
With these and the other patches I sent, I get for branch-2-0:

patch #1:
Detect static dietlibc.  One could think about trying to map `-static'
and `-shared' to `diet' and `diet-dyn' respectively, but I figured that
isn't worth the effort (I don't think you're supposed to mix these
anyway).

        * m4/libtool.m4 (_LT_LINKER_SHLIBS): Treat linux-dietlibc with
        the `diet' compiler wrapper (as opposed to the `diet-dyn'
        wrapper) as a static-only platform.

Okay, with one nit, below:

Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.125.2.14
diff -u -r1.125.2.14 libtool.m4
--- m4/libtool.m4       24 Nov 2004 17:24:30 -0000      1.125.2.14
+++ m4/libtool.m4       28 Nov 2004 09:48:27 -0000
@@ -3611,7 +3611,14 @@
       ;;
linux*|tpf*)
-      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null; 
then
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case "$cc_basename" in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking 
(!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null && \
+         test "$tmp_diet" = no; then

The line splitting here is awkward, my preference is for && and || at
the beginning of a line:

  if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
     && test "$tmp_diet" = no
  then

because it is easier to see which lines are continuations of the
previous line when scanning the left columns (or the line ends,
which is, I think, rarer).  Also I prefer to put the `then' on
its own line when the condition is multi-lined to put a visual
pause between the condition and the branch code.  It probably
isn't consistent throughout libtool's code, but I've been writing
shell code like this for a lot of years.  Unless you disagree,
I'll add something to the HACKING file to this effect.

patch #2:

        * libltdl/ltdl.c (trim): Use memcpy instead of strncpy here, to
        avoid problems with non-conforming strncpy.  This is safe here.

Looks good to me.

Cheers,
        Gary.
--
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]