Bug 692040

Summary: [patch] automake-1.6 is required in ijs sources, but does not work
Product: Ghostscript Reporter: Richard Hughes <richard>
Component: Build ProcessAssignee: Chris Liddell (chrisl) <chris.liddell>
Status: RESOLVED FIXED    
Severity: normal CC: dam, henry.stiles, htl10
Priority: P4    
Version: master   
Hardware: All   
OS: Linux   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 695038    
Attachments: Up the ijs autoconf BR to 1.8

Description Richard Hughes 2011-03-08 10:33:55 UTC
Created attachment 7346 [details]
Up the ijs autoconf BR to 1.8

In Fedora, we are running autogen.sh before building ijs in the ghostscript package. autogen.sh reads Makefile.am and extracts that automake-1.6 should be used rather than the system automake which is 1.11 on Fedora 15.

autoconf-1.6 is duely run, and then automake-1.6 is then run. I think this then fails as AM_INIT_AUTOMAKE doesn't seem to be present by default in automake-1.6 and aclocal wasn't called with --force (which doesn't exist in 1.6 anyway...):

+ ./autogen.sh
checking for autoconf...
checking for automake 1.6 or later... automake-1.6
checking for aclocal 1.6 or later... aclocal-1.6
checking for libtoolize... libtoolize
Creating configuration files for ijs...
  aclocal-1.6 
aclocal: macro `_LT_DECL_SED' required but not defined
aclocal: macro `_LT_FUNC_STRIPNAME_CNF' required but not defined
  libtoolize --automake
  automake-1.6 --add-missing 
Useless use of /d modifier in transliteration operator at /usr/bin/automake-1.6 line 5741.
configure.ac:88: no proper implementation of AM_INIT_AUTOMAKE was found,
configure.ac:88: probably because aclocal.m4 is missing...
configure.ac:88: You should run aclocal to create this file, then
configure.ac:88: run automake again.
configure.ac: installing `./install-sh'
configure.ac: installing `./mkinstalldirs'
configure.ac: installing `./missing'
Use of uninitialized value $file in concatenation (.) or string at /usr/bin/automake-1.6 line 8449.
: installing `./config.guess'
Use of uninitialized value $file in concatenation (.) or string at /usr/bin/automake-1.6 line 8449.
: installing `./config.sub'
  autoconf
configure.ac:88: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:114: error: possibly undefined macro: AC_DISABLE_SHARED
configure.ac:115: error: possibly undefined macro: AM_PROG_LIBTOOL
configure.ac:121: error: possibly undefined macro: AM_PROG_CC_STDC
configure.ac:145: error: possibly undefined macro: AM_CONDITIONAL
Running ./configure --enable-maintainer-mode --enable-compile-warnings ...
configure: WARNING: unrecognized options: --enable-maintainer-mode, --enable-compile-warnings
./configure: line 1804: syntax error near unexpected token `ijs,'
./configure: line 1804: `AM_INIT_AUTOMAKE(ijs, 0.35)'
error: Bad exit status from /home/hughsie/rpmbuild/tmp/rpm-tmp.iHO7KV (%build)

Upping the required automake (and thus autoconf) version to 1.8 fixes the problem. Automake 1.8 has been around for over 6 years now. I've attached a trivial patch.

Thanks,

Richard.
Comment 1 Chris Liddell (chrisl) 2012-08-17 14:18:30 UTC
Patch applied:

http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=de8f9636

Thanks for your contribution.
Comment 2 Hin-Tak Leung 2014-02-12 08:27:11 UTC
This change seems to be wrong. The ijs code (or its build system) hasn't changed much for about 15 years. I just got stopped by this but but revert the change and built with automake 1.6.3
Comment 3 Hin-Tak Leung 2014-02-12 21:32:52 UTC
The original analysis from Richard was rubbish in quite a few ways. I have managed to reproduce the issue observed by installing the old fedora package automake16-1.6.3-18.fc13.1.noarch onto a current fedora system.

The bottom line is that aclocal-1.6 (and the way fedora ships it) does not work correctly with libtool 2.x . You can replicate the problem without any gs sources, just by (in an empty directory):

      echo AM_PROG_LIBTOOL > configure.ac
      aclocal-1.6

This generates:
  aclocal: macro `_LT_DECL_SED' required but not defined
  aclocal: macro `_LT_FUNC_STRIPNAME_CNF' required but not defined

and in fact aclocal-1.6 failed, so "aclocal.m4" is missing. And that's all there is.

If you hack at the m4 macros in /usr/share/aclocal/libtool.m4 and /usr/share/aclocal/ltdl.m4 to get rid of some "m4_require([_LT_DECL_SED])" and "AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])", aclocal-1.6 will run, and automake-1.6 does work.

The older system I was trying to build ijs on, has libtool 1.5 with automake-1.6/aclocal-1.6, so it worked.

The suggested change only work for a fortuitous reason: autogen.sh has code to do either an exact match or use the current - i.e. it tries aclocal-x.x.x or just aclocal. So after the change, it wasn't using 1.8 (since fedora 15 did not have that version) but it was using automake 1.11, and of course it worked with libtool 2.x .

I am going to file a bug at fedora, as well as another here about building ijs n mac os x 10.4.
Comment 5 Dagobert Michelsen 2015-01-09 05:34:31 UTC
This is related to http://bugs.ghostscript.com/show_bug.cgi?id=695692