Makefile.m32: delete legacy component bits [ci skip]

- Drop auto-detection of OpenSSL 1.0.2 and earlier. Now always defaulting
  to OpenSSL 1.1.0 and later, LibreSSL and BoringSSL.

- Drop `Invalid path to OpenSSL package` detection. OpenSSL has been
  using a standard file layout since 1.1.0, so this seems unnecessary
  now.

- Drop special logic to enable Novell LDAP SDK support.

- Drop special logic to enable OpenLDAP LDAP SDK support. This seems
  to be distinct from native OpenLDAP, with support implemented inside
  `lib/ldap.c` (vs. `lib/openldap.c`) back when the latter did not exist
  yet in curl.

- Add `-lwldap32` only if there is no other LDAP library (either native
  OpenLDAP, or SDKs above) present.

- Update `doc/INSTALL.md` accordingly.

After this patch, it's necessary to make configration changes when using
OpenSSL 1.0.2 or earlier, or the two LDAP SDKs.

OpenSSL 1.0.2 and earlier:
```
export OPENSSL_INCLUDE = <path-to-openssl>/outinc
export OPENSSL_LIBPATH = <path-to-openssl>/out
export OPENSSL_LIBS = -lssl32 -leay32 -lgdi32
```

Novell LDAP SDK, previously enabled via `USE_LDAP_NOVELL=1`:
```
export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/inc -DCURL_HAS_NOVELL_LDAPSDK
export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib/mscvc -lldapsdk -lldapssl -lldapx
```

OpenLDAP LDAP SDK, previously enabled via `USE_LDAP_OPENLDAP=1`:
```
export CURL_CFLAG_EXTRAS = -I<path-to-sdk>/include -DCURL_HAS_OPENLDAP_LDAPSDK
export CURL_LDFLAG_EXTRAS = -L<path-to-sdk>/lib -lldap -llber
```

I haven't tested these scenarios, and in general we recommend using
a recent OpenSSL release. Also, WinLDAP (the Windows default) and
OpenLDAP (via `-DUSE_OPENLDAP`) are the LDAP options actively worked on
in curl.

Closes #9631
This commit is contained in:
Viktor Szakats 2022-10-02 09:34:13 +00:00
parent 37b3fb1c6a
commit e604a82cae
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
4 changed files with 17 additions and 117 deletions

View file

@ -61,10 +61,6 @@ endif
ifndef LIBIDN2_PATH
LIBIDN2_PATH = $(PROOT)/../libidn2
endif
# https://www.novell.com/developer/ndk/ldap_libraries_for_c.html
ifndef LDAP_SDK
LDAP_SDK = $(PROOT)/../openldapsdk
endif
ifndef NGHTTP2_PATH
NGHTTP2_PATH = $(PROOT)/../nghttp2
endif
@ -269,30 +265,11 @@ ifdef NGHTTP3
endif
ifdef SSL
ifndef OPENSSL_INCLUDE
ifeq "$(wildcard $(OPENSSL_PATH)/outinc)" "$(OPENSSL_PATH)/outinc"
# OpenSSL 1.0.2 and earlier
OPENSSL_INCLUDE = $(OPENSSL_PATH)/outinc
endif
ifeq "$(wildcard $(OPENSSL_PATH)/include)" "$(OPENSSL_PATH)/include"
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
endif
endif
ifneq "$(wildcard $(OPENSSL_INCLUDE)/openssl/opensslv.h)" "$(OPENSSL_INCLUDE)/openssl/opensslv.h"
$(error Invalid path to OpenSSL package: $(OPENSSL_PATH))
OPENSSL_INCLUDE = $(OPENSSL_PATH)/include
endif
ifndef OPENSSL_LIBPATH
OPENSSL_LIBS = -lssl -lcrypto
ifeq "$(wildcard $(OPENSSL_PATH)/out)" "$(OPENSSL_PATH)/out"
# OpenSSL 1.0.2 and earlier
OPENSSL_LIBPATH = $(OPENSSL_PATH)/out
OPENSSL_LIBS = -lssl32 -leay32
ifndef DYN
OPENSSL_LIBS += -lgdi32
endif
endif
ifeq "$(wildcard $(OPENSSL_PATH)/lib)" "$(OPENSSL_PATH)/lib"
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
endif
OPENSSL_LIBPATH = $(OPENSSL_PATH)/lib
endif
INCLUDES += -I"$(OPENSSL_INCLUDE)"
CFLAGS += -DUSE_OPENSSL
@ -348,19 +325,9 @@ endif
ifdef LDAPS
CFLAGS += -DHAVE_LDAP_SSL
endif
ifdef USE_LDAP_NOVELL
CFLAGS += -DCURL_HAS_NOVELL_LDAPSDK
curl_LDADD += -L"$(LDAP_SDK)/lib/mscvc" -lldapsdk -lldapssl -lldapx
endif
ifdef USE_LDAP_OPENLDAP
CFLAGS += -DCURL_HAS_OPENLDAP_LDAPSDK
curl_LDADD += -L"$(LDAP_SDK)/lib" -lldap -llber
endif
ifndef USE_LDAP_NOVELL
ifndef USE_LDAP_OPENLDAP
ifeq ($(findstring -lldap,$(LDFLAGS)),)
curl_LDADD += -lwldap32
endif
endif
curl_LDADD += -lws2_32 -lcrypt32 -lbcrypt
# Makefile.inc provides the check_PROGRAMS define