diff options
author | Guenter Knauf <fuankg@apache.org> | 2011-03-04 01:19:29 +0000 |
---|---|---|
committer | Guenter Knauf <fuankg@apache.org> | 2011-03-04 01:19:29 +0000 |
commit | c16c739cb3b93b193e0e0763480ddf0c4c3b2e88 (patch) | |
tree | 22959e8de91441a74f7acad20fb598d37d591030 | |
parent | 7bcd12b29d916fe124c8dd084fd6337b56903f9b (diff) | |
download | apr-c16c739cb3b93b193e0e0763480ddf0c4c3b2e88.tar.gz |
NetWare build overhaul in order to compile on Linux.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1076916 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | NWGNUmakefile | 4 | ||||
-rw-r--r-- | build/NWGNUenvironment.inc | 65 | ||||
-rw-r--r-- | build/NWGNUhead.inc | 21 | ||||
-rw-r--r-- | build/NWGNUmakefile | 23 | ||||
-rw-r--r-- | build/NWGNUtail.inc | 94 | ||||
-rw-r--r-- | misc/netware/aprlib.def | 3 | ||||
-rw-r--r-- | xml/NWGNUmakefile | 12 |
7 files changed, 142 insertions, 80 deletions
diff --git a/NWGNUmakefile b/NWGNUmakefile index b4fb03219..69e267bae 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -275,8 +275,8 @@ endif #If the LDAP support is defined then add the imports ifneq "$(LDAPSDK)" "" FILES_nlm_Ximports += \ - @$(LDAPSDK)/imports/lldapsdk.imp \ - @$(LDAPSDK)/imports/lldapssl.imp \ + @lldapsdk.imp \ + @lldapssl.imp \ $(EOLIST) endif diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 259c52458..44ef89b14 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -143,6 +143,38 @@ LIB = mwldnlm -type library -w nocmdline # Setup build tools AWK = awk +# +# Declare Command and tool macros here +# + +ifeq "$(OSTYPE)" "linux" +DEL = $(RM) +MD = mkdir -p +DELTREE = rmdir -p +CP = cp -av +XCP = cp -ar +CHK = test -e +CHKNOT = test ! -e +ECHONL = echo "" +DL = ' +else +ifeq "$(OS)" "Windows_NT" +CMD = cmd /c +DEL = del /q /f 2>NUL +DELTREE = rd /s /q 2>NUL +else +CMD = command /c +DEL = del +DELTREE = deltree /y +endif +MD = md 2>NUL +CP = copy /y 2>NUL +XCP = xcopy /e /y 2>NUL +CHK = $(CMD) if exist +CHKNOT = $(CMD) if not exist +ECHONL = $(CMD) echo. +endif + ifdef IPV6 ifndef USE_STDSOCKETS USE_STDSOCKETS=1 @@ -151,7 +183,7 @@ endif NOVI = $(NOVELLLIBC)/imports -INCDIRS = $(NOVELLLIBC)/include;$(NOVELLLIBC)/include/nks; +INCDIRS = $(NOVELLLIBC)/include; DEFINES = -DNETWARE ifdef USE_STDSOCKETS @@ -214,7 +246,9 @@ endif CFLAGS += -prefix apr_arch_pre_nw.h +ifneq "$(OSTYPE)" "linux" PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools +endif # # Declare major project deliverables output directories here @@ -280,35 +314,6 @@ INSTDIRS += \ $(INSTALLBASE) # -# Declare Command and tool macros here -# - -# Os2LibPath is an extra check to see if we are on NT -ifdef Os2LibPath -OS = Windows_NT -endif - -ifeq "$(OS)" "Windows_NT" -CMD = cmd /C -DEL = del /F -DELTREE = $(CMD) rd /s/q -WINNT = 1 -else -CMD = command /C -DEL = del -DELTREE = deltree /y -endif -CP = copy /Y -XCP = xcopy /E /Y -CHK = $(CMD) if exist -CHKNOT = $(CMD) if not exist - - -# -# Setup base C compiler flags -# - -# # Common directories # diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index e9a5d097a..427e5ffe9 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -26,7 +26,7 @@ install :: NO_LICENSE_FILE installdev :: NO_LICENSE_FILE NO_LICENSE_FILE : - $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)\license.dat" + $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)/license.dat" else # LM_LICENSE_FILE must be defined so use the real targets @@ -51,21 +51,20 @@ help : @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map @echo clobber_all . . . deletes all possible output from the make @echo clobber_install . deletes all files in $(INSTALL) - @$(CMD) echo. + @$(ECHONL) @echo Multiple targets can be used on a single nmake command line - @echo (i.e. $(MAKE) clean all) - @$(CMD) echo. + @$(ECHONL) @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release @echo The default is RELEASE=release clobber_all :: clean clobber_install clobber_install :: - -$(DELTREE) $(INSTALL) 2>NUL + -$(DELTREE) $(INSTALL) test :: default $(MAKE) -C $(APRTEST) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" - $(CMD) echo. # # build recursive targets @@ -73,13 +72,13 @@ test :: default $(SUBDIRS) : FORCE ifneq "$(MAKECMDGOALS)" "clean" - $(CMD) echo. + @$(ECHONL) @echo Building $(CURDIR)/$@ endif $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" - $(CMD) echo. + @$(ECHONL) -FORCE: +FORCE : ; # # Standard targets @@ -87,13 +86,13 @@ FORCE: clean :: $(SUBDIRS) $(APRTEST) @echo Cleaning up $(CURDIR) - -$(DELTREE) $(OBJDIR) 2> NUL + -$(DELTREE) $(OBJDIR) $(CHK) *.err $(DEL) *.err $(CHK) *.map $(DEL) *.map $(CHK) *.d $(DEL) *.d $(CHK) *.tmp $(DEL) *.tmp - -$(DELTREE) $(OBJDIR) 2> NUL + -$(DELTREE) $(OBJDIR) $(OBJDIR) :: - $(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR) + -$(MD) $@ diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index b15ad8b23..fb6f1183d 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -26,16 +26,17 @@ FILES_prebuild_headers = \ nlms :: $(APR)/aprlib.imp $(APR)/aprlib.imp : make_nw_export.awk nw_export.i - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ $(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | sort >$@ nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ $(CC) $< @$(NLM_NAME)_cc.opt $(NLM_NAME)_cc.opt : NWGNUmakefile $(APR)/build/NWGNUenvironment.inc $(APR)/build/NWGNUhead.inc $(APR)/build/NWGNUtail.inc $(CUSTOM_INI) - $(CHK) $@ $(DEL) $@ - @echo -P >> $@ + @echo -P > $@ @echo -EP >> $@ @echo -nosyspath >> $@ @echo -w nocmdline >> $@ @@ -52,15 +53,27 @@ endif $(APR)/include/%.h: $(APR)/include/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/%.h: $(APR)/include/private/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/%.h: $(APR)/include/private/%.hw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(APR)/include/private/apu_config.h: FORCE @@ -87,5 +100,5 @@ clean :: # in this makefile # -include $(APR_WORK)\build\NWGNUtail.inc +include $(APR_WORK)/build/NWGNUtail.inc diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 63dfeb591..60215b6f5 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -85,7 +85,8 @@ endif ifneq ($(MAKECMDGOALS),clean) $(APRBUILD)/NWGNUversion.inc : $(APRBUILD)/nw_ver.awk $(APR)/include/apr_version.h - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ @$(AWK) -f $^ > $@ -include $(APRBUILD)/NWGNUversion.inc @@ -112,13 +113,19 @@ endif ifeq "$(INCLUDE_BLDCMDS)" "1" $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt - @echo Compiling $< +# @echo Compiling $< + @echo CC $< $(CC) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - @echo CCOPT_DEPENDS=$^ - @echo Generating $@ +endif +# @echo CCOPT_DEPENDS=$^ +# @echo Generating $@ + @echo GEN $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -139,13 +146,19 @@ ifneq "$(strip $(XDEFINES))" "" endif $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt - @echo Compiling $< +# @echo Compiling $< + @echo CC $< $(CCP) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif @echo CPPOPT_DEPENDS=$^ - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ ifneq "$(strip $(CFLAGS))" "" @echo $(CFLAGS) >> $@ endif @@ -176,14 +189,24 @@ endif # one target nlm or lib ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - @echo Generating $@ +endif +# @echo Generating $@ + @echo AR $@ $(LIB) -o $@ @$< $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif ifneq "$(strip $(FILES_lib_objs))" "" - @echo Generating $@ +# @echo Generating $@ + @echo GEN $@ @echo $(wordlist 1, 10, $(FILES_lib_objs)) >> $@ @echo $(wordlist 11, 20, $(FILES_lib_objs)) >> $@ @echo $(wordlist 21, 30, $(FILES_lib_objs)) >> $@ @@ -198,10 +221,14 @@ ifneq "$(strip $(FILES_lib_objs))" "" endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) +endif ifneq "$(strip $(FILES_lib_objs))" "" - @echo Generating $@ - @echo CWD $(CURDIR) +# @echo Generating $@ + @echo GEN $@ @echo $(FILES_lib_objs) >> $@ endif @@ -223,16 +250,23 @@ vpath libcpre.o $(NOVELLLIBC)/imports ifeq "$(words $(strip $(TARGET_nlm)))" "1" $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt - @echo Linking $@ +# @echo Linking $@ + @echo LINK $@ $(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt # This will force the link option file to be rebuilt if we change the # corresponding makefile $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) +ifeq "$(OSTYPE)" "linux" + $(DEL) $@ + $(DEL) $(@:.opt=.def) +else $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) $(CHK) $(subst /,\,$(@:.opt=.def)) $(DEL) $(subst /,\,$(@:.opt=.def)) - @echo Generating $@ +endif +# @echo Generating $@ + @echo GEN $@ @echo -warnings off >> $@ @echo -zerobss >> $@ @echo -o $(TARGET_nlm) >> $@ @@ -251,14 +285,15 @@ endif @echo -l $(APRBUCKETS)/$(OBJDIR) >> $@ @echo -l $(APRLDAP)/$(OBJDIR) >> $@ @echo -l $(APRXML)/$(OBJDIR) >> $@ - @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime" >> $@ - @echo -l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++" >> $@ + @echo -l $(APR)/misc/netware >> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL) >> $@ + @echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL) >> $@ ifneq "$(IPV6)" "" @echo -l $(NOVELLLIBC)/include/winsock/IPV6 >> $@ endif @echo -l $(NOVELLLIBC)/imports >> $@ ifneq "$(LDAPSDK)" "" - @echo -l $(LDAPSDK)/lib/nlm >> $@ + @echo -l $(LDAPSDK)/imports >> $@ endif @echo -nodefaults >> $@ @echo -map $(OBJDIR)/$(NLM_NAME).map>> $@ @@ -266,14 +301,14 @@ ifneq "$(strip $(XLFLAGS))" "" @echo $(XLFLAGS) >> $@ endif ifneq "$(strip $(FILES_nlm_objs))" "" - @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(subst /,\,$(objfile))) >> $@ + @echo $(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile)) >> $@ endif ifneq "$(FILES_nlm_libs)" "" - @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(subst /,\,$(libfile))) >> $@ + @echo $(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile)) >> $@ endif @echo -commandfile $(@:.opt=.def) >> $@ - @echo # Do not edit this file - it is created by make! > $(@:.opt=.def) - @echo # All your changes will be lost!! >> $(@:.opt=.def) + @echo $(DL)# Do not edit this file - it is created by make!$(DL) > $(@:.opt=.def) + @echo $(DL)# All your changes will be lost!!$(DL) >> $(@:.opt=.def) ifneq "$(FILE_nlm_msg)" "" @echo Messages $(FILE_nlm_msg) >> $(@:.opt=.def) endif @@ -281,16 +316,16 @@ ifneq "$(FILE_nlm_hlp)" "" @echo Help $(FILE_nlm_hlp) >> $(@:.opt=.def) endif ifeq "$(FILE_nlm_copyright)" "" - @echo copyright "$(NLM_COPYRIGHT)" >> $(@:.opt=.def) + @echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL) >> $(@:.opt=.def) endif - @echo description "$(NLM_DESCRIPTION)" >> $(@:.opt=.def) - @echo threadname "$(NLM_THREAD_NAME)" >> $(@:.opt=.def) + @echo $(DL)description "$(NLM_DESCRIPTION)"$(DL) >> $(@:.opt=.def) + @echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL) >> $(@:.opt=.def) ifneq "$(NLM_STACK_SIZE)" "" @echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def) else @echo stacksize 64000 >> $(@:.opt=.def) endif - @echo screenname "$(NLM_SCREEN_NAME)" >> $(@:.opt=.def) + @echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL) >> $(@:.opt=.def) ifneq "$(NLM_VERSION)" "" @echo version $(NLM_VERSION) >> $(@:.opt=.def) else @@ -309,13 +344,13 @@ ifneq "$(NLM_FLAGS)" "" @echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_modules)" "" - @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(subst /,\,$(module))) >> $(@:.opt=.def) + @echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_Ximports)" "" - @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(subst /,\,$(import))) >> $(@:.opt=.def) + @echo import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import)) >> $(@:.opt=.def) endif ifneq "$(FILES_nlm_exports)" "" - @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(subst /,\,$(export))) >> $(@:.opt=.def) + @echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export)) >> $(@:.opt=.def) endif # if APACHE_UNIPROC is defined, don't include XDCData @@ -323,7 +358,7 @@ ifndef APACHE_UNIPROC ifneq "$(string $(XDCDATA))" "" @echo xdcdata $(XDCDATA) >> $(@:.opt=.def) else - @echo xdcdata $(APR)/misc/netware/apr.xdc >> $(@:.opt=.def) + @echo xdcdata apr.xdc >> $(@:.opt=.def) endif endif @@ -337,7 +372,7 @@ ifndef NO_LICENSE_FILE $(OBJDIR)/%.nlm: NWGNU% $(APRBUILD)/NWGNUhead.inc $(APRBUILD)/NWGNUtail.inc $(APRBUILD)/NWGNUenvironment.inc $(CUSTOM_INI) $(VERSION_INC) FORCE @echo Calling $< $(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE) - $(CMD) echo. + @$(ECHONL) else @@ -348,6 +383,7 @@ endif # NO_LICENSE_FILE endif # multiple targets $(INSTDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ +# $(CHKNOT) $@\NUL mkdir $@ + -$(MD) $@ diff --git a/misc/netware/aprlib.def b/misc/netware/aprlib.def deleted file mode 100644 index 0a2a01eb8..000000000 --- a/misc/netware/aprlib.def +++ /dev/null @@ -1,3 +0,0 @@ -MODULE LIBC.NLM -MODULE WS2_32.NLM -EXPORT @aprlib.imp diff --git a/xml/NWGNUmakefile b/xml/NWGNUmakefile index 4cdf300cd..d4e5c61d4 100644 --- a/xml/NWGNUmakefile +++ b/xml/NWGNUmakefile @@ -33,15 +33,27 @@ endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(EXPATSRC)/lib/%.h: $(EXPATSRC)/lib/%.h.in @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif $(EXPATSRC)/lib/%.h: $(CURDIR)/%.hnw @echo Creating $@ +ifeq "$(OSTYPE)" "linux" + $(CP) $< $@ +else $(CP) $(subst /,\,$<) $(subst /,\,$@) +endif vpath %.c $(EXPATSRC)/lib |