aboutsummaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-08-13 15:32:20 +0000
committerYang Tse <yangsita@gmail.com>2008-08-13 15:32:20 +0000
commitfeb03e471786e9c543ef6e807a4a748046c0ce2b (patch)
treeb2c7571bd167c31f8702240a0e9c6f1fec295df5 /acinclude.m4
parent64e3a091c34482b666c3c50c312829cd7fa140c9 (diff)
The size of long is a build time characteristic and as such it is now recorded
in curlbuild.h as CURL_SIZEOF_LONG. Definition now done from configure process and in CVS curlbuild.h.dist for non-configure systems.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m443
1 files changed, 38 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 433a4e22e..8240a7da1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3613,6 +3613,43 @@ _EOF
])
+dnl CURL_CONFIGURE_LONG
+dnl -------------------------------------------------
+dnl Find out the size of long as reported by sizeof() and define
+dnl CURL_SIZEOF_LONG as appropriate to be used in template file
+dnl include/curl/curlbuild.h.in to properly configure the library.
+dnl The size of long is a build time characteristic and as such
+dnl must be recorded in curlbuild.h
+
+AC_DEFUN([CURL_CONFIGURE_LONG], [
+ if test ! -z "$ac_cv_sizeof_long"; then
+ AC_MSG_WARN([AC_CHECK_SIZEOF(long) was called before CURL_CONFIGURE_LONG])
+ fi
+ AC_MSG_CHECKING([size of long])
+ curl_sizeof_long="unknown"
+ for tmp_size in '16' '8' '4' '2' '1' ; do
+ if test "$curl_sizeof_long" = "unknown"; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ typedef char dummy_arr[sizeof(long) == $tmp_size ? 1 : -1];
+ ]],[[
+ dummy_arr[1] = (long)1;
+ ]])
+ ],[
+ curl_sizeof_long="$tmp_size"
+ ])
+ fi
+ done
+ if test "$curl_sizeof_long" = "unknown"; then
+ AC_MSG_ERROR([cannot find out size of long])
+ else
+ AC_MSG_RESULT([$curl_sizeof_long])
+ CURL_DEFINE_UNQUOTED([CURL_SIZEOF_LONG], [$curl_sizeof_long])
+ ac_cv_sizeof_long="$curl_sizeof_long"
+ fi
+])
+
+
dnl CURL_INCLUDES_INTTYPES
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
@@ -3722,13 +3759,9 @@ AC_DEFUN([CURL_CONFIGURE_CURL_OFF_T], [
AC_MSG_ERROR([SED not set. Cannot continue without SED being set.])
fi
#
- AC_CHECK_SIZEOF(long)
+ CURL_CONFIGURE_LONG
AC_CHECK_SIZEOF(void*)
#
- if test -z "$ac_cv_sizeof_long" ||
- test "$ac_cv_sizeof_long" -eq "0"; then
- AC_MSG_ERROR([cannot find out size of long.])
- fi
if test -z "$ac_cv_sizeof_voidp" ||
test "$ac_cv_sizeof_voidp" -eq "0"; then
AC_MSG_ERROR([cannot find out size of void*.])