From: UnixOS2 Archive To: "UnixOS2 Archive" Date: Fri, 12 Jul 2002 04:31:56 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 270 ************************************************** Thursday 11 July 2002 Number 270 ************************************************** Subjects for today 1 Building Flex : John Poltorak 2 at echo on : John Poltorak 3 Re: Attrib -> chmod : Pete Milne 4 Re: emxomfar: Record too long : csaba.raduly at sophos.com 5 Re: emxomfar: Record too long : John Poltorak 6 Re: emxomfar: Record too long : csaba.raduly at sophos.com 7 PHP 4.0.6 : John Poltorak **= Email 1 ==========================** Date: Fri, 12 Jul 2002 09:53:03 +0100 From: John Poltorak Subject: Building Flex Can someone see if this build script for Flex works on their system? :- # CWD=`pwd` PATH=c:/usr/local/bin';'c:/usr/bin';'c:/emx/bin';'c:/os2';' CC=gcc AWK=awk LEX=flex RANLIB=echo export C_INCLUDE_PATH=c:/emx/include export LIBRARY_PATH=c:/emx/lib export ac_executable_extensions=".exe" export SHELL=c:/bin/sh test -f flex-2.5.4a.tar.gz || wget ftp://ftp.mirror.ac.uk/sites/ftp.gnu.org/pub/gnu/non-gnu/flex/flex-2.5.4a.tar.gz mkdir workdir cd workdir tar zxf $CWD/flex-2.5.4a.tar.gz cd flex-2.5.4 autoconf ./configure --prefix=c:/usr/local make CFLAGS="-O2" LDFLAGS="-s -Zmt -Zcrtdll -Zsysv-signals -Zbin-files -Zexe" This assumes you have the standard Unix tools and OS/2 on C: and that Autoconf is installed. Please feel free to suggest any changes to the above script, especially the Make line. Here, I actually get this error msg at the end on one of my systems:- C:\EMX\BIN\ld.exe: Permission denied for C:\EMX\BIN\ldstub.bin make: *** [flex] Error 1 although a 139268 byte flex.exe seems to get built successfully. -- John **= Email 2 ==========================** Date: Fri, 12 Jul 2002 09:56:24 +0100 From: John Poltorak Subject: at echo on Is there the equivalent of ' at echo on' for shell scripts? I know I can use 'sh -x', but that isn't quite the same thing. -- John **= Email 3 ==========================** Date: Fri, 12 Jul 2002 10:35:57 +0100 From: Pete Milne Subject: Re: Attrib -> chmod "Thomas E. Dickey" wrote: > On Wed, 10 Jul 2002, John Poltorak wrote: > > > On Wed, Jul 10, 2002 at 01:00:59PM +0100, csaba.raduly at sophos.com wrote: > > > > > > >Thanks, for that. I thought I needed to use some funny numbers like 666 or > > > >something :-)... I can never remember them. > > > > > > It's easy, you only have to convert three bits to octal at a time. > > > > > > So the *correct* a+w is equivalent to 'chmod -R 666 *' > > > a+w, the file permission of the beast :-) > > > > > > Is there any easy way to remember these values? > > > > Sometimes shell scripts include things like chmod 744 foo and I don't know > > a convenient place to look this up. > > lots of places... for instance the manpage for chmod (quoting from one): > > A numeric mode is from one to four octal digits (0-7), > derived by adding up the bits with values 4, 2, and 1. > Any omitted digits are assumed to be leading zeros. The > first digit selects the set user ID (4) and set group ID > (2) and sticky (1) attributes. The second digit selects > permissions for the user who owns the file: read (4), > write (2), and execute (1); the third selects permissions > for other users in the file's group, with the same values; > and the fourth for other users not in the file's group, > with the same values. > I find it easier to convert the digits to binary, so 744 becomes 111 100 100, which you can interpret as: user group all r w x r w x r w x 1 1 1 1 0 0 1 0 0 so the permissions would be reported by ls as "rwxr--r--". It's easy to reverse this procedure to set desired permissions for a file. hth Pete > > -- > T.E.Dickey > http://invisible-island.net > ftp://invisible-island.net **= Email 4 ==========================** Date: Fri, 12 Jul 2002 11:03:26 +0100 From: csaba.raduly at sophos.com Subject: Re: emxomfar: Record too long On 11/07/2002 19:36:29 owner-os2-unix wrote: >On Thu, Jul 11, 2002 at 12:29:05PM -0400, Henry Sobotka wrote: >> John Poltorak wrote: >> > >> > When/where should I use AR? >> >> Just realized I may not have quite answered your question. Make will >> invoke AR to create a static library. With -Zomf, set it to emxomfar; >> otherwise to ar. If I'm not mistaken, the flags they use are identical. > >Thanks for the explanation, although I am still a little unclear about >what is required. If you compile with -Zomf, then you should use emxomfar and emxomfld (the latter is invoked automatically when you use gcc -Zomf to link) If you compile without -Zomf, then use ar and ld >Perhaps I should explain what I'm trying to do... > >I'm building up a table of parameters required for building specific apps. >These include CFLAGS, LDFLAGS and parameters for use with MAKE. >The normal build process consists of exporting CFLAGS and LDFLAGS, then >running AUTOCONF, then CONFIGURE and MAKE with any make parameters. > >I did find that FLEX would build without any *FLAGS, as long as I used the >following command line with Make:- > >make CFLAGS="-O2" LDFLAGS="-s -Zmt -Zcrtdll -Zsysv-signals -Zbin-files -Zexe" > >ie CFLAGS and LDFLAGS are not set during configure and it uses the >defaults. > >In this case I get a flex.exe which seems to be OK along with a zero >length flex file. That's -Zexe at work > >Unfortunately, I can get my build script to parse the above parameter from >the table, and hoped there was some other way of specifying it. > > >If I use make AR=ar, I get a flex file which FILE describes as:- You can't just use ar and emxomfar interchangeably without recompiling. emxomfar works only with OMF files, ar with a.out > >flex: Linux/i386 demand-paged executable (ZMAGIC) > >I guess this can be converted to flex.exe with an extra step. > Yes, emxbind. However, it's much easier to have gcc invoke it for you. In order to do that, you should set the output of the link step to e.g. flex.EXE; the exe extension causes gcc invoke emxbind to create an OS/2 executable. Most makefiles of ported software are written in Unixish way: no exe suffix. -Zexe can be used to "fool" the makefile (that's why it creates a file 'flex'; make checks for the existence of that file). If you compile with -Zomf, gcc uses emxomfld to do the linking. emxomfld is just a frontend for LINK386, and it always creates an OS/2 executable. -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: csaba.raduly at sophos.com http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 **= Email 5 ==========================** Date: Fri, 12 Jul 2002 12:15:01 +0100 From: John Poltorak Subject: Re: emxomfar: Record too long On Fri, Jul 12, 2002 at 11:03:26AM +0100, csaba.raduly at sophos.com wrote: > > On 11/07/2002 19:36:29 owner-os2-unix wrote: > > >On Thu, Jul 11, 2002 at 12:29:05PM -0400, Henry Sobotka wrote: > >> John Poltorak wrote: > >> > >> Just realized I may not have quite answered your question. Make will > >> invoke AR to create a static library. With -Zomf, set it to emxomfar; > >> otherwise to ar. If I'm not mistaken, the flags they use are identical. > > > >Thanks for the explanation, although I am still a little unclear about > >what is required. > > If you compile with -Zomf, then you should use emxomfar and emxomfld > (the latter is invoked automatically when you use gcc -Zomf to link) > > If you compile without -Zomf, then use ar and ld This doesn't really help since I'm using the defaults created by autoconf and configure. The only way I know how to get the final executable is to modify the Make command line with the addition of:- CFLAGS="-O2" LDFLAGS="-s -Zmt -Zcrtdll -Zsysv-signals -Zbin-files -Zexe" This seems to have the desired affect. > >In this case I get a flex.exe which seems to be OK along with a zero > >length flex file. > > That's -Zexe at work In some circumstances, I don't see a zero length flex file when a flex.exe is created, but I haven't got to the bottom of that yet. > >Unfortunately, I can get my build script to parse the above parameter from > >the table, and hoped there was some other way of specifying it. > > > > > >If I use make AR=ar, I get a flex file which FILE describes as:- > > You can't just use ar and emxomfar interchangeably without > recompiling. emxomfar works only with OMF files, ar with a.out How can I tell if I have an OMF or a.out file by visual inspection? > Most makefiles of ported software are written in Unixish way: > no exe suffix. -Zexe can be used to "fool" the makefile > (that's why it creates a file 'flex'; make checks for the > existence of that file). > If you compile with -Zomf, gcc uses emxomfld to do the linking. > emxomfld is just a frontend for LINK386, and it always creates > an OS/2 executable. Maybe Flex is complicated by the addition of the lib file libfl.a. I have found that the modification of the Make line as mentioned above works OK, but setting the *FLAGS variables specifically does not. I don't know if there is a simpler way to get FLEX built, but it sounds as if it should be... -- John **= Email 6 ==========================** Date: Fri, 12 Jul 2002 15:47:59 +0100 From: csaba.raduly at sophos.com Subject: Re: emxomfar: Record too long On 12/07/2002 12:15:01 owner-os2-unix wrote: [snip] > >How can I tell if I have an OMF or a.out file by visual inspection? > a.out object files should have the string gcc2_compiled towards the end Run "strings --all foo.o" OMF objects should contain strings like TEXT32, DATA32, BSS32 (also visible with strings --all) -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: csaba.raduly at sophos.com http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 **= Email 7 ==========================** Date: Fri, 12 Jul 2002 16:14:50 +0100 From: John Poltorak Subject: PHP 4.0.6 Is PHP 4.0.6 available anywhere? I've been trying to get Phorums working but appear to have problems with PHP. I'm told it does work with that particular version. -- John