]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: build: remove home-baked long/ptr size detection
authorJan Engelhardt <jengelh@inai.de>
Fri, 25 May 2012 07:18:40 +0000 (09:18 +0200)
committerBen Myers <bpm@sgi.com>
Wed, 31 Oct 2012 18:20:57 +0000 (13:20 -0500)
autoconf can do this for us.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
configure.ac
include/platform_defs.h.in
m4/package_types.m4

index be57501ee13d290ffc2277473cea90fa5f030940..0b03af952adac7f0d5ca26e78fecc8aa24e0e4e7 100644 (file)
@@ -113,10 +113,11 @@ AC_HAVE_PREADV
 AC_HAVE_SYNC_FILE_RANGE
 AC_HAVE_BLKID_TOPO($enable_blkid)
 
+AC_CHECK_SIZEOF([long])
+AC_CHECK_SIZEOF([char *])
 AC_TYPE_PSINT
 AC_TYPE_PSUNSIGNED
 AC_TYPE_U32
-AC_SIZEOF_POINTERS_AND_LONG
 AC_MANUAL_FORMAT
 
 AC_CONFIG_FILES([include/builddefs])
index 0196cc4436f9b0db4f476aeb2ddd76c06fc77ac6..4e1e0c403df0f916bef3a689ddf3274f143bb77e 100644 (file)
@@ -33,6 +33,7 @@
 #include <pthread.h>
 #include <ctype.h>
 #include <sys/types.h>
+#include <limits.h>
 
 #undef HAVE___U32
 #ifdef HAVE___U32
@@ -77,26 +78,17 @@ typedef struct filldir              filldir_t;
 #endif
 
 /* long and pointer must be either 32 bit or 64 bit */
-#undef HAVE_32BIT_LONG
-#undef HAVE_64BIT_LONG
-#undef HAVE_32BIT_PTR
-#undef HAVE_64BIT_PTR
-
-#if defined(HAVE_32BIT_LONG)
-# define BITS_PER_LONG 32
-#elif defined(HAVE_64BIT_LONG)
-# define BITS_PER_LONG 64
-#else
-# error Unknown long size
-#endif
+#undef SIZEOF_LONG
+#undef SIZEOF_CHAR_P
+#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
 
 /* Check if __psint_t is set to something meaningful */
 #undef HAVE___PSINT_T
 #ifndef HAVE___PSINT_T
-# ifdef HAVE_32BIT_PTR
+# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
 typedef int __psint_t;
-# elif defined HAVE_64BIT_PTR
-#  ifdef HAVE_64BIT_LONG
+# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
+#  if BITS_PER_LONG == 64
 typedef long __psint_t;
 #  else
 /* This is a very strange architecture, which has 64 bit pointers but */
@@ -111,10 +103,10 @@ typedef long long __psint_t;
 /* Check if __psunsigned_t is set to something meaningful */
 #undef HAVE___PSUNSIGNED_T
 #ifndef HAVE___PSUNSIGNED_T
-# ifdef HAVE_32BIT_PTR
+# if (SIZEOF_CHAR_P * CHAR_BIT) == 32
 typedef unsigned int __psunsigned_t;
-# elif defined HAVE_64BIT_PTR
-#  ifdef HAVE_64BIT_LONG
+# elif (SIZEOF_CHAR_P * CHAR_BIT) == 64
+#  if BITS_PER_LONG == 64
 typedef long __psunsigned_t;
 #  else
 /* This is a very strange architecture, which has 64 bit pointers but */
index 0a0e08774614da239681e94d0385aaa29276d847..dfcb0d9989f198f6d98f6273a35c602cf17ec3b8 100644 (file)
@@ -39,26 +39,3 @@ AC_DEFUN([AC_TYPE_U32],
          __u32  u32;
     ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no))
   ])
-
-# 
-# Check type sizes
-# 
-AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG],
-  [ if test "$cross_compiling" = yes -a -z "$ac_cv_sizeof_long"; then
-      AC_MSG_WARN([Cross compiling; assuming 32bit long and 32bit pointers])
-    fi
-    AC_CHECK_SIZEOF(long, 4)
-    AC_CHECK_SIZEOF(char *, 4)
-    if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then
-      AC_DEFINE(HAVE_32BIT_LONG)
-    fi
-    if test $ac_cv_sizeof_long -eq 8; then
-      AC_DEFINE(HAVE_64BIT_LONG)
-    fi
-    if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then
-      AC_DEFINE(HAVE_32BIT_PTR)
-    fi
-    if test $ac_cv_sizeof_char_p -eq 8; then
-      AC_DEFINE(HAVE_64BIT_PTR)
-    fi
-  ])