Imported Upstream version 7.53.1
[platform/upstream/curl.git] / lib / Makefile.netware
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 2004 - 2015, Guenter Knauf, <http://www.gknw.net/phpbb>.
9 # Copyright (C) 2001 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
10 #
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at https://curl.haxx.se/docs/copyright.html.
14 #
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
18 #
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
21 #
22 #***************************************************************************
23
24 #################################################################
25 #
26 ## Makefile for building libcurl.nlm (NetWare version - gnu make)
27 ##
28 ## Use: make -f Makefile.netware
29 #
30 #################################################################
31
32 # Edit the path below to point to the base of your Novell NDK.
33 ifndef NDKBASE
34 NDKBASE = c:/novell
35 endif
36
37 # Edit the path below to point to the base of your Zlib sources.
38 ifndef ZLIB_PATH
39 ZLIB_PATH = ../../zlib-1.2.8
40 endif
41
42 # Edit the path below to point to the base of your OpenSSL package.
43 ifndef OPENSSL_PATH
44 OPENSSL_PATH = ../../openssl-1.0.2a
45 endif
46
47 # Edit the path below to point to the base of your LibSSH2 package.
48 ifndef LIBSSH2_PATH
49 LIBSSH2_PATH = ../../libssh2-1.5.0
50 endif
51
52 # Edit the path below to point to the base of your axTLS package.
53 ifndef AXTLS_PATH
54 AXTLS_PATH = ../../axTLS-1.2.7
55 endif
56
57 # Edit the path below to point to the base of your libidn package.
58 ifndef LIBIDN_PATH
59 LIBIDN_PATH = ../../libidn-1.18
60 endif
61
62 # Edit the path below to point to the base of your librtmp package.
63 ifndef LIBRTMP_PATH
64 LIBRTMP_PATH = ../../librtmp-2.3
65 endif
66
67 # Edit the path below to point to the base of your nghttp2 package.
68 ifndef NGHTTP2_PATH
69 NGHTTP2_PATH = ../../nghttp2-0.6.7
70 endif
71
72 # Edit the path below to point to the base of your fbopenssl package.
73 ifndef FBOPENSSL_PATH
74 FBOPENSSL_PATH = ../../fbopenssl-0.4
75 endif
76
77 # Edit the path below to point to the base of your c-ares package.
78 ifndef LIBCARES_PATH
79 LIBCARES_PATH = ../ares
80 endif
81
82 ifndef INSTDIR
83 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
84 endif
85
86 # Edit the vars below to change NLM target settings.
87 TARGET  = libcurl
88 VERSION = $(LIBCURL_VERSION)
89 COPYR   = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
90 DESCR   = curl libcurl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.haxx.se
91 MTSAFE  = YES
92 STACK   = 64000
93 SCREEN  = none
94 EXPORTF = $(TARGET).imp
95 EXPORTS = @$(EXPORTF)
96
97 # Uncomment the next line to enable linking with POSIX semantics.
98 # POSIXFL = 1
99
100 # Edit the var below to point to your lib architecture.
101 ifndef LIBARCH
102 LIBARCH = LIBC
103 endif
104
105 # must be equal to NDEBUG or DEBUG, CURLDEBUG
106 ifndef DB
107 DB      = NDEBUG
108 endif
109 # Optimization: -O<n> or debugging: -g
110 ifeq ($(DB),NDEBUG)
111         OPT     = -O2
112         OBJDIR  = release
113 else
114         OPT     = -g
115         OBJDIR  = debug
116 endif
117
118 # The following lines defines your compiler.
119 ifdef CWFolder
120         METROWERKS = $(CWFolder)
121 endif
122 ifdef METROWERKS
123         # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
124         MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
125         CC = mwccnlm
126 else
127         CC = gcc
128 endif
129 PERL    = perl
130 # Here you can find a native Win32 binary of the original awk:
131 # http://www.gknw.net/development/prgtools/awk-20100523.zip
132 AWK     = awk
133 CP      = cp -afv
134 MKDIR   = mkdir
135 # RM    = rm -f
136 # If you want to mark the target as MTSAFE you will need a tool for
137 # generating the xdc data for the linker; here's a minimal tool:
138 # http://www.gknw.net/development/prgtools/mkxdc.zip
139 MPKXDC  = mkxdc
140
141 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
142 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
143
144 # Include the version info retrieved from curlver.h
145 -include $(OBJDIR)/version.inc
146
147 # Global flags for all compilers
148 CFLAGS  += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
149
150 ifeq ($(CC),mwccnlm)
151 LD      = mwldnlm
152 LDFLAGS = -nostdlib $(PRELUDE) $(OBJL) -o $@ -commandfile
153 AR      = mwldnlm
154 ARFLAGS = -nostdlib -type library -o
155 LIBEXT  = lib
156 #RANLIB =
157 CFLAGS  += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586
158 CFLAGS  += -relax_pointers
159 #CFLAGS += -w on
160 ifeq ($(LIBARCH),LIBC)
161 ifeq ($(POSIXFL),1)
162         PRELUDE = $(NDK_LIBC)/imports/posixpre.o
163 else
164         PRELUDE = $(NDK_LIBC)/imports/libcpre.o
165 endif
166         CFLAGS += -align 4
167 else
168         # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
169         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
170         PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
171         # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
172         CFLAGS += -align 1
173 endif
174 else
175 LD      = nlmconv
176 LDFLAGS = -T
177 AR      = ar
178 ARFLAGS = -cq
179 LIBEXT  = a
180 RANLIB  = ranlib
181 CFLAGS  += -m32
182 CFLAGS  += -fno-builtin -fno-strict-aliasing
183 ifeq ($(findstring gcc,$(CC)),gcc)
184 CFLAGS  += -fpcc-struct-return
185 endif
186 CFLAGS  += -Wall # -pedantic
187 ifeq ($(LIBARCH),LIBC)
188 ifeq ($(POSIXFL),1)
189         PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
190 else
191         PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
192 endif
193 else
194         PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
195         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
196         # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
197         # PRELUDE = $(NDK_ROOT)/pre/prelude.o
198         CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
199 endif
200 endif
201
202 NDK_ROOT = $(NDKBASE)/ndk
203 ifndef NDK_CLIB
204 NDK_CLIB = $(NDK_ROOT)/nwsdk
205 endif
206 ifndef NDK_LIBC
207 NDK_LIBC = $(NDK_ROOT)/libc
208 endif
209 ifndef NDK_LDAP
210 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
211 endif
212 CURL_INC = ../include
213 CURL_LIB = ../lib
214
215 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
216
217 ifeq ($(findstring -static,$(CFG)),-static)
218 LINK_STATIC = 1
219 endif
220 ifeq ($(findstring -ares,$(CFG)),-ares)
221 WITH_ARES = 1
222 endif
223 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
224 WITH_RTMP = 1
225 WITH_SSL = 1
226 WITH_ZLIB = 1
227 endif
228 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
229 WITH_SSH2 = 1
230 WITH_SSL = 1
231 WITH_ZLIB = 1
232 endif
233 ifeq ($(findstring -axtls,$(CFG)),-axtls)
234 WITH_AXTLS = 1
235 WITH_SSL =
236 else
237 ifeq ($(findstring -ssl,$(CFG)),-ssl)
238 WITH_SSL = 1
239 ifeq ($(findstring -srp,$(CFG)),-srp)
240 ifeq "$(wildcard $(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)/openssl/srp.h)" "$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)/openssl/srp.h"
241 WITH_SRP = 1
242 endif
243 endif
244 endif
245 endif
246 ifeq ($(findstring -zlib,$(CFG)),-zlib)
247 WITH_ZLIB = 1
248 endif
249 ifeq ($(findstring -idn,$(CFG)),-idn)
250 WITH_IDN = 1
251 endif
252 ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
253 WITH_NGHTTP2 = 1
254 endif
255 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
256 ENABLE_IPV6 = 1
257 endif
258
259 ifdef WITH_ARES
260         INCLUDES += -I$(LIBCARES_PATH)
261         LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
262 endif
263 ifdef WITH_SSH2
264         INCLUDES += -I$(LIBSSH2_PATH)/include
265 ifdef LINK_STATIC
266         LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
267 else
268         MODULES += libssh2.nlm
269         IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
270 endif
271 endif
272 ifdef WITH_RTMP
273         INCLUDES += -I$(LIBRTMP_PATH)
274         LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
275 endif
276 ifdef WITH_SSL
277         INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
278         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
279         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
280         IMPORTS += GetProcessSwitchCount RunningProcess
281         INSTDEP += ca-bundle.crt
282 else
283 ifdef WITH_AXTLS
284         INCLUDES += -I$(AXTLS_PATH)/inc
285 ifdef LINK_STATIC
286         LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
287 else
288         MODULES += libaxtls.nlm
289         IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
290 endif
291         INSTDEP += ca-bundle.crt
292 endif
293 endif
294 ifdef WITH_ZLIB
295         INCLUDES += -I$(ZLIB_PATH)
296 ifdef LINK_STATIC
297         LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
298 else
299         MODULES += libz.nlm
300         IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
301 endif
302 endif
303 ifdef WITH_IDN
304         INCLUDES += -I$(LIBIDN_PATH)/include
305         LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
306 endif
307 ifdef WITH_NGHTTP2
308         INCLUDES += -I$(NGHTTP2_PATH)/include
309         LDLIBS += $(NGHTTP2_PATH)/lib/libnghttp2.$(LIBEXT)
310 endif
311
312 ifeq ($(LIBARCH),LIBC)
313         INCLUDES += -I$(NDK_LIBC)/include
314         # INCLUDES += -I$(NDK_LIBC)/include/nks
315         # INCLUDES += -I$(NDK_LIBC)/include/winsock
316         CFLAGS += -D_POSIX_SOURCE
317 else
318         INCLUDES += -I$(NDK_CLIB)/include/nlm
319         # INCLUDES += -I$(NDK_CLIB)/include/nlm/obsolete
320         # INCLUDES += -I$(NDK_CLIB)/include
321 endif
322 ifndef DISABLE_LDAP
323         INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
324 endif
325 CFLAGS  += $(INCLUDES)
326
327 ifeq ($(MTSAFE),YES)
328         XDCOPT = -n
329 endif
330 ifeq ($(MTSAFE),NO)
331         XDCOPT = -u
332 endif
333 ifdef XDCOPT
334         XDCDATA = $(OBJDIR)/$(TARGET).xdc
335 endif
336
337 ifeq ($(findstring /sh,$(SHELL)),/sh)
338 DL      = '
339 DS      = /
340 PCT     = %
341 #-include $(NDKBASE)/nlmconv/ncpfs.inc
342 else
343 DS      = \\
344 PCT     = %%
345 endif
346
347 # Makefile.inc provides the CSOURCES and HHEADERS defines
348 include Makefile.inc
349
350 OBJS    := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(notdir $(CSOURCES)))) $(OBJDIR)/nwos.o
351
352 OBJL    = $(OBJS) $(OBJDIR)/nwlib.o $(LDLIBS)
353
354 vpath %.c . vauth vtls
355
356 all: lib nlm
357
358 nlm: prebuild $(TARGET).nlm
359
360 lib: prebuild $(TARGET).$(LIBEXT)
361
362 prebuild: $(OBJDIR) $(CURL_INC)/curl/curlbuild.h $(OBJDIR)/version.inc curl_config.h
363
364 $(OBJDIR)/%.o: %.c
365 #       @echo Compiling $<
366         $(CC) $(CFLAGS) -c $< -o $@
367
368 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
369         @echo Creating $@
370         @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
371
372 install: $(INSTDIR) all $(INSTDEP)
373         @$(CP) $(TARGET).nlm $(INSTDIR)
374         @$(CP) $(TARGET).$(LIBEXT) $(INSTDIR)
375         @$(CP) ../CHANGES $(INSTDIR)
376         @$(CP) ../COPYING $(INSTDIR)
377         @$(CP) ../README $(INSTDIR)
378         @$(CP) ../RELEASE-NOTES $(INSTDIR)
379 ifdef WITH_SSL
380         @-$(CP) ca-bundle.crt $(INSTDIR)/ca-bundle.crt
381 endif
382
383 clean:
384         -$(RM) curl_config.h
385         -$(RM) -r $(OBJDIR)
386
387 distclean vclean: clean
388         -$(RM) $(TARGET).$(LIBEXT) $(TARGET).nlm $(TARGET).imp
389         -$(RM) certdata.txt ca-bundle.crt
390
391 $(OBJDIR) $(INSTDIR):
392         @$(MKDIR) $@
393
394 $(TARGET).$(LIBEXT): $(OBJS)
395         @echo Creating $@
396         @-$(RM) $@
397         @$(AR) $(ARFLAGS) $@ $^
398 ifdef RANLIB
399         @$(RANLIB) $@
400 endif
401
402 $(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(OBJL) $(EXPORTF) $(XDCDATA)
403         @echo Linking $@
404         @-$(RM) $@
405         @$(LD) $(LDFLAGS) $<
406
407 $(OBJDIR)/%.xdc: Makefile.netware
408         @echo Creating $@
409         @$(MPKXDC) $(XDCOPT) $@
410
411 $(OBJDIR)/%.def: Makefile.netware
412         @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
413         @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
414         @echo $(DL)# All your changes will be lost!!$(DL) >> $@
415         @echo $(DL)#$(DL) >> $@
416         @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
417         @echo $(DL)description "$(DESCR)"$(DL) >> $@
418         @echo $(DL)version $(VERSION)$(DL) >> $@
419 ifdef NLMTYPE
420         @echo $(DL)type $(NLMTYPE)$(DL) >> $@
421 endif
422 ifdef STACK
423         @echo $(DL)stack $(STACK)$(DL) >> $@
424 endif
425 ifdef SCREEN
426         @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
427 else
428         @echo $(DL)screenname "DEFAULT"$(DL) >> $@
429 endif
430 ifneq ($(DB),NDEBUG)
431         @echo $(DL)debug$(DL) >> $@
432 endif
433         @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
434 ifdef XDCDATA
435         @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
436 endif
437         @echo $(DL)flag_on 64$(DL) >> $@
438 ifeq ($(LIBARCH),CLIB)
439         @echo $(DL)start _Prelude$(DL) >> $@
440         @echo $(DL)exit _Stop$(DL) >> $@
441         @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
442         @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
443         @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
444         @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
445         @echo $(DL)module clib$(DL) >> $@
446 ifndef DISABLE_LDAP
447         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
448         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
449 #       @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
450         @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
451 endif
452 else
453 ifeq ($(POSIXFL),1)
454         @echo $(DL)flag_on 4194304$(DL) >> $@
455 endif
456         @echo $(DL)pseudopreemption$(DL) >> $@
457 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
458         @echo $(DL)start POSIX_Start$(DL) >> $@
459         @echo $(DL)exit POSIX_Stop$(DL) >> $@
460         @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
461 else
462         @echo $(DL)start _LibCPrelude$(DL) >> $@
463         @echo $(DL)exit _LibCPostlude$(DL) >> $@
464         @echo $(DL)check _LibCCheckUnload$(DL) >> $@
465 endif
466         @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
467         @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
468         @echo $(DL)module libc$(DL) >> $@
469 ifndef DISABLE_LDAP
470         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
471         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
472 #       @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
473         @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
474 endif
475 endif
476 ifdef MODULES
477         @echo $(DL)module $(MODULES)$(DL) >> $@
478 endif
479 ifdef EXPORTS
480         @echo $(DL)export $(EXPORTS)$(DL) >> $@
481 endif
482 ifdef IMPORTS
483         @echo $(DL)import $(IMPORTS)$(DL) >> $@
484 endif
485 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
486         @echo $(DL)input $(PRELUDE)$(DL) >> $@
487         @echo $(DL)input $(OBJL)$(DL) >> $@
488 #ifdef LDLIBS
489 #       @echo $(DL)input $(LDLIBS)$(DL) >> $@
490 #endif
491         @echo $(DL)output $(TARGET).nlm$(DL) >> $@
492 endif
493
494 curl_config.h: Makefile.netware
495         @echo Creating $@
496         @echo $(DL)/* $@ for NetWare target.$(DL) > $@
497         @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
498         @echo $(DL)** All your changes will be lost!!$(DL) >> $@
499         @echo $(DL)*/$(DL) >> $@
500         @echo $(DL)#ifndef NETWARE$(DL) >> $@
501         @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
502         @echo $(DL)#endif$(DL) >> $@
503         @echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
504         @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.haxx.se/mail/"$(DL) >> $@
505 ifeq ($(LIBARCH),CLIB)
506         @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
507         @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
508         @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
509         @echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
510         @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
511         @echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
512         @echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
513         @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
514         @echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
515         @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
516         @echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@
517         @echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
518         @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
519         @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
520         @echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
521         @echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
522         @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
523         @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
524         @echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
525         @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
526         @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
527         @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
528         @echo $(DL)#define SIZEOF_SIZE_T 4$(DL) >> $@
529         @echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
530 else
531         @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
532         @echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
533         @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
534         @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
535         @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
536         @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
537         @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
538         @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
539         @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
540         @echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@
541         @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
542         @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
543         @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
544         @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
545         @echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
546         @echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
547         @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
548         @echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
549         @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
550         @echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@
551         @echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
552         @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
553         @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
554         @echo $(DL)#define RECVFROM_TYPE_ARG6 size_t$(DL) >> $@
555         @echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
556         @echo $(DL)#define RECVFROM_TYPE_ARG2_IS_VOID 1$(DL) >> $@
557         @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
558         @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
559         @echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
560         @echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
561         @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
562         @echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
563         @echo $(DL)#define SIZEOF_OFF_T 8$(DL) >> $@
564         @echo $(DL)#define SIZEOF_SIZE_T 8$(DL) >> $@
565         @echo $(DL)#define _LARGEFILE 1$(DL) >> $@
566 ifdef ENABLE_IPV6
567         @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
568         @echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
569         @echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
570         @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
571         @echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
572         @echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
573         @echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
574         @echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
575         @echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
576         @echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
577 endif
578 endif
579         @echo $(DL)#define USE_MANUAL 1$(DL) >> $@
580         @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
581         @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
582         @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@
583         @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
584         @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
585         @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
586         @echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
587         @echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
588         @echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
589         @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
590         @echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@
591         @echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@
592         @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
593         @echo $(DL)#define HAVE_LL 1$(DL) >> $@
594         @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
595         @echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
596         @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
597         @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
598         @echo $(DL)#define HAVE_RECV 1$(DL) >> $@
599         @echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
600         @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
601         @echo $(DL)#define HAVE_SEND 1$(DL) >> $@
602         @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
603         @echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
604         @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
605         @echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
606         @echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
607         @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
608         @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
609         @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
610         @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
611         @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
612         @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
613         @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
614         @echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
615         @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
616         @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
617         @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
618         @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
619         @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
620         @echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
621         @echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
622         @echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
623         @echo $(DL)#define RETSIGTYPE void$(DL) >> $@
624         @echo $(DL)#define SIZEOF_INT 4$(DL) >> $@
625         @echo $(DL)#define SIZEOF_SHORT 2$(DL) >> $@
626         @echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
627         @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
628         @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
629 ifdef DISABLE_LDAP
630         @echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@
631 else
632         @echo $(DL)#define CURL_HAS_NOVELL_LDAPSDK 1$(DL) >> $@
633 ifndef DISABLE_LDAPS
634         @echo $(DL)#define HAVE_LDAP_SSL 1$(DL) >> $@
635 endif
636         @echo $(DL)#define HAVE_LDAP_SSL_H 1$(DL) >> $@
637         @echo $(DL)#define HAVE_LDAP_URL_PARSE 1$(DL) >> $@
638 endif
639 ifdef NW_WINSOCK
640         @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
641 else
642         @echo $(DL)#define USE_BSD_SOCKETS 1$(DL) >> $@
643         @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
644         @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
645         @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
646         @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
647 endif
648 ifdef WITH_ARES
649         @echo $(DL)#define USE_ARES 1$(DL) >> $@
650 endif
651 ifdef WITH_ZLIB
652         @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
653         @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
654 endif
655 ifdef WITH_SSL
656         @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
657         @echo $(DL)#define USE_OPENSSL 1$(DL) >> $@
658         @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
659         @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
660         @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
661         @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
662         @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
663         @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
664         @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
665         @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
666         @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
667         @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
668 ifdef WITH_SRP
669         @echo $(DL)#define HAVE_SSLEAY_SRP 1$(DL) >> $@
670         @echo $(DL)#define USE_TLS_SRP 1$(DL) >> $@
671 endif
672 ifdef WITH_SPNEGO
673         @echo $(DL)#define HAVE_SPNEGO 1$(DL) >> $@
674 endif
675 else
676 ifdef WITH_AXTLS
677         @echo $(DL)#define USE_AXTLS 1$(DL) >> $@
678 endif
679 endif
680 ifdef WITH_SSH2
681         @echo $(DL)#define USE_LIBSSH2 1$(DL) >> $@
682         @echo $(DL)#define HAVE_LIBSSH2_H 1$(DL) >> $@
683 endif
684 ifdef WITH_IDN
685         @echo $(DL)#define HAVE_LIBIDN 1$(DL) >> $@
686         @echo $(DL)#define HAVE_TLD_H 1$(DL) >> $@
687 endif
688 ifdef WITH_RTMP
689         @echo $(DL)#define USE_LIBRTMP 1$(DL) >> $@
690 endif
691 ifdef WITH_NGHTTP2
692         @echo $(DL)#define USE_NGHTTP2 1$(DL) >> $@
693 endif
694         @echo $(DL)#ifdef __GNUC__$(DL) >> $@
695         @echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@
696         @echo $(DL)#else$(DL) >> $@
697         @echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
698         @echo $(DL)#endif$(DL) >> $@
699 ifdef CABUNDLE
700         @echo $(DL)#define CURL_CA_BUNDLE "$(CABUNDLE)"$(DL) >> $@
701 else
702         @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
703 endif
704
705 $(EXPORTF): $(CURL_INC)/curl/curl.h $(CURL_INC)/curl/easy.h $(CURL_INC)/curl/multi.h $(CURL_INC)/curl/mprintf.h
706         @echo Creating $@
707         @$(AWK) -f ../packages/NetWare/get_exp.awk $^ > $@
708
709 FORCE: ;
710
711 info: $(OBJDIR)/version.inc
712         @echo Configured to build $(TARGET) with these options:
713         @echo libarchitecture: $(LIBARCH)
714         @echo curl version:    $(LIBCURL_VERSION_STR)
715         @echo compiler/linker: $(CC) / $(LD)
716 ifdef CABUNDLE
717         @echo ca-bundle path:  $(CABUNDLE)
718 endif
719 ifdef WITH_SSL
720         @echo SSL support:     enabled (OpenSSL)
721 else
722         @echo SSL support:     no
723 endif
724 ifdef WITH_SRP
725         @echo SRP support:     enabled
726 else
727         @echo SRP support:     no
728 endif
729 ifdef WITH_SSH2
730         @echo SSH2 support:    enabled (libssh2)
731 else
732         @echo SSH2 support:    no
733 endif
734 ifdef WITH_ZLIB
735         @echo zlib support:    enabled
736 else
737         @echo zlib support:    no
738 endif
739 ifdef WITH_NGHTTP2
740         @echo http2 support:   enabled
741 else
742         @echo http2 support:   no
743 endif
744 ifdef WITH_ARES
745         @echo c-ares support:  enabled
746 else
747         @echo c-ares support:  no
748 endif
749 ifdef ENABLE_IPV6
750         @echo IPv6 support:    enabled
751 else
752         @echo IPv6 support:    no
753 endif
754
755 $(CURL_INC)/curl/curlbuild.h: Makefile.netware FORCE
756         @echo Creating $@
757         @echo $(DL)/* $@ intended for NetWare target.$(DL) > $@
758         @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
759         @echo $(DL)** All your changes will be lost!!$(DL) >> $@
760         @echo $(DL)*/$(DL) >> $@
761         @echo $(DL)#ifndef NETWARE$(DL) >> $@
762         @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
763         @echo $(DL)#endif$(DL) >> $@
764         @echo $(DL)#ifndef __CURL_CURLBUILD_H$(DL) >> $@
765         @echo $(DL)#define __CURL_CURLBUILD_H$(DL) >> $@
766 ifeq ($(LIBARCH),LIBC)
767         @echo $(DL)#define CURL_SIZEOF_LONG 4$(DL) >> $@
768         @echo $(DL)#define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int$(DL) >> $@
769         @echo $(DL)#define CURL_SIZEOF_CURL_SOCKLEN_T 4$(DL) >> $@
770         @echo $(DL)#define CURL_TYPEOF_CURL_OFF_T long long$(DL) >> $@
771         @echo $(DL)#define CURL_FORMAT_CURL_OFF_T "lld"$(DL) >> $@
772         @echo $(DL)#define CURL_FORMAT_CURL_OFF_TU "llu"$(DL) >> $@
773         @echo $(DL)#define CURL_FORMAT_OFF_T "$(PCT)lld"$(DL) >> $@
774         @echo $(DL)#define CURL_SIZEOF_CURL_OFF_T 8$(DL) >> $@
775         @echo $(DL)#define CURL_SUFFIX_CURL_OFF_T LL$(DL) >> $@
776         @echo $(DL)#define CURL_SUFFIX_CURL_OFF_TU ULL$(DL) >> $@
777 else
778         @echo $(DL)#define CURL_SIZEOF_LONG 4$(DL) >> $@
779         @echo $(DL)#define CURL_TYPEOF_CURL_SOCKLEN_T int$(DL) >> $@
780         @echo $(DL)#define CURL_SIZEOF_CURL_SOCKLEN_T 4$(DL) >> $@
781         @echo $(DL)#define CURL_TYPEOF_CURL_OFF_T long$(DL) >> $@
782         @echo $(DL)#define CURL_FORMAT_CURL_OFF_T "ld"$(DL) >> $@
783         @echo $(DL)#define CURL_FORMAT_CURL_OFF_TU "lu"$(DL) >> $@
784         @echo $(DL)#define CURL_FORMAT_OFF_T "$(PCT)ld"$(DL) >> $@
785         @echo $(DL)#define CURL_SIZEOF_CURL_OFF_T 4$(DL) >> $@
786         @echo $(DL)#define CURL_SUFFIX_CURL_OFF_T L$(DL) >> $@
787         @echo $(DL)#define CURL_SUFFIX_CURL_OFF_TU UL$(DL) >> $@
788 endif
789         @echo $(DL)typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;$(DL) >> $@
790         @echo $(DL)typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;$(DL) >> $@
791         @echo $(DL)#endif /* __CURL_CURLBUILD_H */$(DL) >> $@
792
793 $(LIBCARES_PATH)/libcares.$(LIBEXT):
794         $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib
795
796 ca-bundle.crt: mk-ca-bundle.pl
797         @echo Creating $@
798         @-$(PERL) $< -b -n $@
799