Blame build/NWGNUenvironment.inc

Packit 90a5c9
#
Packit 90a5c9
# Setup needed Tools and Libraries
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
ifeq "$(wildcard $(AP_WORK)/NWGNUcustom.ini)" "$(AP_WORK)/NWGNUcustom.ini"
Packit 90a5c9
include $(AP_WORK)/NWGNUcustom.ini
Packit 90a5c9
CUSTOM_INI = $(AP_WORK)/NWGNUcustom.ini
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef VERBOSE
Packit 90a5c9
.SILENT:
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Treat like an include
Packit 90a5c9
#
Packit 90a5c9
ifndef EnvironmentDefined
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# simple macros for parsing makefiles
Packit 90a5c9
#
Packit 90a5c9
EOLIST:=
Packit 90a5c9
EMPTY :=
Packit 90a5c9
COMMA := ,
Packit 90a5c9
SPACE := $(EMPTY) $(EMPTY)
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Base environment
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
# Try and handle case issues
Packit 90a5c9
ifndef NOVELLLIBC
Packit 90a5c9
ifdef NovellLibC
Packit 90a5c9
NOVELLLIBC = $(NovellLibC)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef NOVELLLIBC
Packit 90a5c9
NOVELLLIBC = C:/novell/ndk/libc
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h"
Packit 90a5c9
$(error NOVELLLIBC does not point to a valid Novell LIBC SDK) 
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef LDAPSDK
Packit 90a5c9
LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h"
Packit 90a5c9
$(error LDAPSDK does not point to a valid Novell CLDAP SDK) 
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef WITH_HTTP2
Packit 90a5c9
ifneq "$(wildcard $(NGH2SRC)/lib/nghttp2_hd.h)" "$(NGH2SRC)/lib/nghttp2_hd.h"
Packit 90a5c9
$(error NGH2SRC does not point to a valid NGHTTP2 source tree)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef PCRESRC
Packit 90a5c9
PCRESRC = $(AP_WORK)/srclib/pcre
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(wildcard $(PCRESRC)/pcre-config.in)" "$(PCRESRC)/pcre-config.in"
Packit 90a5c9
$(error PCRESRC does not point to a valid PCRE source tree) 
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# This is a placeholder
Packit 90a5c9
# ifndef ZLIBSDK
Packit 90a5c9
# ZLIBSDK = C:/novell/ndk/zlibsdk
Packit 90a5c9
# endif
Packit 90a5c9
Packit 90a5c9
ifndef METROWERKS
Packit 90a5c9
METROWERKS = $(ProgramFiles)\Metrowerks\CodeWarrior
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# If LM_LICENSE_FILE isn't defined, define a variable that can be used to
Packit 90a5c9
# restart make with it defined
Packit 90a5c9
ifndef LM_LICENSE_FILE
Packit 90a5c9
NO_LICENSE_FILE = NO_LICENSE_FILE
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Set the Release type that you want to build, possible values are:
Packit 90a5c9
#
Packit 90a5c9
#  debug	- full debug switches are set
Packit 90a5c9
#  noopt	- normal switches are set
Packit 90a5c9
#  release	- optimization switches are set (default)
Packit 90a5c9
Packit 90a5c9
ifdef reltype
Packit 90a5c9
RELEASE = $(reltype)
Packit 90a5c9
endif    
Packit 90a5c9
Packit 90a5c9
ifdef RELTYPE
Packit 90a5c9
RELEASE = $(RELTYPE)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef debug
Packit 90a5c9
RELEASE = debug
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef DEBUG
Packit 90a5c9
RELEASE = debug
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef noopt
Packit 90a5c9
RELEASE = noopt
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef NOOPT
Packit 90a5c9
RELEASE = noopt
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef optimized
Packit 90a5c9
RELEASE = release
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef OPTIMIZED
Packit 90a5c9
RELEASE = release
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef RELEASE
Packit 90a5c9
RELEASE = release
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
OBJDIR = obj_$(RELEASE)
Packit 90a5c9
Packit 90a5c9
# Define minimum APR version to check for
Packit 90a5c9
APR_WANTED = 1004000
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Setup compiler information
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
# MetroWerks NLM tools
Packit 90a5c9
CC	= mwccnlm
Packit 90a5c9
CPP	= mwccnlm
Packit 90a5c9
LINK	= mwldnlm
Packit 90a5c9
LIB	= mwldnlm -type library -w nocmdline
Packit 90a5c9
WIN_CC	= mwcc
Packit 90a5c9
Packit 90a5c9
# Setup build tools
Packit 90a5c9
AWK	= awk
Packit 90a5c9
Packit 90a5c9
# Setup distribution tools
Packit 90a5c9
ZIP	= zip -qr9
Packit 90a5c9
7ZA	= 7za >NUL a
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Declare Command and tool macros here
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
ifeq ($(findstring /sh,$(SHELL)),/sh)
Packit 90a5c9
DEL	= rm -f $1
Packit 90a5c9
RMDIR	= rm -fr $1
Packit 90a5c9
MKDIR	= mkdir -p $1
Packit 90a5c9
COPY	= -cp -afv $1 $2
Packit 90a5c9
#COPYR	= -cp -afr $1/* $2
Packit 90a5c9
COPYR	= -rsync -aC $1/* $2
Packit 90a5c9
TOUCH	= -touch $1
Packit 90a5c9
ECHONL	= echo ""
Packit 90a5c9
DL	= '
Packit 90a5c9
CAT	= cat
Packit 90a5c9
else
Packit 90a5c9
ifeq "$(OS)" "Windows_NT"
Packit 90a5c9
DEL	= $(shell if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1))
Packit 90a5c9
RMDIR	= $(shell if exist $(subst /,\,$1)\NUL rd /q /s 2>NUL $(subst /,\,$1))
Packit 90a5c9
else
Packit 90a5c9
DEL	= $(shell if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1))
Packit 90a5c9
RMDIR	= $(shell if exist $(subst /,\,$1)\NUL deltree /y 2>NUL $(subst /,\,$1))
Packit 90a5c9
endif
Packit 90a5c9
ECHONL	= $(ComSpec) /c echo.
Packit 90a5c9
MKDIR	= $(shell if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1))
Packit 90a5c9
COPY	= -copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2)
Packit 90a5c9
COPYR	= -xcopy /q /y /e 2>NUL $(subst /,\,$1) $(subst /,\,$2)
Packit 90a5c9
TOUCH	= -copy /b 2>&1>NUL $(subst /,\,$1) +,,
Packit 90a5c9
CAT	= type
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef IPV6
Packit 90a5c9
ifndef USE_STDSOCKETS
Packit 90a5c9
USE_STDSOCKETS=1
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
NOVI	= $(NOVELLLIBC)/imports
Packit 90a5c9
PRELUDE	= $(NOVI)/libcpre.o
Packit 90a5c9
Packit 90a5c9
INCDIRS	= $(NOVELLLIBC)/include;
Packit 90a5c9
ifndef USE_STDSOCKETS
Packit 90a5c9
INCDIRS	+= $(NOVELLLIBC)/include/winsock;
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(LDAPSDK)" ""
Packit 90a5c9
INCDIRS += $(LDAPSDK)/inc;
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(ZLIBSDK)" ""
Packit 90a5c9
INCDIRS += $(ZLIBSDK);
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(PCRESRC)" ""
Packit 90a5c9
INCDIRS += $(PCRESRC);
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
DEFINES	= -DNETWARE 
Packit 90a5c9
ifndef USE_STDSOCKETS
Packit 90a5c9
DEFINES	+= -DUSE_WINSOCK
Packit 90a5c9
endif
Packit 90a5c9
ifndef DEBUG
Packit 90a5c9
DEFINES	+= -DNDEBUG
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef USE_STDSOCKETS
Packit 90a5c9
VERSION_SKT = (BSDSOCK)
Packit 90a5c9
else
Packit 90a5c9
VERSION_SKT = (WINSOCK)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# MetroWerks static Libraries
Packit 90a5c9
CLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime/mwcrtl.lib
Packit 90a5c9
MATH3S	=
Packit 90a5c9
PLIB3S	= $(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++/MWCPP.lib
Packit 90a5c9
Packit 90a5c9
ifeq "$(OS)" "Windows_NT"
Packit 90a5c9
# MetroWerks Win32 build flags to create build tools
Packit 90a5c9
MWCW_MSL         = "$(METROWERKS)/MSL"
Packit 90a5c9
MWCW_W32         = "$(METROWERKS)/Win32-x86 Support"
Packit 90a5c9
CC_FOR_BUILD     = $(WIN_CC)
Packit 90a5c9
CFLAGS_FOR_BUILD =  -O2 -gccinc -nodefaults -proc 586 -w off
Packit 90a5c9
CFLAGS_FOR_BUILD += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
Packit 90a5c9
CFLAGS_FOR_BUILD += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
Packit 90a5c9
else
Packit 90a5c9
# GNUC build flags to create build tools
Packit 90a5c9
CC_FOR_BUILD     = gcc
Packit 90a5c9
CFLAGS_FOR_BUILD = -Wall -O2
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# Base compile flags
Packit 90a5c9
# and prefix or precompiled header added here.
Packit 90a5c9
Packit 90a5c9
# The default flags are as follows:
Packit 90a5c9
#
Packit 90a5c9
# -c                    compile only, no link
Packit 90a5c9
# -gccinc               search directory of referencing file first for #includes
Packit 90a5c9
# -Cpp_exceptions off   disable C++ exceptions
Packit 90a5c9
# -RTTI off             disable C++ run-time typing information
Packit 90a5c9
# -align 4              align on 4 byte bounderies
Packit 90a5c9
# -w nocmdline          disable command-line driver/parser warnings
Packit 90a5c9
# -proc PII             generate code base on Pentium II instruction set
Packit 90a5c9
# -inst mmx             use MMX extensions (Not used)
Packit 90a5c9
Packit 90a5c9
CFLAGS += -c -w nocmdline -gccinc -Cpp_exceptions off -RTTI off -align 4 -proc PII
Packit 90a5c9
Packit 90a5c9
ifdef CC_MAX_ERRORS
Packit 90a5c9
CFLAGS += -maxerrors $(CC_MAX_ERRORS)
Packit 90a5c9
else
Packit 90a5c9
CFLAGS += -maxerrors 1
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(REQUIRE_PROTOTYPES)" "1"
Packit 90a5c9
CFLAGS += -r
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# -g                    generate debugging information
Packit 90a5c9
# -O0                   level 0 optimizations
Packit 90a5c9
ifeq "$(RELEASE)" "debug"
Packit 90a5c9
CFLAGS += -g -O0
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# -O4,p                 level 4 optimizations, optimize for speed
Packit 90a5c9
ifeq "$(RELEASE)" "release"
Packit 90a5c9
CFLAGS += -O4,p
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# -prefix pre_nw.h      #include pre_nw.h for all files
Packit 90a5c9
CFLAGS += -prefix pre_nw.h
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
ifneq ($(findstring /sh,$(SHELL)),/sh)
Packit 90a5c9
PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Declare major project deliverables output directories here
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
ifndef PORT
Packit 90a5c9
PORT = 80
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef SSLPORT
Packit 90a5c9
SSLPORT = 443
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef DEST
Packit 90a5c9
INSTALL = $(subst \,/,$(DEST))
Packit 90a5c9
ifeq (/, $(findstring /,$(INSTALL)))
Packit 90a5c9
INSTDIRS = $(INSTALL)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifdef dest
Packit 90a5c9
INSTALL = $(subst \,/,$(dest))
Packit 90a5c9
ifeq (/, $(findstring /,$(INSTALL)))
Packit 90a5c9
INSTDIRS = $(INSTALL)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef INSTALL
Packit 90a5c9
INSTALL = $(AP_WORK)/Dist
Packit 90a5c9
INSTDIRS = $(INSTALL)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq ($(MAKECMDGOALS),installdev)
Packit 90a5c9
ifndef BASEDIR
Packit 90a5c9
export BASEDIR = apache_$(VERSION_STR)-sdk
Packit 90a5c9
endif
Packit 90a5c9
else
Packit 90a5c9
ifndef BASEDIR
Packit 90a5c9
export BASEDIR = Apache$(VERSION_MAJMIN)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
# Add support for building IPV6 alongside
Packit 90a5c9
ifneq "$(IPV6)" ""
Packit 90a5c9
DEFINES += -DNW_BUILD_IPV6
Packit 90a5c9
# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS)
Packit 90a5c9
Packit 90a5c9
ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
Packit 90a5c9
OBJDIR := $(OBJDIR)_IPV6
Packit 90a5c9
endif
Packit 90a5c9
        
Packit 90a5c9
ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
Packit 90a5c9
INSTALL := $(INSTALL)_IPV6
Packit 90a5c9
endif        
Packit 90a5c9
Packit 90a5c9
ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
Packit 90a5c9
INSTDIRS := $(INSTDIRS)_IPV6
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
INSTALLBASE = $(INSTALL)/$(BASEDIR)
Packit 90a5c9
Packit 90a5c9
INSTDEVDIRS = \
Packit 90a5c9
	$(INSTALL) \
Packit 90a5c9
	$(INSTALLBASE) \
Packit 90a5c9
	$(INSTALLBASE)/build \
Packit 90a5c9
	$(INSTALLBASE)/include \
Packit 90a5c9
	$(INSTALLBASE)/lib \
Packit 90a5c9
	$(EOLIST) 
Packit 90a5c9
Packit 90a5c9
INSTDIRS += \
Packit 90a5c9
	$(INSTALLBASE) \
Packit 90a5c9
	$(INSTALLBASE)/bin \
Packit 90a5c9
	$(INSTALLBASE)/cgi-bin \
Packit 90a5c9
	$(INSTALLBASE)/conf \
Packit 90a5c9
	$(INSTALLBASE)/conf/extra \
Packit 90a5c9
	$(INSTALLBASE)/error \
Packit 90a5c9
	$(INSTALLBASE)/htdocs \
Packit 90a5c9
	$(INSTALLBASE)/icons \
Packit 90a5c9
	$(INSTALLBASE)/logs \
Packit 90a5c9
	$(INSTALLBASE)/man \
Packit 90a5c9
	$(INSTALLBASE)/manual \
Packit 90a5c9
	$(INSTALLBASE)/modules \
Packit 90a5c9
	$(EOLIST) 
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Common directories
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
SRC		= $(subst \,/,$(AP_WORK))
Packit 90a5c9
APR		= $(subst \,/,$(APR_WORK))
Packit 90a5c9
APRUTIL		= $(subst \,/,$(APU_WORK))
Packit 90a5c9
APBUILD		= $(SRC)/build
Packit 90a5c9
STDMOD		= $(SRC)/modules
Packit 90a5c9
HTTPD		= $(SRC)/modules/http
Packit 90a5c9
DAV		= $(SRC)/modules/dav
Packit 90a5c9
NWOS		= $(SRC)/os/netware
Packit 90a5c9
SERVER		= $(SRC)/server
Packit 90a5c9
SUPMOD		= $(SRC)/support
Packit 90a5c9
APULDAP		= $(APRUTIL)/ldap
Packit 90a5c9
XML		= $(APRUTIL)/xml
Packit 90a5c9
APRTEST		= $(APR)/test
Packit 90a5c9
PCRE		= $(PCRESRC)
Packit 90a5c9
Packit 90a5c9
PREBUILD_INST	= $(SRC)/nwprebuild
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Internal Libraries
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
APRLIB		= $(APR)/$(OBJDIR)/aprlib.lib
Packit 90a5c9
APRUTLIB	= $(APRUTIL)/$(OBJDIR)/aprutil.lib
Packit 90a5c9
APULDAPLIB	= $(APULDAP)/$(OBJDIR)/apuldap.lib
Packit 90a5c9
STMODLIB	= $(STDMOD)/$(OBJDIR)/stdmod.lib
Packit 90a5c9
PCRELIB		= $(SRC)/$(OBJDIR)/pcre.lib
Packit 90a5c9
NWOSLIB		= $(NWOS)/$(OBJDIR)/netware.lib
Packit 90a5c9
SERVLIB		= $(SERVER)/$(OBJDIR)/server.lib
Packit 90a5c9
HTTPDLIB	= $(HTTPD)/$(OBJDIR)/httpd.lib
Packit 90a5c9
XMLLIB		= $(XML)/$(OBJDIR)/xmllib.lib
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Additional general defines
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
EnvironmentDefined = 1
Packit 90a5c9
endif # ifndef EnvironmentDefined
Packit 90a5c9
Packit 90a5c9
# This is always set so that it will show up in lower directories
Packit 90a5c9
Packit 90a5c9
ifdef Path
Packit 90a5c9
Path = $(PATH)
Packit 90a5c9
endif
Packit 90a5c9