-SUBDIRS = srclib modules os server support
+SUBDIRS = srclib os server modules support
PROGRAM_NAME = $(progname)
PROGRAM_SOURCES = modules.c
suexec:
cd support && make suexec
+
+include $(top_srcdir)/os/os2/core.mk
APACHE_SUBST(PORT)
APACHE_SUBST(NOTEST_CFLAGS)
APACHE_SUBST(NOTEST_LDFLAGS)
+ APACHE_SUBST(CORE_IMPLIB_FILE)
+ APACHE_SUBST(CORE_IMPLIB)
+ APACHE_SUBST(SH_LIBTOOL)
+ APACHE_SUBST(MK_IMPLIB)
abs_srcdir="`(cd $srcdir && pwd)`"
# Link-related commands
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(LDFLAGS) $(NOTEST_LDFLAGS) -o $@
-SH_LINK = $(SH_LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(LDFLAGS) $(NOTEST_LDFLAGS) -o $@
+SH_LINK = $(SH_LIBTOOL) --mode=link $(COMPILE) $(LTFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(CORE_IMPLIB) -o $@
MOD_LINK = $(LIBTOOL) --mode=link $(COMPILE) -module $(LTFLAGS) $(LDFLAGS) $(NOTEST_LDFLAGS) -o $@
# Cross compile commands
# Helper programs
-SH_LIBTOOL = $(SHELL) $(top_builddir)/shlibtool --silent
MKINSTALLDIRS = $(abs_srcdir)/build/mkdir.sh
INSTALL = $(abs_srcdir)/build/install.sh -c
INSTALL_DATA = $(INSTALL) -m 644
SHLIB_SUFFIX = so
.SUFFIXES:
-.SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo
+.SUFFIXES: .S .c .$(CXX_SUFFIX) .lo .o .s .y .l .slo .def .la
.c.o:
$(COMPILE) -c $<
all: all-recursive
install: install-recursive
+
+# Makes an import library from a def file
+.def.la:
+ $(LIBTOOL) --mode=compile $(MK_IMPLIB) -o $@ $<
+
+
# if we are doing a distclean, we actually want to hit every
# directory that has ever been configured. To do this, we just do a quick
# find for all the leftover Makefiles, and then run make distclean in those
clean: clean-recursive clean-x
clean-x:
- rm -f $(targets) *.slo *.lo *.la *.o $(CLEAN_TARGETS)
+ rm -f $(targets) *.slo *.lo *.la *.o *.obj $(CLEAN_TARGETS)
rm -rf .libs
distclean: distclean-recursive clean-x
AC_CANONICAL_SYSTEM
+case "$host_alias" in
+ *os2*)
+ # Use a custom made libtool replacement
+ echo "using aplibtool"
+ LIBTOOL="$abs_srcdir/srclib/apr/build/aplibtool"
+ SH_LIBTOOL="$LIBTOOL --shared --export-all"
+ CORE_IMPLIB_FILE="ApacheCoreOS2.la"
+ CORE_IMPLIB="$abs_srcdir/server/$CORE_IMPLIB_FILE"
+ MK_IMPLIB="emximp"
+ SHMOD_EXPORT_EXT="def"
+ other_targets="$other_targets os2core"
+ ;;
+ *)
+ SH_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool --silent'
+ ;;
+esac
+
dnl
dnl ## Preload our OS configuration
APR_PRELOAD
APACHE_SUBST(BUILTIN_LIBS)
AM_DISABLE_SHARED
-AM_PROG_LIBTOOL
-APACHE_LIBTOOL_SILENT
+if test -z "$LIBTOOL"; then
+ AM_PROG_LIBTOOL
+ APACHE_LIBTOOL_SILENT
+fi
if test "$apache_need_shared" = "yes"; then
$SHELL $ac_aux_dir/ltconfig --output=shlibtool --disable-static --srcdir=$ac_aux_dir --cache-file=./config.cache $ac_aux_dir/ltmain.sh
if test "$OS" = "os2" ; then
CFLAGS="$CFLAGS -DOS2 -O2"
- LDFLAGS="$LDFLAGS -Zexe"
fi
--- /dev/null
+# Some rules for making a shared core dll on OS/2
+
+os2core: httpd.dll $(CORE_IMPLIB)
+ $(LIBTOOL) --mode=link gcc $(EXTRA_LDFLAGS) -o httpd $(CORE_IMPLIB)
+
+httpd.dll: $(PROGRAM_DEPENDENCIES) $(CORE_IMPLIB)
+ $(LINK) -Zdll $(EXTRA_LDFLAGS) -s -o $@ server/exports.lo modules.lo $(PROGRAM_DEPENDENCIES) $(EXTRA_LIBS) server/ApacheCoreOS2.def
--- /dev/null
+LIBRARY httpd INITINSTANCE
+DESCRIPTION "Apache Server Core"
+EXPORTS
+ "main"
+ "ap_my_generation"
+ "ap_restart_time"
+ "ap_extended_status"
+ "ap_scoreboard_image"
+ "ap_conftree"
+ "ap_server_root"
+ "ap_top_module"
TARGET_EXPORTS = apache.exports
CLEAN_TARGETS = gen_test_char gen_uri_delims test_char.h uri_delims.h \
- $(TARGET_EXPORTS)
+ $(TARGET_EXPORTS) ApacheCoreOS2.def
SUBDIRS = mpm
util_filter.c exports.c buildmark.c scoreboard.c \
error_bucket.c protocol.c core.c request.c
-targets = delete-exports $(LTLIBRARY_NAME)
+targets = delete-exports $(LTLIBRARY_NAME) $(CORE_IMPLIB_FILE)
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk
# wtf does this have to be explicit????
exports.lo: exports.c
+
+# Rule to make def file for OS/2 core dll
+ApacheCoreOS2.def: exports.c $(top_srcdir)/os/$(OS_DIR)/core_header.def
+ cat $(top_srcdir)/os/$(OS_DIR)/core_header.def > $@
+ $(CPP) $< $(COMMON_FLAGS) | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$$/ "\1"/' >> $@