apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fua...@apache.org
Subject svn commit: r1090884 - in /apr/apr/trunk: NWGNUmakefile build/NWGNUenvironment.inc build/NWGNUmakefile build/NWGNUtail.inc build/nw_export.h build/nw_export.inc file_io/netware/filepath.c
Date Sun, 10 Apr 2011 20:07:32 GMT
Author: fuankg
Date: Sun Apr 10 20:07:31 2011
New Revision: 1090884

URL: http://svn.apache.org/viewvc?rev=1090884&view=rev
Log:
Prepare NetWare build system for other compilers.

Initial patch from NormW <normw gknw net>;
various modifications and adds by fuankg.

Added:
    apr/apr/trunk/build/nw_export.h
      - copied unchanged from r1090871, apr/apr/trunk/build/nw_export.inc
Removed:
    apr/apr/trunk/build/nw_export.inc
Modified:
    apr/apr/trunk/NWGNUmakefile
    apr/apr/trunk/build/NWGNUenvironment.inc
    apr/apr/trunk/build/NWGNUmakefile
    apr/apr/trunk/build/NWGNUtail.inc
    apr/apr/trunk/file_io/netware/filepath.c

Modified: apr/apr/trunk/NWGNUmakefile
URL: http://svn.apache.org/viewvc/apr/apr/trunk/NWGNUmakefile?rev=1090884&r1=1090883&r2=1090884&view=diff
==============================================================================
--- apr/apr/trunk/NWGNUmakefile (original)
+++ apr/apr/trunk/NWGNUmakefile Sun Apr 10 20:07:31 2011
@@ -43,10 +43,9 @@ include $(APR_WORK)/build/NWGNUhead.inc
 XINCDIRS	+= \
 			$(APR)/include \
 			$(APR)/include/private \
-			$(APR)/include/arch/NetWare \
+			$(APR)/include/arch/netware \
 			$(APR)/include/arch/unix \
 			$(APR)/dbm/sdbm \
-			$(APR)/memory/unix \
 			$(APR)/random/unix \
 			$(LDAPSDK)/inc \
 			$(EOLIST)
@@ -428,6 +427,7 @@ nlms :: libs $(TARGET_nlm)
 # Updated this target to create necessary directories and copy files to the
 # correct place.  (See $(APR_WORK)/build/NWGNUhead.inc for examples)
 #
+
 install :: nlms $(INSTDIRS) FORCE
 	$(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/)
 ifndef DEST
@@ -453,9 +453,10 @@ endif
 # Any specialized rules here
 #
 
+vpath filepath.c file_io/win32
 vpath %.c atomic/netware:strings:tables:passwd:time/unix
-vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware
-vpath %.c poll/unix:shmem/unix:support/unix:random/unix
+vpath %.c file_io/netware:file_io/unix:locks/netware:misc/netware:misc/unix
+vpath %.c threadproc/netware:poll/unix:shmem/unix:support/unix:random/unix
 vpath %.c dso/netware:memory/unix:mmap/unix:user/netware:util-misc
 vpath %.c buckets:crypto:dbd:dbm:dbm/sdbm:encoding:hooks:memcache:misc:strmatch:uri:xlate
 
@@ -465,11 +466,6 @@ vpath %.c network_io/win32
 endif
 vpath %.c network_io/unix
 
