2004-10-08 Stepan Kasal Support cross compiling. Based on research by Mark Fortescue. Maciej W. Rozycki pointed out this issue previously. * configure.ac: If cross compiling, run second configure script in a subdirectory ${native_tools}. New automake conditional TOOLS_ONLY is set inside that subdirectory. * Makefile.am (SUBDIRS): Add $(native_tools); restrict the SUBDIRS to minimum, if we are inside the $(native_toos) dir. (distclean-local): Remove directory $(native_toos). * doc/Makefile.am: If necessary, use makeinfo and install-info from $(native_toos). * info/Makefile.am: Similarily with the ``makedoc'' program. Index: Makefile.am =================================================================== RCS file: /cvsroot/texinfo/texinfo/Makefile.am,v retrieving revision 1.10 diff -u -r1.10 Makefile.am --- Makefile.am 11 Apr 2004 17:56:45 -0000 1.10 +++ Makefile.am 8 Oct 2004 10:01:49 -0000 @@ -21,11 +21,16 @@ # distribution directory. TEXINFO_TEX = doc/texinfo.tex -# All subdirectories. -# Do intl, m4, and lib first since the C programs depend on them. -# Do doc last so makeinfo will be built when we get there. -# Others are alphabetical. -SUBDIRS = intl m4 lib info makeinfo po util doc +if TOOLS_ONLY + # Build native tools only. + SUBDIRS = lib info makeinfo util +else + # All subdirectories. + # Do intl, m4, and lib first since the C programs depend on them. + # Do doc last so makeinfo will be built when we get there. + # Others are alphabetical. + SUBDIRS = $(native_tools) intl m4 lib info makeinfo po util doc +endif # for gettext. ACLOCAL_AMFLAGS = -I m4 @@ -38,3 +43,12 @@ # One special target for installers to use by hand if desired. install-tex: cd doc && $(MAKE) TEXMF=$(TEXMF) install-tex + +distclean-local: + -test -d "$(native_tools)" && rm -rf "$(native_tools)" + +# Don't install native tools for cross compile. +if TOOLS_ONLY +install: + +endif Index: configure.ac =================================================================== RCS file: /cvsroot/texinfo/texinfo/configure.ac,v retrieving revision 1.39 diff -u -r1.39 configure.ac --- configure.ac 1 Oct 2004 18:04:46 -0000 1.39 +++ configure.ac 8 Oct 2004 10:01:49 -0000 @@ -79,6 +79,24 @@ # term library. AC_CANONICAL_BUILD +if test "$cross_compiling" = no; then + native_tools= +else + # Make twice, once locally, then with host compiler. + native_tools=tools + test -d "$native_tools" || mkdir "$native_tools" + confdir=`(cd "$srcdir";pwd)` + rm -f config.status + # Make sure the secondary configure won't complain + # that it's "already configured." + cd "$native_tools" + tools_only=1 $confdir/configure --build=${build} --host=${build} \ + --disable-rpath --disable-nls + cd .. +fi +AC_SUBST(native_tools) +AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]]) + # Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but # rather ncurses. So we check for it. TERMLIBS= Index: doc/Makefile.am =================================================================== RCS file: /cvsroot/texinfo/texinfo/doc/Makefile.am,v retrieving revision 1.18 diff -u -r1.18 Makefile.am --- doc/Makefile.am 13 Apr 2004 00:07:51 -0000 1.18 +++ doc/Makefile.am 8 Oct 2004 10:01:49 -0000 @@ -18,8 +18,8 @@ info.5 texinfo.5 # Use the programs built in our distribution. -MAKEINFO = ../makeinfo/makeinfo -INSTALL_INFO = ../util/install-info +MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo +INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \ txi-it.tex txi-nl.tex txi-no.tex txi-pl.tex txi-pt.tex txi-tr.tex Index: info/Makefile.am =================================================================== RCS file: /cvsroot/texinfo/texinfo/info/Makefile.am,v retrieving revision 1.4 diff -u -r1.4 Makefile.am --- info/Makefile.am 11 Apr 2004 17:56:45 -0000 1.4 +++ info/Makefile.am 8 Oct 2004 10:01:49 -0000 @@ -62,4 +62,4 @@ # The $(EXEEXT) should be added by Automake, but isn't. Fine. $(BUILT_SOURCES): makedoc$(EXEEXT) $(cmd_sources) rm -f $(BUILT_SOURCES) - ./makedoc $(cmd_sources) + $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)