1# 2# This Makefile requires the environment var OSSLSDK 3# pointing to the base directory of your OpenSSL SDK. 4# If you want to use the Novell NTLS SDK instead then 5# define NTLSSDK pointing to the base directory of the 6# SDK, and also set USE_NTLS=1 7# 8 9# 10# Declare the sub-directories to be built here 11# 12 13SUBDIRS = \ 14 $(EOLIST) 15 16# 17# Get the 'head' of the build environment. This includes default targets and 18# paths to tools 19# 20 21include $(AP_WORK)/build/NWGNUhead.inc 22 23# 24# build this level's files 25# 26# Make sure all needed macro's are defined 27# 28 29ifeq "$(USE_NTLS)" "1" 30SSL_INC = $(NTLSSDK)/inc 31SSL_LIB = $(NTLSSDK)/imp 32SSL_BIN = $(NTLSSDK)/bin 33SSL_APP = $(NTLSSDK)/apps 34ifneq "$(wildcard $(SSL_INC)/openssl/opensslv.h)" "$(SSL_INC)/openssl/opensslv.h" 35$(error '$(NTLSSDK)' does NOT point to a valid NTLS SDK!) 36endif 37else 38SSL_INC = $(OSSLSDK)/outinc_nw_libc 39SSL_LIB = $(OSSLSDK)/out_nw_libc 40SSL_BIN = $(OSSLSDK)/out_nw_libc 41SSL_APP = $(OSSLSDK)/apps 42ifneq "$(wildcard $(SSL_INC)/openssl/opensslv.h)" "$(SSL_INC)/openssl/opensslv.h" 43$(error '$(OSSLSDK)' does NOT point to a valid OpenSSL SDK!) 44endif 45endif 46 47# 48# These directories will be at the beginning of the include list, followed by 49# INCDIRS 50# 51XINCDIRS += \ 52 $(SSL_INC) \ 53 $(APR)/include \ 54 $(APRUTIL)/include \ 55 $(AP_WORK)/include \ 56 $(AP_WORK)/modules/cache \ 57 $(AP_WORK)/modules/generators \ 58 $(AP_WORK)/server/mpm/NetWare \ 59 $(NWOS) \ 60 $(EOLIST) 61 62# 63# These flags will come after CFLAGS 64# 65XCFLAGS += \ 66 $(EOLIST) 67 68# 69# These defines will come after DEFINES 70# 71XDEFINES += \ 72 -DHAVE_OPENSSL \ 73 $(EOLIST) 74 75# 76# These flags will be added to the link.opt file 77# 78XLFLAGS += \ 79 -l $(SSL_LIB) \ 80 $(EOLIST) 81 82# 83# These values will be appended to the correct variables based on the value of 84# RELEASE 85# 86ifeq "$(RELEASE)" "debug" 87XINCDIRS += \ 88 $(EOLIST) 89 90XCFLAGS += \ 91 $(EOLIST) 92 93XDEFINES += \ 94 $(EOLIST) 95 96XLFLAGS += \ 97 $(EOLIST) 98endif 99 100ifeq "$(RELEASE)" "noopt" 101XINCDIRS += \ 102 $(EOLIST) 103 104XCFLAGS += \ 105 $(EOLIST) 106 107XDEFINES += \ 108 $(EOLIST) 109 110XLFLAGS += \ 111 $(EOLIST) 112endif 113 114ifeq "$(RELEASE)" "release" 115XINCDIRS += \ 116 $(EOLIST) 117 118XCFLAGS += \ 119 $(EOLIST) 120 121XDEFINES += \ 122 $(EOLIST) 123 124XLFLAGS += \ 125 $(EOLIST) 126endif 127 128# 129# These are used by the link target if an NLM is being generated 130# This is used by the link 'name' directive to name the nlm. If left blank 131# TARGET_nlm (see below) will be used. 132# 133NLM_NAME = mod_ssl 134 135# 136# This is used by the link '-desc ' directive. 137# If left blank, NLM_NAME will be used. 138# 139ifeq "$(USE_NTLS)" "1" 140NLM_DESCRIPTION = Apache $(VERSION_STR) SSL module (NTLS) 141else 142NLM_DESCRIPTION = Apache $(VERSION_STR) SSL module (OpenSSL) 143endif 144 145# 146# This is used by the '-threadname' directive. If left blank, 147# NLM_NAME Thread will be used. 148# 149NLM_THREAD_NAME = $(NLM_NAME) 150 151# 152# If this is specified, it will override VERSION value in 153# $(AP_WORK)/build/NWGNUenvironment.inc 154# 155NLM_VERSION = 156 157# 158# If this is specified, it will override the default of 64K 159# 160NLM_STACK_SIZE = 8192 161 162 163# 164# If this is specified it will be used by the link '-entry' directive 165# 166NLM_ENTRY_SYM = 167 168# 169# If this is specified it will be used by the link '-exit' directive 170# 171NLM_EXIT_SYM = 172 173# 174# If this is specified it will be used by the link '-check' directive 175# 176NLM_CHECK_SYM = 177 178# 179# If this is specified it will be used by the link '-flags' directive 180# 181NLM_FLAGS = 182 183# 184# If this is specified it will be linked in with the XDCData option in the def 185# file instead of the default of $(NWOS)/apache.xdc. XDCData can be disabled 186# by setting APACHE_UNIPROC in the environment 187# 188XDCDATA = 189 190# 191# Declare all target files (you must add your files here) 192# 193 194# 195# If there is an NLM target, put it here 196# 197TARGET_nlm = \ 198 $(OBJDIR)/$(NLM_NAME).nlm \ 199 $(EOLIST) 200 201# 202# If there is an LIB target, put it here 203# 204TARGET_lib = \ 205 $(EOLIST) 206 207# 208# These are the OBJ files needed to create the NLM target above. 209# Paths must all use the '/' character 210# 211FILES_nlm_objs := $(patsubst %.c,$(OBJDIR)/%.o,$(wildcard *.c)) 212 213 214# 215# These are the LIB files needed to create the NLM target above. 216# These will be added as a library command in the link.opt file. 217# 218FILES_nlm_libs = \ 219 $(PRELUDE) \ 220 $(EOLIST) 221 222ifneq "$(USE_NTLS)" "1" 223FILES_nlm_libs += \ 224 $(SSL_LIB)/crypto.lib \ 225 $(SSL_LIB)/ssl.lib \ 226 $(EOLIST) 227endif 228 229# 230# These are the modules that the above NLM target depends on to load. 231# These will be added as a module command in the link.opt file. 232# 233FILES_nlm_modules = \ 234 Apache2 \ 235 Libc \ 236 $(EOLIST) 237 238ifeq "$(USE_NTLS)" "1" 239FILES_nlm_modules += ntls \ 240 $(EOLIST) 241endif 242 243# 244# If the nlm has a msg file, put it's path here 245# 246FILE_nlm_msg = 247 248# 249# If the nlm has a hlp file put it's path here 250# 251FILE_nlm_hlp = 252 253# 254# If this is specified, it will override $(NWOS)\copyright.txt. 255# 256FILE_nlm_copyright = 257 258# 259# Any additional imports go here 260# 261FILES_nlm_Ximports = \ 262 @libc.imp \ 263 @aprlib.imp \ 264 @httpd.imp \ 265 $(EOLIST) 266 267# Don't link with Winsock if standard sockets are being used 268ifneq "$(USE_STDSOCKETS)" "1" 269FILES_nlm_Ximports += @ws2nlm.imp \ 270 $(EOLIST) 271endif 272 273ifeq "$(USE_NTLS)" "1" 274FILES_nlm_Ximports += @ntls.imp \ 275 $(EOLIST) 276else 277FILES_nlm_Ximports += \ 278 GetProcessSwitchCount \ 279 RunningProcess \ 280 GetSuperHighResolutionTimer \ 281 $(EOLIST) 282endif 283 284# 285# Any symbols exported to here 286# 287FILES_nlm_exports = \ 288 ssl_module \ 289 $(EOLIST) 290 291# 292# These are the OBJ files needed to create the LIB target above. 293# Paths must all use the '/' character 294# 295FILES_lib_objs = \ 296 $(EOLIST) 297 298# 299# implement targets and dependancies (leave this section alone) 300# 301 302libs :: $(OBJDIR) $(TARGET_lib) 303 304nlms :: libs $(TARGET_nlm) 305 306# 307# Updated this target to create necessary directories and copy files to the 308# correct place. (See $(AP_WORK)/build/NWGNUhead.inc for examples) 309# 310install :: nlms FORCE 311 $(call COPY,$(OBJDIR)/*.nlm, $(INSTALLBASE)/modules/) 312 $(call COPY,$(SSL_BIN)/openssl.nlm, $(INSTALLBASE)/bin/) 313 $(call COPY,$(SSL_APP)/openssl.cnf, $(INSTALLBASE)/bin/) 314 315# 316# Any specialized rules here 317# 318vpath %.c $(AP_WORK)/modules/arch/netware 319 320# 321# Include the 'tail' makefile that has targets that depend on variables defined 322# in this makefile 323# 324 325include $(APBUILD)/NWGNUtail.inc 326 327 328