Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-12-20 Thread Chris Pickett

Chris Pickett wrote:
And, I've applied Loïc's AC_INCLUDES_DEFAULT patch to my local 
repository, r5551.


I noticed that bug 342864 is still open.  It's been closed in a released 
version of Check since 0.9.4.


Cheers,
Chris



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-19 Thread Robert Collins
On Sat, 2006-03-18 at 23:17 -0500, Chris Pickett wrote:
 Robert Collins wrote:
 
  CFLAGS=-Werror may not have optimisations enabled in gcc - many
  warnings are disabled. Can you reproduce with CFLAGS=-Werror -O2 ?
 
 I haven't tried this, but I just wanted to say: I think a lot of the 
 AM_PATH_CHECK macro can be cleaned up or eliminated.  Probably the other 
 things in /usr/share/aclocal can help with that, or a best practice 
 question could be sent to the autoconf list---there might also be hints 
 in the autoconf manual about what to do.  Clearly not every library 
 needs such a macro, given how few macros actually are in 
 /usr/share/aclocal/.
...

Sure but lets not let the perfect be the enemy of the good:

There are two patches now that will correct AM_PATH_CHECK with -Werror
in CFLAGS. Both are improvements, and I'm completely happy with either
being applied which will fix the bug. Additionally, neither make
refactoring or replacing AM_PATH_CHECK later harder - they do not change
its structure or introduce additional complexity.

Rob

-- 
GPG key available at: http://www.robertcollins.net/keys.txt.


signature.asc
Description: This is a digitally signed message part


Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-19 Thread Loïc Minier
On Sun, Mar 19, 2006, Robert Collins wrote:
 Sure but lets not let the perfect be the enemy of the good:
 There are two patches now that will correct AM_PATH_CHECK with -Werror
 in CFLAGS. Both are improvements, and I'm completely happy with either
 being applied which will fix the bug. Additionally, neither make
 refactoring or replacing AM_PATH_CHECK later harder - they do not change
 its structure or introduce additional complexity.

 Exactly.  Please think of backward-compatibility for people using
 AM_PATH_CHECK in their configure.ac.

 The -version mentionned previously doesn't help in the task of
 detecting whether libcheck is available in the build environment.

 What you could *add* to the library is a pkg-config (.pc) file, which
 would permit using pkg-config's macros to check for the availability
 and the version of libcheck (pkg-config now supports the static /
 dynamic linking flags distinction).  That should be in addition to the
 macro (which should simply be deprecated).

-- 
Loïc Minier [EMAIL PROTECTED]



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-19 Thread Chris Pickett

Loïc Minier wrote:

On Sun, Mar 19, 2006, Robert Collins wrote:


Sure but lets not let the perfect be the enemy of the good:
There are two patches now that will correct AM_PATH_CHECK with -Werror
in CFLAGS. Both are improvements, and I'm completely happy with either
being applied which will fix the bug. Additionally, neither make
refactoring or replacing AM_PATH_CHECK later harder - they do not change
its structure or introduce additional complexity.



 Exactly.  Please think of backward-compatibility for people using
 AM_PATH_CHECK in their configure.ac.


Yes, that's quite fair, compatability is certainly more important than 
cleanliness.


These are the things I'd still like done Check 0.9.4:
  -- fix AM_PATH_CHECK
  -- make Check pass its own unit tests: make distcheck fails
  -- use stricter CFLAGS for compiling Check
  -- update the documentation so that the tutorial works
  -- deprecate the old API: Check clobbers things, e.g. fail() in C++

The last version of Check that passed its own unit tests was 0.9.2.


 The -version mentionned previously doesn't help in the task of
 detecting whether libcheck is available in the build environment.

 What you could *add* to the library is a pkg-config (.pc) file, which
 would permit using pkg-config's macros to check for the availability
 and the version of libcheck (pkg-config now supports the static /
 dynamic linking flags distinction).  That should be in addition to the
 macro (which should simply be deprecated).


Thanks, I'll look at pkg-config.  As for deprecating the old macro, 
maybe it's possible then to make it do nothing but print out 
AM_PATH_CHECK is deprecated; it will go away by version 1.0.0.


I just heard from the Check maintainer, he's going to be busy until the 
end of April I think.  But he offered me repository access, so that's good.


Cheers,
Chris


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-19 Thread Chris Pickett

Chris Pickett wrote:

Loïc Minier wrote:


