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