2e7522f
2009-10-29  Stepan Kasal  <skasal@redhat.com>
2e7522f
2e7522f
Make build with autoconf 2.59.
2e7522f
2e7522f
diff -urN powerpc-utils-1.2.2.orig/configure.ac powerpc-utils-1.2.2/configure.ac
2e7522f
--- powerpc-utils-1.2.2.orig/configure.ac	2009-10-22 21:00:13.000000000 +0200
2e7522f
+++ powerpc-utils-1.2.2/configure.ac	2009-10-29 15:41:58.000000000 +0100
2e7522f
@@ -1,8 +1,9 @@
2e7522f
 #                                               -*- Autoconf -*-
2e7522f
 # Process this file with autoconf to produce a configure script.
2e7522f
 
2e7522f
-AC_PREREQ([2.63])
2e7522f
-AC_INIT([powerpc-utils], [1.2.0], [nfont@austin.ibm.com])
2e7522f
+AC_PREREQ([2.59])
2e7522f
+m4_include([ac_type_uint.m4])
2e7522f
+AC_INIT([powerpc-utils], [1.2.2], [nfont@austin.ibm.com])
2e7522f
 AM_INIT_AUTOMAKE
2e7522f
 AC_CONFIG_SRCDIR([src/rtas_ibm_get_vpd.c])
2e7522f
 
