Preparations for building on win32 with autoconf Makefile.ins.
authorcls%seawood.org
Sat, 30 Dec 2000 05:44:01 +0000
changeset 1653 58cb1bb962e4106a209d1f0f0a777507f108c9e9
parent 1651 4dc28392b606ac889c2b6fc1a00637ecff88935e
child 1655 93e25f63d510e09ef3ed4a0e09f524feecc8f0ef
push idunknown
push userunknown
push dateunknown
Preparations for building on win32 with autoconf Makefile.ins.
config/autoconf.mk.in
config/config.mk
config/rules.mk
configure.in
lib/ds/Makefile.in
lib/libc/src/Makefile.in
pr/src/Makefile.in
pr/src/md/windows/objs.mk
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -1,14 +1,14 @@
 
 USE_AUTOCONF	= 1
 MOZILLA_CLIENT	= @MOZILLA_CLIENT@
 DIST		= @prefix@
-OBJDIR_NAME	= .
-OBJDIR		= .
+OBJDIR_NAME	= @OBJDIR_NAME@
+OBJDIR		= @OBJDIR@
 OBJ_SUFFIX	= @OBJ_SUFFIX@
 LIB_SUFFIX	= @LIB_SUFFIX@
 DLL_SUFFIX	= @DLL_SUFFIX@
 MOD_VERSION	= @NSPR_VERSION@
 MOD_NAME	= @NSPR_MODNAME@
 
 CROSS_COMPILE	= @CROSS_COMPILE@
 BUILD_OPT	= @MOZ_OPTIMIZE@
@@ -29,23 +29,28 @@ CC		= @CC@
 CCC		= @CXX@
 AR		= @AR@
 AR_FLAGS	= @AR_FLAGS@
 LD		= @LD@
 RANLIB		= @RANLIB@
 PERL		= @PERL@
 DLLTOOL		= @DLLTOOL@
 WINDRES		= @WINDRES@
-RC		= $(WINDRES)
+RC		= @RC@
 STRIP		= @STRIP@
+NSINSTALL	= @NSINSTALL@
+INSTALL		= @INSTALL@
 
 OS_CFLAGS	= @CFLAGS@ $(DSO_CFLAGS)
 OS_CXXFLAGS	= @CXXFLAGS@ $(DSO_CFLAGS)
 OS_LIBS         = @OS_LIBS@
 OS_LDFLAGS	= @LDFLAGS@
+OS_DLLFLAGS	= @OS_DLLFLAGS@
+DLLFLAGS	= @DLLFLAGS@
+OPTIMIZER	= @OPTIMIZER@
 
 MKSHLIB		= @MKSHLIB@
 DSO_CFLAGS	= @DSO_CFLAGS@
 DSO_LDOPTS	= @DSO_LDOPTS@
 
 RESOLVE_LINK_SYMBOLS = @RESOLVE_LINK_SYMBOLS@
 
 HOST_CC		= @HOST_CC@
--- a/config/config.mk
+++ b/config/config.mk
@@ -65,17 +65,23 @@ CFLAGS		= $(CC_ONLY_FLAGS) $(OPTIMIZER) 
 CCCFLAGS	= $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
 # For purify
 NOMD_CFLAGS	= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
 NOMD_CCFLAGS	= $(CCC_ONLY_FLAGS) $(OPTIMIZER) $(NOMD_OS_CFLAGS)\
 		  $(XP_DEFINE) $(DEFINES) $(INCLUDES) $(XCFLAGS)
 
