From: Michael Castle Subject: Re: PBM stuff? To: dridge AT MIT DOT EDU (Matthew Eldridge) Date: Mon, 9 May 1994 13:36:25 -0600 (CDT) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Amazingly enough Matthew Eldridge said: > alright, I give up. What is the "NetPBM" distribution? I've heard > it tossed around before. Is it a rework of Jef's original PBM suite? Kinda. Basically it's a group of people headed by (I *think*) Bill Davidsen (he used to moderate comp.binaries.ibm.pc and a 386 mail based discussion list). They basically tried to gather up all the bug fixes and new p?m programs that others have written, and packaged them all together. Jef's not part of it, but he is aware of it. And true to the nature of those involved, tempers often flare about how things should be done. Quite amusing really. :-> Source can be picked up at ftp.wustl.edu in graphics/graphics/packages/NetPBM or something like that.... the first 3 subdirs are right anyway... If you apply the patches that I included with my PBMPlus port, and do any other fixups (namely editing the other program names in the p?mmerge.c files), it should compile fairly easily (I would recommend using a make that swaps itself out of memory as it does recursive makes, and you'll quickly run out of go32 room with the current djgpp based make). When I did the port, I cheated most heinously. I used a modified crt0.o startup file. *hangs head in shame* Problem is, of course, that stdin and stdout need to be in binary mode. So, I used a modified crt0.s that merely jumped to a void f(void) function I had added to libc.a that did setmode()s as appropriate (calling this function just before it called main()). It seemed to work quite well, but it is really a gross hack. Still... better than modifiying 50+ *.c files, specially when I didn't know sed/awk/perl/etc at the time and had to do it by hand (not that i really know them know ;-). Next time I do it though, I will probably follow the scheme that was used in the os/2 port. The os/2 port used ibm's c-set/2 compiler, and so didn't have access to nor the ability to modify the crt0.obj, so he had to come up with another method. Basically, he put a small main() at the end of the on *.h file included in every *.c file. This main did the setmode()s, then called next_main(argc,argv). Then after that, he had the following: #define main next_main So that the real main in the *.c file got renamed. This will require a bit more work to work with merged files (mulitple definitions of next_main), but I think I can work around that. Just some objservations on porting things using djgpp. cheers mrc -- Mike Castle .-=NEXUS=-. Life is like a clock: You can work constantly mcastle AT cs DOT umr DOT edu and be right all the time, or not work at all S087891 AT UMRVMA DOT UMR DOT EDU and be right at least twice a day. -- mrc We are all of us living in the shadow of Manhattan. -- Watchmen