On Sun, Mar 19, 2006, Robert Collins wrote:


Sure but lets not let the perfect be the enemy of the good:
There are two patches now that will correct AM_PATH_CHECK with -Werror
in CFLAGS. Both are improvements, and I'm completely happy with either
being applied which will fix the bug. Additionally, neither make
refactoring or replacing AM_PATH_CHECK later harder - they do not change
its structure or introduce additional complexity.




 Exactly.  Please think of backward-compatibility for people using
 AM_PATH_CHECK in their configure.ac.



Yes, that's quite fair, compatability is certainly more important than 
cleanliness.


And, I've applied Loïc's AC_INCLUDES_DEFAULT patch to my local 
repository, r5551.  My latest version of Check will always be here, 
until SF is sorted out:


http://www.sable.mcgill.ca/~cpicke/public_html/check/

Thanks for the patch, sorry for the whinyness.

Cheers,
Chris


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-18 Thread Loïc Minier
tags #342864 + confirmed upstream patch
stop

Hi,

On Sun, Dec 11, 2005, Robert Collins wrote:
 The AM_PATH_CHECK macro in 0.9.3 fails to build if -Werror -g -O2 is
 used as the CFLAGS during autoconf

 Indeed.

 Note that all that is needed is to add
 #if HAVE_STRING_H
 #include string.h
 #endif
 and it should work fine.

 Hmm, I think it would be cleaner to simply remove all #includes and
 replace them with AC_INCLUDES_DEFAULT([]).

 Robert Lemmen couldn't reproduce the bug, here's how:
cat EOF  configure.ac
AC_INIT(test, 0.0)
AC_PREREQ(2.52)
AM_PATH_CHECK
EOF
aclocal-1.9
autoconf
./configure CFLAGS=-Werror

 Patch attached.

   Cheers,

-- 
Loïc Minier [EMAIL PROTECTED]
Current Earth status:   NOT DESTROYED



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-18 Thread Loïc Minier
On Sat, Mar 18, 2006, Loïc Minier wrote:
  Patch attached.

 Err, hmm.

-- 
Loïc Minier [EMAIL PROTECTED]
Current Earth status:   NOT DESTROYED
--- /usr/share/aclocal/check.m4 2006-01-02 17:55:01.0 +0100
+++ m4/check.m4 2006-03-18 11:16:49.0 +0100
@@ -30,10 +30,7 @@
 LIBS=$CHECK_LIBS $LIBS
 
 rm -f conf.check-test
-AC_TRY_RUN([
-#include stdio.h
-#include stdlib.h
-
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT([])
 #include check.h
 
 int main ()
@@ -81,7 +78,7 @@
 
   return 1;
 }
-],, no_check=yes, [echo $ac_n cross compiling; assumed OK... $ac_c])
+])],, no_check=yes, [echo $ac_n cross compiling; assumed OK... $ac_c])
 
 CFLAGS=$ac_save_CFLAGS
 LIBS=$ac_save_LIBS


Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-18 Thread Robert Collins
On Sat, 2006-03-18 at 11:21 +0100, Loïc Minier wrote:
 tags #342864 + confirmed upstream patch
 stop
 
 Hi,
 
 On Sun, Dec 11, 2005, Robert Collins wrote:
  The AM_PATH_CHECK macro in 0.9.3 fails to build if -Werror -g -O2 is
  used as the CFLAGS during autoconf
 
  Indeed.
 
  Note that all that is needed is to add
  #if HAVE_STRING_H
  #include string.h
  #endif
  and it should work fine.
 
  Hmm, I think it would be cleaner to simply remove all #includes and
  replace them with AC_INCLUDES_DEFAULT([]).
 
  Robert Lemmen couldn't reproduce the bug, here's how:
 cat EOF  configure.ac
 AC_INIT(test, 0.0)
 AC_PREREQ(2.52)
 AM_PATH_CHECK
 EOF
 aclocal-1.9
 autoconf
 ./configure CFLAGS=-Werror

CFLAGS=-Werror may not have optimisations enabled in gcc - many
warnings are disabled. Can you reproduce with CFLAGS=-Werror -O2 ?

Rob

-- 
GPG key available at: http://www.robertcollins.net/keys.txt.


signature.asc
Description: This is a digitally signed message part


Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-18 Thread Loïc Minier
On Sat, Mar 18, 2006, Robert Collins wrote:
   Robert Lemmen couldn't reproduce the bug, here's how:
