Merge pull request #25 from trtom/master
[platform/upstream/curl.git] / src / Makefile.netware
1 #################################################################
2 #
3 ## Makefile for building curl.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.5
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.8r
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.3.0
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  = curl
61 VERSION = $(LIBCURL_VERSION)
62 COPYR   = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
63 DESCR   = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
64 MTSAFE  = YES
65 STACK   = 64000
66 SCREEN  = $(TARGET) commandline utility
67 # Comment the line below if you dont want to load protected automatically.
68 # LDRING = 3
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 $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
126 LIBEXT  = lib
127 CFLAGS  += -gccinc -inline off -opt nointrinsics -proc 586
128 CFLAGS  += -relax_pointers
129 #CFLAGS += -w on
130 ifeq ($(LIBARCH),LIBC)
131 ifeq ($(POSIXFL),1)
132         PRELUDE = $(NDK_LIBC)/imports/posixpre.o
133 else
134         PRELUDE = $(NDK_LIBC)/imports/libcpre.o
135 endif
136         CFLAGS += -align 4
137 else
138         # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
139         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
140         PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
141         # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
142         CFLAGS += -align 1
143 endif
144 else
145 LD      = nlmconv
146 LDFLAGS = -T
147 LIBEXT  = a
148 CFLAGS  += -m32
149 CFLAGS  += -fno-builtin -fno-strict-aliasing
150 ifeq ($(findstring gcc,$(CC)),gcc)
151 CFLAGS  += -fpcc-struct-return
152 endif
153 CFLAGS  += -Wall # -pedantic
154 ifeq ($(LIBARCH),LIBC)
155 ifeq ($(POSIXFL),1)
156         PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
157 else
158         PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
159 endif
160 else
161         # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
162         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
163         # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
164         PRELUDE = $(NDK_ROOT)/pre/prelude.o
165         CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
166 endif
167 endif
168
169 NDK_ROOT = $(NDKBASE)/ndk
170 ifndef NDK_CLIB
171 NDK_CLIB = $(NDK_ROOT)/nwsdk
172 endif
173 ifndef NDK_LIBC
174 NDK_LIBC = $(NDK_ROOT)/libc
175 endif
176 ifndef NDK_LDAP
177 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
178 endif
179 CURL_INC = ../include
180 CURL_LIB = ../lib
181
182 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
183
184 ifeq ($(findstring -static,$(CFG)),-static)
185 LINK_STATIC = 1
186 endif
187 ifeq ($(findstring -ares,$(CFG)),-ares)
188 WITH_ARES = 1
189 endif
190 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
191 WITH_RTMP = 1
192 WITH_SSL = 1
193 WITH_ZLIB = 1
194 endif
195 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
196 WITH_SSH2 = 1
197 WITH_SSL = 1
198 WITH_ZLIB = 1
199 endif
200 ifeq ($(findstring -axtls,$(CFG)),-axtls)
201 WITH_AXTLS = 1
202 WITH_SSL =
203 else
204 ifeq ($(findstring -ssl,$(CFG)),-ssl)
205 WITH_SSL = 1
206 endif
207 endif
208 ifeq ($(findstring -zlib,$(CFG)),-zlib)
209 WITH_ZLIB = 1
210 endif
211 ifeq ($(findstring -idn,$(CFG)),-idn)
212 WITH_IDN = 1
213 endif
214 ifeq ($(findstring -spnego,$(CFG)),-spnego)
215 WITH_SPNEGO = 1
216 endif
217 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
218 ENABLE_IPV6 = 1
219 endif
220
221 ifdef LINK_STATIC
222         LDLIBS  = $(CURL_LIB)/libcurl.$(LIBEXT)
223 ifdef WITH_ARES
224         LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
225 endif
226 else
227         MODULES = libcurl.nlm
228         IMPORTS = @$(CURL_LIB)/libcurl.imp
229 endif
230 ifdef WITH_SSH2
231         # INCLUDES += -I$(LIBSSH2_PATH)/include
232 ifdef LINK_STATIC
233         LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
234 else
235         MODULES += libssh2.nlm
236         IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
237 endif
238 endif
239 ifdef WITH_RTMP
240         # INCLUDES += -I$(LIBRTMP_PATH)
241 ifdef LINK_STATIC
242         LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
243 endif
244 endif
245 ifdef WITH_SSL
246         # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
247         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
248         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
249         IMPORTS += GetProcessSwitchCount RunningProcess
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 endif
264 endif
265 ifdef WITH_ZLIB
266         INCLUDES += -I$(ZLIB_PATH)
267 ifdef LINK_STATIC
268         LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
269 else
270         MODULES += libz.nlm
271         IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
272 endif
273 endif
274 ifdef WITH_IDN
275         # INCLUDES += -I$(LIBIDN_PATH)/include
276         LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
277 endif
278
279 ifeq ($(LIBARCH),LIBC)
280         INCLUDES += -I$(NDK_LIBC)/include
281         # INCLUDES += -I$(NDK_LIBC)/include/nks
282         # INCLUDES += -I$(NDK_LIBC)/include/winsock
283         CFLAGS += -D_POSIX_SOURCE
284 else
285         INCLUDES += -I$(NDK_CLIB)/include/nlm
286         # INCLUDES += -I$(NDK_CLIB)/include
287 endif
288 ifndef DISABLE_LDAP
289         # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
290 endif
291 CFLAGS  += $(INCLUDES)
292
293 ifeq ($(MTSAFE),YES)
294         XDCOPT = -n
295 endif
296 ifeq ($(MTSAFE),NO)
297         XDCOPT = -u
298 endif
299 ifdef XDCOPT
300         XDCDATA = $(OBJDIR)/$(TARGET).xdc
301 endif
302
303 ifeq ($(findstring /sh,$(SHELL)),/sh)
304 DL      = '
305 DS      = /
306 PCT     = %
307 #-include $(NDKBASE)/nlmconv/ncpfs.inc
308 else
309 DS      = \\
310 PCT     = %%
311 endif
312
313 # Makefile.inc provides the CSOURCES and HHEADERS defines
314 include Makefile.inc
315
316 OBJX    := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_ONES))))
317 OBJS    := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
318 ifndef LINK_STATIC
319 OBJS    += $(OBJX)
320 endif
321
322 vpath %.c $(CURL_LIB)
323
324 all: prebuild $(TARGET).nlm
325
326 prebuild: $(OBJDIR) $(OBJDIR)/version.inc curl_config.h
327
328 $(OBJDIR)/%.o: %.c
329 #       @echo Compiling $<
330         $(CC) $(CFLAGS) -c $< -o $@
331
332 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
333         @echo Creating $@
334         @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
335
336 install: $(INSTDIR) all
337         @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
338         @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
339         @$(CP) $(TARGET).nlm $(INSTDIR)
340
341 clean:
342 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
343         -$(RM) hugehelp.c
344 endif
345         -$(RM) curl_config.h
346         -$(RM) -r $(OBJDIR)
347
348 distclean vclean: clean
349         -$(RM) $(TARGET).nlm
350
351 $(OBJDIR) $(INSTDIR):
352         @$(MKDIR) $@
353
354 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
355         @echo Linking $@
356         @-$(RM) $@
357         @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
358
359 $(OBJDIR)/%.xdc: Makefile.netware
360         @echo Creating $@
361         @$(MPKXDC) $(XDCOPT) $@
362
363 $(OBJDIR)/%.def: Makefile.netware
364         @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
365         @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
366         @echo $(DL)# All your changes will be lost!!$(DL) >> $@
367         @echo $(DL)#$(DL) >> $@
368         @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
369         @echo $(DL)description "$(DESCR)"$(DL) >> $@
370         @echo $(DL)version $(VERSION)$(DL) >> $@
371 ifdef NLMTYPE
372         @echo $(DL)type $(NLMTYPE)$(DL) >> $@
373 endif
374 ifdef STACK
375         @echo $(DL)stack $(STACK)$(DL) >> $@
376 endif
377 ifdef SCREEN
378         @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
379 else
380         @echo $(DL)screenname "DEFAULT"$(DL) >> $@
381 endif
382 ifneq ($(DB),NDEBUG)
383         @echo $(DL)debug$(DL) >> $@
384 endif
385         @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
386 ifdef XDCDATA
387         @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
388 endif
389 ifeq ($(LDRING),0)
390         @echo $(DL)flag_on 16$(DL) >> $@
391 endif
392 ifeq ($(LDRING),3)
393         @echo $(DL)flag_on 512$(DL) >> $@
394 endif
395 ifeq ($(LIBARCH),CLIB)
396         @echo $(DL)start _Prelude$(DL) >> $@
397         @echo $(DL)exit _Stop$(DL) >> $@
398         @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
399         @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
400         @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
401         @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
402         @echo $(DL)module clib$(DL) >> $@
403 ifndef DISABLE_LDAP
404         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
405         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
406 #       @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
407         @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
408 endif
409 else
410 ifeq ($(POSIXFL),1)
411         @echo $(DL)flag_on 4194304$(DL) >> $@
412 endif
413         @echo $(DL)flag_on 64$(DL) >> $@
414         @echo $(DL)pseudopreemption$(DL) >> $@
415 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
416         @echo $(DL)start POSIX_Start$(DL) >> $@
417         @echo $(DL)exit POSIX_Stop$(DL) >> $@
418         @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
419 else
420         @echo $(DL)start _LibCPrelude$(DL) >> $@
421         @echo $(DL)exit _LibCPostlude$(DL) >> $@
422         @echo $(DL)check _LibCCheckUnload$(DL) >> $@
423 endif
424         @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
425         @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
426         @echo $(DL)module libc$(DL) >> $@
427 ifndef DISABLE_LDAP
428         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
429         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
430 #       @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
431         @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
432 endif
433 endif
434 ifdef MODULES
435         @echo $(DL)module $(MODULES)$(DL) >> $@
436 endif
437 ifdef EXPORTS
438         @echo $(DL)export $(EXPORTS)$(DL) >> $@
439 endif
440 ifdef IMPORTS
441         @echo $(DL)import $(IMPORTS)$(DL) >> $@
442 endif
443 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
444         @echo $(DL)input $(PRELUDE)$(DL) >> $@
445         @echo $(DL)input $(OBJS)$(DL) >> $@
446 ifdef LDLIBS
447         @echo $(DL)input $(LDLIBS)$(DL) >> $@
448 endif
449         @echo $(DL)output $(TARGET).nlm$(DL) >> $@
450 endif
451
452 curl_config.h: Makefile.netware
453         @echo Creating $@
454         @echo $(DL)/* $@ for NetWare target.$(DL) > $@
455         @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
456         @echo $(DL)** All your changes will be lost!!$(DL) >> $@
457         @echo $(DL)*/$(DL) >> $@
458         @echo $(DL)#ifndef NETWARE$(DL) >> $@
459         @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
460         @echo $(DL)#endif$(DL) >> $@
461         @echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
462         @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
463 ifeq ($(LIBARCH),CLIB)
464         @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
465         @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
466         @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
467         @echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
468         @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
469         @echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
470         @echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
471         @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
472         @echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
473         @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
474         @echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@
475         @echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
476         @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
477         @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
478         @echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
479         @echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
480         @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
481         @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
482         @echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
483         @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
484         @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
485         @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
486         @echo $(DL)#define SIZEOF_SIZE_T 4$(DL) >> $@
487         @echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
488 else
489         @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
490         @echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
491         @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
492         @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
493         @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
494         @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
495         @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
496         @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
497         @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
498         @echo $(DL)#define HAVE_STRTOLL 1$(DL) >> $@
499         @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
500         @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
501         @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
502         @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
503         @echo $(DL)#define RECV_TYPE_ARG2 void *$(DL) >> $@
504         @echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
505         @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
506         @echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
507         @echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
508         @echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@
509         @echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
510         @echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
511         @echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
512         @echo $(DL)#define RECVFROM_TYPE_ARG6 size_t$(DL) >> $@
513         @echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
514         @echo $(DL)#define RECVFROM_TYPE_ARG2_IS_VOID 1$(DL) >> $@
515         @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
516         @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
517         @echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
518         @echo $(DL)#define SEND_TYPE_ARG3 size_t$(DL) >> $@
519         @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
520         @echo $(DL)#define SEND_TYPE_RETV ssize_t$(DL) >> $@
521         @echo $(DL)#define SIZEOF_OFF_T 8$(DL) >> $@
522         @echo $(DL)#define SIZEOF_SIZE_T 8$(DL) >> $@
523         @echo $(DL)#define _LARGEFILE 1$(DL) >> $@
524 ifdef ENABLE_IPV6
525         @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
526         @echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
527         @echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
528         @echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
529         @echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
530         @echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
531         @echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
532         @echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
533         @echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
534         @echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
535 endif
536 endif
537         @echo $(DL)#define USE_MANUAL 1$(DL) >> $@
538         @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
539         @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
540         @echo $(DL)#define HAVE_ERRNO_H 1$(DL) >> $@
541         @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
542         @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
543         @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
544         @echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
545         @echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
546         @echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
547         @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
548         @echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@
549         @echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@
550         @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
551         @echo $(DL)#define HAVE_LL 1$(DL) >> $@
552         @echo $(DL)#define HAVE_LOCALE_H 1$(DL) >> $@
553         @echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
554         @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
555         @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
556         @echo $(DL)#define HAVE_RECV 1$(DL) >> $@
557         @echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
558         @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
559         @echo $(DL)#define HAVE_SEND 1$(DL) >> $@
560         @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
561         @echo $(DL)#define HAVE_SETLOCALE 1$(DL) >> $@
562         @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
563         @echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
564         @echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
565         @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
566         @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
567         @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
568         @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
569         @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
570         @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
571         @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
572         @echo $(DL)#define HAVE_SYS_IOCTL_H 1$(DL) >> $@
573         @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
574         @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
575         @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
576         @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
577         @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
578         @echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
579         @echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
580         @echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
581         @echo $(DL)#define RETSIGTYPE void$(DL) >> $@
582         @echo $(DL)#define SIZEOF_INT 4$(DL) >> $@
583         @echo $(DL)#define SIZEOF_SHORT 2$(DL) >> $@
584         @echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
585         @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
586         @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
587 ifdef DISABLE_LDAP
588         @echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@
589 else
590         @echo $(DL)#define CURL_HAS_NOVELL_LDAPSDK 1$(DL) >> $@
591 ifndef DISABLE_LDAPS
592         @echo $(DL)#define HAVE_LDAP_SSL 1$(DL) >> $@
593 endif
594         @echo $(DL)#define HAVE_LDAP_SSL_H 1$(DL) >> $@
595         @echo $(DL)#define HAVE_LDAP_URL_PARSE 1$(DL) >> $@
596 endif
597 ifdef NW_WINSOCK
598         @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
599 else
600         @echo $(DL)#define USE_BSD_SOCKETS 1$(DL) >> $@
601         @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
602         @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
603         @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
604         @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
605 endif
606 ifdef WITH_ARES
607         @echo $(DL)#define USE_ARES 1$(DL) >> $@
608 endif
609 ifdef WITH_ZLIB
610         @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
611         @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
612 endif
613 ifdef WITH_SSL
614         @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
615         @echo $(DL)#define USE_OPENSSL 1$(DL) >> $@
616         @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
617         @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
618         @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
619         @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
620         @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
621         @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
622         @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
623         @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
624         @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
625         @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
626 ifdef WITH_SPNEGO
627         @echo $(DL)#define HAVE_SPNEGO 1$(DL) >> $@
628 endif
629 else
630 ifdef WITH_AXTLS
631         @echo $(DL)#define USE_AXTLS 1$(DL) >> $@
632 endif
633 endif
634 ifdef WITH_SSH2
635         @echo $(DL)#define USE_LIBSSH2 1$(DL) >> $@
636         @echo $(DL)#define HAVE_LIBSSH2_H 1$(DL) >> $@
637 endif
638 ifdef WITH_IDN
639         @echo $(DL)#define HAVE_LIBIDN 1$(DL) >> $@
640         @echo $(DL)#define HAVE_TLD_H 1$(DL) >> $@
641 endif
642 ifdef WITH_RTMP
643         @echo $(DL)#define USE_LIBRTMP 1$(DL) >> $@
644 endif
645         @echo $(DL)#ifdef __GNUC__$(DL) >> $@
646         @echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@
647         @echo $(DL)#else$(DL) >> $@
648         @echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
649         @echo $(DL)#endif$(DL) >> $@
650 ifdef CABUNDLE
651         @echo $(DL)#define CURL_CA_BUNDLE "$(CABUNDLE)"$(DL) >> $@
652 else
653         @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
654 endif
655
656 hugehelp.c:
657         @echo Creating $@
658         @$(CP) hugehelp.c.cvs $@
659
660 $(LIBCARES_PATH)/libcares.$(LIBEXT):
661         $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib
662
663