-$(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt
-#	@echo Compiling $<
-	@echo $(DL)CC   $<$(DL)
-	$(CC) -cwd source -o $@ $< @$(OBJDIR)/$(NLM_NAME)_cc.opt
-
 #
 # Include the 'tail' makefile that has targets that depend on variables defined
 # in this makefile

Modified: apr/apr/trunk/build/NWGNUenvironment.inc
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/NWGNUenvironment.inc?rev=1090884&r1=1090883&r2=1090884&view=diff
==============================================================================
--- apr/apr/trunk/build/NWGNUenvironment.inc (original)
+++ apr/apr/trunk/build/NWGNUenvironment.inc Sun Apr 10 20:07:31 2011
@@ -71,10 +71,6 @@ ifndef EXPAT_INC
 $(error neither EXPATSDK nor EXPATSRC defined - cant compile without EXPAT SDK or source
tree) 
 endif
 
-ifndef METROWERKS
-METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
-endif
-
 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to
 # restart make with it defined
 ifndef LM_LICENSE_FILE
@@ -134,14 +130,105 @@ OBJDIR = obj_$(RELEASE)
 # Setup compiler information
 #
 
+ifdef METROWERKS
 # MetroWerks NLM tools
-CC	= mwccnlm
-CPP	= mwccnlm
-LINK	= mwldnlm
-LIB	= mwldnlm -type library -w nocmdline
+#ifndef METROWERKS
+#METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
+#endif
+
+CC		= mwccnlm -w nocmdline -nosyspath
+CPP		= $(CC)
+CPRE	= $(CC) -P -EP
+LINK	= mwldnlm -w nocmdline
+AR		= $(LINK) -type library
+
+ifneq ($(findstring /sh,$(SHELL)),/sh)
+PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
+endif
+
+# MetroWerks static Libraries
+CLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
+MATH3S	=
+PLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
+
+# Base compile flags
+# and prefix or precompiled header added here.
+
+# The default flags are as follows:
+#
+# -w nocmdline          disable command-line driver/parser warnings
+# -nosyspath            treat #include <...> like #include "..."
+# -Cpp_exceptions off   disable C++ exceptions
+# -RTTI off             disable C++ run-time typing information
+# -align 4              align on 4 byte bounderies
+# -proc PII             generate code base on Pentium II instruction set
+# -inst mmx             use MMX extensions (not used)
+
+CFLAGS	= -proc PII -align 4
+CPFLAGS	= -Cpp_exceptions off -RTTI off
+
+ifeq "$(REQUIRE_PROTOTYPES)" "1"
+CFLAGS	+= -r
+endif
+
+# -g                    generate debugging information
+# -O0                   level 0 optimizations
+ifeq "$(RELEASE)" "debug"
+CFLAGS	+= -g -O0
+endif
+
+# -O4,p                 level 4 optimizations, optimize for speed
+ifeq "$(RELEASE)" "release"
+CFLAGS	+= -O4,p
+endif
+
+PRELUDE	= $(NOVI)/libcpre.o
+
+else
+# GNU NLM tools (gcc / nlmconv)
+
+CC		= gcc
+CPP		= g++
+CPRE	= $(CC) -E
+LINK	= nlmconv -UT
+AR		= ar cru
+RANLIB	= ranlib
+
+CFLAGS	= -m32 -fno-builtin -fpcc-struct-return -fstrict-aliasing
+CFLAGS	+= -fpack-struct=4
+CFLAGS	+= -Wall
+CFLAGS	+= -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes
+
+ifdef MAINTAINER
+CFLAGS	+= \
+	-W -Wpointer-arith -Wwrite-strings -Wunused -Wshadow -Winline \
+	-Wnested-externs -Wcast-align -Wtype-limits -Wstrict-prototypes \
+	-Wfloat-equal -Wno-multichar -Wsign-compare -Wundef -Wendif-labels \
+	-Wold-style-declaration -Wmissing-parameter-type -Wempty-body \
+	-Wclobbered -Wignored-qualifiers -Wconversion -Wvla -pedantic
+endif
+
+# -g                    generate debugging information
+# -O0                   level 0 optimizations
+ifeq "$(RELEASE)" "debug"
+CFLAGS	+= -g -O0
+endif
+
+# -O3                   level 3 optimizations, optimize for speed
+ifeq "$(RELEASE)" "release"
+CFLAGS	+= -O3
+endif
+
+PRELUDE	= $(NOVI)/libcpre.gcc.o
+
+endif
+
+# -prefix apr_arch_pre_nw.h      #include pre_nw.h for all files
+CFLAGS	+= -prefix apr_arch_pre_nw.h
+
 
 # Setup build tools
-AWK	= awk
+AWK		= awk
 
 #
 # Declare Command and tool macros here
@@ -178,16 +265,14 @@ endif
 endif
 
 NOVI	= $(NOVELLLIBC)/imports
-PRELUDE	= $(NOVI)/libcpre.o
-
-INCDIRS	= $(NOVELLLIBC)/include;
+INCDIRS	= $(NOVELLLIBC)/include
 
 DEFINES	= -DNETWARE
 ifdef USE_STDSOCKETS
 DEFINES	+= -DUSE_BSD_SOCKETS
 else
 DEFINES	+= -DUSE_WINSOCK
-INCDIRS	+= $(NOVELLLIBC)/include/winsock;
+INCDIRS	+= $(NOVELLLIBC)/include/winsock
 endif
 ifndef DEBUG
 DEFINES	+= -DNDEBUG
@@ -199,50 +284,6 @@ else
 VERSION_SKT = (WINSOCK)
 endif
 
-# MetroWerks static Libraries
-CLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
-MATH3S	=
-PLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
-
-# Base compile flags
-# and prefix or precompiled header added here.
-
-# The default flags are as follows:
-#
-# -c                    compile only, no link
-# -nosyspath            treat #include <...> like #include "..."
-# -Cpp_exceptions off   disable C++ exceptions
-# -RTTI off             disable C++ run-time typing information
-# -align 4              align on 4 byte bounderies
-# -w nocmdline          disable command-line driver/parser warnings
-# -proc PII             generate code base on Pentium II instruction set
-# -inst mmx             use MMX extensions (not used)
-
-CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII
-
-ifeq "$(REQUIRE_PROTOTYPES)" "1"
-CFLAGS += -r
-endif
-
-# -g                    generate debugging information
-# -O0                   level 0 optimizations
-ifeq "$(RELEASE)" "debug"
-CFLAGS += -g -O0
-endif
-
-# -O4,p                 level 4 optimizations, optimize for speed
-ifeq "$(RELEASE)" "release"
-CFLAGS += -O4,p
-endif
-
-# -prefix apr_arch_pre_nw.h      #include pre_nw.h for all files
-CFLAGS += -prefix apr_arch_pre_nw.h
-
-
-ifneq ($(findstring /sh,$(SHELL)),/sh)
-PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
-endif
-
 #
 # Declare major project deliverables output directories here
 #
@@ -270,7 +311,7 @@ endif
 # Add support for building IPV6 alongside
 ifneq "$(IPV6)" ""
 DEFINES += -DNW_BUILD_IPV6
-# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS)
+# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6 $(INCDIRS)
 
 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
 OBJDIR := $(OBJDIR)_IPV6

Modified: apr/apr/trunk/build/NWGNUmakefile
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/NWGNUmakefile?rev=1090884&r1=1090883&r2=1090884&view=diff
==============================================================================
--- apr/apr/trunk/build/NWGNUmakefile (original)
+++ apr/apr/trunk/build/NWGNUmakefile Sun Apr 10 20:07:31 2011
@@ -15,6 +15,23 @@ include $(APR_WORK)/build/NWGNUhead.inc
 #
 # build this level's files
 
+#
+# Make sure all needed macro's are defined
+#
+
+#
+# These directories will be at the beginning of the include list, followed by
+# INCDIRS
+#
+XINCDIRS += \
+	$(APR)/include \
+	$(APR)/include/private \
+	$(APR)/include/arch/netware \
+	$(APR)/include/arch/unix \
+	$(APRBUILD) \
+	$(LDAPSDK)/inc \
+	$(EOLIST)
+
 FILES_prebuild_headers = \
 	$(APR)/include/apr.h \
 	$(APR)/include/apu_want.h \
@@ -25,30 +42,12 @@ FILES_prebuild_headers = \
 nlms :: $(APR)/aprlib.imp
 
 $(APR)/aprlib.imp : make_nw_export.awk nw_export.i
-#	@echo Generating $@
 	@echo $(DL)GEN  $@$(DL)
 	$(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ >$@
 
-nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt
-#	@echo Generating $@
+nw_export.i : nw_export.h $(FILES_prebuild_headers) $(CCOPT_DEPENDS)
 	@echo $(DL)GEN  $@$(DL)
-	$(CC) $< @cc.opt
-
-cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc
$(CUSTOM_INI)
-	@echo -P > $@
-	@echo -EP >> $@
-	@echo -nosyspath >> $@
-	@echo -w nocmdline >> $@
-	@echo $(DEFINES) -DGENEXPORTS >> $@
-	@echo -I$(APR)/include >> $@
-	@echo -I$(APR)/include/private >> $@
-	@echo -I$(APR)/include/arch/netware >> $@
-	@echo -I$(APR)/include/arch/unix >> $@
-	@echo -I$(APR)/build >> $@
-	@echo -ir $(NOVELLLIBC) >> $@
-ifneq "$(LDAPSDK)" ""
-	@echo -ir $(LDAPSDK) >> $@
-endif
+	$(CPRE) $(CCFLAGS) -DGENEXPORTS $< -o $@
 
 %.h: %.hnw
 	@echo Creating $@

Modified: apr/apr/trunk/build/NWGNUtail.inc
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/NWGNUtail.inc?rev=1090884&r1=1090883&r2=1090884&view=diff
==============================================================================
--- apr/apr/trunk/build/NWGNUtail.inc (original)
+++ apr/apr/trunk/build/NWGNUtail.inc Sun Apr 10 20:07:31 2011
@@ -51,7 +51,6 @@ endif
 # Create dependency lists based on the files available
 #
 
-
 CCOPT_DEPENDS			= \
 				$(APRBUILD)/NWGNUhead.inc \
 				$(APRBUILD)/NWGNUenvironment.inc \
@@ -94,8 +93,8 @@ endif
 
 ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)"
 $(NLM_NAME)_LINKOPT_DEPENDS	+= NWGNU$(NLM_NAME)
-CCOPT_DEPENDS 	+= NWGNU$(NLM_NAME)
-CPPOPT_DEPENDS 	+= NWGNU$(NLM_NAME)
+CCOPT_DEPENDS			+= NWGNU$(NLM_NAME)
+CPPOPT_DEPENDS			+= NWGNU$(NLM_NAME)
 endif
 
 #
@@ -129,69 +128,43 @@ INCLUDE_BLDCMDS	= 1
 CCOPT_NAME	= $(LIB_NAME)
 endif
 
-ifeq "$(INCLUDE_BLDCMDS)" "1"
-
-$(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt
-#	@echo Compiling $<
-	@echo $(DL)CC   $<$(DL)
-	$(CC) -o $@ $< @$(word 2, $^)
-
-$(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS)
-	$(call DEL,$@)
-ifdef VERBOSE
-	@echo CCOPT_DEPENDS=$^
-endif
-#	@echo Generating $@
-	@echo $(DL)GEN  $@$(DL)
+CCFLAGS = 
 ifneq "$(strip $(CFLAGS))" ""
-	@echo $(DL)$(CFLAGS)$(DL)>> $@
+CCFLAGS += $(CFLAGS)
 endif
 ifneq "$(strip $(XCFLAGS))" ""
-	@echo $(DL)$(XCFLAGS)$(DL)>> $@
+CCFLAGS += $(XCFLAGS)
 endif
 ifneq "$(strip $(XINCDIRS))" ""
-	@echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>>
$@
+CCFLAGS += $(foreach xincdir,$(strip $(XINCDIRS)),-I$(xincdir))
 endif
 ifneq "$(strip $(INCDIRS))" ""
-	@echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>>
$@
+CCFLAGS += $(foreach incdir,$(strip $(INCDIRS)),-I$(incdir))
 endif
 ifneq "$(strip $(DEFINES))" ""
-	@echo $(DL)$(DEFINES)$(DL)>> $@
+CCFLAGS += $(DEFINES)
 endif
 ifneq "$(strip $(XDEFINES))" ""
-	@echo $(DL)$(XDEFINES)$(DL)>> $@
+CCFLAGS += $(XDEFINES)
 endif
 
-$(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt
-#	@echo Compiling $<
-	@echo $(DL)CPP  $<$(DL)
-	$(CCP) -o $@ $< @$(word 2, $^)
+ifeq "$(INCLUDE_BLDCMDS)" "1"
 
-$(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
-	$(call DEL,$@)
+$(OBJDIR)/%.o: %.c $(CCOPT_DEPENDS)
+	@echo $(DL)CC   $<$(DL)
 ifdef VERBOSE
-	@echo CPPOPT_DEPENDS=$^
-endif
-#	@echo Generating $@
-	@echo $(DL)GEN  $@$(DL)
-ifneq "$(strip $(CFLAGS))" ""
-	@echo $(DL)$(CFLAGS)$(DL)>> $@
+	@echo CCOPT_DEPENDS=$(CCOPT_DEPENDS)
 endif
-ifneq "$(strip $(XCFLAGS))" ""
-	@echo $(DL)$(XCFLAGS)$(DL)>> $@
-endif
-ifneq "$(strip $(XINCDIRS))" ""
-	@echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>>
$@
-endif
-ifneq "$(strip $(INCDIRS))" ""
-	@echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>>
$@
-endif
-ifneq "$(strip $(DEFINES))" ""
-	@echo $(DL)$(DEFINES)$(DL)>> $@
-endif
-ifneq "$(strip $(XDEFINES))" ""
-	@echo $(DL)$(XDEFINES)$(DL)>> $@
+	$(CC) $(CCFLAGS) -c -o $@ $<
+
+CCPFLAGS = $(CPFLAGS) $(CCFLAGS)
+
+$(OBJDIR)/%.o: %.cpp $(CPPOPT_DEPENDS)
+	@echo $(DL)CPP  $<$(DL)
+ifdef VERBOSE
+	@echo CPPOPT_DEPENDS=$(CPPOPT_DEPENDS)
 endif
+	$(CPP) $(CCPFLAGS) -c -o $@ $<
 
 endif # one target nlm or lib
 
@@ -205,14 +178,15 @@ ifeq "$(words $(strip $(TARGET_lib)))" "
 
 $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
 	$(call DEL,$@)
-#	@echo Generating $@
 	@echo $(DL)AR   $@$(DL)
-	$(LIB) -o $@ @$<
+	$(AR) -o $@ @$<
+ifdef RANLIB
+	$(RANLIB) $@
+endif
 
 $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS)
 	$(call DEL,$@)
 ifneq "$(strip $(FILES_lib_objs))" ""
-#	@echo Generating $@
 	@echo $(DL)GEN  $@$(DL)
 	@echo $(DL)$(wordlist 1, 10, $(FILES_lib_objs))$(DL)>> $@
 	@echo $(DL)$(wordlist 11, 20, $(FILES_lib_objs))$(DL)>> $@
@@ -230,7 +204,6 @@ endif
 $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
 	$(call DEL,$@)
 ifneq "$(strip $(FILES_lib_objs))" ""
-#	@echo Generating $@
 	@echo $(DL)GEN  $@$(DL)
 	@echo $(DL)$(FILES_lib_objs)$(DL)>> $@
 endif
@@ -251,7 +224,6 @@ endif
 ifeq "$(words $(strip $(TARGET_nlm)))" "1"
 
 $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
-#	@echo Linking $@
 	@echo $(DL)LINK $@$(DL)
 	$(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt
 
@@ -261,7 +233,6 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILE
 $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
 	$(call DEL,$@)
 	$(call DEL,$(@:.opt=.def))
-#	@echo Generating $@
 	@echo $(DL)GEN  $@$(DL)
 	@echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@
 	@echo $(DL)# All your changes will be lost!!$(DL)>> $@

Modified: apr/apr/trunk/file_io/netware/filepath.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/file_io/netware/filepath.c?rev=1090884&r1=1090883&r2=1090884&view=diff
==============================================================================
--- apr/apr/trunk/file_io/netware/filepath.c (original)
+++ apr/apr/trunk/file_io/netware/filepath.c Sun Apr 10 20:07:31 2011
@@ -1,4 +0,0 @@
-/* NetWare & Win32 have much in common with regards to file names (both are 
- * DOSish) so it makes sense to share some code 
- */
-#include "../win32/filepath.c"



Mime
View raw message