From: SourceForge.net <no...@so...> - 2005-02-16 20:10:57
|
Bugs item #1123741, was opened at 2005-02-16 03:01 Message generated for change (Comment added) made by nhorman You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1123741&group_id=4664 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Neil Horman (nhorman) Summary: [Solaris 9 x386] no KEY_RESIZE in curses.h Initial Comment: Cscope does not compile with following error : ... make[2]: Entering directory `/usr/cscope/src' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT command.o -MD -MP -MF ".deps/command.Tpo" -c -o command.o `test -f 'command.c' || echo './'`command.c; then mv -f ".deps/command.Tpo" ".deps/command.Po"; else rm -f ".deps/command.Tpo"; exit 1; fi command.c: In function `command': command.c:414: error: `KEY_RESIZE' undeclared (first use in this function) command.c:414: error: (Each undeclared identifier is reported only once command.c:414: error: for each function it appears in.) make[2]: *** [command.o] Error 1 make[2]: Leaving directory `/usr/cscope/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/cscope' make: *** [all] Error 2 uname -a SunOS moscou 5.9 Generic_117172-12 i86pc i386 i86pc REMARK : After defining KEY_RESIZE to a dummy value (0403) in constant.h and main.c, everything works fine (except resizing I don't want to test). But, I don't know to which value it should be set on a PC... ---------------------------------------------------------------------- >Comment By: Neil Horman (nhorman) Date: 2005-02-16 15:10 Message: Logged In: YES user_id=827328 man I'm throwing gutter balls today.... I made the changes to command.c as I should have, but forgot to copy command.c to command.c.orig, so gendiff didn't pick up the changes. Dang it. Here's the patch I'm checking in. ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 15:07 Message: Logged In: YES user_id=27517 "Version 3" of the patch touches only main.c, not command.c. You really should be using cscope to make sure you find all occurences of KEY_RESIZE that need to be addressed ;-> Other than that, it's fine. [And config.h.in regeneration should work better, not worse, if you're building directly in the source tree. Please report what happens if you rm cscope.h.in; make in an already configured source tree. If you remove it before running configure, you'll of course have to run 'autoheader' or 'autoreconf' yourself, since there's no Makefile yet to do it for you...] ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 14:18 Message: Logged In: YES user_id=827328 My autoconf setup is just fine. I was building in the same directory as the source, that was probably the issue, I'll check in a bit. Either way, just keying off of KEY_RESIZE is good for me. New patch attached. If you like it, I'll check it in. ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 13:41 Message: Logged In: YES user_id=27517 Given what you report, I must vote against immediate checkin. If your current source tree and build platform can't rebuild a lost config.h.in, that's a sure sign you've broken something. Like: your build system is missing a usable automake installation, or my worries about you patching config.h.in were justified. I can remove config.h.in here, and just re-"make" (even though I build in a directory other than the main source directory), and everything works just as it should --- config.h.in is regenerated. Look at the first line of config.h.in: what's written there is true. As to the test: I've changed my mind: we don't need a test at all --- KEY_RESIZE itself is the test macro. I.e. instead of #ifdef HAVE_KEY_RESIZE just write #ifdef KEY_RESIZE Trivial, once you saw it ;-> ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 12:58 Message: Logged In: YES user_id=827328 New version of the patch attached. HAS_KEY_RESIZE renamed to HAVE_KEY_RESIZE. Unless there are other objections to this I'll check it in. Also, I confirmed that if I remove config.h.in, the build breaks, it needed for configure to work properly, and must have HAVE_KEY_RESIZE added to it. ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 12:44 Message: Logged In: YES user_id=827328 *) I understand and agree with you're concern regarding AC_EGREP_RAW. Unfortunately the only other predefined egrep macros I'm aware of is AC_EGREP_CPP and AC_EGREP_HEADER (a derivative of AC_EGREP_CPP). Since both of the latter macros grep for a value by passing them through the C preprocessor (ostensibly to draw in any nested includes), searching for a #define macro is useless, as they are stripped by cpp. The result is always false on the grep. Thats why I made AC_EGREP_RAW. To be honest, I think its a deficiency in autoconf, and AC_EGREP_RAW should probably be inlcuded in general.m4 with autoconf, but until then, unless you know of another pre-defined grep macro, I think we're stuck. I also don't believe that config.h.in is auto-generated. config.h is definately auto-generated, but config.h.in is its template, much like Makefile.in is the template for Makefile. I'll rework the patch and repost. As for the sigaction stuff, I'm happy to re-work that, but unless you object, I'd just as soon do that in another bug, to avoid convoluting this one. I'll rename the test macro, and repost the patch ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 12:09 Message: Logged In: YES user_id=27517 Just some cosmetic/technical changes I would like to see before this can go to CVS: *) I'm a bit uncomfortable with AC_EGREP_RAW --- is there really no predefined autoconf macro you could use instead of rolling your own? *) The test macro should be renamed to HAVE_KEY_RESIZE, to match the usual auto-foo naming scheme. *) patching config.h.in is pointless --- it's a generated file. And one other thing I noticed only now: you used sigaction() and friends to install your signal handler, but all the rest of cscope still makes do with plain old signal(). This could hamper portability quite a bit. In particular, I'm worried about the DJGPP port. ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 11:30 Message: Logged In: YES user_id=827328 heres a first stab at a patch to fix this break. When configure finds an (n)curses header it greps it for KEY_RESIZE. If found it sets HAS_KEY_RESIZE in config.h. This in turn can be tested from the appropriate places in the code to see if we can support window resizing. I tested it here by removing KEY_RESIZE from my ncurses.h file, and building/runing. Works fine for me, but I'd rather have the bug reported give it a test as well if possible. Hans, any thoughts from you? ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 08:22 Message: Logged In: YES user_id=827328 I agree that proposal (b) is not a great idea, and that some variant of (a) is probably the best way to fix this. I'll work up a patch for and post it here ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 07:45 Message: Logged In: YES user_id=27517 > Interestingly, both the versions of ncurses.h and the > version of curses.h that I have define KEY_RESIZE Odds are that's because they're the same file ;-) That's the usual situation on Linux boxes. As to proposal b): that's a bad idea, I think. We have no way of knowing whether 0632 is already used by some other random implementation of curses or not. It may be worth considering a configure test for KEY_RESIZE itself, rather than assuming USE_NCURSES --> HAVE_KEY_RESIZE. ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2005-02-16 07:24 Message: Logged In: YES user_id=827328 Crud. Well, the easies thing to do I suppose teh best way to go here is to either: a) put a USE_NCURSES ifdef around the KEY_RESIZE case in command, and in around the signal registration code. b)add a #ifndef KEY_RESIZE #define KEY_RESIZE 0632 #endif to the globals header file so that this will all just work. Interestingly, both the versions of ncurses.h and the version of curses.h that I have define KEY_RESIZE. This may also be nothing more than than an old version of curses which has not yet defined KEY_RESIZE. To the bug reporter: can you send in your config.log? ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 06:14 Message: Logged In: YES user_id=27517 Sorry, that "Zoran:" was of course directed to the poster of this bug (anonymous). Confusion by too many projects in parallel. ---------------------------------------------------------------------- Comment By: Hans-Bernhard Broeker (broeker) Date: 2005-02-16 06:09 Message: Logged In: YES user_id=27517 Well, Neil, looks like my hesitation about the SIGWINCH handling stuff being ncurses-only was correct ... Zoran: could you please add some details to this report? Most importantly, I think we need to know what your curses library is (the relevant part of "config.log" should be helpful). We may just get away with flatly disabling this part of the code, but that might bring you back the bug this was intended to fix. So please check: does resizing your xterm with the newly built cscope running in it (in full-screen curses mode) crash you out of cscope? ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-02-16 03:11 Message: Logged In: NO I forgot to tell that : cscope: version 16.0a ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2005-02-16 03:09 Message: Logged In: NO Ooops, I forgot to tell that I downloaded cscope today via CVS, so my version is : cscope: version 16.0a ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1123741&group_id=4664 |