Avoid potential negative array index access to cached text.
[LibreOffice.git] / external / curl / ExternalProject_curl.mk
blobc63a8e0465ce50222b20c72f4b532dfa59498cd3
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_ExternalProject_ExternalProject,curl))
12 $(eval $(call gb_ExternalProject_use_externals,curl,\
13 $(if $(ENABLE_OPENSSL),openssl) \
14 zlib \
17 $(eval $(call gb_ExternalProject_register_targets,curl,\
18 build \
21 ifneq ($(OS),WNT)
23 curl_CPPFLAGS :=
24 curl_LDFLAGS := $(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN)
26 ifneq ($(OS),ANDROID)
27 ifneq ($(SYSBASE),)
28 curl_CPPFLAGS += -I$(SYSBASE)/usr/include
29 curl_LDFLAGS += -L$(SYSBASE)/usr/lib
30 endif
31 endif
33 # use --with-secure-transport on macOS >10.5 and iOS to get a native UI for SSL certs for CMIS usage
34 # use --with-openssl only on platforms other than macOS and iOS
35 $(call gb_ExternalProject_get_state_target,curl,build):
36 $(call gb_Trace_StartRange,curl,EXTERNAL)
37 $(call gb_ExternalProject_run,build,\
38 $(gb_RUN_CONFIGURE) ./configure \
39 --without-amissl --without-bearssl --without-gnutls \
40 --without-mbedtls --without-rustls --without-wolfssl \
41 --disable-ftp --enable-http --enable-ipv6 \
42 --without-libidn2 --without-libpsl --without-librtmp \
43 --without-libssh2 --without-nghttp2 \
44 --without-libssh --without-brotli \
45 --without-ngtcp2 --without-quiche \
46 --without-zstd --without-hyper --without-libgsasl --without-gssapi \
47 --disable-mqtt --disable-ares \
48 --disable-dict --disable-file --disable-gopher --disable-imap \
49 --disable-ldap --disable-ldaps --disable-manual --disable-pop3 \
50 --disable-rtsp --disable-smb --disable-smtp --disable-telnet \
51 --disable-tftp \
52 $(if $(filter iOS MACOSX,$(OS)),\
53 --with-secure-transport,\
54 $(if $(ENABLE_OPENSSL),--with-openssl$(if $(SYSTEM_OPENSSL),,="$(call gb_UnpackedTarball_get_dir,openssl)"))) \
55 $(if $(filter LINUX,$(OS)),--without-ca-bundle --without-ca-path) \
56 $(gb_CONFIGURE_PLATFORMS) \
57 $(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
58 $(if $(ENABLE_DEBUG),--enable-debug) \
59 $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
60 $(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
61 $(if $(filter MACOSX,$(OS)),CFLAGS='$(CFLAGS) \
62 -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)') \
63 $(if $(filter -fsanitize=undefined,$(CC)),CC='$(CC) -fno-sanitize=function') \
64 CPPFLAGS='$(curl_CPPFLAGS)' \
65 CFLAGS="$(gb_CFLAGS) $(call gb_ExternalProject_get_build_flags,curl)" \
66 LDFLAGS='$(call gb_ExternalProject_get_link_flags,curl) $(curl_LDFLAGS)' \
67 ZLIB_CFLAGS='$(ZLIB_CFLAGS)' ZLIB_LIBS='$(ZLIB_LIBS)' \
68 && cd lib \
69 && $(MAKE) \
71 $(call gb_Trace_EndRange,curl,EXTERNAL)
73 else ifeq ($(COM),MSC)
75 $(eval $(call gb_ExternalProject_use_nmake,curl,build))
77 $(call gb_ExternalProject_get_state_target,curl,build):
78 $(call gb_Trace_StartRange,curl,EXTERNAL)
79 $(call gb_ExternalProject_run,build,\
80 nmake -f Makefile.vc \
81 mode=dll \
82 VC=12 \
83 MACHINE=$(gb_MSBUILD_PLATFORM) \
84 GEN_PDB=$(if $(call gb_Module__symbols_enabled,curl),yes,no) \
85 $(if $(call gb_Module__symbols_enabled,curl),CFLAGS_PDB_VALUE="$(gb_DEBUGINFO_FLAGS)") \
86 DEBUG=$(if $(MSVC_USE_DEBUG_RUNTIME),yes,no) \
87 ENABLE_IPV6=yes \
88 ENABLE_SSPI=yes \
89 ENABLE_WINSSL=yes \
90 WITH_ZLIB=static \
91 ,winbuild)
92 $(call gb_Trace_EndRange,curl,EXTERNAL)
94 endif
96 # vim: set noet sw=4 ts=4: