libtool ChangeLog libltdl/argz.c libltdl/argz_.h
CVSROOT:/cvsroot/libtool Module name:libtool Changes by: Ralf Wildenhues rwild 08/02/26 22:18:03 Modified files: . : ChangeLog libltdl: argz.c argz_.h Log message: * libltdl/argz.c (argz_add, argz_count): New functions. * libltdl/argz_.h: Declare them. Report by Juan Manuel Guerrero [EMAIL PROTECTED]. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/libtool/ChangeLog?cvsroot=libtoolr1=1.2595r2=1.2596 http://cvs.savannah.gnu.org/viewcvs/libtool/libltdl/argz.c?cvsroot=libtoolr1=1.11r2=1.12 http://cvs.savannah.gnu.org/viewcvs/libtool/libltdl/argz_.h?cvsroot=libtoolr1=1.8r2=1.9 ___ Libtool-commit mailing list Libtool-commit@gnu.org http://lists.gnu.org/mailman/listinfo/libtool-commit
Re: patch adding argz_add and argz_count implementation
Hi Karl, * Karl Berry wrote on Tue, Feb 26, 2008 at 06:11:34PM CET: Good, except that I'd prefer if argz_count used strlen instead of Ok, since you prefer it, I copied the strlen loop from libc. Below is a revised patch (for both files for convenience). Thanks. Applied as shown below. I'll change the name in Libtool after 2.2. Maybe I'll even change it to use gnulib-tool ... If you start maintaining the argz files with gnulib as the master, please tell me so I can stop syncing from libtool to gnulib :). Sure. FWIW I can also apply this to gnulib for you (I'm not sure if you prefer to do that yourself). Cheers, Ralf 2008-02-26 Karl Berry [EMAIL PROTECTED] * libltdl/argz.c (argz_add, argz_count): New functions. * libltdl/argz_.h: Declare them. Report by Juan Manuel Guerrero [EMAIL PROTECTED]. Index: libltdl/argz.c === RCS file: /cvsroot/libtool/libtool/libltdl/argz.c,v retrieving revision 1.11 diff -u -r1.11 argz.c --- libltdl/argz.c 25 Mar 2007 12:12:42 - 1.11 +++ libltdl/argz.c 26 Feb 2008 22:16:15 - @@ -1,6 +1,6 @@ /* argz.c -- argz implementation for non-glibc systems - Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the @@ -76,6 +76,14 @@ } +/* Add a string to the argz vector. */ +error_t +argz_add (char **pargz, size_t *pargz_len, const char *str) +{ + return argz_append (pargz, pargz_len, str, strlen (str) + 1); +} + + error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { @@ -223,3 +231,24 @@ } } } + + +/* Count number of elements (null bytes) in argz vector. */ + +size_t +argz_count (const char *argz, size_t argz_len) +{ + size_t count = 0; + + assert ((argz argz_len) || (!argz !argz_len)); + + while (argz_len 0) +{ + size_t part_len = strlen (argz); + argz += part_len + 1; + argz_len -= part_len + 1; + count++; +} + + return count; +} Index: libltdl/argz_.h === RCS file: /cvsroot/libtool/libtool/libltdl/argz_.h,v retrieving revision 1.8 diff -u -r1.8 argz_.h --- libltdl/argz_.h 25 Apr 2007 21:17:58 - 1.8 +++ libltdl/argz_.h 26 Feb 2008 22:16:15 - @@ -1,6 +1,6 @@ /* lt__argz.h -- internal argz interface for non-glibc systems - Copyright (C) 2004, 2007 Free Software Foundation, Inc. + Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the @@ -49,6 +49,8 @@ LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); +LT_SCOPE error_t argz_add (char **pargz, size_t *pargz_len, + const char *str); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, @@ -56,6 +58,7 @@ LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); +LT_SCOPE size_t argz_count (const char *argz, size_t argz_len); #if defined(__cplusplus) }
Re: Convenience libraries build both PIC and non-PIC regardless of -static?
Ralf Wildenhues wrote: With CVS HEAD Libtool, try libconvenience_la_CXXFLAGS = -static or with either HEAD or 1.5.x, and Automake = 1.10, try libconvenience_la_LIBTOOLFLAGS = --tag=disable-shared Hope that helps. Thanks, that did the trick. ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: linking a C program with a C++ library on Solaris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Ralf Wildenhues on 2/25/2008 11:58 PM: | I believe that backward compatability has been mostly respected. | | Yes, but just running libtoolize has never been enough. Running aclocal | (with Libtool 2.2's macro files visible to aclocal) to get the new macro | definitions is also needed; autoreconf -vf takes care of both. Although when upgrading m4 to a newer version of libtool, we noticed that autoreconf runs aclocal prior to libtoolize, which is probably the wrong order. We still need to investigate whether autoconf should switch that order. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHxA5F84KuGfSFAYARApRpAJ9CnHD52M7j6q4D/9rDcRvNSrcx/wCgjAf1 yCIHq+W/XhBt2kTissBpimc= =g9Gz -END PGP SIGNATURE- ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: linking a C program with a C++ library on Solaris
Hi Eric, * Eric Blake wrote on Tue, Feb 26, 2008 at 02:04:05PM CET: According to Ralf Wildenhues on 2/25/2008 11:58 PM: | I believe that backward compatability has been mostly respected. | | Yes, but just running libtoolize has never been enough. Running aclocal | (with Libtool 2.2's macro files visible to aclocal) to get the new macro | definitions is also needed; autoreconf -vf takes care of both. Although when upgrading m4 to a newer version of libtool, we noticed that autoreconf runs aclocal prior to libtoolize, which is probably the wrong order. We still need to investigate whether autoconf should switch that order. autoreconf should run aclocal both before and after libtoolize. It does a certain amount of short-cutting, though. If there is a bug you can reproduce (time stamps are important!) I'm all ears. Cheers, Ralf ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: linking a C program with a C++ library on Solaris
In regard to: Re: linking a C program with a C++ library on Solaris, Ralf...: Hello Bob, Tim, * Bob Friesenhahn wrote on Tue, Feb 26, 2008 at 03:11:44AM CET: On Mon, 25 Feb 2008, Tim Mooney wrote: I don't see anything in 2.1b's info files or README or NEWS for updating a project from 1.5.x to 2.2. I assume that means that there's nothing a project maintainer needs to do other than to re-libtoolize his or her project? I believe that backward compatability has been mostly respected. Yes, but just running libtoolize has never been enough. Absolutely -- I guess I was just implying the aclocal run too, though I should have been more explicit. My main question was whether any new macros needed to be called, or old ones needed to change how they're called, and it looks like that's generally not needed, which is great news. Running aclocal (with Libtool 2.2's macro files visible to aclocal) to get the new macro definitions is also needed; autoreconf -vf takes care of both. As a subsequent poster has mentioned, I've also noticed that autoreconf typically only runs aclocal *before* libtoolize, which struck me as odd when I noticed it. I'm not saying that autoreconf's behavior is broken, since I've only used it a few times and have never noticed a problem because of this unexpected order in which it runs the commands. I was just surprised at the order it has used on the few occasions that I've used it. Tim -- Tim Mooney [EMAIL PROTECTED] Information Technology Services (701) 231-1076 (Voice) Room 242-J6, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164 ___ http://lists.gnu.org/mailman/listinfo/libtool