cmake/autotools: Use AC_CHECK_SIZEOF to fix 32bit support
This commit is contained in:
parent
0ee4a6a94e
commit
09ec4ff9c1
@ -29,6 +29,7 @@ PACKAGE_STRING
|
||||
PACKAGE_TARNAME
|
||||
PACKAGE_URL
|
||||
PACKAGE_VERSION
|
||||
SIZEOF_VOID_P
|
||||
size_t
|
||||
STDC_HEADERS
|
||||
VERSION
|
||||
|
@ -55,13 +55,13 @@ if("FALSE")
|
||||
endif()
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@ac_cv_sizeof_void_p@" STREQUAL "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
math(EXPR installedBits "8 * 8")
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@ac_cv_sizeof_void_p@")
|
||||
math(EXPR installedBits "@ac_cv_sizeof_void_p@ * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
||||
|
@ -372,6 +372,7 @@ LIBDIR_BASENAME="$(basename "${libdir}")"
|
||||
SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
|
||||
SO_MINOR="${LIBAGE}"
|
||||
SO_PATCH="${LIBREVISION}"
|
||||
AC_CHECK_SIZEOF([void *]) # sets ac_cv_sizeof_void_p
|
||||
AC_SUBST([EXPAT_ATTR_INFO])
|
||||
AC_SUBST([EXPAT_DTD])
|
||||
AC_SUBST([EXPAT_LARGE_SIZE])
|
||||
@ -384,6 +385,7 @@ AC_SUBST([LIBDIR_BASENAME])
|
||||
AC_SUBST([SO_MAJOR])
|
||||
AC_SUBST([SO_MINOR])
|
||||
AC_SUBST([SO_PATCH])
|
||||
AC_SUBST([ac_cv_sizeof_void_p])
|
||||
|
||||
|
||||
dnl write the Automake flags we set
|
||||
|
Loading…
Reference in New Issue
Block a user