From: Philipp Thomas <pth@suse.de>
Date: 2013-01-18 15:53:13+01:00
Subject: Add required check, clean up help messages
References: 

- Newer autoconf versions need AM_PROG_CC_C_O for certain feature.
- swig.m4 needs to explicitly be included in order for autoreconf
  to work.

---
 configure.in          |   12 +++++++-----
 ibdiag/Makefile.am    |    2 +-
 ibdiag/configure.in   |    1 +
 ibdm/Makefile.am      |    2 +-
 ibdm/configure.in     |    3 +++
 ibis/Makefile.am      |    2 +-
 ibis/configure.in     |    3 +++
 ibmgtsim/configure.in |    3 +++
 8 files changed, 20 insertions(+), 8 deletions(-)

Index: configure.in
===================================================================
--- configure.in.orig	2011-03-08 12:08:02.000000000 +0100
+++ configure.in	2013-01-18 17:01:35.947628898 +0100
@@ -37,7 +37,9 @@ dnl use local config dir for extras
 AC_CONFIG_AUX_DIR(config)
 
 dnl Auto make
-AM_INIT_AUTOMAKE( [foreign ] )
+AM_INIT_AUTOMAKE( [foreign] )
+
+AC_CONFIG_FILES([Makefile])
 
 dnl Defines the Language
 AC_LANG_C
@@ -52,7 +54,7 @@ AC_PROG_MAKE_SET
 
 dnl Define an input config option to control debug compile
 AC_ARG_ENABLE(debug,
-[  --enable-debug    Turn on debugging],
+AS_HELP_STRING([--enable-debug], [Turn on debugging]),
 [case "${enableval}" in
   yes) debug=true ;;
   no)  debug=false ;;
@@ -61,7 +63,7 @@ esac],[debug=false])
 
 dnl For making dist we need not check any lib dependency
 AC_ARG_ENABLE(libcheck,
-[  --enable-libcheck    Enable Dependency Checking],
+AS_HELP_STRING([--enable-libcheck], [Enable Dependency Checking]),
 [case "${enableval}" in
   yes) libcheck=true ;;
   no)  libcheck=false ;;
@@ -75,7 +77,7 @@ dnl Configure the following subdirs
 AC_CONFIG_SUBDIRS(ibis ibdm ibdiag)
 
 AC_ARG_ENABLE(ibmgtsim,
-[  --enable-ibmgtsim    Build ibmgtsim],
+AS_HELP_STRING([--enable-ibmgtsim], [Build ibmgtsim]),
 [case "${enableval}" in
   yes) ibmgtsim=true ;;
   no)  ibmgtsim=false ;;
@@ -94,5 +96,5 @@ fi
 
 AC_CONFIG_FILES([ibutils.spec])
 dnl Create the following Makefiles
-AC_OUTPUT(Makefile)
+AC_OUTPUT()
 
Index: ibdiag/Makefile.am
===================================================================
--- ibdiag/Makefile.am.orig	2010-02-24 11:09:24.000000000 +0100
+++ ibdiag/Makefile.am	2013-01-18 17:15:28.357632983 +0100
@@ -38,4 +38,4 @@ SUBDIRS 		= src doc
 # this will control the update of the files in order
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in
 
-ACLOCAL			= aclocal -I $(ac_aux_dir)
+ACLOCAL_AMFLAGS	     = -I config
Index: ibdiag/configure.in
===================================================================
--- ibdiag/configure.in.orig	2011-03-08 12:08:02.000000000 +0100
+++ ibdiag/configure.in	2013-01-18 17:01:35.948628874 +0100
@@ -35,6 +35,7 @@ dnl Process this file with autoconf to p
 AC_INIT([ibdiag], [1.5.7], [openib-general@openib.org])
 dnl use local config dir for extras
 AC_CONFIG_AUX_DIR([config])
+AC_CONFIG_MACRO_DIR([config])
 
 dnl Auto make
 AM_INIT_AUTOMAKE( [foreign ] )
Index: ibdm/Makefile.am
===================================================================
--- ibdm/Makefile.am.orig	2010-11-02 00:03:44.000000000 +0100
+++ ibdm/Makefile.am	2013-01-18 17:44:30.313779141 +0100
@@ -38,7 +38,7 @@ SUBDIRS 		= ibdm src Clusters ibnl doc s
 # this will control the update of the files in order
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in
 
-ACLOCAL			= aclocal -I $(ac_aux_dir)
+ACLOCAL_AMFLAGS	     = -I config
 
 # Support cleanup of swig wrappers
 swigclean:
Index: ibdm/configure.in
===================================================================
--- ibdm/configure.in.orig	2011-03-08 12:08:02.000000000 +0100
+++ ibdm/configure.in	2013-01-18 17:42:33.162593396 +0100
@@ -32,6 +32,9 @@
 
 dnl Process this file with autoconf to produce a configure script.
 
+m4_include(config/tcl.m4)
+m4_include(config/swig.m4)
+
 AC_INIT([ibdm],[1.5.7])
 AC_CONFIG_SRCDIR([ibdm/Fabric.h])
 
Index: ibis/Makefile.am
===================================================================
--- ibis/Makefile.am.orig	2010-02-24 11:09:25.000000000 +0100
+++ ibis/Makefile.am	2013-01-18 17:34:26.792277835 +0100
@@ -38,7 +38,7 @@ SUBDIRS 		= src tests doc
 # this will control the update of the files in order
 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in
 
-ACLOCAL			= aclocal -I $(ac_aux_dir)
+ACLOCAL_AMFLAGS         = -I config
 
 # Support cleanup of swig wrappers
 swigclean:
Index: ibis/configure.in
===================================================================
--- ibis/configure.in.orig	2011-03-08 12:08:02.000000000 +0100
+++ ibis/configure.in	2013-01-18 17:01:35.948628874 +0100
@@ -30,6 +30,8 @@
 # SOFTWARE.
 #--
 
+m4_include(config/swig.m4)
+
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT([ibis],[1.5.7])
 AC_CONFIG_SRCDIR([src/ibis_api.h])
@@ -63,6 +65,7 @@ dnl We will use libtool for making ...
 AC_PROG_CXX
 AC_PROG_CPP
 AC_PROG_LIBTOOL
+AM_PROG_CC_C_O
 
 dnl For making dist we need not check any lib dependency
 AC_ARG_ENABLE(libcheck,
Index: ibmgtsim/configure.in
===================================================================
--- ibmgtsim/configure.in.orig	2011-03-08 12:08:02.000000000 +0100
+++ ibmgtsim/configure.in	2013-01-18 17:01:35.949628850 +0100
@@ -32,6 +32,9 @@
 
 dnl Process this file with autoconf to produce a configure script.
 
+m4_include([config/swig.m4])
+m4_include([config/ibdm.m4])
+
 AC_INIT([ibmgtsim],[1.5.7])
 AC_CONFIG_SRCDIR([src/sim.h])
 
