Thread: [q-lang-users] q 7.11 build fails on Mac OS X 10.3.9
Brought to you by:
agraef
From: Ryan S. <rya...@us...> - 2008-06-09 06:04:15
Attachments:
q-on-panther.txt
|
I'm testing software on Mac OS X 10.3.9, and I found that Q 7.11 doesn't compile there. This is on a Power Mac G4 with Xcode 1.5 (gcc 3.3). clib.c: In function `ictowcs': clib.c:587: warning: passing arg 2 of `libiconv' from incompatible pointer type clib.c: In function `icfromwcs': clib.c:608: warning: passing arg 2 of `libiconv' from incompatible pointer type clib.c: In function `__F__clib_glob': clib.c:6077: error: `GLOB_NOMATCH' undeclared (first use in this function) clib.c:6077: error: (Each undeclared identifier is reported only once clib.c:6077: error: for each function it appears in.) |
From: Albert G. <Dr....@t-...> - 2008-06-09 07:57:10
|
Ryan Schmidt wrote: > clib.c:6077: error: `GLOB_NOMATCH' undeclared (first use in this function) > clib.c:6077: error: (Each undeclared identifier is reported only once > clib.c:6077: error: for each function it appears in.) GLOB_NOMATCH is required by POSIX, so it looks like the local glob implementation is broken or too old. What does your 10.3.9 glob(3) manpage say about the return value of glob()? Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-09 08:46:26
Attachments:
Mac_OS_X_10.3.9_man_3_glob.txt
|
On Jun 9, 2008, at 02:56, Albert Graef wrote: > Ryan Schmidt wrote: > >> clib.c:6077: error: `GLOB_NOMATCH' undeclared (first use in this >> function) >> clib.c:6077: error: (Each undeclared identifier is reported only once >> clib.c:6077: error: for each function it appears in.) > > GLOB_NOMATCH is required by POSIX, so it looks like the local glob > implementation is broken or too old. What does your 10.3.9 glob(3) > manpage say about the return value of glob()? The manpage is attached. |
From: Albert G. <Dr....@t-...> - 2008-06-09 09:10:07
|
Ryan Schmidt wrote: >> GLOB_NOMATCH is required by POSIX, so it looks like the local glob >> implementation is broken or too old. What does your 10.3.9 glob(3) >> manpage say about the return value of glob()? > > The manpage is attached. Thanks. The 10.3.9 glob is obviously non-POSIX, as POSIX clearly requires GLOB_NOMATCH, see: http://www.opengroup.org/onlinepubs/007908799/xsh/glob.html So you need to patch clib.c on OSX 10.3.9 to work around this. AFAICT from the manpage, the following edit should make clib compile on this OSX version, and glob should still give the intended results in case of matching failure: Replace lines 6077-6079 in clib.c: if (res == GLOB_NOMATCH) return mknil; else if (res) with just: if (res) (Note that I can't just commit this to the official Q sources, since it would break clib::glob on POSIX-conforming platforms.) HTH, Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-09 11:07:47
Attachments:
Mac_OS_X_10.3.9_man_2_setpgrp.txt
|
On Jun 9, 2008, at 04:09, Albert Graef wrote: > So you need to patch clib.c on OSX 10.3.9 to work around this. AFAICT > from the manpage, the following edit should make clib compile on this > OSX version, and glob should still give the intended results in > case of > matching failure: > > Replace lines 6077-6079 in clib.c: > > if (res == GLOB_NOMATCH) > return mknil; > else if (res) > > with just: > > if (res) Thanks, that fixes clib. Now I have this: /bin/sh ../../libtool --tag=CC --mode=compile /usr/bin/gcc-3.3 - DHAVE_CONFIG_H -I. -I../.. -I../../libq -I/mp/include -O2 -MT system.lo -MD -MP -MF .deps/system.Tpo -c -o system.lo system.c /usr/bin/gcc-3.3 -DHAVE_CONFIG_H -I. -I../.. -I../../libq -I/mp/ include -O2 -MT system.lo -MD -MP -MF .deps/system.Tpo -c system.c - fno-common -DPIC -o .libs/system.o system.c: In function `ictowcs': system.c:766: warning: passing arg 2 of `libiconv' from incompatible pointer type system.c: In function `icfromwcs': system.c:787: warning: passing arg 2 of `libiconv' from incompatible pointer type system.c: In function `__F__system_setpgrp': system.c:4860: error: too few arguments to function `setpgrp' system.c: In function `__F__system_iconv': system.c:6208: warning: passing arg 2 of `libiconv' from incompatible pointer type make[4]: *** [system.lo] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 |
From: Albert G. <Dr....@t-...> - 2008-06-09 11:38:12
|
Ryan Schmidt wrote: > system.c: In function `__F__system_setpgrp': > system.c:4860: error: too few arguments to function `setpgrp' Yes, that's another one of those POSIX incompatibilities in older OSX. configure is supposed to check for this one, though. Can you please send me your config.log? -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-09 23:07:06
Attachments:
config.log.bz2
|
On Jun 9, 2008, at 06:37, Albert Graef wrote: > Ryan Schmidt wrote: > >> system.c: In function `__F__system_setpgrp': >> system.c:4860: error: too few arguments to function `setpgrp' > > Yes, that's another one of those POSIX incompatibilities in older OSX. > configure is supposed to check for this one, though. Can you please > send > me your config.log? Here you go... The relevant part seems to be: configure:32826: checking whether setpgrp takes no argument configure:32860: /usr/bin/gcc-3.3 -o conftest -O2 -I/mp/include -L/mp/ lib conftest.c -lm >&5 configure:32863: $? = 0 configure:32869: ./conftest configure:32872: $? = 0 configure:32888: result: no And it never says anything about having set SETPGRP_VOID. But then in system.c it says: /* configure might detect wrong interface on these systems */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #undef SETPGRP_VOID #endif #if defined(__APPLE__) #define SETPGRP_VOID #endif So configure got it right, and then the source overrode it. Maybe setpgrp takes no arguments on 10.4 and later, but didn't on 10.3 and earlier? I'm not sure because on 10.4 and later I can't find a manpage for setpgrp. I found this slightly updated manpage on Apple's web site: http://developer.apple.com/documentation/Darwin/Reference/ManPages/ man2/setpgrp.2.html It says you should use setpgid instead of setpgrp? |
From: Albert G. <Dr....@t-...> - 2008-06-10 00:05:37
|
Ryan Schmidt wrote: > #if defined(__APPLE__) > #define SETPGRP_VOID > #endif > > So configure got it right, and then the source overrode it. Maybe > setpgrp takes no arguments on 10.4 and later, but didn't on 10.3 and > earlier? Yes, I think that this indeed was the reason that I added the #define SETPGRP_VOID. IIRC, OSX 10.4 at some point switched to the POSIX-conformant setpgrp(void), but configure would still detect the old interface for some reason. So the immediate fix would be to just comment or remove those lines. For a more elaborate solution I'd probably have to rewrite the AC_SETPGRP macro. > It says you should use setpgid instead of setpgrp? That's not an option here. The system module provides the POSIX system interface to Q scripts. POSIX has both operations, so they are both provided by the module. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: John C. <co...@cc...> - 2008-06-10 02:14:59
|
Albert Graef scripsit: > > It says you should use setpgid instead of setpgrp? > > That's not an option here. The system module provides the POSIX system > interface to Q scripts. POSIX has both operations, so they are both > provided by the module. However, Posix defines setpgrp() as identical to setpgid(0, 0), so you can *export* setpgrp to Q scripts but implement it using setpgid. The same for getpgrp() and getpgid(0). That way you don't care if get/setpgrp is defined by the system or not. -- Barry gules and argent of seven and six, John Cowan on a canton azure fifty molets of the second. co...@cc... --blazoning the U.S. flag http://www.ccil.org/~cowan |
From: Albert G. <Dr....@t-...> - 2008-06-10 05:09:14
|
John Cowan wrote: > However, Posix defines setpgrp() as identical to setpgid(0, 0), so you can > *export* setpgrp to Q scripts but implement it using setpgid. The same > for getpgrp() and getpgid(0). That way you don't care if get/setpgrp > is defined by the system or not. Yes, that's right. I put that on my TODO list. -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |
From: Ryan S. <rya...@us...> - 2008-06-10 03:47:58
|
On Jun 9, 2008, at 19:05, Albert Graef wrote: > Ryan Schmidt wrote: > >> #if defined(__APPLE__) >> #define SETPGRP_VOID >> #endif >> >> So configure got it right, and then the source overrode it. Maybe >> setpgrp takes no arguments on 10.4 and later, but didn't on 10.3 and >> earlier? > > Yes, I think that this indeed was the reason that I added the #define > SETPGRP_VOID. IIRC, OSX 10.4 at some point switched to the > POSIX-conformant setpgrp(void), but configure would still detect > the old > interface for some reason. > > So the immediate fix would be to just comment or remove those lines. Thanks, now q 7.11 builds on Mac OS X 10.3.9! I applied your patches in the MacPorts portfile. http://trac.macports.org/changeset/37492 Next, maybe I'll try to install Mac OS X 10.2.8... :-) > For a more elaborate solution I'd probably have to rewrite the > AC_SETPGRP macro. |
From: Albert G. <Dr....@t-...> - 2008-06-10 05:11:19
|
Ryan Schmidt wrote: > Thanks, now q 7.11 builds on Mac OS X 10.3.9! I applied your patches > in the MacPorts portfile. > > http://trac.macports.org/changeset/37492 Great, many thanks. > Next, maybe I'll try to install Mac OS X 10.2.8... :-) And then ... OS9? ;-) -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |