You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Yitzchak Scott-Thoennes <st...@efn.org> on 1999/05/13 10:43:10 UTC

Building Apache for OS/2

I've been building apache on os/2 and have had to work around a couple
of problems with the build.

First, with emx0.9d, socket.h now defines MAXSOCKETS as 2048 (the
MAXSOCKETS define was required by but missing from the header in
emx0.9c), so the define in ap_config.h should be changed to match it.
According to the author of the sockets code in a recent message to the
emx list, socket() will croak on socket handles greater than 2048
anyway.

Second, when building the support programs, emx's ld looks for os.a
and ap.a (it doesn't add the "lib" suffix) but these are built as
libos.a and libap.a.  I can't figure out how anyone else is working
around this with emx, other than editing the Makefile or letting it
bomb, renaming the libs, and restarting the make.

In any case, it seems like we are asking for trouble by telling ld to
search for libraries when we do actually know the path to them.
Someday someone will have some completely different lib named libos.a
or libap.a in a standard lib directory and their build will fail with
a less than obvious error message.

The following patch addresses these two problems.  Your feedback
(particularly +1's) is welcomed.

diff -ur apache_1.3.6/src/include/ap_config.h apache/src/include/ap_config.h
--- apache_1.3.6/src/include/ap_config.h	Tue Mar 16 09:16:14 1999
+++ apache/src/include/ap_config.h	Tue Apr  6 17:22:56 1999
@@ -752,7 +752,9 @@
 /* Add some drive name support */
 #define chdir _chdir2
 #include <sys/time.h>
-#define MAXSOCKETS 4096
+#ifndef MAXSOCKETS
+#define MAXSOCKETS 2048
+#endif
 #define USE_OS2_SCOREBOARD
 #define NO_RELIABLE_PIPED_LOGS
 #define USE_OS2SEM_SERIALIZED_ACCEPT
diff -ur apache_1.3.6/src/support/Makefile.tmpl apache/src/support/Makefile.tmpl
--- apache_1.3.6/src/support/Makefile.tmpl	Tue Jan 12 15:34:48 1999
+++ apache/src/support/Makefile.tmpl	Tue Apr  6 17:15:14 1999
@@ -1,8 +1,8 @@
 
 CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
-LIBS=-los -lap $(EXTRA_LIBS) $(LIBS1)
+LIBS=$(OSDIR)/libos.a $(SRCDIR)/ap/libap.a $(EXTRA_LIBS) $(LIBS1)
 INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
-LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) -L$(OSDIR) -L$(SRCDIR)/ap
+LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)
 
 TARGETS=htpasswd htdigest rotatelogs logresolve ab apxs