-NSINSTALL	= $(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall
+LDFLAGS		= $(OS_LDFLAGS)
+
+define MAKE_OBJDIR
+if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
+endef
+
+LINK_DLL	= $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
 
 ifeq ($(NSDISTMODE),copy)
 # copy files, but preserve source mtime
 INSTALL		= $(NSINSTALL) -t
 else
 ifeq ($(NSDISTMODE),absolute_symlink)
 # install using absolute symbolic links
 INSTALL		= $(NSINSTALL) -L `$(NFSPWD)`
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -315,19 +315,16 @@ endif
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 	$(IMPLIB) $@ $(SHARED_LIBRARY).def
 endif
     
 $(SHARED_LIBRARY): $(OBJS)
 	@$(MAKE_OBJDIR)
 	rm -f $@
-ifdef USE_AUTOCONF
-	$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
-else
 ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 	echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	nm -B -C -g $(OBJS) \
 		| awk '/ [T,D] / {print $$3}' \
 		| sed -e 's/^\.//' \
 		| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
 		-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
@@ -367,22 +364,25 @@ ifeq ($(OS_TARGET), OpenVMS)
 	@if test ! -f $(OBJDIR)/VMSuni.opt; then \
 	    echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\
 	    create_opt_uni $(OBJS); \
 	    mv VMSuni.opt $(OBJDIR); \
 	fi
 	$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(OBJDIR)/VMSuni.opt
 	@echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms)
 else	# OpenVMS
+ifdef USE_AUTOCONF
+	$(MKSHLIB) $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
+else
 	$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
+endif   # USE_AUTOCONF
 endif	# OpenVMS
 endif   # OS2
 endif	# WINNT
 endif	# AIX 4.1
-endif   # USE_AUTOCONF
 ifdef BUILD_OPT
 	$(STRIP) $@
 endif
 
 
 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 $(RES): $(RESNAME)
 	@$(MAKE_OBJDIR)
--- a/configure.in
+++ b/configure.in
@@ -65,16 +65,20 @@ USE_N32=
 USE_64=
 USE_CPLUS=
 USE_IPV6=
 USE_MDUPDATE=
 _OPTIMIZE_FLAGS=-O
 _DEBUG_FLAGS=-g
 MOZ_DEBUG=1
 MOZ_OPTIMIZE=
+OBJDIR=.
+OBJDIR_NAME=.
+NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
+
 dnl Link in libraries necessary to resolve all symbols for shared libs
 RESOLVE_LINK_SYMBOLS=
 
 dnl ========================================================
 dnl =
 dnl = Dont change the following lines.  Doing so breaks:
 dnl =
 dnl = CFLAGS="-foo" ./configure
@@ -1166,16 +1170,21 @@ AC_SUBST(STRIP)
 AC_SUBST(OS_LIBS)
 AC_SUBST(RESOLVE_LINK_SYMBOLS)
 AC_SUBST(AIX_LINK_OPTS)
 AC_SUBST(NOSUCHFILE)
 AC_SUBST(MOZ_OBJFORMAT)
 AC_SUBST(ULTRASPARC_LIBRARY)
 AC_SUBST(ULTRASPARC_FILTER_LIBRARY)
 
+AC_SUBST(OBJDIR)
+AC_SUBST(OBJDIR_NAME)
+AC_SUBST(NSINSTALL)
+AC_SUBST(OPTIMIZER)
+
 dnl ========================================================
 dnl Generate output files.
 dnl ========================================================
 MAKEFILES="
 Makefile 
 config/Makefile
 config/autoconf.mk
 config/nsprincl.mk
--- a/lib/ds/Makefile.in
+++ b/lib/ds/Makefile.in
@@ -62,17 +62,16 @@ CSRCS = \
 HEADERS = \
 	plarenas.h \
 	plarena.h \
 	plhash.h \
 	$(NULL)
 
 HEADERS := $(addprefix $(srcdir)/, $(HEADERS))
 
-ifndef USE_AUTOCONF
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
 # OS_CFLAGS = $(OS_EXE_CFLAGS)
 EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
 else
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/plds.res
 RESNAME=plds.rc
@@ -85,17 +84,18 @@ endif
 
 ifdef MOZ_DEBUG
 ifdef GLOWCODE
 EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
 endif
 endif
 endif
 
