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