]> rtime.felk.cvut.cz Git - hornmich/skoda-qr-demo.git/blob - QRScanner/mobile/jni/thirdparty/curl/src/Makefile.netware
Add MuPDF native source codes
[hornmich/skoda-qr-demo.git] / QRScanner / mobile / jni / thirdparty / curl / src / Makefile.netware
1 #################################################################
2 #
3 ## Makefile for building curl.nlm (NetWare version - gnu make)
4 ## Use: make -f Makefile.netware
5 ##
6 ## Comments to: Guenter Knauf http://www.gknw.net/phpbb
7 #
8 #################################################################
9
10 # Edit the path below to point to the base of your Novell NDK.
11 ifndef NDKBASE
12 NDKBASE = c:/novell
13 endif
14
15 # Edit the path below to point to the base of your Zlib sources.
16 ifndef ZLIB_PATH
17 ZLIB_PATH = ../../zlib-1.2.8
18 endif
19
20 # Edit the path below to point to the base of your OpenSSL package.
21 ifndef OPENSSL_PATH
22 OPENSSL_PATH = ../../openssl-0.9.8y
23 endif
24
25 # Edit the path below to point to the base of your LibSSH2 package.
26 ifndef LIBSSH2_PATH
27 LIBSSH2_PATH = ../../libssh2-1.4.3
28 endif
29
30 # Edit the path below to point to the base of your axTLS package.
31 ifndef AXTLS_PATH
32 AXTLS_PATH = ../../axTLS-1.2.7
33 endif
34
35 # Edit the path below to point to the base of your libidn package.
36 ifndef LIBIDN_PATH
37 LIBIDN_PATH = ../../libidn-1.18
38 endif
39
40 # Edit the path below to point to the base of your librtmp package.
41 ifndef LIBRTMP_PATH
42 LIBRTMP_PATH = ../../librtmp-2.3
43 endif
44
45 # Edit the path below to point to the base of your fbopenssl package.
46 ifndef FBOPENSSL_PATH
47 FBOPENSSL_PATH = ../../fbopenssl-0.4
48 endif
49
50 # Edit the path below to point to the base of your libmetalink package.
51 ifndef LIBMETALINK_PATH
52 LIBMETALINK_PATH = ../../libmetalink-0.1.2
53 endif
54
55 # Edit the path below to point to the base of your libexpat package.
56 ifndef LIBEXPAT_PATH
57 LIBEXPAT_PATH = ../../expat-2.1.0
58 endif
59
60 # Edit the path below to point to the base of your libXML2 package.
61 ifndef LIBXML2_PATH
62 LIBXML2_PATH = ../../libxml2-2.8.0
63 endif
64
65 # Edit the path below to point to the base of your c-ares package.
66 ifndef LIBCARES_PATH
67 LIBCARES_PATH = ../ares
68 endif
69
70 ifndef INSTDIR
71 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
72 endif
73
74 # Edit the vars below to change NLM target settings.
75 TARGET  = curl
76 VERSION = $(LIBCURL_VERSION)
77 COPYR   = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
78 DESCR   = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
79 MTSAFE  = YES
80 STACK   = 64000
81 SCREEN  = $(TARGET) commandline utility
82 # Comment the line below if you dont want to load protected automatically.
83 # LDRING = 3
84
85 # Uncomment the next line to enable linking with POSIX semantics.
86 # POSIXFL = 1
87
88 # Edit the var below to point to your lib architecture.
89 ifndef LIBARCH
90 LIBARCH = LIBC
91 endif
92
93 # must be equal to NDEBUG or DEBUG, CURLDEBUG
94 ifndef DB
95 DB      = NDEBUG
96 endif
97 # Optimization: -O<n> or debugging: -g
98 ifeq ($(DB),NDEBUG)
99         OPT     = -O2
100         OBJDIR  = release
101 else
102         OPT     = -g
103         OBJDIR  = debug
104 endif
105
106 # The following lines defines your compiler.
107 ifdef CWFolder
108         METROWERKS = $(CWFolder)
109 endif
110 ifdef METROWERKS
111         # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
112         MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
113         CC = mwccnlm
114 else
115         CC = gcc
116 endif
117 PERL    = perl
118 # Here you can find a native Win32 binary of the original awk:
119 # http://www.gknw.net/development/prgtools/awk-20100523.zip
120 AWK     = awk
121 CP      = cp -afv
122 MKDIR   = mkdir
123 # RM    = rm -f
124 # If you want to mark the target as MTSAFE you will need a tool for
125 # generating the xdc data for the linker; here's a minimal tool:
126 # http://www.gknw.net/development/prgtools/mkxdc.zip
127 MPKXDC  = mkxdc
128
129 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
130 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
131
132 # Include the version info retrieved from curlver.h
133 -include $(OBJDIR)/version.inc
134
135 # Global flags for all compilers
136 CFLAGS  += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
137
138 ifeq ($(CC),mwccnlm)
139 LD      = mwldnlm
140 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
141 LIBEXT  = lib
142 CFLAGS  += -gccinc -inline off -opt nointrinsics -proc 586
143 CFLAGS  += -relax_pointers
144 #CFLAGS += -w on
145 ifeq ($(LIBARCH),LIBC)
146 ifeq ($(POSIXFL),1)
147         PRELUDE = $(NDK_LIBC)/imports/posixpre.o
148 else
149         PRELUDE = $(NDK_LIBC)/imports/libcpre.o
150 endif
151         CFLAGS += -align 4
152 else
153         # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
154         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
155         PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
156         # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
157         CFLAGS += -align 1
158 endif
159 else
160 LD      = nlmconv
161 LDFLAGS = -T
162 LIBEXT  = a
163 CFLAGS  += -m32
164 CFLAGS  += -fno-builtin -fno-strict-aliasing
165 ifeq ($(findstring gcc,$(CC)),gcc)
166 CFLAGS  += -fpcc-struct-return
167 endif
168 CFLAGS  += -Wall # -pedantic
169 ifeq ($(LIBARCH),LIBC)
170 ifeq ($(POSIXFL),1)
171         PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
172 else
173         PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
174 endif
175 else
176         # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
177         # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
178         # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
179         PRELUDE = $(NDK_ROOT)/pre/prelude.o
180         CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
181 endif
182 endif
183
184 NDK_ROOT = $(NDKBASE)/ndk
185 ifndef NDK_CLIB
186 NDK_CLIB = $(NDK_ROOT)/nwsdk
187 endif
188 ifndef NDK_LIBC
189 NDK_LIBC = $(NDK_ROOT)/libc
190 endif
191 ifndef NDK_LDAP
192 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
193 endif
194 CURL_INC = ../include
195 CURL_LIB = ../lib
196
197 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
198
199 ifeq ($(findstring -static,$(CFG)),-static)
200 LINK_STATIC = 1
201 endif
202 ifeq ($(findstring -ares,$(CFG)),-ares)
203 WITH_ARES = 1
204 endif
205 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
206 WITH_RTMP = 1
207 WITH_SSL = 1
208 WITH_ZLIB = 1
209 endif
210 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
211 WITH_SSH2 = 1
212 WITH_SSL = 1
213 WITH_ZLIB = 1
214 endif
215 ifeq ($(findstring -axtls,$(CFG)),-axtls)
216 WITH_AXTLS = 1
217 WITH_SSL =
218 else
219 ifeq ($(findstring -ssl,$(CFG)),-ssl)
220 WITH_SSL = 1
221 endif
222 endif
223 ifeq ($(findstring -zlib,$(CFG)),-zlib)
224 WITH_ZLIB = 1
225 endif
226 ifeq ($(findstring -idn,$(CFG)),-idn)
227 WITH_IDN = 1
228 endif
229 ifeq ($(findstring -spnego,$(CFG)),-spnego)
230 WITH_SPNEGO = 1
231 WITH_SSL = 1
232 endif
233 ifeq ($(findstring -metalink,$(CFG)),-metalink)
234 WITH_METALINK = 1
235 WITH_SSL = 1
236 endif
237 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
238 ENABLE_IPV6 = 1
239 endif
240
241 ifdef LINK_STATIC
242         LDLIBS  = $(CURL_LIB)/libcurl.$(LIBEXT)
243 ifdef WITH_ARES
244         LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
245 endif
246 else
247         MODULES = libcurl.nlm
248         IMPORTS = @$(CURL_LIB)/libcurl.imp
249 endif
250 ifdef WITH_SSH2
251         # INCLUDES += -I$(LIBSSH2_PATH)/include
252 ifdef LINK_STATIC
253         LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
254 else
255         MODULES += libssh2.nlm
256         IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
257 endif
258 endif
259 ifdef WITH_RTMP
260         # INCLUDES += -I$(LIBRTMP_PATH)
261 ifdef LINK_STATIC
262         LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
263 endif
264 endif
265 ifdef WITH_SSL
266         # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
267         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
268         LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
269         IMPORTS += GetProcessSwitchCount RunningProcess
270 ifdef WITH_SPNEGO
271         # INCLUDES += -I$(FBOPENSSL_PATH)/include
272         LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT)
273 endif
274 else
275 ifdef WITH_AXTLS
276         # INCLUDES += -I$(AXTLS_PATH)/inc
277 ifdef LINK_STATIC
278         LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
279 else
280         MODULES += libaxtls.nlm
281         IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
282 endif
283 endif
284 endif
285 ifdef WITH_ZLIB
286         INCLUDES += -I$(ZLIB_PATH)
287 ifdef LINK_STATIC
288         LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
289 else
290         MODULES += libz.nlm
291         IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
292 endif
293 endif
294 ifdef WITH_IDN
295         # INCLUDES += -I$(LIBIDN_PATH)/include
296         LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
297 endif
298 ifdef WITH_METALINK
299         CFLAGS += -DUSE_METALINK
300         INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
301         INCLUDES += -I$(LIBMETALINK_PATH)/include
302         LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
303 ifdef WITH_LIBEXPAT
304         ifeq ($(LIBARCH),LIBC)
305                 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
306                 MODULES += expatlbc
307         else
308                 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
309                 MODULES += expatlib
310         endif
311 else
312 ifdef WITH_LIBXML2
313         IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
314         MODULES += libxml2
315 endif
316 endif
317 endif
318
319 ifeq ($(LIBARCH),LIBC)
320         INCLUDES += -I$(NDK_LIBC)/include
321         # INCLUDES += -I$(NDK_LIBC)/include/nks
322         # INCLUDES += -I$(NDK_LIBC)/include/winsock
323         CFLAGS += -D_POSIX_SOURCE
324 else
325         INCLUDES += -I$(NDK_CLIB)/include/nlm
326         # INCLUDES += -I$(NDK_CLIB)/include
327 endif
328 ifndef DISABLE_LDAP
329         # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
330 endif
331 CFLAGS  += $(INCLUDES)
332
333 ifeq ($(MTSAFE),YES)
334         XDCOPT = -n
335 endif
336 ifeq ($(MTSAFE),NO)
337         XDCOPT = -u
338 endif
339 ifdef XDCOPT
340         XDCDATA = $(OBJDIR)/$(TARGET).xdc
341 endif
342
343 ifeq ($(findstring /sh,$(SHELL)),/sh)
344 DL      = '
345 DS      = /
346 PCT     = %
347 #-include $(NDKBASE)/nlmconv/ncpfs.inc
348 else
349 DS      = \\
350 PCT     = %%
351 endif
352
353 # Makefile.inc provides the CSOURCES and HHEADERS defines
354 include Makefile.inc
355
356 OBJX    := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_ONES))))
357 OBJS    := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
358 ifndef LINK_STATIC
359 OBJS    += $(OBJX)
360 endif
361
362 vpath %.c $(CURL_LIB)
363
364 all: prebuild $(TARGET).nlm
365
366 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
367
368 $(OBJDIR)/%.o: %.c
369 #       @echo Compiling $<
370         $(CC) $(CFLAGS) -c $< -o $@
371
372 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
373         @echo Creating $@
374         @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
375
376 install: $(INSTDIR) all
377         @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
378         @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
379         @$(CP) $(TARGET).nlm $(INSTDIR)
380
381 clean:
382 ifeq "$(wildcard tool_hugehelp.c.cvs)" "tool_hugehelp.c.cvs"
383         -$(RM) tool_hugehelp.c
384 endif
385         -$(RM) -r $(OBJDIR)
386
387 distclean vclean: clean
388         -$(RM) $(TARGET).nlm
389
390 $(OBJDIR) $(INSTDIR):
391         @$(MKDIR) $@
392
393 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
394         @echo Linking $@
395         @-$(RM) $@
396         @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
397
398 $(OBJDIR)/%.xdc: Makefile.netware
399         @echo Creating $@
400         @$(MPKXDC) $(XDCOPT) $@
401
402 $(OBJDIR)/%.def: Makefile.netware
403         @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
404         @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
405         @echo $(DL)# All your changes will be lost!!$(DL) >> $@
406         @echo $(DL)#$(DL) >> $@
407         @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
408         @echo $(DL)description "$(DESCR)"$(DL) >> $@
409         @echo $(DL)version $(VERSION)$(DL) >> $@
410 ifdef NLMTYPE
411         @echo $(DL)type $(NLMTYPE)$(DL) >> $@
412 endif
413 ifdef STACK
414         @echo $(DL)stack $(STACK)$(DL) >> $@
415 endif
416 ifdef SCREEN
417         @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
418 else
419         @echo $(DL)screenname "DEFAULT"$(DL) >> $@
420 endif
421 ifneq ($(DB),NDEBUG)
422         @echo $(DL)debug$(DL) >> $@
423 endif
424         @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
425 ifdef XDCDATA
426         @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
427 endif
428 ifeq ($(LDRING),0)
429         @echo $(DL)flag_on 16$(DL) >> $@
430 endif
431 ifeq ($(LDRING),3)
432         @echo $(DL)flag_on 512$(DL) >> $@
433 endif
434 ifeq ($(LIBARCH),CLIB)
435         @echo $(DL)start _Prelude$(DL) >> $@
436         @echo $(DL)exit _Stop$(DL) >> $@
437         @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
438         @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
439         @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
440         @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
441         @echo $(DL)module clib$(DL) >> $@
442 ifndef DISABLE_LDAP
443         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
444         @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
445 #       @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
446         @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
447 endif
448 else
449 ifeq ($(POSIXFL),1)
450         @echo $(DL)flag_on 4194304$(DL) >> $@
451 endif
452         @echo $(DL)flag_on 64$(DL) >> $@
453         @echo $(DL)pseudopreemption$(DL) >> $@
454 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
455         @echo $(DL)start POSIX_Start$(DL) >> $@
456         @echo $(DL)exit POSIX_Stop$(DL) >> $@
457         @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
458 else
459         @echo $(DL)start _LibCPrelude$(DL) >> $@
460         @echo $(DL)exit _LibCPostlude$(DL) >> $@
461         @echo $(DL)check _LibCCheckUnload$(DL) >> $@
462 endif
463         @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
464         @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
465         @echo $(DL)module libc$(DL) >> $@
466 ifndef DISABLE_LDAP
467         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
468         @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
469 #       @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
470         @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
471 endif
472 endif
473 ifdef MODULES
474         @echo $(DL)module $(MODULES)$(DL) >> $@
475 endif
476 ifdef EXPORTS
477         @echo $(DL)export $(EXPORTS)$(DL) >> $@
478 endif
479 ifdef IMPORTS
480         @echo $(DL)import $(IMPORTS)$(DL) >> $@
481 endif
482 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
483         @echo $(DL)input $(PRELUDE)$(DL) >> $@
484         @echo $(DL)input $(OBJS)$(DL) >> $@
485 ifdef LDLIBS
486         @echo $(DL)input $(LDLIBS)$(DL) >> $@
487 endif
488         @echo $(DL)output $(TARGET).nlm$(DL) >> $@
489 endif
490
491 tool_hugehelp.c:
492         @echo Creating $@
493         @$(CP) tool_hugehelp.c.cvs $@
494
495 $(LIBCARES_PATH)/libcares.$(LIBEXT):
496         $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib
497
498