-else
+ifndef USE_AUTOCONF
+
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
 
 else
 ifeq ($(OS_ARCH), AIX)
 ifeq ($(CLASSIC_NSPR),1)
 OS_LIBS += -lc
 else
--- a/lib/libc/src/Makefile.in
+++ b/lib/libc/src/Makefile.in
@@ -71,17 +71,16 @@ CSRCS =\
 	plgetopt.c \
 	$(NULL)
 
 LIBRARY_NAME	= plc
 LIBRARY_VERSION	= $(MOD_VERSION)
 
 RELEASE_LIBS = $(TARGETS)
 
-ifndef USE_AUTOCONF
 ifeq ($(OS_ARCH),WINNT)
 ifeq ($(OS_TARGET), WIN16)
 EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).lib
 else
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/plc.res
 RESNAME=plc.rc
 ifeq ($(OS_TARGET),WIN95)
@@ -92,17 +91,18 @@ endif
 
 ifdef MOZ_DEBUG
 ifdef GLOWCODE
 EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
 endif
 endif
 endif
 
-else
+ifndef USE_AUTOCONF
+
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 EXTRA_LIBS = $(DIST)/lib/nspr$(MOD_VERSION).$(LIB_SUFFIX)
 
 else
 ifeq ($(OS_ARCH), AIX)
 ifeq ($(CLASSIC_NSPR),1)
 OS_LIBS += -lc
 else
--- a/pr/src/Makefile.in
+++ b/pr/src/Makefile.in
@@ -157,27 +157,28 @@ endif
 ifeq ($(OS_ARCH),UNIXWARE)
 OS_LIBS		= -lsocket -lc
 endif
 
 ifeq ($(OS_ARCH),NEWS-OS)
 OS_LIBS		= -lsocket -lnsl -lgen -lresolv
 endif
 
+ifdef GC_LEAK_DETECTOR
+OS_LIBS		+= -L$(DIST)/lib -lboehm
+endif
+
+endif # USE_AUTOCONF
+
 ifeq ($(OS_ARCH),WINNT)
 ifneq ($(OS_TARGET),WIN16)
 OS_LIBS		= advapi32.lib wsock32.lib
 endif
 endif
 
-ifdef GC_LEAK_DETECTOR
-OS_LIBS		+= -L$(DIST)/lib -lboehm
-endif
-
-endif # USE_AUTOCONF
 #
 # Define platform-dependent OBJS
 #
 
 OBJS = \
     $(OBJDIR)/prvrsion.$(OBJ_SUFFIX) \
     io/$(OBJDIR)/prfdcach.$(OBJ_SUFFIX) \
     io/$(OBJDIR)/prmwait.$(OBJ_SUFFIX) \
@@ -269,37 +270,39 @@ OBJS += \
 	cplus/$(OBJDIR)/rcthread.$(OBJ_SUFFIX) \
 	cplus/$(OBJDIR)/rctime.$(OBJ_SUFFIX)
 endif
 
 ifdef GC_LEAK_DETECTOR
 OBJS += memory/$(OBJDIR)/prgcleak.$(OBJ_SUFFIX)
 endif
 
-ifdef USE_AUTOCONF
-
-include $(srcdir)/md/$(PR_MD_ARCH_DIR)/objs.mk
-ifdef USE_BTHREADS
-include $(srcdir)/bthreads/objs.mk
-endif
-
-else
-
 ifeq ($(OS_ARCH), WINNT)
 ifneq ($(OS_TARGET),WIN16)
 DLLBASE=/BASE:0x30000000
 RES=$(OBJDIR)/nspr.res
 RESNAME=nspr.rc
 ifdef MOZ_DEBUG
 ifdef GLOWCODE
 EXTRA_LIBS += $(GLOWDIR)/glowcode.lib
 endif
 endif
 endif
+endif # WINNT
 