[...]
  ./configure CFLAGS=-Werror
 
 CFLAGS=-Werror may not have optimisations enabled in gcc - many
 warnings are disabled. Can you reproduce with CFLAGS=-Werror -O2 ?

 Sure, the configure I provided fails under Debian sid (gcc 4.0.3-1)
 with CFLAGS=-Werror and CFLAGS=-Werror -O2.

-- 
Loïc Minier [EMAIL PROTECTED]
Current Earth status:   NOT DESTROYED



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2006-03-18 Thread Chris Pickett

Robert Collins wrote:


CFLAGS=-Werror may not have optimisations enabled in gcc - many
warnings are disabled. Can you reproduce with CFLAGS=-Werror -O2 ?


I haven't tried this, but I just wanted to say: I think a lot of the 
AM_PATH_CHECK macro can be cleaned up or eliminated.  Probably the other 
things in /usr/share/aclocal can help with that, or a best practice 
question could be sent to the autoconf list---there might also be hints 
in the autoconf manual about what to do.  Clearly not every library 
needs such a macro, given how few macros actually are in 
/usr/share/aclocal/.


For instance, using

libcheck_la_LDFLAGS = -version-info x:y:z

or some such thing in Check's Makefile.am is probably the right way to 
manage interface compatability (note that x:y:z here is not 0.9.3 --- 
adl gives some details about when to bump interface numbers in his 
excellent autotools tutorial).


I noticed that check.m4 is in fact very similar to 
/usr/share/aclocal/esd.m4, and esd is probably more stable than Check. 
I wonder if they both came from some common template.


In general, looking for clean solutions or rewrites rather than quick 
hacks (that in reality aren't so quick because they require a lot of 
discussion) is probably the best way to handle Check at this point since 
what I've seen so far of it hasn't aged gracefully.


Cheers,
Chris


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#342864: AM_PATH_CHECK macro fails to build with -Werror

2005-12-11 Thread Robert Collins
package: check
severity: normal

The AM_PATH_CHECK macro in 0.9.3 fails to build if -Werror -g -O2 is
used as the CFLAGS during autoconf:

configure:22065: i486-linux-gnu-gcc -o conftest -Werror -g -O2
conftest.c -lcheck  5
cc1: warnings being treated as errors
conftest.c: In function 'main':
conftest.c:41: warning: incompatible implicit declaration of built-in
function 'strdup'
configure:22068: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME OpenSync
| #define PACKAGE_TARNAME libopensync
| #define PACKAGE_VERSION 0.18
| #define PACKAGE_STRING OpenSync 0.18
| #define PACKAGE_BUGREPORT 
| #define PACKAGE libopensync
| #define VERSION 0.18
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #ifdef __cplusplus
| extern C void std::exit (int) throw (); using std::exit;
| #endif
| #define BUILD_ENGINE 1
| #define ENABLE_DEBUG 1
| #define ENABLE_TRACE 1
| /* end confdefs.h.  */
|
| #include stdio.h
| #include stdlib.h
|
| #include check.h
|
| int main ()
| {
|   int major, minor, micro;
|   char *tmp_version;
|
| 
|   system (touch conf.check-test);
| 
|   /* HP/UX 9 ([EMAIL PROTECTED]) writes to sscanf strings */
|   tmp_version = strdup(0.9.0);
|   if (sscanf(tmp_version, %d.%d.%d, major, minor, micro) != 3) {
|  printf(%s, bad version string\n, 0.9.0);
|  return 1;
|}
| 
|   if ((CHECK_MAJOR_VERSION != check_major_version) ||
|   (CHECK_MINOR_VERSION != check_minor_version) ||
|   (CHECK_MICRO_VERSION != check_micro_version))
| { 
|   printf(\n*** The check header file (version %d.%d.%d) does not
match\n,
|CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION,
CHECK_MICRO_VERSION);
|   printf(*** the check library (version %d.%d.%d).\n,
|check_major_version, check_minor_version,
check_micro_version);
|   return 1;
| } 
|   
|   if ((check_major_version  major) ||
...
configure:22095: result: no
configure:22124: i486-linux-gnu-gcc -o conftest -Werror -g -O2
conftest.c -lcheck  5


Note that all that is needed is to add

#if HAVE_STRING_H
#include string.h
#endif

and it should work fine.

Rob
-- 
GPG key available at: http://www.robertcollins.net/keys.txt.


signature.asc
Description: This is a digitally signed message part