Date: Fri, 16 Apr 2004 00:04:05 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 350 ************************************************** Thursday 15 April 2004 Number 350 ************************************************** Subjects for today 1 Warnings and errors : John Poltorak 2 Re: Finding most recent file : Steven Levine" 3 Re: Finding most recent file : John Poltorak 4 Re: Finding most recent file : Steven Levine" 5 Re: Warnings and errors : John Poltorak 6 sys/termios.h : John Poltorak 7 Makefile.in.in : John Poltorak 8 Re: sys/termios.h : Knut Stange Osmundsen 9 Re: sys/termios.h : John Poltorak 10 grep.dll : John Poltorak **= Email 1 ==========================** Date: Wed, 14 Apr 2004 15:38:41 +0100 From: John Poltorak Subject: Warnings and errors After making progress in building MAN, I get a number of error msgs but am unsure which is the showstopper among this lot:- Created Makefile and conf_script. Now do "make" and "make install". make cd src; ../conf_script Makefile Creating Makefile from Makefile.in cd src; make make[1]: Entering directory `U:/unixos2/workdir/man-1.5k/src' gcc -O -Zomf -O2 -s -D__ST_MT_ERRNO__ -s -Zcrtdll -Zmt -s -Zlinker /exepack:2 -Zlinker /pmtype:vio makemsg.c -o makemsg ../makemsg ../msgs/mess.en gripedefs.h msg.c gcc -O -c -Wall -Wstrict-prototypes -Wmissing-prototypes -Zomf -O2 -s -D__ST_MT_ERRNO__ -I. -DUSG -Duid_t= -Dgid_t= -DALLOCA_MISSING -DNONLS -DNOGETOPT -DGREPSILENT=\'q\' man.c In file included from u:\unixos2\posix2\include\sys/fcntl.h:15, from u:\unixos2\emx\include\sys/file.h:5, from man.c:27: u:\unixos2\posix2\include\sys/types.h:84: warning: empty declaration u:\unixos2\posix2\include\sys/types.h:94: warning: empty declaration In file included from u:\unixos2\posix2\include\sys/fcntl.h:16, from u:\unixos2\emx\include\sys/file.h:5, from man.c:27: u:\unixos2\posix2\include\sys/stat.h:73: parse error before `st_uid' u:\unixos2\posix2\include\sys/stat.h:73: warning: no semicolon at end of struct or union u:\unixos2\posix2\include\sys/stat.h:74: warning: type defaults to `int' in declaration of `st_gid' u:\unixos2\posix2\include\sys/stat.h:74: warning: data definition has no type or storage class u:\unixos2\posix2\include\sys/stat.h:97: parse error before `}' In file included from u:\unixos2\posix2\include\unistd.h:232, from man.c:31: u:\unixos2\posix2\include\sys/unistdx.h:86: parse error before `,' u:\unixos2\posix2\include\sys/unistdx.h:87: parse error before `,' u:\unixos2\posix2\include\sys/unistdx.h:88: parse error before `,' u:\unixos2\posix2\include\sys/unistdx.h:162: parse error before `owner' u:\unixos2\posix2\include\sys/unistdx.h:163: parse error before `owner' u:\unixos2\posix2\include\sys/unistdx.h:167: parse error before `owner' u:\unixos2\posix2\include\sys/unistdx.h:182: parse error before `,' u:\unixos2\posix2\include\sys/unistdx.h:183: parse error before `,' u:\unixos2\posix2\include\sys/unistdx.h:203: parse error before `o' u:\unixos2\posix2\include\sys/unistdx.h:204: warning: function declaration isn't a prototype u:\unixos2\posix2\include\sys/unistdx.h: In function `chown': u:\unixos2\posix2\include\sys/unistdx.h:204: `p' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:204: (Each undeclared identifier is reported only once u:\unixos2\posix2\include\sys/unistdx.h:204: for each function it appears in.) u:\unixos2\posix2\include\sys/unistdx.h:204: `o' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:204: `g' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h: At top level: u:\unixos2\posix2\include\sys/unistdx.h:206: parse error before `o' u:\unixos2\posix2\include\sys/unistdx.h:206: warning: function declaration isn't a prototype u:\unixos2\posix2\include\sys/unistdx.h: In function `fchown': u:\unixos2\posix2\include\sys/unistdx.h:206: `f' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:206: `o' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:206: `g' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h: At top level: u:\unixos2\posix2\include\sys/unistdx.h:209: parse error before `o' u:\unixos2\posix2\include\sys/unistdx.h:209: warning: function declaration isn't a prototype u:\unixos2\posix2\include\sys/unistdx.h: In function `lchown': u:\unixos2\posix2\include\sys/unistdx.h:209: `p' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:209: `o' undeclared (first use in this function) u:\unixos2\posix2\include\sys/unistdx.h:209: `g' undeclared (first use in this function) man.c: In function `make_cat_file': man.c:670: storage size of `statbuf' isn't known man.c:670: warning: unused variable `statbuf' man.c: In function `main': man.c:1203: `LC_MESSAGES' undeclared (first use in this function) make[1]: *** [man.o] Error 1 make[1]: Leaving directory `U:/unixos2/workdir/man-1.5k/src' make: *** [source] Error 2 What can I do to avoid the error? -- John **= Email 2 ==========================** Date: Wed, 14 Apr 2004 07:40:58 -0700 From: "Steven Levine" Subject: Re: Finding most recent file In <20040414111927.Q44505 at warpix.org>, on 04/14/04 at 11:19 AM, John Poltorak said: >The only thing wrong is that I wasn't familiar with how the '-t' option >for ls worked. This is a better solution, although I don't understaand >why you need grep. You said you just wanted the most recent file not the most recent file or directory. ls and for have different semantics. >Also in my original solution, the oldest rather than the newest file was >being shown, so 'tail' needs to be replaced, but 'head' is not >appropriate since it is the second line of output which needs to be >shown, so I've replaced it with 'sed -n "2p"', but thanks for the >suggested solution. I believed you meant what you said in the subject title. To show the oldest rather than the newest use: ls -ltr | tail -1 If you wish to use sed, it can do the job of both the grep and the cut. It's a toss up which will be more efficient overall. My seat of the pants estimate says grep and cut together should be faster than sed for most implementations. Of course, you could do the whole job with a perl one liner, but perl's slow loading time makes it a poor choice for this problem unless the directory contains a very large number of files. HTH, Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.41 #10183 Warp4/FP15/14.093c_W4 www.scoug.com irc.webbnet.info irc.fyrelizard.org #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 3 ==========================** Date: Wed, 14 Apr 2004 16:43:21 +0100 From: John Poltorak Subject: Re: Finding most recent file On Wed, Apr 14, 2004 at 07:40:58AM -0700, Steven Levine wrote: > In <20040414111927.Q44505 at warpix.org>, on 04/14/04 > at 11:19 AM, John Poltorak said: > > I believed you meant what you said in the subject title. The subject was correct but my example was wrong. > To show the > oldest rather than the newest use: > > ls -ltr | tail -1 No, that shows the newest, and is exactly what I want. Although I'm trying to use the output from this commant to create a reference 'timestamp' file, thus:- touch -r `ls -ltr | tail -1 | cut -c34-` $TMP/timestamp > If you wish to use sed, it can do the job of both the grep and the cut. I only used SED because I wanted the second line - I wasn't aware of the '-r' flag. > HTH, > > Steven > > > -- > ---------------------------------------------------------------------- > "Steven Levine" MR2/ICE 2.41 #10183 Warp4/FP15/14.093c_W4 > www.scoug.com irc.webbnet.info irc.fyrelizard.org #scoug (Wed 7pm PST) > ---------------------------------------------------------------------- -- John **= Email 4 ==========================** Date: Wed, 14 Apr 2004 09:45:34 -0700 From: "Steven Levine" Subject: Re: Finding most recent file In <20040414164321.Y44505 at warpix.org>, on 04/14/04 at 04:43 PM, John Poltorak said: >> To show the >> oldest rather than the newest use: >> >> ls -ltr | tail -1 >No, that shows the newest, and is exactly what I want. Senior moment. So many switches, so little time. :-) >touch -r `ls -ltr | tail -1 | cut -c34-` $TMP/timestamp Yep. I probably have similar code somewhere on the sun. >I only used SED because I wanted the second line - I wasn't aware of the >'-r' flag. ls -? or man ls. :-) Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.41 #10183 Warp4/FP15/14.093c_W4 www.scoug.com irc.webbnet.info irc.fyrelizard.org #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 5 ==========================** Date: Wed, 14 Apr 2004 17:49:53 +0100 From: John Poltorak Subject: Re: Warnings and errors On Wed, Apr 14, 2004 at 03:38:41PM +0100, John Poltorak wrote: > After making progress in building MAN, I get a number of error msgs but am > unsure which is the showstopper among this lot:- > > > Created Makefile and conf_script. Now do "make" and "make install". The previous msgs occurred when using Posix/2. If I use the standard EMX headers I get:- ../makemsg ../msgs/mess.en gripedefs.h msg.c gcc -O -c -Wall -Wstrict-prototypes -Wmissing-prototypes -Zomf -O2 -s -D__ST_MT_ERRNO__ -I. -DUSG -Duid_t= -Dgid_t= -DALLOCA_MISSING -DNONLS -DNOGETOPT -DGREPSILENT=\'q\' man.c In file included from man.c:28: u:\unixos2\emx\include\sys/stat.h:7: warning: #warning requires In file included from man.c:23: u:\unixos2\emx\include\stdio.h:158: warning: no previous prototype for `feof' u:\unixos2\emx\include\stdio.h:163: warning: no previous prototype for `ferror' u:\unixos2\emx\include\stdio.h:170: warning: no previous prototype for `_getc_inline' u:\unixos2\emx\include\stdio.h:179: warning: no previous prototype for `_putc_inline' u:\unixos2\emx\include\stdio.h:197: warning: no previous prototype for `getchar' u:\unixos2\emx\include\stdio.h:198: warning: no previous prototype for `putchar' u:\unixos2\emx\include\stdio.h:207: warning: no previous prototype for `fileno' In file included from man.c:24: u:\unixos2\emx\include\ctype.h:34: warning: no previous prototype for `_toupper' u:\unixos2\emx\include\ctype.h:35: warning: no previous prototype for `_tolower' u:\unixos2\emx\include\ctype.h:37: warning: no previous prototype for `toupper' u:\unixos2\emx\include\ctype.h:39: warning: no previous prototype for `tolower' In file included from u:\unixos2\emx\include\sys/stat.h:8, from man.c:28: u:\unixos2\emx\include\sys/types.h:48: warning: empty declaration u:\unixos2\emx\include\sys/types.h:58: warning: empty declaration In file included from man.c:28: u:\unixos2\emx\include\sys/stat.h:23: parse error before `st_uid' u:\unixos2\emx\include\sys/stat.h:23: warning: no semicolon at end of struct or union u:\unixos2\emx\include\sys/stat.h:24: warning: type defaults to `int' in declaration of `st_gid' u:\unixos2\emx\include\sys/stat.h:24: warning: data definition has no type or storage class u:\unixos2\emx\include\sys/stat.h:32: parse error before `}' man.c: In function `is_section': man.c:176: warning: subscript has type `char' man.c:176: warning: subscript has type `char' man.c: In function `make_cat_file': man.c:670: storage size of `statbuf' isn't known man.c:670: warning: unused variable `statbuf' man.c: In function `main': man.c:1203: `LC_MESSAGES' undeclared (first use in this function) man.c:1203: (Each undeclared identifier is reported only once man.c:1203: for each function it appears in.) make[1]: *** [man.o] Error 1 Any of this familiar to anyone? -- John **= Email 6 ==========================** Date: Wed, 14 Apr 2004 20:05:23 +0100 From: John Poltorak Subject: sys/termios.h I need sys/termios.h when building the JOE editor, but this header isn't included in EMX or Posix/2, although I do see it in FreeBSD. Is it likely to be usable in my OS/2 environment? For some reason something called autoconf.h (generated from autoconf.h.in) includes:- #define HAVE_POSIX_TERMIOS 1 Is this wrong? Do I need to run autoheader to recreate this file? -- John **= Email 7 ==========================** Date: Wed, 14 Apr 2004 20:53:56 +0100 From: John Poltorak Subject: Makefile.in.in Has anyone ever come across a Makefile.in.in? I can't help feeling that this file has been named incorrectly... -- John **= Email 8 ==========================** Date: Thu, 15 Apr 2004 01:12:27 +0200 From: Knut Stange Osmundsen Subject: Re: sys/termios.h John Poltorak wrote: > I need sys/termios.h when building the JOE editor, but this header isn't > included in EMX or Posix/2, although I do see it in FreeBSD. Is it likely to > be usable in my OS/2 environment? FreeBSD (5.2) symlinked termios.h and sys/termios.h. EMX comes with termios.h I think, at least does InnoTek LIBC, but it's not in include/sys but in include. echo '#include ' > emx/include/sys/termios.h Kind Regards, knut **= Email 9 ==========================** Date: Thu, 15 Apr 2004 10:15:38 +0100 From: John Poltorak Subject: Re: sys/termios.h On Thu, Apr 15, 2004 at 01:12:27AM +0200, Knut Stange Osmundsen wrote: > John Poltorak wrote: > > I need sys/termios.h when building the JOE editor, but this header isn't > > included in EMX or Posix/2, although I do see it in FreeBSD. Is it likely to > > be usable in my OS/2 environment? > > FreeBSD (5.2) symlinked termios.h and sys/termios.h. EMX comes with > termios.h I think, at least does InnoTek LIBC, but it's not in > include/sys but in include. Yes, you're right, I hadn't spotted that. Is the EMX version derived from BSD? They seem very different and have different values for some of the #defines... > echo '#include ' > emx/include/sys/termios.h I copied EMX's version to \usr\include\sys which resolved the initial problem, only to get caught further along in the build. The problems differed according to whether Posix/2 was being used. With Posix/2:- gcc -DHAVE_CONFIG_H -I. -I. -I. -DJOERC="\"/usr/local/etc/\"" -c `test -f 'utils.c' || echo './'`utils.c gcc -lbsd -o joe.exe b.o blocks.o bw.o cmd.o hash.o help.o kbd.o macro.o main.o menu.o path.o poshist.o pw.o queue.o qw.o rc.o regex.o scrn.o tab.o termcap.o tty.o tw.o ublock.o uedit.o uerror.o ufile.o uformat.o uisrch.o umath.o undo.o usearch.o ushell.o utag.o va.o vfile.o vs.o w.o utils.o -lncurses tty.o: Undefined symbol _setpgrp referenced from text segment u:\unixos2\posix2\lib/cExt.a(itimer.o): Undefined symbol __beginthread referenced from text segment make: *** [joe.exe] Error 1 Without Posix/2:- gcc -DHAVE_CONFIG_H -I. -I. -I. -DJOERC="\"/usr/local/etc/\"" -c `test -f 'utils.c' || echo './'`utils.c gcc -lbsd -o joe.exe b.o blocks.o bw.o cmd.o hash.o help.o kbd.o macro.o main.o menu.o path.o poshist.o pw.o queue.o qw.o rc.o regex.o scrn.o tab.o termcap.o tty.o tw.o ublock.o uedit.o uerror.o ufile.o uformat.o uisrch.o umath.o undo.o usearch.o ushell.o utag.o va.o vfile.o vs.o w.o utils.o -lncurses b.o: Undefined symbol _lstat referenced from text segment b.o: Undefined symbol _fchmod referenced from text segment path.o: Undefined symbol _fchmod referenced from text segment tty.o: Undefined symbol _setpgrp referenced from text segment vfile.o: Undefined symbol _random referenced from text segment vfile.o: Undefined symbol _random referenced from text segment make: *** [joe.exe] Error 1 > Kind Regards, > knut -- John **= Email 10 ==========================** Date: Thu, 15 Apr 2004 11:21:18 +0100 From: John Poltorak Subject: grep.dll An old port of GREP includes a GNUGREP.DLL which appears to be the main grep engine for front ends like grep.exe, egrep.exe and fgrep.exe all of which are only 2kB in size. This seems like a reasonable way of providing shared functionality rather than having three seperate, large, identical programs, in the absence of having symbolic links, which I presume is the way these things are handled on Unix. Is there a way building such a version of GREP - ie to include GREP.DLL, by using autoconf and libtool? -- John