Skip to content

Commit b5bb381

Browse files
author
Guenter Knauf
committed
NetWare build overhaul in order to compile on Linux.
Part 4. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1078559 13f79535-47bb-0310-9956-ffa450edef68
1 parent 72d4d5c commit b5bb381

27 files changed

+172
-207
lines changed

NWGNUmakefile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ NLM_STACK_SIZE =
141141
#
142142
# If this is specified it will be used by the link '-entry' directive
143143
#
144-
NLM_ENTRY_SYM = _LibCPrelude
144+
NLM_ENTRY_SYM =
145145

146146
#
147147
# If this is specified it will be used by the link '-exit' directive
148148
#
149-
NLM_EXIT_SYM = _LibCPostlude
149+
NLM_EXIT_SYM =
150150

151151
#
152152
# If this is specified it will be used by the link '-check' directive
@@ -156,7 +156,7 @@ NLM_CHECK_SYM =
156156
#
157157
# If this is specified it will be used by the link '-flags' directive
158158
#
159-
NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
159+
NLM_FLAGS =
160160

161161
#
162162
# If this is specified it will be linked in with the XDCData option in the def
@@ -423,24 +423,24 @@ nlms :: libs $(TARGET_nlm)
423423
# correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples)
424424
#
425425
install :: nlms $(INSTDIRS) FORCE
426-
$(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/)
426+
$(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/)
427427
ifndef DEST
428-
-$(call CP,$(APR)/STATUS,$(INSTALLBASE)/*.apr)
429-
-$(call CP,$(APR)/LICENSE,$(INSTALLBASE)/)
430-
-$(call CP,$(APR)/CHANGES,$(INSTALLBASE)/*.apr)
431-
@-$(call XCP,$(APR)/docs,$(INSTALLBASE)/docs/)
428+
-$(call COPY,$(APR)/STATUS,$(INSTALLBASE)/*.apr)
429+
-$(call COPY,$(APR)/LICENSE,$(INSTALLBASE)/)
430+
-$(call COPY,$(APR)/CHANGES,$(INSTALLBASE)/*.apr)
431+
@-$(call COPYR,$(APR)/docs,$(INSTALLBASE)/docs/)
432432
endif
433433

434434
ifndef DEST
435435
installdev :: $(INSTDEVDIRS) FORCE
436-
$(call CP,$(APR)/include/*.h,$(INSTALLBASE)/include/)
437-
$(call CP,$(APR)/*.imp,$(INSTALLBASE)/lib/)
438-
$(call CP,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/)
439-
$(call CP,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/)
440-
$(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/)
436+
$(call COPY,$(APR)/include/*.h,$(INSTALLBASE)/include/)
437+
$(call COPY,$(APR)/*.imp,$(INSTALLBASE)/lib/)
438+
$(call COPY,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/)
439+
$(call COPY,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/)
440+
$(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/)
441441

442442
$(INSTDEVDIRS) ::
443-
$(call MD,$@)
443+
$(call MKDIR,$@)
444444
endif
445445

446446
#
@@ -460,14 +460,15 @@ endif
460460
vpath %.c network_io/unix
461461

462462
$(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt
463-
@echo Compiling $<
463+
# @echo Compiling $<
464+
@echo $(DL)CC $<$(DL)
464465
$(CC) -cwd source -o $@ $< @$(OBJDIR)/$(NLM_NAME)_cc.opt
465466

466467
#
467468
# Include the 'tail' makefile that has targets that depend on variables defined
468469
# in this makefile
469470
#
470471

471-
include $(APR_WORK)/build/NWGNUtail.inc
472+
include $(APRBUILD)/NWGNUtail.inc
472473

473474

build/NWGNUenvironment.inc

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $(error neither EXPATSDK nor EXPATSRC defined - cant compile without EXPAT SDK o
7272
endif
7373

7474
ifndef METROWERKS
75-
METROWERKS = C:\Program Files\Metrowerks\CodeWarrior
75+
METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
7676
endif
7777

7878
# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
@@ -142,33 +142,35 @@ LIB = mwldnlm -type library -w nocmdline
142142

143143
# Setup build tools
144144
AWK = awk
145+
SORT = sort
145146

146147
#
147148
# Declare Command and tool macros here
148149
#
149150

150151
ifeq ($(findstring /sh,$(SHELL)),/sh)
151-
DEL = $(RM) $1
152-
MD = mkdir -p $1
153-
DELTREE = rm -rf $1
154-
CP = cp -av $1 $2
155-
XCP = cp -ar
152+
DEL = rm -f $1
153+
RMDIR = rm -rf $1
154+
MKDIR = mkdir -p $1
155+
COPY = cp -av $1 $2
156+
COPYR = cp -ar $1 $2
156157
ECHONL = echo ""
157158
DL = '
159+
CAT = cat
158160
else
159161
ifeq "$(OS)" "Windows_NT"
160-
CMD = cmd /c
161-
DEL = $(CMD) if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1)
162-
DELTREE = rd /s /q 2>NUL $(subst /,\,$1)
162+
DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
163+
RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
164+
ECHONL = cmd /c echo.
163165
else
164-
CMD = command /c
165-
DEL = $(CMD) if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1)
166-
DELTREE = deltree /y $(subst /,\,$1)
167-
endif
168-
MD = $(CMD) if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1)
169-
CP = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
170-
XCP = xcopy /e /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
171-
ECHONL = $(CMD) echo.
166+
DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
167+
RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
168+
ECHONL = command /c echo.
169+
endif
170+
MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
171+
COPY = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
172+
COPYR = xcopy /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
173+
CAT = type
172174
endif
173175
174176
ifdef IPV6

build/NWGNUhead.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ FORCE : ;
8686

8787
clean :: $(SUBDIRS) $(APRTEST)
8888
@echo Cleaning up $(CURDIR)
89-
-$(call DELTREE,$(OBJDIR))
89+
$(call RMDIR,$(OBJDIR))
9090
$(call DEL,*.err)
9191
$(call DEL,*.map)
92-
# $(call DEL,*.d)
9392
$(call DEL,*.tmp)
93+
# $(call DEL,*.d)
9494

9595
$(OBJDIR) ::
96-
$(call MD,$@)
96+
$(call MKDIR,$@)
9797

build/NWGNUmakefile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ FILES_prebuild_headers = \
1919
$(APR)/include/apr.h \
2020
$(APR)/include/apu_want.h \
2121
$(APR)/include/apr_ldap.h \
22-
$(APR)/include/private/apu_config.h \
2322
$(APR)/include/private/apu_select_dbm.h \
2423
$(EOLIST)
2524

@@ -28,7 +27,7 @@ nlms :: $(APR)/aprlib.imp
2827
$(APR)/aprlib.imp : make_nw_export.awk nw_export.i
2928
# @echo Generating $@
3029
@echo GEN $@
31-
$(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | sort >$@
30+
$(AWK) -v EXPPREFIX=APR$(VERSION_MAJMIN) -f $^ | $(SORT) >$@
3231

3332
nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt
3433
# @echo Generating $@
@@ -51,19 +50,13 @@ ifneq "$(LDAPSDK)" ""
5150
@echo -ir $(LDAPSDK) >> $@
5251
endif
5352

54-
$(APR)/include/%.h: $(APR)/include/%.hnw
53+
%.h: %.hnw
5554
@echo Creating $@
56-
$(call CP,$<,$@)
55+
$(call COPY,$<,$@)
5756

58-
$(APR)/include/private/%.h: $(APR)/include/private/%.hnw
57+
%.h: %.hw
5958
@echo Creating $@
60-
$(call CP,$<,$@)
61-
62-
$(APR)/include/private/%.h: $(APR)/include/private/%.hw
63-
@echo Creating $@
64-
$(call CP,$<,$@)
65-
66-
$(APR)/include/private/apu_config.h: FORCE
59+
$(call COPY,$<,$@)
6760

6861
#
6962
# You can use this target if all that is needed is to copy files to the
@@ -76,17 +69,14 @@ clean ::
7669
$(call DEL,nw_export.i)
7770
$(call DEL,$(NLM_NAME)_cc.opt)
7871
$(call DEL,NWGNUversion.inc)
79-
$(call DEL,$(APR)/include/apr.h)
80-
$(call DEL,$(APR)/include/apu_want.h)
81-
$(call DEL,$(APR)/include/apr_ldap.h)
82-
$(call DEL,$(APR)/include/private/apu_config.h)
83-
$(call DEL,$(APR)/include/private/apu_select_dbm.h)
8472
$(call DEL,$(APR)/aprlib.imp)
73+
$(foreach file,$(FILES_prebuild_headers),$(call DEL,$(file)))
8574

8675
#
8776
# Include the 'tail' makefile that has targets that depend on variables defined
8877
# in this makefile
8978
#
9079

91-
include $(APR_WORK)/build/NWGNUtail.inc
80+
include $(APRBUILD)/NWGNUtail.inc
81+
9282

build/NWGNUtail.inc

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@ ifndef NLM_COPYRIGHT
2828
NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0
2929
endif
3030

31+
ifeq "$(NLM_FLAGS)" ""
32+
NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
33+
endif
34+
35+
ifeq "$(NLM_STACK_SIZE)" ""
36+
NLM_STACK_SIZE = 65536
37+
endif
38+
39+
ifeq "$(NLM_ENTRY_SYM)" ""
40+
NLM_ENTRY_SYM = _LibCPrelude
41+
endif
42+
43+
ifeq "$(NLM_EXIT_SYM)" ""
44+
NLM_EXIT_SYM = _LibCPostlude
45+
endif
46+
3147
#
3248
# Create dependency lists based on the files available
3349
#
@@ -114,14 +130,14 @@ ifeq "$(INCLUDE_BLDCMDS)" "1"
114130

115131
$(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt
116132
# @echo Compiling $<
117-
@echo CC $<
133+
@echo $(DL)CC $<$(DL)
118134
$(CC) -o $@ $< @$(word 2, $^)
119135

120136
$(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS)
121137
$(call DEL,$@)
122138
# @echo CCOPT_DEPENDS=$^
123139
# @echo Generating $@
124-
@echo GEN $@
140+
@echo $(DL)GEN $@$(DL)
125141
ifneq "$(strip $(CFLAGS))" ""
126142
@echo $(CFLAGS) >> $@
127143
endif
@@ -143,14 +159,14 @@ endif
143159

144160
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt
145161
# @echo Compiling $<
146-
@echo CC $<
162+
@echo $(DL)CPP $<$(DL)
147163
$(CCP) -o $@ $< @$(word 2, $^)
148164

149165
$(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
150166
$(call DEL,$@)
151-
@echo CPPOPT_DEPENDS=$^
167+
# @echo CPPOPT_DEPENDS=$^
152168
# @echo Generating $@
153-
@echo GEN $@
169+
@echo $(DL)GEN $@$(DL)
154170
ifneq "$(strip $(CFLAGS))" ""
155171
@echo $(CFLAGS) >> $@
156172
endif
@@ -183,14 +199,14 @@ ifeq "$(words $(strip $(TARGET_lib)))" "1"
183199
$(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
184200
$(call DEL,$@)
185201
# @echo Generating $@
186-
@echo AR $@
202+
@echo $(DL)AR $@$(DL)
187203
$(LIB) -o $@ @$<
188204

189205
$(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS)
190206
$(call DEL,$@)
191207
ifneq "$(strip $(FILES_lib_objs))" ""
192208
# @echo Generating $@
193-
@echo GEN $@
209+
@echo $(DL)GEN $@$(DL)
194210
@echo $(wordlist 1, 10, $(FILES_lib_objs)) >> $@
195211
@echo $(wordlist 11, 20, $(FILES_lib_objs)) >> $@
196212
@echo $(wordlist 21, 30, $(FILES_lib_objs)) >> $@
@@ -208,7 +224,7 @@ $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
208224
$(call DEL,$@)
209225
ifneq "$(strip $(FILES_lib_objs))" ""
210226
# @echo Generating $@
211-
@echo GEN $@
227+
@echo $(DL)GEN $@$(DL)
212228
@echo $(FILES_lib_objs) >> $@
213229
endif
214230

@@ -231,7 +247,7 @@ ifeq "$(words $(strip $(TARGET_nlm)))" "1"
231247

232248
$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
233249
# @echo Linking $@
234-
@echo LINK $@
250+
@echo $(DL)LINK $@$(DL)
235251
$(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt
236252

237253
# This will force the link option file to be rebuilt if we change the
@@ -241,18 +257,20 @@ $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
241257
$(call DEL,$@)
242258
$(call DEL,$(@:.opt=.def))
243259
# @echo Generating $@
244-
@echo GEN $@
260+
@echo $(DL)GEN $@$(DL)
261+
@echo $(DL)# Do not edit this file - it is created by make!$(DL) > $@
262+
@echo $(DL)# All your changes will be lost!!$(DL) >> $@
245263
@echo -warnings off >> $@
246264
@echo -zerobss >> $@
247265
@echo -o $(TARGET_nlm) >> $@
248266
ifneq "$(FILE_nlm_copyright)" ""
249-
@-type $(FILE_nlm_copyright) >> $@
267+
@-$(CAT) $(FILE_nlm_copyright) >> $@
250268
endif
251269
ifeq "$(RELEASE)" "debug"
252270
@echo -g >> $@
253271
@echo -sym internal >> $@
254272
@echo -sym codeview4 >> $@
255-
@echo -osym $(OBJDIR)\$(NLM_NAME).sym >> $@
273+
@echo -osym $(OBJDIR)/$(NLM_NAME).sym >> $@
256274
else
257275
@echo -sym internal >> $@
258276
endif
@@ -295,29 +313,19 @@ ifeq "$(FILE_nlm_copyright)" ""
295313
endif
296314
@echo $(DL)description "$(NLM_DESCRIPTION)"$(DL) >> $(@:.opt=.def)
297315
@echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL) >> $(@:.opt=.def)
298-
ifneq "$(NLM_STACK_SIZE)" ""
299-
@echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def)
300-
else
301-
@echo stacksize 64000 >> $(@:.opt=.def)
302-
endif
303316
@echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL) >> $(@:.opt=.def)
317+
@echo stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE)))) >> $(@:.opt=.def)
304318
ifneq "$(NLM_VERSION)" ""
305319
@echo version $(NLM_VERSION) >> $(@:.opt=.def)
306320
else
307321
@echo version $(VERSION) >> $(@:.opt=.def)
308322
endif
309-
ifneq "$(NLM_ENTRY_SYM)" ""
323+
@echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def)
310324
@echo start $(NLM_ENTRY_SYM) >> $(@:.opt=.def)
311-
endif
312-
ifneq "$(NLM_EXIT_SYM)" ""
313325
@echo exit $(NLM_EXIT_SYM) >> $(@:.opt=.def)
314-
endif
315326
ifneq "$(NLM_CHECK_SYM)" ""
316327
@echo check $(NLM_CHECK_SYM) >> $(@:.opt=.def)
317328
endif
318-
ifneq "$(NLM_FLAGS)" ""
319-
@echo $(strip $(NLM_FLAGS)) >> $(@:.opt=.def)
320-
endif
321329
ifneq "$(FILES_nlm_modules)" ""
322330
@echo module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module)) >> $(@:.opt=.def)
323331
endif
@@ -327,7 +335,6 @@ endif
327335
ifneq "$(FILES_nlm_exports)" ""
328336
@echo export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export)) >> $(@:.opt=.def)
329337
endif
330-
331338
# if APACHE_UNIPROC is defined, don't include XDCData
332339
ifndef APACHE_UNIPROC
333340
ifneq "$(string $(XDCDATA))" ""
@@ -358,6 +365,6 @@ endif # NO_LICENSE_FILE
358365
endif # multiple targets
359366

360367
$(INSTDIRS) ::
361-
$(call MD,$@)
368+
$(call MKDIR,$@)
362369

363370

0 commit comments

Comments
 (0)