X-Git-Url: https://granicus.if.org/sourcecode?a=blobdiff_plain;f=build%2FNWGNUenvironment.inc;h=162365c16feefc87fd49926afe13dd3ec482fcf1;hb=cdb37c5e4d684dd22c702a1d8ae65ab875603d40;hp=0f8c97f1d4a9a3a23cc5b8453f2754c090e85fac;hpb=11128b2991ec9afea1b12d805b716ff97873e3c0;p=apache diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 0f8c97f1d4..162365c16f 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -2,9 +2,9 @@ # Setup needed Tools and Libraries # -ifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini" -include $(AP_WORK)\NWGNUcustom.ini -CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini +ifeq "$(wildcard $(AP_WORK)/NWGNUcustom.ini)" "$(AP_WORK)/NWGNUcustom.ini" +include $(AP_WORK)/NWGNUcustom.ini +CUSTOM_INI = $(AP_WORK)/NWGNUcustom.ini endif ifndef VERBOSE @@ -38,14 +38,31 @@ endif ifndef NOVELLLIBC NOVELLLIBC = C:/novell/ndk/libc endif +ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h" +$(error NOVELLLIBC does not point to a valid Novell LIBC SDK) +endif + +ifndef LDAPSDK +LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc +endif +ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h" +$(error LDAPSDK does not point to a valid Novell CLDAP SDK) +endif + +ifndef PCRESRC +PCRESRC = $(AP_WORK)/srclib/pcre +endif +ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in" +$(error PCRESRC does not point to a valid PCRE source tree) +endif # This is a placeholder -# ifndef LDAPSDK -# LDAPSDK = C:/novell/ndk/cldapsdk +# ifndef ZLIBSDK +# ZLIBSDK = C:/novell/ndk/zlibsdk # endif ifndef METROWERKS -METROWERKS = C:\Program Files\Metrowerks\CodeWarrior +METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior endif # If LM_LICENSE_FILE isn't defined, define a variable that can be used to @@ -57,75 +74,155 @@ endif # # Set the Release type that you want to build, possible values are: # -# debug - full debug switches are set -# noopt - normal switches are set (default) -# optimized - optimization switches are set +# debug - full debug switches are set +# noopt - normal switches are set +# release - optimization switches are set (default) ifdef reltype -RELEASE=$(reltype) -endif +RELEASE = $(reltype) +endif ifdef RELTYPE -RELEASE=$(RELTYPE) +RELEASE = $(RELTYPE) endif ifdef debug -RELEASE=debug +RELEASE = debug endif ifdef DEBUG -RELEASE=debug +RELEASE = debug endif -ifdef optimized -RELEASE=optimized +ifdef noopt +RELEASE = noopt endif -ifdef OPTIMIZED -RELEASE=optimized +ifdef NOOPT +RELEASE = noopt endif -ifndef RELEASE -RELEASE = optimized +ifdef optimized +RELEASE = release endif -ifeq "$(RELEASE)" "debug" -OBJDIR = Debug +ifdef OPTIMIZED +RELEASE = release endif -ifeq "$(RELEASE)" "noopt" -OBJDIR = Noopt +ifndef RELEASE +RELEASE = release endif -ifeq "$(RELEASE)" "optimized" -OBJDIR = Release -endif +OBJDIR = obj_$(RELEASE) + +# Define minimum APR version to check for +APR_WANTED = 1004000 # # Setup compiler information # # MetroWerks NLM tools -CC = mwccnlm -CPP = mwccnlm +CC = mwccnlm +CPP = mwccnlm LINK = mwldnlm -LIB = mwldnlm -type library -w nocmdline +LIB = mwldnlm -type library -w nocmdline +WIN_CC = mwcc + +# Setup build tools +AWK = awk -NOVI = $(NOVELLLIBC)\imports +# Setup distribution tools +ZIP = zip -qr9 +7ZA = 7za >NUL a -INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock; +# +# Declare Command and tool macros here +# + +ifeq ($(findstring /sh,$(SHELL)),/sh) +DEL = rm -f $1 +RMDIR = rm -fr $1 +MKDIR = mkdir -p $1 +COPY = -cp -afv $1 $2 +#COPYR = -cp -afr $1/* $2 +COPYR = -rsync -aC $1/* $2 +TOUCH = -touch $1 +ECHONL = echo "" +DL = ' +CAT = cat +else +ifeq "$(OS)" "Windows_NT" +DEL = $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1)) +RMDIR = $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1)) +else +DEL = $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1)) +RMDIR = $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1)) +endif +ECHONL = $(ComSpec) /c echo. +MKDIR = $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1)) +COPY = -copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) +COPYR = -xcopy /q /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2) +TOUCH = -copy /b 2>&1>NUL $(subst /,\,$1) +,, +CAT = type +endif + +ifdef IPV6 +ifndef USE_STDSOCKETS +USE_STDSOCKETS=1 +endif +endif + +NOVI = $(NOVELLLIBC)/imports +PRELUDE = $(NOVI)/libcpre.o + +INCDIRS = $(NOVELLLIBC)/include; +ifndef USE_STDSOCKETS +INCDIRS += $(NOVELLLIBC)/include/winsock; +endif ifneq "$(LDAPSDK)" "" -INCDIRS := $(INCDIRS);$(LDAPSDK)/inc +INCDIRS += $(LDAPSDK)/inc; +endif +ifneq "$(ZLIBSDK)" "" +INCDIRS += $(ZLIBSDK); +endif +ifneq "$(PCRESRC)" "" +INCDIRS += $(PCRESRC); endif -DEFINES = -DNETWARE +DEFINES = -DNETWARE +ifndef USE_STDSOCKETS +DEFINES += -DUSE_WINSOCK +endif +ifndef DEBUG +DEFINES += -DNDEBUG +endif -# -# MetroWerks static Libraries +ifdef USE_STDSOCKETS +VERSION_SKT = (BSDSOCK) +else +VERSION_SKT = (WINSOCK) +endif -CLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib +# 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 +PLIB3S = $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib + +ifeq "$(OS)" "Windows_NT" +# MetroWerks Win32 build flags to create build tools +MWCW_MSL = "$(METROWERKS)/MSL" +MWCW_W32 = "$(METROWERKS)/Win32-x86 Support" +HOST_CC = $(WIN_CC) +HOST_CFLAGS = -O2 -gccinc -nodefaults -proc 586 -w off +HOST_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32) +HOST_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib +else +# GNUC build flags to create build tools +HOST_CC = gcc +HOST_CFLAGS = -Wall -O2 +endif # Base compile flags # and prefix or precompiled header added here. @@ -139,128 +236,138 @@ PLIB3S = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP # -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 +# -inst mmx use MMX extensions (Not used) -CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII -inst mmx +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)" "optimized" +ifeq "$(RELEASE)" "release" CFLAGS += -O4,p endif # -prefix pre_nw.h #include pre_nw.h for all files - CFLAGS += -prefix 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 # +ifndef PORT +PORT = 80 +endif + +ifndef SSLPORT +SSLPORT = 443 +endif + ifdef DEST -INSTALL = $(DEST) -ifeq (\, $(findstring \,$(INSTALL))) -INSTDIRS = $(DEST) +INSTALL = $(subst \,/,$(DEST)) +ifeq (/, $(findstring /,$(INSTALL))) +INSTDIRS = $(INSTALL) endif endif ifdef dest -INSTALL = $(dest) -ifeq (\, $(findstring \,$(INSTALL))) -INSTDIRS = $(dest) +INSTALL = $(subst \,/,$(dest)) +ifeq (/, $(findstring /,$(INSTALL))) +INSTDIRS = $(INSTALL) endif endif ifndef INSTALL -INSTALL = $(AP_WORK)\Dist -INSTDIRS = $(AP_WORK)\Dist +INSTALL = $(AP_WORK)/Dist +INSTDIRS = $(INSTALL) +endif + +ifeq ($(MAKECMDGOALS),installdev) +ifndef BASEDIR +export BASEDIR = apache_$(VERSION_STR)-sdk +endif +else +ifndef BASEDIR +export BASEDIR = Apache$(VERSION_MAJMIN) +endif 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 "$(IPV6)" "SET" +ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" OBJDIR := $(OBJDIR)_IPV6 +endif + +ifneq "$(findstring IPV6,$(INSTALL))" "IPV6" INSTALL := $(INSTALL)_IPV6 +endif + +ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6" INSTDIRS := $(INSTDIRS)_IPV6 -IPV6=SET endif endif -INSTDEVDIRS := \ - $(INSTDIRS) \ - $(INSTALL)\Apache2\include \ - $(INSTALL)\Apache2\lib \ - -INSTDIRS += \ - $(INSTALL)\Apache2 \ - $(INSTALL)\Apache2\bin \ - $(INSTALL)\Apache2\cgi-bin \ - $(INSTALL)\Apache2\conf \ - $(INSTALL)\Apache2\error \ - $(INSTALL)\Apache2\htdocs \ - $(INSTALL)\Apache2\icons \ - $(INSTALL)\Apache2\logs \ - $(INSTALL)\Apache2\man \ - $(INSTALL)\Apache2\manual \ - $(INSTALL)\Apache2\modules \ +INSTALLBASE = $(INSTALL)/$(BASEDIR) -# -# Declare Command and tool macros here -# +INSTDEVDIRS = \ + $(INSTALL) \ + $(INSTALLBASE) \ + $(INSTALLBASE)/build \ + $(INSTALLBASE)/include \ + $(INSTALLBASE)/lib \ + $(EOLIST) -# 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 -CHK=cmd /C if exist -CHKNOT=cmd /C if not exist -DEL = del /F -DELTREE = cmd /C rd /s/q -WINNT=1 -else -CMD=command /C -CHK=command /C if exist -CHKNOT=command /C if not exist -DEL = del -DELTREE = deltree /y -endif - - -# -# Setup base C compiler flags -# +INSTDIRS += \ + $(INSTALLBASE) \ + $(INSTALLBASE)/bin \ + $(INSTALLBASE)/cgi-bin \ + $(INSTALLBASE)/conf \ + $(INSTALLBASE)/conf/extra \ + $(INSTALLBASE)/error \ + $(INSTALLBASE)/htdocs \ + $(INSTALLBASE)/icons \ + $(INSTALLBASE)/logs \ + $(INSTALLBASE)/man \ + $(INSTALLBASE)/manual \ + $(INSTALLBASE)/modules \ + $(EOLIST) # # Common directories # -STDMOD = $(AP_WORK)/modules -NWOS = $(AP_WORK)/os/netware -SERVER = $(AP_WORK)/server -SRC = $(AP_WORK) -APR = $(AP_WORK)/srclib/apr -APRUTIL = $(AP_WORK)/srclib/apr-util -SUPMOD = $(AP_WORK)/support -PCRE = $(AP_WORK)/srclib/pcre -APRTEST = $(AP_WORK)/srclib/apr/test -HTTPD = $(AP_WORK)/modules/http -XML = $(AP_WORK)/srclib/apr-util/xml +SRC = $(subst \,/,$(AP_WORK)) +APR = $(subst \,/,$(APR_WORK)) +APRUTIL = $(subst \,/,$(APU_WORK)) +APBUILD = $(SRC)/build +STDMOD = $(SRC)/modules +HTTPD = $(SRC)/modules/http +DAV = $(SRC)/modules/dav +NWOS = $(SRC)/os/netware +SERVER = $(SRC)/server +SUPMOD = $(SRC)/support +APULDAP = $(APRUTIL)/ldap +XML = $(APRUTIL)/xml +APRTEST = $(APR)/test +PCRE = $(PCRESRC) + +PREBUILD_INST = $(SRC)/nwprebuild # # Internal Libraries @@ -268,8 +375,9 @@ XML = $(AP_WORK)/srclib/apr-util/xml APRLIB = $(APR)/$(OBJDIR)/aprlib.lib APRUTLIB = $(APRUTIL)/$(OBJDIR)/aprutil.lib +APULDAPLIB = $(APULDAP)/$(OBJDIR)/apuldap.lib STMODLIB = $(STDMOD)/$(OBJDIR)/stdmod.lib -PCRELIB = $(PCRE/$(OBJDIR)/pcre.lib +PCRELIB = $(SRC)/$(OBJDIR)/pcre.lib NWOSLIB = $(NWOS)/$(OBJDIR)/netware.lib SERVLIB = $(SERVER)/$(OBJDIR)/server.lib HTTPDLIB = $(HTTPD)/$(OBJDIR)/httpd.lib @@ -278,7 +386,6 @@ XMLLIB = $(XML)/$(OBJDIR)/xmllib.lib # # Additional general defines # -VERSION = 2,0,0 EnvironmentDefined = 1 endif # ifndef EnvironmentDefined