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