[PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at
Hi! I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both ok with the __declspec() notation. On MSVC, the test goes from skip to fail, as it needs 2/2. Cheers, Peter From 52972128c5952da628e033e4509208711906c3a2 Mon Sep 17 00:00:00 2001 From: Peter Rosin p...@lysator.liu.se Date: Mon, 20 Sep 2010 09:07:25 +0200 Subject: [PATCH 1/2] tests: __declspec (dll{ex,im}port) in tests/exceptions.at * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use __declspec (dllimport) and __declspec (dllexport) instead of the less portable __attribute__ ((dllimport)) and __attribute__ ((dllexport)). Makes the test compile on MSVC. Signed-off-by: Peter Rosin p...@lysator.liu.se --- ChangeLog |8 tests/exceptions.at | 17 - 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78d3e48..3c72890 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-09-20 Peter Rosin p...@lysator.liu.se + + tests: __declspec (dll{ex,im}port) in tests/exceptions.at + * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use + __declspec (dllimport) and __declspec (dllexport) instead of + the less portable __attribute__ ((dllimport)) and + __attribute__ ((dllexport)). Makes the test compile on MSVC. + 2010-09-19 Peter Rosin p...@lysator.liu.se tests: Import items from liba1 for MSVC. diff --git a/tests/exceptions.at b/tests/exceptions.at index 235597c..286b2ac 100644 --- a/tests/exceptions.at +++ b/tests/exceptions.at @@ -66,9 +66,8 @@ CPPFLAGS=$LTDLINCL $CPPFLAGS # the regex). However, in this test, none of these situations apply, # so we don't directly address it. Otherwise, the correct mechanism # would be to avoid all of those flags, and instead explicitly decorate -# all symbols with appropriate __attribute__ ((dllexport)) or -# __attribute__ ((dllimport)) flags when building the DLLs and the -# clients. +# all symbols with appropriate __declspec (dllexport) or +# __declspec (dllimport) flags when building the DLLs and the clients. # # For more information, see these two threads: # http://lists.gnu.org/archive/html/bug-libtool/2010-06/msg00069.html @@ -84,9 +83,9 @@ AT_DATA([common.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_COMMON_DLL) # if defined(LIBTOOL_TEST_IN_COMMON) -# define COMMON_IMPEXP __attribute__ ((dllexport)) +# define COMMON_IMPEXP __declspec (dllexport) # else -# define COMMON_IMPEXP __attribute__ ((dllimport)) +# define COMMON_IMPEXP __declspec (dllimport) # endif # else # define COMMON_IMPEXP @@ -128,9 +127,9 @@ AT_DATA([module.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_MODULE_DLL) # if defined(LIBTOOL_TEST_IN_MODULE) -# define MODULE_IMPEXP __attribute__ ((dllexport)) +# define MODULE_IMPEXP __declspec (dllexport) # else -# define MODULE_IMPEXP __attribute__ ((dllimport)) +# define MODULE_IMPEXP __declspec (dllimport) # endif # else # define MODULE_IMPEXP @@ -174,9 +173,9 @@ AT_DATA([lib.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_LIB_DLL) # if defined(LIBTOOL_TEST_IN_LIB) -# define LIB_IMPEXP __attribute__ ((dllexport)) +# define LIB_IMPEXP __declspec (dllexport) # else -# define LIB_IMPEXP __attribute__ ((dllimport)) +# define LIB_IMPEXP __declspec (dllimport) # endif # else # define LIB_IMPEXP -- 1.7.1
Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at
On Mon, 20 Sep 2010, Peter Rosin wrote: Hi! I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both ok with the __declspec() notation. On MSVC, the test goes from skip to fail, as it needs 2/2. This patch looks good to apply, as does the 2/2 patch to make sure that lt__PROGRAM__LTX_preloaded_symbols is globally scoped and extern C. Bob Cheers, Peter From 52972128c5952da628e033e4509208711906c3a2 Mon Sep 17 00:00:00 2001 From: Peter Rosin p...@lysator.liu.se Date: Mon, 20 Sep 2010 09:07:25 +0200 Subject: [PATCH 1/2] tests: __declspec (dll{ex,im}port) in tests/exceptions.at * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use __declspec (dllimport) and __declspec (dllexport) instead of the less portable __attribute__ ((dllimport)) and __attribute__ ((dllexport)). Makes the test compile on MSVC. Signed-off-by: Peter Rosin p...@lysator.liu.se --- ChangeLog |8 tests/exceptions.at | 17 - 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78d3e48..3c72890 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-09-20 Peter Rosin p...@lysator.liu.se + + tests: __declspec (dll{ex,im}port) in tests/exceptions.at + * tests/exceptions.at (common.h, module.h, lib.h) [w32]: Use + __declspec (dllimport) and __declspec (dllexport) instead of + the less portable __attribute__ ((dllimport)) and + __attribute__ ((dllexport)). Makes the test compile on MSVC. + 2010-09-19 Peter Rosin p...@lysator.liu.se tests: Import items from liba1 for MSVC. diff --git a/tests/exceptions.at b/tests/exceptions.at index 235597c..286b2ac 100644 --- a/tests/exceptions.at +++ b/tests/exceptions.at @@ -66,9 +66,8 @@ CPPFLAGS=$LTDLINCL $CPPFLAGS # the regex). However, in this test, none of these situations apply, # so we don't directly address it. Otherwise, the correct mechanism # would be to avoid all of those flags, and instead explicitly decorate -# all symbols with appropriate __attribute__ ((dllexport)) or -# __attribute__ ((dllimport)) flags when building the DLLs and the -# clients. +# all symbols with appropriate __declspec (dllexport) or +# __declspec (dllimport) flags when building the DLLs and the clients. # # For more information, see these two threads: # http://lists.gnu.org/archive/html/bug-libtool/2010-06/msg00069.html @@ -84,9 +83,9 @@ AT_DATA([common.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_COMMON_DLL) # if defined(LIBTOOL_TEST_IN_COMMON) -# define COMMON_IMPEXP __attribute__ ((dllexport)) +# define COMMON_IMPEXP __declspec (dllexport) # else -# define COMMON_IMPEXP __attribute__ ((dllimport)) +# define COMMON_IMPEXP __declspec (dllimport) # endif # else # define COMMON_IMPEXP @@ -128,9 +127,9 @@ AT_DATA([module.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_MODULE_DLL) # if defined(LIBTOOL_TEST_IN_MODULE) -# define MODULE_IMPEXP __attribute__ ((dllexport)) +# define MODULE_IMPEXP __declspec (dllexport) # else -# define MODULE_IMPEXP __attribute__ ((dllimport)) +# define MODULE_IMPEXP __declspec (dllimport) # endif # else # define MODULE_IMPEXP @@ -174,9 +173,9 @@ AT_DATA([lib.h], #if defined(__CYGWIN__) || defined(_WIN32) # if defined(DLL_EXPORT) || defined(USING_LIB_DLL) # if defined(LIBTOOL_TEST_IN_LIB) -# define LIB_IMPEXP __attribute__ ((dllexport)) +# define LIB_IMPEXP __declspec (dllexport) # else -# define LIB_IMPEXP __attribute__ ((dllimport)) +# define LIB_IMPEXP __declspec (dllimport) # endif # else # define LIB_IMPEXP -- Bob Friesenhahn bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Re: [PATCH 1/2] tests: __declspec (dll{ex, im}port) in tests/exceptions.at
Hi Bob, Den 2010-09-20 17:57 skrev Bob Friesenhahn: On Mon, 20 Sep 2010, Peter Rosin wrote: I have tested this patch on MinGW/gcc and Cygwin/gcc and they are both ok with the __declspec() notation. On MSVC, the test goes from skip to fail, as it needs 2/2. This patch looks good to apply, as does the 2/2 patch to make sure that lt__PROGRAM__LTX_preloaded_symbols is globally scoped and extern C. Both pushed, thanks for looking them over! Cheers, Peter
Re: [PATCH 6/6] maint: use sed instead of maintaining 2 README files.
Hello Gary, * Gary V. Vaughan wrote on Sun, Sep 19, 2010 at 05:46:25AM CEST: On 18 Sep 2010, at 13:40, Ralf Wildenhues wrote: * Gary V. Vaughan wrote on Sat, Sep 18, 2010 at 07:20:18AM CEST: + sed -e '/^This is GNU Libtool,/,/^interface.$/c\ +This is an alpha testing release of GNU Libtool, a generic library\ +support script. Libtool hides the complexity of using shared libraries\ +behind a consistent, portable interface.' $file $file.T \ this script will wrongly exit with status 0 if the stdout redirection fails at this point. Ah, true. I was trying to keep the script simple, and overdid it a bit. In light of that, and my having noticed that the script also didn't complain if sed was unable to match any text to edit, I've now improved the script thus: Well, your improvements: # Make sure the paragraph we are matching has not been edited since # this script was written. matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \ |wc -l |sed 's|^ *||'` test 3 = $matched \ || func_fatal_error $file format has changed, please fix \`$0' actually caused a regression: this code will cause 'make distcheck' to fail, because at 'make dist' time the file will be rewritten before being added to the tarball (if the version doesn't indicate a stable release), then when distcheck tries to create yet another tarball, the above check will catch: | case 2.2.11a in \ | *[a-z]) /bin/sh ../libltdl/config/edit-readme-alpha libtool-2.2.11a/README ;; \ | esac | edit-readme-alpha: libtool-2.2.11a/README format has changed, please fix `../libltdl/config/edit-readme-alpha' | make[3]: *** [dist-hook] Error 1 | make[3]: *** Waiting for unfinished jobs Cheers, Ralf
[PATCH] build: ship autobuild.m4, to reduce bootstrap requirement
Shipping a copy of autobuild.m4 makes it so that users need not pre-install autobuild just for aclocal to find the macro AB_INIT. * libltdl/m4/.gitignore: Drop autobuild.m4. * libltdl/m4/autobuild.m4: New file, copied from autobuild. * configure.ac (AB_INIT): Unconditionally call it. Signed-off-by: Eric Blake ebl...@redhat.com --- Be sure to *not* list autobuild.m4 anywhere else, e.g., in Makefile.am. It is picked up automatically. You can make the AB_INIT call in configure.ac unconditional, but then again, no loss in leaving it as it is. I've tested that 'make dist' does include autobuild.m4. ChangeLog |7 +++ configure.ac|3 +-- libltdl/m4/.gitignore |1 - libltdl/m4/autobuild.m4 | 40 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 libltdl/m4/autobuild.m4 diff --git a/ChangeLog b/ChangeLog index 8ed47f7..d468552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-09-20 Eric Blake ebl...@redhat.com + + build: ship autobuild.m4, to reduce bootstrap requirement + * libltdl/m4/.gitignore: Drop autobuild.m4. + * libltdl/m4/autobuild.m4: New file, copied from autobuild. + * configure.ac (AB_INIT): Unconditionally call it. + 2010-09-20 Peter Rosin p...@lysator.liu.se Ralf Wildenhues ralf.wildenh...@gmx.de diff --git a/configure.ac b/configure.ac index 0fcf109..131cd3b 100644 --- a/configure.ac +++ b/configure.ac @@ -138,8 +138,7 @@ AM_INIT_AUTOMAKE([1.11.1 gnu subdir-objects dist-xz color-tests parallel-tests]) # string for this build. : ${autobuild_mode=default} AB_VERSION=AC_PACKAGE_VERSION ($TIMESTAMP) -m4_ifdef([AB_INIT], -[AB_INIT([$autobuild_mode])]) +AB_INIT([$autobuild_mode]) dnl We use m4sh to generate libtool's portable shell scripts diff --git a/libltdl/m4/.gitignore b/libltdl/m4/.gitignore index 81a1059..0b52c5c 100644 --- a/libltdl/m4/.gitignore +++ b/libltdl/m4/.gitignore @@ -1,2 +1 @@ ltversion.m4 -autobuild.m4 diff --git a/libltdl/m4/autobuild.m4 b/libltdl/m4/autobuild.m4 new file mode 100644 index 000..93ccb54 --- /dev/null +++ b/libltdl/m4/autobuild.m4 @@ -0,0 +1,40 @@ +# autobuild.m4 serial 7 +dnl Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +dnl Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# Usage: AB_INIT([MODE]). +AC_DEFUN([AB_INIT], +[ + AC_REQUIRE([AC_CANONICAL_BUILD]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + if test -z $AB_PACKAGE; then +AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE} + fi + AC_MSG_NOTICE([autobuild project... $AB_PACKAGE]) + + if test -z $AB_VERSION; then +AB_VERSION=${PACKAGE_VERSION:-$VERSION} + fi + AC_MSG_NOTICE([autobuild revision... $AB_VERSION]) + + hostname=`hostname` + if test $hostname; then +AC_MSG_NOTICE([autobuild hostname... $hostname]) + fi + + ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])]) + + date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ` + if test $? != 0; then +date=`date` + fi + if test $date; then +AC_MSG_NOTICE([autobuild timestamp... $date]) + fi +]) -- 1.7.2.3
Re: [PATCH] build: ship autobuild.m4, to reduce bootstrap requirement
On 09/20/2010 12:44 PM, Ralf Wildenhues wrote: * Eric Blake wrote on Mon, Sep 20, 2010 at 08:13:25PM CEST: Shipping a copy of autobuild.m4 makes it so that users need not pre-install autobuild just for aclocal to find the macro AB_INIT. * libltdl/m4/.gitignore: Drop autobuild.m4. * libltdl/m4/autobuild.m4: New file, copied from autobuild. * configure.ac (AB_INIT): Unconditionally call it. OK thanks! Pushed. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org
Re: libtool does not recognize lib64 -- Update to Olly Betts' patch
On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote: Greetings. I package software for Fedora and frequently get hit with /usr/lib64 being added as an rpath in builds. I found what I think is the last thread on this subject here: http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html In the second message, Olly Betts links to a message from 2007 where he proposed a patch that would solve this by parsing the output of /sbin/ldconfig rather than trying to parse /etc/ld.so.conf. The thread ended with a positive view of the patch and a request to update the patch for current libtool. This last step doesn't appear to have happened. Since I care about this issue, I've gone ahead and ported the patch to current git master. I'm attaching it here. Anything I need to do to get this looked at? Thanks, -Toshio pgpbSNk4aRWEo.pgp Description: PGP signature
Re: libtool does not recognize lib64 -- Update to Olly Betts' patch
* Toshio Kuratomi wrote on Mon, Sep 20, 2010 at 10:20:09PM CEST: On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote: Greetings. I package software for Fedora and frequently get hit with /usr/lib64 being added as an rpath in builds. I found what I think is the last thread on this subject here: http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html In the second message, Olly Betts links to a message from 2007 where he proposed a patch that would solve this by parsing the output of /sbin/ldconfig rather than trying to parse /etc/ld.so.conf. The thread ended with a positive view of the patch and a request to update the patch for current libtool. This last step doesn't appear to have happened. Since I care about this issue, I've gone ahead and ported the patch to current git master. I'm attaching it here. Anything I need to do to get this looked at? I'm looking at it. The patch has issues, the approach itself has issues too, and is definitely not ready for the upcoming release. Details when I have them sorted out. Thanks, Ralf
[PATCH] maint: drop autobuild requirement
* HACKING: Update. Signed-off-by: Eric Blake ebl...@redhat.com --- I'm pushing this under the obvious rule, given that the whole point of my previous patch was to remove this dependency, and since this is a docs-only patch. ChangeLog |3 +++ HACKING |4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d468552..ceb193c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2010-09-20 Eric Blake ebl...@redhat.com + maint: drop autobuild requirement + * HACKING: Update. + build: ship autobuild.m4, to reduce bootstrap requirement * libltdl/m4/.gitignore: Drop autobuild.m4. * libltdl/m4/autobuild.m4: New file, copied from autobuild. diff --git a/HACKING b/HACKING index d36b7f0..977be10 100644 --- a/HACKING +++ b/HACKING @@ -602,9 +602,7 @@ or obtained by writing to the Free Software Foundation, Inc., (esp. bug-libtool) for outstanding bug reports also in the list of pending moderation requests. -* Make sure you have wget, xz, and autobuild installed. aclocal should be - able to find autobuild.m4; or you can install it into the tree with - aclocal -I libltdl/m4 --install +* Make sure you have wget and xz installed. * Make sure your locale is sane, e.g. by exporting LC_ALL=C. -- 1.7.2.3
Re: libtool does not recognize lib64 -- Update to Olly Betts' patch
On Mon, Sep 20, 2010 at 10:25:06PM +0200, Ralf Wildenhues wrote: * Toshio Kuratomi wrote on Mon, Sep 20, 2010 at 10:20:09PM CEST: On Sat, Sep 11, 2010 at 04:04:04PM -0400, Toshio Kuratomi wrote: Greetings. I package software for Fedora and frequently get hit with /usr/lib64 being added as an rpath in builds. I found what I think is the last thread on this subject here: http://lists.gnu.org/archive/html/libtool-patches/2010-06/msg00141.html In the second message, Olly Betts links to a message from 2007 where he proposed a patch that would solve this by parsing the output of /sbin/ldconfig rather than trying to parse /etc/ld.so.conf. The thread ended with a positive view of the patch and a request to update the patch for current libtool. This last step doesn't appear to have happened. Since I care about this issue, I've gone ahead and ported the patch to current git master. I'm attaching it here. Anything I need to do to get this looked at? I'm looking at it. The patch has issues, the approach itself has issues too, and is definitely not ready for the upcoming release. Details when I have them sorted out. No problem, thsanks for looking. /me Awaits list of things to work on :-) -Toshio pgpkEjZo5lfik.pgp Description: PGP signature
Re: [PATCH] Skip need_lib_prefix.at on systems without lib prefix on libraries.
Peter Rosin wrote: Den 2010-09-18 00:04 skrev Roumen Petrov: Hi Peter, Peter Rosin wrote: Hi! need_lib_prefix.at currently fails with MSVC. Hmm probably test fail as shared library is build without -no-undefined flag. Did libtool MSC allow creation of shared libraries without -no-undefined ? On windows platforms (msc, gcc(mingw*)) may be the test require some PATH magics. (as example like func_fix_path from static.at test) You are barking up the wrong tree, since: 1. The test passes on MinGW and Cygwin with gcc, if wouldn't do that if -no-undefined was the cause of the fail. 2. The patch in the old quoted message makes the test pass on MSVC, which it wouldn't do if -no-undefined was the cause of the fail. PATH magic is not relevant if -no-undefined is not passed, since everything should be static in that case (no dlls created). But the libtool command contain -rpath so the test build shared and static libraries . 1) linux native build: $ cd .../testsuite.dir/086 $ strace -f ./main 21 | grep foo open(/.libs/tls/i686/libfoo1.so, O_RDONLY) = -1 ENOENT (No such file or directory) open(/.libs/tls/libfoo1.so, O_RDONLY) = -1 ENOENT (No such file or directory) open(/.libs/i686/libfoo1.so, O_RDONLY) = -1 ENOENT (No such file or directory) open(/.libs/libfoo1.so, O_RDONLY) = 3 open(/.libs/libfoo2.so, O_RDONLY) = 3 write(1, libfoo1: 2\nlibfoo2: 3\n, 22libfoo1: 2 libfoo2: 3 $ ls .../testsuite.dir/086/.libs/ foo1.la@ foo1.lai foo1.o foo2.o libfoo1.a libfoo1.so* libfoo2.a libfoo2.la@ libfoo2.lai libfoo2.so* lt-main* main* mainS.o Result test pass. Both static and shared libraries are created. The executable load shared. 2) In cross-build env. verbose more: libtool: link: ( cd .libs rm -f foo1.la ln -s ../foo1.la foo1.la ) /X/need_lib_prefix.at:165: $LIBTOOL --mode=link $CC -module -avoid-version $CFLAGS $LDFLAGS -o libfoo2.la foo2.lo -rpath $instdir/lib stderr: libtool: link: warning: undefined symbols not allowed in i386-pc-mingw32msvc shared libraries $ ls .libs/ foo1.la@ foo1.lai foo1.o foo2.o libfoo1.a libfoo2.a libfoo2.la@ libfoo2.lai lt-main.c main.exe* main.exeS.o main_ltshwrapper Result the test pass. Shared libraries are not created. I'm not convinced that test is correct for windows platforms. 3) In cross-build env. and test patched with -no-undefined : $ ls .libs/ foo1.la@ foo1.o libfoo1.a libfoo1.dll.a libfoo2.dll* libfoo2.la@ lt-main.c main.exeS.o foo1.lai foo2.o libfoo1.dll* libfoo2.a libfoo2.dll.a libfoo2.lai main.exe* main_ltshwrapper Result test skipped = failed. 3.1) $ cd .../testsuite.dir/086/.libs/ $ ./main.exe libfoo2: 3 function `f' not found: Procedure not found error during preloading. $ strace -f ./main.exe 21 | grep foo [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 338] open(/086/.libs/libfoo1.dll, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 78 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] open(/086/.libs/libfoo1.dll, O_RDONLY) = 9 [pid 353] open(/opt/wine/1.3.1/lib/wine/libfoo1.dll.so, O_RDONLY) = -1 ENOENT (No such file or directory) [pid 353] open(/opt/wine/1.3.1/lib/wine/libfoo1.dll.so, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 338] open(/086/.libs/libfoo2.dll, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 79 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755, st_size=809656, ...}) = 0 [pid 353] open(/086/.libs/libfoo2.dll, O_RDONLY) = 9 [pid 353] open(/opt/wine/1.3.1/lib/wine/libfoo2.dll.so, O_RDONLY) = -1 ENOENT (No such file or directory) [pid 353] open(/opt/wine/1.3.1/lib/wine/libfoo2.dll.so, O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo1.dll, {st_mode=S_IFREG|0755, st_size=809650, ...}) = 0 [pid 353] stat64(/086/.libs/libfoo2.dll, {st_mode=S_IFREG|0755,
[PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.
Hallo Ralf, On 21 Sep 2010, at 00:34, Ralf Wildenhues wrote: a regression: this code will cause 'make distcheck' to fail, because at 'make dist' time the file will be rewritten before being added to the tarball (if the version doesn't indicate a stable release), then when distcheck tries to create yet another tarball, the above check will catch: | case 2.2.11a in \ | *[a-z]) /bin/sh ../libltdl/config/edit-readme-alpha libtool-2.2.11a/README ;; \ | esac | edit-readme-alpha: libtool-2.2.11a/README format has changed, please fix `../libltdl/config/edit-readme-alpha' | make[3]: *** [dist-hook] Error 1 | make[3]: *** Waiting for unfinished jobs Ah. D'oh. Well, it does at least show that the script interacts correctly with an error for make to help catch the case where someone commits a change to the first paragraph of README without a matching edit to the sed expressions in edit-readme-alpha. Here is (an overkill) patch to not exit with an error, so that `make distcheck' can complete. Okay to push? * libltdl/config/edit-readme-alpha: If README is non-writable assume that it is being run from distcheck, and bail out with a warning (to help diagnose cases where the heuristic is not correct). However, if README has already been edited to the alpha text, quietly skip without an error message. --- ChangeLog|9 + libltdl/config/edit-readme-alpha | 15 ++- 2 files changed, 23 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceb193c..342c2ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-21 Gary V. Vaughan g...@gnu.org + + maint: edit-readme-alpha shouldn't try to re-edit during dist. + * libltdl/config/edit-readme-alpha: If README is non-writable + assume that it is being run from distcheck, and bail out with + a warning (to help diagnose cases where the heuristic is not + correct). However, if README has already been edited to the + alpha text, quietly skip without an error message. + 2010-09-20 Eric Blake ebl...@redhat.com maint: drop autobuild requirement diff --git a/libltdl/config/edit-readme-alpha b/libltdl/config/edit-readme-alpha index 6070a31..c60fbc0 100755 --- a/libltdl/config/edit-readme-alpha +++ b/libltdl/config/edit-readme-alpha @@ -55,10 +55,23 @@ func_fatal_error () for file in $@; do + # Assume that read-only README indicates that we are running inside + # the latter part of a `make distcheck'. + test -w $file || { +echo $progname: not editing non-writeable \`$file' (distcheck?) +continue + } + # Make sure the paragraph we are matching has not been edited since # this script was written. - matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \ + matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \ |wc -l |sed 's|^ *||'` + + # Unless, of course, it was edited by this script already. + test 3 = $matched \ + || matched=`sed -n -e '/^This is an alpha testing release/,/behind a consistent, portable interface\.$/p' $file \ + |wc -l |sed 's|^ *||'` + test 3 = $matched \ || func_fatal_error $file format has changed, please fix \`$0' -- 1.7.2.2
Re: [PATCH] maint: edit-readme-alpha shouldn't try to re-edit during dist.
Hi Gary, * Gary V. Vaughan wrote on Tue, Sep 21, 2010 at 03:05:46AM CEST: Well, it does at least show that the script interacts correctly with an error for make to help catch the case where someone commits a change to the first paragraph of README without a matching edit to the sed expressions in edit-readme-alpha. Here is (an overkill) patch to not exit with an error, so that `make distcheck' can complete. Okay to push? Well, I don't want to appear overly nitpicky for this issue, but if you don't absolutely need to check and skip non-writable files, I wouldn't do it, and rather error out in that case. * libltdl/config/edit-readme-alpha: If README is non-writable assume that it is being run from distcheck, and bail out with a warning FWIW, exiting 0 is not what I'd call bail out. (to help diagnose cases where the heuristic is not correct). However, if README has already been edited to the alpha text, quietly skip without an error message. --- a/libltdl/config/edit-readme-alpha +++ b/libltdl/config/edit-readme-alpha @@ -55,10 +55,23 @@ func_fatal_error () for file in $@; do + # Assume that read-only README indicates that we are running inside + # the latter part of a `make distcheck'. + test -w $file || { +echo $progname: not editing non-writeable \`$file' (distcheck?) If you prefer to, or need to keep the warning+skip, I suggest to print warnings on stderr. +continue + } + # Make sure the paragraph we are matching has not been edited since # this script was written. - matched=`sed -n -e '/^This is GNU Libtool,/,/^interface.$/p' $file \ + matched=`sed -n -e '/^This is GNU Libtool,/,/^interface\.$/p' $file \ |wc -l |sed 's|^ *||'` + + # Unless, of course, it was edited by this script already. + test 3 = $matched \ + || matched=`sed -n -e '/^This is an alpha testing release/,/behind a consistent, portable interface\.$/p' $file \ + |wc -l |sed 's|^ *||'` Indentation is a bit weird here, I'd have expected the | to align one after the ` in the line above. + test 3 = $matched \ || func_fatal_error $file format has changed, please fix \`$0' Thanks, Ralf