2e7522f
diff -urN powerpc-utils-1.2.2.orig/ac_type_uint.m4 powerpc-utils-1.2.2/ac_type_uint.m4
2e7522f
--- powerpc-utils-1.2.2.orig/ac_type_uint.m4	1970-01-01 01:00:00.000000000 +0100
2e7522f
+++ powerpc-utils-1.2.2/ac_type_uint.m4	2009-10-29 16:04:41.000000000 +0100
2e7522f
@@ -0,0 +1,119 @@
2e7522f
+AC_DEFUN([AC_TYPE_INT8_T], [_AC_TYPE_INT(8)])
2e7522f
+AC_DEFUN([AC_TYPE_INT16_T], [_AC_TYPE_INT(16)])
2e7522f
+AC_DEFUN([AC_TYPE_INT32_T], [_AC_TYPE_INT(32)])
2e7522f
+AC_DEFUN([AC_TYPE_INT64_T], [_AC_TYPE_INT(64)])
2e7522f
+AC_DEFUN([AC_TYPE_UINT8_T], [_AC_TYPE_UNSIGNED_INT(8)])
2e7522f
+AC_DEFUN([AC_TYPE_UINT16_T], [_AC_TYPE_UNSIGNED_INT(16)])
2e7522f
+AC_DEFUN([AC_TYPE_UINT32_T], [_AC_TYPE_UNSIGNED_INT(32)])
2e7522f
+AC_DEFUN([AC_TYPE_UINT64_T], [_AC_TYPE_UNSIGNED_INT(64)])
2e7522f
+
2e7522f
+# _AC_TYPE_INT(NBITS)
2e7522f
+# -------------------
2e7522f
+AC_DEFUN([_AC_TYPE_INT],
2e7522f
+[
2e7522f
+  AC_CACHE_CHECK([for int$1_t], [ac_cv_c_int$1_t],
2e7522f
+    [ac_cv_c_int$1_t=no
2e7522f
+     for ac_type in 'int$1_t' 'int' 'long int' \
2e7522f
+	 'long long int' 'short int' 'signed char'; do
2e7522f
+       AC_COMPILE_IFELSE(
2e7522f
+	 [AC_LANG_BOOL_COMPILE_TRY(
2e7522f
+	    [AC_INCLUDES_DEFAULT],
2e7522f
+	    [[0 < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1)]])],
2e7522f
+	 [AC_COMPILE_IFELSE(
2e7522f
+	    [AC_LANG_BOOL_COMPILE_TRY(
2e7522f
+	       [AC_INCLUDES_DEFAULT],
2e7522f
+	       [[($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1)
2e7522f
+		 < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 2)]])],
2e7522f
+	    [],
2e7522f
+	    [AS_CASE([$ac_type], [int$1_t],
2e7522f
+	       [ac_cv_c_int$1_t=yes],
2e7522f
+	       [ac_cv_c_int$1_t=$ac_type])])])
2e7522f
+       test "$ac_cv_c_int$1_t" != no && break
2e7522f
+     done])
2e7522f
+  case $ac_cv_c_int$1_t in #(
2e7522f
+  no|yes) ;; #(
2e7522f
+  *)
2e7522f
+    AC_DEFINE_UNQUOTED([int$1_t], [$ac_cv_c_int$1_t],
2e7522f
+      [Define to the type of a signed integer type of width exactly $1 bits
2e7522f
+       if such a type exists and the standard includes do not define it.]);;
2e7522f
+  esac
2e7522f
+])# _AC_TYPE_INT
2e7522f
+
2e7522f
+# _AC_TYPE_UNSIGNED_INT(NBITS)
2e7522f
+# ----------------------------
2e7522f
+AC_DEFUN([_AC_TYPE_UNSIGNED_INT],
2e7522f
+[
2e7522f
+  AC_CACHE_CHECK([for uint$1_t], [ac_cv_c_uint$1_t],
2e7522f
+    [ac_cv_c_uint$1_t=no
2e7522f
+     for ac_type in 'uint$1_t' 'unsigned int' 'unsigned long int' \
2e7522f
+	 'unsigned long long int' 'unsigned short int' 'unsigned char'; do
2e7522f
+       AC_COMPILE_IFELSE(
2e7522f
+	 [AC_LANG_BOOL_COMPILE_TRY(
2e7522f
+	    [AC_INCLUDES_DEFAULT],
2e7522f
+	    [[($ac_type) -1 >> ($1 - 1) == 1]])],
2e7522f
+	 [AS_CASE([$ac_type], [uint$1_t],
2e7522f
+	    [ac_cv_c_uint$1_t=yes],
2e7522f
+	    [ac_cv_c_uint$1_t=$ac_type])])
2e7522f
+       test "$ac_cv_c_uint$1_t" != no && break
2e7522f
+     done])
2e7522f
+  case $ac_cv_c_uint$1_t in #(
2e7522f
+  no|yes) ;; #(
2e7522f
+  *)
2e7522f
+    m4_bmatch([$1], [^\(8\|32\|64\)$],
2e7522f
+      [AC_DEFINE([_UINT$1_T], 1,
2e7522f
+	 [Define for Solaris 2.5.1 so the uint$1_t typedef from
2e7522f
+	  <sys/synch.h>, <pthread.h>, or <semaphore.h> is not used.
2e7522f
+	  If the typedef were allowed, the #define below would cause a
2e7522f
+	  syntax error.])])
2e7522f
+    AC_DEFINE_UNQUOTED([uint$1_t], [$ac_cv_c_uint$1_t],
2e7522f
+      [Define to the type of an unsigned integer type of width exactly $1 bits
2e7522f
+       if such a type exists and the standard includes do not define it.]);;
2e7522f
+  esac
2e7522f
+])# _AC_TYPE_UNSIGNED_INT
2e7522f
+
2e7522f
+
2e7522f
+# AS_CASE(WORD, [PATTERN1], [IF-MATCHED1]...[DEFAULT])
2e7522f
+# ----------------------------------------------------
2e7522f
+# Expand into
2e7522f
+# | case WORD in
2e7522f
+# | PATTERN1) IF-MATCHED1 ;;
2e7522f
+# | ...
2e7522f
+# | *) DEFAULT ;;
2e7522f
+# | esac
2e7522f
+m4_define([_AS_CASE],
2e7522f
+[  $1[)] m4_default([$2], [:]) ;;
2e7522f
+])
2e7522f
+m4_define([_AS_CASE_DEFAULT],
2e7522f
+[  *[)] $1 ;;
2e7522f
+])
2e7522f
+m4_defun([AS_CASE],
2e7522f
+[m4_ifval([$2$3],
2e7522f
+[case $1 in
2e7522f
+m4_transform_pair([_$0], [_$0_DEFAULT], m4_shift($@))dnl
2e7522f
+esac
2e7522f
+])dnl
2e7522f
+])# AS_CASE
2e7522f
+
2e7522f
+
2e7522f
+# m4_transform_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
2e7522f
+# --------------------------------------------------------------
2e7522f
+# Perform a pairwise grouping of consecutive ARGs, by expanding
2e7522f
+# EXPRESSION([ARG1], [ARG2]).  If there are an odd number of ARGs, the
2e7522f
+# final argument is expanded with END-EXPR([ARGn]).
2e7522f
+#
2e7522f
+# For example:
2e7522f
+#   m4_define([show], [($*)m4_newline])dnl
2e7522f
+#   m4_transform_pair([show], [], [a], [b], [c], [d], [e])dnl
2e7522f
+#   => (a,b)
2e7522f
+#   => (c,d)
2e7522f
+#   => (e)
2e7522f
+#
2e7522f
+# Please keep foreach.m4 in sync with any adjustments made here.
2e7522f
+m4_define([m4_transform_pair],
2e7522f
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
2e7522f
+       [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
2e7522f
+       [$#], [2], [],
2e7522f
+       [$#], [3], [m4_default([$2], [$1])([$3])[]],
2e7522f
+       [$#], [4], [$1([$3], [$4])[]],
2e7522f
+       [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])])
2e7522f
+