From: Michihiro NAKAJIMA Date: Thu, 20 May 2010 14:50:00 +0000 (-0400) Subject: Enable HAVE_SYS_TYPES_H macro during HASH detecting because X-Git-Tag: v3.0.0a~995 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7420cf359f87c388175fc88ca5763afcae2dc1c;p=thirdparty%2Flibarchive.git Enable HAVE_SYS_TYPES_H macro during HASH detecting because md5.h,sha1.h and sha2.h requre sys/types.h SVN-Revision: 2412 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cd0e11bab..9ee104407 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,6 +277,12 @@ ENDIF() # archive_hash.h # MACRO(CHECK_MD HASH IMPLEMENTATIONS) + IF(HAVE_SYS_TYPES_H) + SET(HASH_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n") + ELSE(HAVE_SYS_TYPES_H) + SET(HASH_HEADER_CONFIG "") + ENDIF(HAVE_SYS_TYPES_H) + FOREACH(IMPLEMENTATION ${IMPLEMENTATIONS}) IF(NOT DEFINED ARCHIVE_HASH_${HASH}_${IMPLEMENTATION}) STRING(TOLOWER "${HASH}" lower_hash) @@ -299,6 +305,7 @@ MACRO(CHECK_MD HASH IMPLEMENTATIONS) SET(SOURCE "#define ${hash}_COMPILE_TEST #define ARCHIVE_HASH_${hash}_${IMPLEMENTATION} #define __LIBARCHIVE_BUILD +${HASH_HEADER_CONFIG} #include \"archive_hash.h\" int diff --git a/configure.ac b/configure.ac index 53d211a6b..8916101eb 100644 --- a/configure.ac +++ b/configure.ac @@ -265,6 +265,9 @@ AC_DEFUN([MD_CHECK], [ saved_LIBS="$LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$srcdir/libarchive" + if test $ac_cv_header_sys_types_h = yes; then + CPPFLAGS="$CPPFLAGS -DHAVE_SYS_TYPES_H=1" + fi LIBS="$LIBS $4" AC_MSG_CHECKING([support for ARCHIVE_HASH_$1_$2]) AC_LINK_IFELSE([