]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: delete unused `NEED_LBER_H`, `HAVE_LDAP_H`
authorViktor Szakats <commit@vsz.me>
Mon, 26 Aug 2024 11:53:41 +0000 (13:53 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 19 Sep 2024 15:48:57 +0000 (17:48 +0200)
Both are used by `./configure` internally, not by curl C code.
CMake adds `NEED_LBER_H` to `CURL_TEST_DEFINES`, which is used by
`curl_internal_test()`, but there is no LDAP-related test made with that
call.

Thus, stop detecting and publishing these from CMake.

`NEED_LBER_H` added in 7320e53d9e17b22cacea77a89ecaa8348513f0e1.
`HAVE_LDAP_H` added in 4c5307b45655ba75ab066564afdc0c111a8b9291 (initial CMake commit).

Closes #14690

.github/scripts/cmp-config.pl
CMakeLists.txt
lib/curl_config.h.cmake

index 9046ad2961d84e8b59c51c631c68770b51645d7f..f573891cc4eae821714a7c7639d4442196c1806a 100755 (executable)
@@ -50,6 +50,7 @@ my %remove = (
     '#define HAVE_GETHOSTBYNAME 1' => 1,
     '#define HAVE_INTTYPES_H 1' => 1,
     '#define HAVE_IOCTL 1' => 1,
+    '#define HAVE_LDAP_H 1' => 1,
     '#define HAVE_LDAP_SSL 1' => 1,
     '#define HAVE_LIBBROTLIDEC 1' => 1,
     '#define HAVE_LIBSOCKET 1' => 1,
@@ -73,6 +74,7 @@ my %remove = (
     '#define HAVE_ZSTD 1' => 1,
     '#define HAVE_ZSTD_H 1' => 1,
     '#define LT_OBJDIR ".libs/"' => 1,
+    '#define NEED_LBER_H 1' => 1,
     '#define OS "Linux"' => 1,
     '#define OS "x86_64-pc-linux-gnu"' => 1,
     '#define PACKAGE "curl"' => 1,
index 4f2c2c0234dbd81a1b2e6e7c730103c5b6a5aa16..8d0fb30cb33eec08f315634e8afb6532da81278c 100644 (file)
@@ -974,21 +974,6 @@ if(NOT CURL_DISABLE_LDAP)
       if(CMAKE_LDAP_INCLUDE_DIR)
         include_directories(${CMAKE_LDAP_INCLUDE_DIR})
       endif()
-      set(NEED_LBER_H ON)
-      unset(_header_list)
-      if(WIN32)
-        list(APPEND _header_list "windows.h")
-      endif()
-      if(HAVE_SYS_TYPES_H)
-        list(APPEND _header_list "sys/types.h")
-      endif()
-      list(APPEND _header_list "ldap.h")
-
-      set(_include_string "")
-      foreach(_header IN LISTS _header_list)
-        set(_include_string "${_include_string}#include <${_header}>\n")
-      endforeach()
-
       list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1")
       list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_LDAP_LIB})
       set(CURL_LIBS "${CMAKE_LDAP_LIB};${CURL_LIBS}")
@@ -997,21 +982,6 @@ if(NOT CURL_DISABLE_LDAP)
         set(CURL_LIBS "${CMAKE_LBER_LIB};${CURL_LIBS}")
       endif()
 
-      check_c_source_compiles("
-        ${_include_string}
-        int main(int argc, char ** argv)
-        {
-          BerValue *bvp = NULL;
-          BerElement *bep = ber_init(bvp);
-          ber_free(bep, 1);
-          return 0;
-        }" NOT_NEED_LBER_H)
-      if(NOT_NEED_LBER_H)
-        set(NEED_LBER_H OFF)
-      else()
-        set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DNEED_LBER_H")
-      endif()
-
       check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE)
       check_function_exists("ldap_init_fd" HAVE_LDAP_INIT_FD)
 
index d803885b3d1460636a6df329f1523968fa0b9356..304e528a71fd702c8f0a8ef6ba61bb59ea4557bb 100644 (file)
 /* Define to 1 if you have the lber.h header file. */
 #cmakedefine HAVE_LBER_H 1
 
-/* Define to 1 if you have the ldap.h header file. */
-#cmakedefine HAVE_LDAP_H 1
-
 /* Use LDAPS implementation */
 #cmakedefine HAVE_LDAP_SSL 1
 
 /* Define this symbol if your OS supports changing the contents of argv */
 #cmakedefine HAVE_WRITABLE_ARGV 1
 
-/* Define to 1 if you need the lber.h header file even with ldap.h */
-#cmakedefine NEED_LBER_H 1
-
 /* Define to 1 if you need the malloc.h header file even with stdlib.h */
 #cmakedefine NEED_MALLOC_H 1