This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: [patch, libgomp, build] PR30546 build fail in libgomp when building from SVN because makeinfo is missing


On Tuesday 30 January 2007 23:37, Daniel Franke wrote:
> On Tuesday 30 January 2007 11:17, Paolo Bonzini wrote:
> > >> I tried that a few days ago, but automake screwed it up, eventhough
> > >> info_TEXINFOS was conditionalized, INFO_DEPS = libgomp.info
> > >> in Makefile.in was unconditional and therefore it insisted to
> > >> regenerate the file anyway.
> > >
> > > The bug is actually that all-am depends on $(INFO_DEPS) rather than
> > > info-am.
> >
> > Sorry, half composed message and actually wrong.  I'm looking into
> > automake to see if it can be easily fixed.
>
> Any news here?
> If not, I will dive in myself, again.

Paolo, 

here's the least intrusive patch I could conjure up, that actually does the 
job.

Easy solution: just override libgomp.info target and use an AM_CONDITIONAL to 
decide whether to call a stamp-* dependency. Nice side-effect: 
if --enable-generated-files-in-srcdir is given, but automake is missing, the 
copy call in stamp-geninsrc will fail.

Attached patch does not contain the regenerated files. Tested info, dvi and 
pdf targets on i686-pc-linux-gnu.

Regards
	Daniel

Index: ../config/acx.m4
===================================================================
--- ../config/acx.m4	(revision 121218)
+++ ../config/acx.m4	(working copy)
@@ -491,3 +491,27 @@
   fi
 fi
 AC_SUBST($2)])
+
+
+dnl Locate a program and check that its version is acceptable.
+dnl ACX_PROG_CHECK_VER(var, name, version-switch,
+dnl                    version-extract-regexp, version-glob)
+AC_DEFUN([ACX_CHECK_PROG_VER],[
+  AC_CHECK_PROG([$1], [$2], [$2])
+  if test -n "[$]$1"; then
+    # Found it, now check the version.
+    AC_CACHE_CHECK([for modern $2],
+                   [gcc_cv_prog_$2_modern],
+                   [ac_prog_version=`eval [$]$1 $3 2>&1 |
+                                     sed -n 's/^.*patsubst([[$4]],/,\/).*$/\1/p'`
+
+                    [case $ac_prog_version in
+                      '')  gcc_cv_prog_$2_modern=no;;
+                      $5)  gcc_cv_prog_$2_modern=yes;;
+                      *)   gcc_cv_prog_$2_modern=no;;
+                    esac]
+                   ])
+  else
+    gcc_cv_prog_$2_modern=no
+  fi
+])
Index: aclocal.m4
===================================================================
--- aclocal.m4	(revision 121218)
+++ aclocal.m4	(working copy)
@@ -856,6 +856,7 @@
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/enable.m4])
 m4_include([../config/lead-dot.m4])
Index: configure.ac
===================================================================
--- configure.ac	(revision 121218)
+++ configure.ac	(working copy)
@@ -130,6 +130,14 @@
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 
+# See if makeinfo has been installed and is modern enough
+# that we can use it.
+ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
+                   [GNU texinfo.* \([0-9][0-9.]*\)],
+                   [4.[4-9]*])
+AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
+
+
 # Configure libtool
 AM_PROG_LIBTOOL
 AC_SUBST(enable_shared)
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 121218)
+++ Makefile.am	(working copy)
@@ -74,11 +74,26 @@
 STAMP_GENINSRC =
 endif
 
+# AM_CONDITIONAL on configure check ACX_CHECK_PROG_VER([MAKEINFO])
+if BUILD_INFO
+STAMP_BUILD_INFO = stamp-build-info
+else
+STAMP_BUILD_INFO =
+endif
+
+
 all-local: $(STAMP_GENINSRC)
 
 stamp-geninsrc: libgomp.info
-	-cp -p $(top_builddir)/libgomp.info $(srcdir)/libgomp.info
-	touch $@
+	cp -p $(top_builddir)/libgomp.info $(srcdir)/libgomp.info
+	@touch $@
 
-CLEANFILES = stamp-geninsrc libgomp.info
+libgomp.info: $(STAMP_BUILD_INFO)
+
+stamp-build-info: libgomp.texi
+	$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -o $@ $(srcdir)/libgomp.texi
+	@touch $@
+
+
+CLEANFILES = $(STAMP_GENINSRC) $(STAMP_BUILD_INFO) libgomp.info
 MAINTAINERCLEANFILES = $(srcdir)/libgomp.info

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]