summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2003-02-13 06:56:34 +0000
committerPeter Johnson <peter@tortall.net>2003-02-13 06:56:34 +0000
commitf4920c410a127e9eb868962ba9c431a89417509e (patch)
treedf205802cdb36d689b2fb749c99619858d8c9853 /m4
parente13c6ac3fde5581553254a94fb0dfbf482763b46 (diff)
downloadyasm-f4920c410a127e9eb868962ba9c431a89417509e.tar.gz
Add long long detection to unsigned long long detection.
svn path=/trunk/yasm/; revision=832
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.am4
-rw-r--r--m4/longlong.m4 (renamed from m4/ulonglong.m4)26
2 files changed, 21 insertions, 9 deletions
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 4a9b658b..e7ea26a0 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -13,8 +13,8 @@ EXTRA_DIST = Makefile.am \
lib-link.m4 \
lib-prefix.m4 \
libtool.m4 \
+ longlong.m4 \
ltdl.m4 \
progtest.m4 \
stdint_h.m4 \
- uintmax_t.m4 \
- ulonglong.m4
+ uintmax_t.m4
diff --git a/m4/ulonglong.m4 b/m4/longlong.m4
index c375e474..daa95c07 100644
--- a/m4/ulonglong.m4
+++ b/m4/longlong.m4
@@ -1,13 +1,25 @@
-# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
-dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License. As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+#serial 2
dnl From Paul Eggert.
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
+[
+ AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+ [AC_TRY_LINK([long long ll = 1; int i = 63;],
+ [long long llmax = (long long) -1;
+ return ll << i | ll >> i | llmax / ll | llmax % ll;],
+ ac_cv_type_long_long=yes,
+ ac_cv_type_long_long=no)])
+ if test $ac_cv_type_long_long = yes; then
+ AC_DEFINE(HAVE_LONG_LONG, 1,
+ [Define if you have the long long type.])
+ fi
+])
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
[
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,