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