Okay. the quick answer is that you can't port Zephyr to OS/2, so go away and leave me alone. I have work to do. Get out of my office! Out! Out! Out! I'm working on my thesis. Really! Leave me alone, dammit!
configure script and
Makefiles work, we'll need a Unix shell. Get ksh524rt.zip from ftp://hobbes.nmsu.edu/os2/unix/.
The volume label in drive D is GNU HPFS.
Directory of D:\zip
4-20-96 7:38a <DIR> 0 .
4-20-96 7:38a <DIR> 0 ..
4-19-96 10:21p 191104 0 bsddev.zip
4-19-96 10:37p 1062253 0 emxdev.zip
4-19-96 11:17p 852511 0 emxfix03.zip
4-19-96 10:25p 359399 0 emxrt.zip
4-19-96 10:50p 506945 0 flex2522.zip
4-19-96 10:45p 229991 0 gnubison.zip
4-20-96 7:33a 965234 0 gnudev1.zip
4-19-96 10:38p 591245 0 gnudev2.zip
4-19-96 10:43p 778889 0 gnufu.zip
4-19-96 10:39p 180273 0 gnugrep.zip
4-20-96 1:31p 518407 0 gnumake.zip
4-19-96 11:07p 168535 0 gnused.zip
4-19-96 10:50p 456750 0 gnusutil.zip
4-19-96 10:48p 217589 0 gnutar.zip
4-19-96 10:59p 547866 0 gnututil.zip
4-19-96 10:50p 76749 0 gz124_32.zip
4-19-96 10:55p 225473 0 ksh524rt.zip
4-20-96 6:51p 116901 0 syslog.zip
4-19-96 10:48p 435844 0 zephyr-2.0.3.tar.gz
21 file(s) 8481958 bytes used
Install everything. Type "make". Die! Die! Die!
The whole package is much too complicated to attack all at once. So, we
want to set our sights as low as possible. There is a running system at
M.I.T. that we want to connect to, so we'll ignore all the server stuff.
The Zephyr Windowgram Client, zwgc, (the program the
actually pops the message windows up on your screen) is X-Windows based,
so that's right out, too. That leaves two pieces [see footnote 1]:
zhm, the program that
sits in the background on your machine and actually does all the
necessary network communication between the client programs and the
servers. zwrite, a client
program that sends a message to another user.zlocate, too. Actually
receiving messages on your OS/2 workstation will be
left for another time (left as an exercise for the reader, you might
say).
Before we can even think about compiling the actual Zephyr programs, we need to work on some of the auxiliary stuff that comes in the Zephyr package that is supposed to help in development. So far, this consists of three things:
configure script to set up the
necessary machine-dependent things in config.h and the Makefiles. The
configure script is a Unix shell script that is generated
by the GNU autoconf package. This is why we need all the Unix stuff.
Set the following environment variables to get the EMX stuff set up right and to help configure make the right decisions about some things.
set C_INCLUDE_PATH=d:/emx/include;d:/zephyr/h set LIBRARY_PATH=d:/emx/lib;d:/zephyr/lib set GCCLOAD=5 set GCCOPT=-pipe set HOME=d:/home set CC=gcc set YACC=bison -y set LEX=flexThere are two small changes that you need to make to the configure script in order to get it to run properly. FIrst of all, ksh cannot run shell scripts that have a dot embedded in their name, so rename config.guess and config.sub to config_guess and config_sub and change the references to them in configure:
ren config.guess config_guess ren config.sub config_sub ren configure configure.original sed -f fix_configure.sed configure.original > configureWhere fix_configure.sed is
s/\/config\.guess/\/config_guess/ s/\/config\.sub/\/config_sub/(I started using sed because I thought there would be a lot more changes to make...)
Replace the current ac_link lines (around line 510) in the configure script with (big thanks to Dale DePriest, the author of ksh for OS/2, for this):
ac_link='${CC-cc} -o conftest.exe $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS && mv conftest.exe conftest'
Now, fire up ksh and run the configure script:
ksh configure --host=i486-ibm-os2 --prefix=/emxWatch this as it procedes and make sure it's doing the right thing. The big one for me was
checking whether cross-compiling...If it answers "yes", everything goes to hell fast. Whenever it answered "no", that meant that I had everything set up right.
Of course, it still barfs on the "os2" part, but this works. Go! Go! Go! (It would be nice if the GNU people would add support for OS/2 to their autoconf package.) This will manufacture lots of neat stuff for you, including all the Makefiles and config.h.
Anyway, this takes a while. Take a coffee break. Like, to Bolivia [see footnote 2].
compile_et: compile_et.o error_table.o
$(CC) $(LDFLAGS) -o $@.exe compile_et.o error_table.o $(LIBS)
This is called "the Makefile-EXE fix".
After applying the Makefile-EXE fix and typing "make", the compile fails because pieces of the error table compiler require a syslog.h file. I faked it by copying the syslog.h file from the syslogd directory into the include directory.
copy \zephyr\clients\syslogd\syslog.h \zephyr\hEventually, this needs to be replaced by a real syslog.h file from a real Syslog Library for OS/2.
The error table compiler calls some (outdated?) string functions in the BSD library that don't exist in the EMX package, but that have equivalents. Hand edit the config.h file to include the following lines:
/* Stuff added to config.h by hand */ #define strcasecmp stricmp #define strncasecmp strnicmpSuddenly, a conversation breaks out between us:
copy libcom_err.a \zephyr\lib\com_err.a
touch \zephyr\h\utmp.hDefine MAXHOSTNAMELEN to something in config.h
#define MAXHOSTNAMELEN 64Typing "make" in the \zephyr\lib\zephyr directory doesn't work for me. Try it. It will compile the error table, and then start compiling the Z*.c files, and MAKE.EXE will dump core after about the sixth one. Bummer.
Here's the sequence of commands that works for me (you still want to run make first, to create the zephyr_err.h file):
make del *.o gcc -c Z*.c make copy libzephyr.a \zephyr\lib\zephyr.aThe undeclared identifier errors that crop up in ZVariables.c when you're compiling the Z*.c files are fixed when you run make the second time. I think that you can safely ignore the prototype errors in ZlocateU.c.
Commenting out all the parts that need the syslog library produces an
executable that behaves until you try to connect to one of the M.I.T.
Zephyr Servers (which you can find by typing hesinfo zephyr
sloc). Then it just complains that the servers keep going down,
because it gets an "Error=9" when waiting for a packet. This is not a
syslog problem.
Someone who knows a lot more about TCP/IP, UDP, packets, sockets, and general network stuff probably needs to take a look at this for me. I'm in over my head.
Actually, since X_DISPLAY_MISSING is defined in config.h, it should compile right up into a ttymode client. And it does. Almost.
Edit the instantiate shell script to take the - out of the first line so that it just says
#!/bin/shThen, after applying the Makefile-EXE fix, type "make" in /zephyr/clients/zwgc.
The executable won't link because the signals SIGTSTP and SIGTTOU are not defined. Are they even supported by EMX? Again, I'm lost here.
The command subsystem library (in listen.c) needs a signal SIGCONT that isn't supported by EMX. Here's not the way to fix it:
#define SIGCONT 35Sticking this in one of the header files and apply the Makefile-EXE fix to the make_cmds line, produces the library without a hitch. We should really come back and fix this.
The server doesn't compile. Here's the fix to get it to compile (I have no idea if this hack works). In main.c, change
flags = fcntl(srv_socket, F_GETFL);to
flags = fcntl(srv_socket, F_GETFL, 0);The server then barfs on link because there's no syslog library.