]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix hash function config tests with CMake
authorBrad King <brad.king@kitware.com>
Mon, 30 Nov 2009 15:19:36 +0000 (10:19 -0500)
committerBrad King <brad.king@kitware.com>
Mon, 30 Nov 2009 15:19:36 +0000 (10:19 -0500)
The commit "Improve portability of MD5/SHA* headers and functions" added
both autotools and CMake detection of MD5, RMD, and SHA* hash functions.
The commit "Move hashing function calling into a separate file" rewrote
the autotools logic and changed the source to use different config
macros but did not update the CMake logic.  This commit updates the
CMake configuration tests to produce the result macros the code expects.

SVN-Revision: 1690

CMakeLists.txt
build/cmake/config.h.in

index 6c6319c6e9eb0dd9e28fe0f1e1e2e99a80c2dca2..0356c9e17f216972f83d901f96749e1d522b822e 100644 (file)
@@ -298,48 +298,21 @@ ENDIF(CRYPTO_LIBRARY)
 # Check MD5/RMD160/SHA functions
 #
 SET(CMAKE_REQUIRED_LIBRARIES ${ADDITIONAL_LIBS})
-CHECK_FUNCTION_EXISTS(MD5_Init HAVE_MD5_Init)
-IF(NOT HAVE_MD5_Init)
-  CHECK_FUNCTION_EXISTS(MD5Init HAVE_MD5Init)
-  IF(HAVE_MD5Init)
-    SET(MD5_Init, "MD5Init")
-    SET(MD5_Update, "MD5Update")
-    SET(MD5_Final, "MD5Final")
-  ENDIF(HAVE_MD5Init)
-ENDIF(NOT HAVE_MD5_Init)
-IF(HAVE_MD5_Init OR HAVE_MD5Init)
-  SET(HAVE_MD5 1)
-ENDIF(HAVE_MD5_Init OR HAVE_MD5Init)
-#
-CHECK_FUNCTION_EXISTS(RIPEMD160_Init HAVE_RIPEMD160_Init)
-IF(NOT HAVE_RIPEMD160_Init)
-  CHECK_FUNCTION_EXISTS(RMD160Init HAVE_RMD160Init)
-  IF(HAVE_RMD160Init)
-    SET(RIPEMD160_Init, "RMD160Init")
-    SET(RIPEMD160_Update, "RMD160Update")
-    SET(RIPEMD160_Final, "RMD160Final")
-  ENDIF(HAVE_RMD160Init)
-ENDIF(NOT HAVE_RIPEMD160_Init)
-IF(HAVE_RIPEMD160_Init OR HAVE_RMD160Init)
-  SET(HAVE_RMD160 1)
-ENDIF(HAVE_RIPEMD160_Init OR HAVE_RMD160Init)
-#
-CHECK_FUNCTION_EXISTS(SHA1_Init HAVE_SHA1_Init)
-IF(NOT HAVE_SHA1_Init)
-  CHECK_FUNCTION_EXISTS(SHA1Init HAVE_SHA1Init)
-  IF(HAVE_SHA1Init)
-    SET(SHA1_Init, "SHA1Init")
-    SET(SHA1_Update, "SHA1Update")
-    SET(SHA1_Final, "SHA1Final")
-  ENDIF(HAVE_SHA1Init)
-ENDIF(NOT HAVE_SHA1_Init)
-IF(HAVE_SHA1_Init OR HAVE_SHA1Init)
-  SET(HAVE_SHA1 1)
-ENDIF(HAVE_SHA1_Init OR HAVE_SHA1Init)
-#
-CHECK_FUNCTION_EXISTS(SHA256_Init HAVE_SHA256)
-CHECK_FUNCTION_EXISTS(SHA384_Init HAVE_SHA384)
-CHECK_FUNCTION_EXISTS(SHA512_Init HAVE_SHA512)
+IF(HAVE_MD5_H)
+  CHECK_SYMBOL_EXISTS(MD5Init                  "md5.h"         HAVE_MD5INIT)
+ENDIF(HAVE_MD5_H)
+IF(HAVE_RMD160_H)
+  CHECK_SYMBOL_EXISTS(RMD160Init               "rmd160.h"      HAVE_RMD160INIT)
+ENDIF(HAVE_RMD160_H)
+IF(HAVE_SHA2_H)
+  CHECK_SYMBOL_EXISTS(SHA256Init               "sha2.h"        HAVE_SHA256INIT)
+  CHECK_SYMBOL_EXISTS(SHA384Init               "sha2.h"        HAVE_SHA384INIT)
+  CHECK_SYMBOL_EXISTS(SHA512Init               "sha2.h"        HAVE_SHA512INIT)
+  CHECK_SYMBOL_EXISTS(SHA256_Init              "sha2.h"        HAVE_SHA256_INIT)
+  CHECK_SYMBOL_EXISTS(SHA384_Init              "sha2.h"        HAVE_SHA384_INIT)
+  CHECK_SYMBOL_EXISTS(SHA512_Init              "sha2.h"        HAVE_SHA512_INIT)
+ENDIF(HAVE_SHA2_H)
+SET(CMAKE_REQUIRED_LIBRARIES "")
 
 #
 # Check functions