+ifdef USE_AUTOCONF
+
+include $(srcdir)/md/$(PR_MD_ARCH_DIR)/objs.mk
+ifdef USE_BTHREADS
+include $(srcdir)/bthreads/objs.mk
+endif
+
+else
+
+ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
 OBJS +=	md/windows/$(OBJDIR)/w16null.$(OBJ_SUFFIX) \
 	md/windows/$(OBJDIR)/w16proc.$(OBJ_SUFFIX)      \
 	md/windows/$(OBJDIR)/w16thred.$(OBJ_SUFFIX)      \
 	md/windows/$(OBJDIR)/w16fmem.$(OBJ_SUFFIX)      \
 	md/windows/$(OBJDIR)/w16sock.$(OBJ_SUFFIX)      \
 	md/windows/$(OBJDIR)/w16mem.$(OBJ_SUFFIX)      \
     md/windows/$(OBJDIR)/w16io.$(OBJ_SUFFIX)       \
@@ -347,18 +350,16 @@ OBJS +=	md/windows/$(OBJDIR)/ntdllmn.$(O
 	md/windows/$(OBJDIR)/win32_errors.$(OBJ_SUFFIX) \
 	md/windows/$(OBJDIR)/w32ipcsem.$(OBJ_SUFFIX) \
 	md/windows/$(OBJDIR)/w32rng.$(OBJ_SUFFIX)	\
 	md/windows/$(OBJDIR)/w32shm.$(OBJ_SUFFIX)	\
 	md/windows/$(OBJDIR)/w32poll.$(OBJ_SUFFIX)
 endif
 endif
 
-else
-
 ifeq ($(OS_ARCH),OS2)
 OBJS +=	md/os2/$(OBJDIR)/os2io.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2sock.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2thred.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2cv.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2gc.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2misc.$(OBJ_SUFFIX) \
 	md/os2/$(OBJDIR)/os2inrval.$(OBJ_SUFFIX) \
@@ -369,19 +370,19 @@ OBJS +=	md/os2/$(OBJDIR)/os2io.$(OBJ_SUF
 else
 
 ifeq ($(OS_ARCH), BeOS)
 	include $(srcdir)/md/beos/objs.mk
 	include $(srcdir)/bthreads/objs.mk
 else
 	# Unix
 	include $(srcdir)/md/unix/objs.mk
-endif
-endif
-endif
+endif # BeOS
+endif # OS2
+endif # WINNT
 endif # !USE_AUTOCONF
 
 LIBRARY_NAME = nspr
 LIBRARY_VERSION = $(MOD_VERSION)
 
 RELEASE_LIBS = $(TARGETS)
 
 include $(topsrcdir)/config/rules.mk
--- a/pr/src/md/windows/objs.mk
+++ b/pr/src/md/windows/objs.mk
@@ -29,36 +29,44 @@
 # the GPL.  If you do not delete the provisions above, a recipient
 # may use your version of this file under either the MPL or the
 # GPL.
 # 
 
 
 ifeq (WINNT,$(MOZ_TARGET))
 CSRCS = ntmisc.c \
+	ntsec.c \
 	ntsem.c \
 	ntinrval.c \
 	ntgc.c \
 	ntio.c \
 	ntthread.c \
 	ntdllmn.c \
 	win32_errors.c \
-	w32poll.c
+	w32ipcsem.c \
+	w32poll.c \
+	w32rng.c \
+	w32shm.c
 else
 ifeq (WIN95,$(MOZ_TARGET))
 CSRCS =	ntmisc.c \
+	ntsec.c \
 	ntsem.c \
 	ntinrval.c \
 	ntgc.c \
 	w95thred.c \
 	w95io.c \
 	w95cv.c \
 	w95sock.c \
 	win32_errors.c \
+	w32ipcsem.c \
 	w32poll.c \
+	w32rng.c \
+	w32shm.c \
 	w95dllmain.c
 else
 ifeq (WIN16,$(MOZ_TARGET))
 CSRCS =	w16null.c \
 	w16thred.c \
 	w16proc.c \
 	w16fmem.c \
 	w16sock.c \