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