index ea96372adc2883dd7842f064fbd5f8b0b1b35fb0..98cb37d0b677294eec5c67a73fe7910bfe1f8c95 100644 (file)
 /* Define to 1 if you have the <lzma.h> header file. */
 #cmakedefine HAVE_LZMA_H 1
 
-/* Define to 1 if you have the `MD5' functions. */
-#cmakedefine HAVE_MD5 1
+/* Define to 1 if you have the `MD5Init' function. */
+#cmakedefine HAVE_MD5INIT 1
 
 /* Define to 1 if you have the <md5.h> header file. */
 #cmakedefine HAVE_MD5_H 1
 /* Define to 1 if you have the <ripemd.h> header file. */
 #cmakedefine HAVE_RIPEMD_H 1
 
-/* Define to 1 if you have the `RIPEMD160' functions. */
-#cmakedefine HAVE_RMD160 1
+/* Define to 1 if you have the `RIPEMD160Init' function. */
+#cmakedefine HAVE_RMD160INIT 1
 
 /* Define to 1 if you have the <rmd160.h> header file. */
 #cmakedefine HAVE_RMD160_H 1
 /* Define to 1 if you have the `setlocale' function. */
 #cmakedefine HAVE_SETLOCALE 1
 
-/* Define to 1 if you have the `SHA1' functions. */
-#cmakedefine HAVE_SHA1 1
+/* Define to 1 if you have the `SHA1Init' function. */
+#cmakedefine HAVE_SHA1INIT 1
+
+/* Define to 1 if you have the `SHA1_Init' function. */
+#cmakedefine HAVE_SHA1_INIT 1
 
 /* Define to 1 if you have the <sha1.h> header file. */
 #cmakedefine HAVE_SHA1_H 1
 
-/* Define to 1 if you have the `SHA256' functions. */
-#cmakedefine HAVE_SHA256 1
+/* Define to 1 if you have the `SHA256Init' function. */
+#cmakedefine HAVE_SHA256INIT 1
+
+/* Define to 1 if you have the `SHA256_Init' function. */
+#cmakedefine HAVE_SHA256_INIT 1
 
 /* Define to 1 if you have the <sha256.h> header file. */
 #cmakedefine HAVE_SHA256_H 1
 /* Define to 1 if you have the <sha2.h> header file. */
 #cmakedefine HAVE_SHA2_H 1
 
-/* Define to 1 if you have the `SHA384' functions. */
-#cmakedefine HAVE_SHA384 1
+/* Define to 1 if you have the `SHA384Init' function. */
+#cmakedefine HAVE_SHA384INIT 1
+
+/* Define to 1 if you have the `SHA384_Init' function. */
+#cmakedefine HAVE_SHA384_INIT 1
+
+/* Define to 1 if you have the `SHA512Init' function. */
+#cmakedefine HAVE_SHA512INIT 1
 
-/* Define to 1 if you have the `SHA512' functions. */
-#cmakedefine HAVE_SHA512 1
+/* Define to 1 if you have the `SHA512_Init' function. */
+#cmakedefine HAVE_SHA512_INIT 1
 
 /* Define to 1 if you have the <sha.h> header file. */
 #cmakedefine HAVE_SHA_H 1
    <sysmacros.h>. */
 #cmakedefine MAJOR_IN_SYSMACROS 1
 
-/* Define to the generates final MD5 hash function. */
-#cmakedefine MD5_Final ${MD5_Final}
-
-/* Define to the initializes MD5 context function. */
-#cmakedefine MD5_Init ${MD5_Init}
-
-/* Define to the updates MD5 context function. */
-#cmakedefine MD5_Update ${MD5_Update}
-
 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
 #cmakedefine NO_MINUS_C_MINUS_O 1
 
-/* Define to the generates final RIPEMD160 hash function. */
-#cmakedefine RIPEMD160_Final ${RIPEMD160_Final}
-
-/* Define to the initializes RIPEMD160 context function. */
-#cmakedefine RIPEMD160_Init ${RIPEMD160_Init}
-
-/* Define to the updates RIPEMD160 context function. */
-#cmakedefine RIPEMD160_Update ${RIPEMD160_Update}
-
-/* Define to the generates final SHA1 hash function. */
-#cmakedefine SHA1_Final ${SHA1_Final}
-
-/* Define to the initializes SHA1 context function. */
-#cmakedefine SHA1_Init ${SHA1_Init}
-
-/* Define to the updates SHA1 context function. */
-#cmakedefine SHA1_Update ${SHA1_Update}
-
 /* The size of `wchar_t', as computed by sizeof. */
 #cmakedefine SIZEOF_WCHAR_T ${SIZEOF_WCHAR_T}