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