Bug 179 - autogen.sh tries to use incorrect m4 directory
: autogen.sh tries to use incorrect m4 directory
Status: NEW
Product: TORQUE
pbs_server
: 3.0.x
: PC Linux
: P5 normal
Assigned To: David Beer
:
:
: 180
  Show dependency treegraph
 
Reported: 2012-04-23 19:22 MDT by rhys.hill
Modified: 2012-04-27 01:32 MDT (History)
1 user (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description rhys.hill 2012-04-23 19:22:52 MDT
On RHEL 5, autogen.sh from the 4.0.1 branch with revision r6023, creates a
configure script with the wrong m4 include directory:

[rhys@moby torque-4.0.1]$ ./autogen.sh 
Putting files in AC_CONFIG_AUX_DIR, `buildutils'.
aclocal:configure.ac:116: warning: macro `AM_SILENT_RULES' not found in library
aclocal:configure.ac:451: warning: macro `AM_SILENT_RULES' not found in library
[rhys@moby torque-4.0.1]$ ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
configure: error: cannot find macro directory `m4'

Changing these two lines in the configure script:

case m4 in
  [\\/]* | ?:[\\/]* ) ac_macro_dir=m4         ;;
  *)                      ac_macro_dir=$srcdir/m4 ;;
esac

to

case m4 in
  [\\/]* | ?:[\\/]* ) ac_macro_dir=buildutils         ;;
  *)                      ac_macro_dir=$srcdir/buildutils ;;
esac

fixes the problem.

I have automake v1.9.6 and autoconf v2.59
Comment 1 rhys.hill 2012-04-27 01:30:28 MDT
The patch below fixes configure.ac so that it works with automake-1.9, which is
all that's available on RHEL 5. It also resolves bug 180, by putting an
explicit check for pkg-config at the start, rather than waiting for the first
pkg check to occur, as was the case previously.

Index: configure.ac
===================================================================
--- configure.ac    (revision 6044)
+++ configure.ac    (working copy)
@@ -37,8 +37,11 @@
 AC_CANONICAL_HOST
 AC_CONFIG_MACRO_DIR([m4])

-LT_INIT
+dnl Enable libtool
+AC_PROG_LIBTOOL

+dnl Ensure we have pkg-config
+PKG_PROG_PKG_CONFIG

 AC_CHECK_PROGS(MAKE,$MAKE make gmake,error)
 if test "x$MAKE" = "xerror" ;then
@@ -111,10 +114,9 @@
 ])
 AM_CONDITIONAL(HAVE_CHECK, test x"$have_check" = "xyes")

-m4_ifdef([AM_SILENT_RULES],[
-  if test "x$have_check" = "xyes"; then
-    AM_SILENT_RULES(no)
-    AC_CONFIG_FILES(src/cmds/test/Makefile
+AS_IF([test "x$have_check" = "xyes"],[
+  AC_CONFIG_FILES(
+    src/cmds/test/Makefile
     src/cmds/test/MXML/Makefile
     src/cmds/test/common_cmds/Makefile
     src/cmds/test/pbs_track/Makefile
@@ -446,12 +448,19 @@
     src/tools/test/printjob/Makefile
     src/tools/test/printserverdb/Makefile
     src/tools/test/printtracking/Makefile
-    src/tools/test/tracejob/Makefile)
-  else
-    AM_SILENT_RULES(no)
-  fi
+    src/tools/test/tracejob/Makefile
+  )
 ])

+dnl
+dnl  ######################################################################
+dnl If unit-testing, disable silent rules. Set a variable so that old
+dnl automake doesn't create an invalid configure script
+AS_IF([test "x$have_check" = "xyes"],[
+ 
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([no])],[DUMMY_VARIABLE_FOR_OLD_AUTOMAKE=1])
+],[
+ 
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],[DUMMY_VARIABLE_FOR_OLD_AUTOMAKE=1])
+])

 dnl
 dnl  ######################################################################
Comment 2 rhys.hill 2012-04-27 01:32:32 MDT
Note that the changes to the script around AM_SILENT_RULES remove the warning
in the first comment.