[LIBGPG-ERROR PATCH] doc: use compiler flags for yat2m when not cross-built.

NIIBE Yutaka gniibe at fsij.org
Tue Mar 20 09:22:49 CET 2018


Here is updated version.

* For cross compile, configure requires yat2m on the build machine.

* For cross compile, yat2m is built and installed.

* For native compile, we support the situation yat2m is not yet
  installed.  In this case, we use yat2m now being built.

==========================
diff --git a/configure.ac b/configure.ac
index 1e648d1..2c23734 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,7 @@ AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_AWK
 AC_CHECK_TOOL(AR, ar, :)
+AC_ARG_VAR(YAT2M, [tool to convert texi to man pages])
 AC_GNU_SOURCE
 
 # Set some variables depending on the platform for later use.
@@ -138,6 +139,14 @@ fi
 AC_MSG_RESULT($CC_FOR_BUILD)
 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
 
+AC_PATH_PROG(YAT2M, yat2m, ./yat2m)
+if test "$cross_compiling" = "yes" -a ac_cv_path_YAT2M = "./yat2m"; then
+   AC_MSG_ERROR([[
+***
+*** yat2m is not installed on this build system.  Please install.
+***]])
+fi
+
 
 AH_BOTTOM([
 /* Force using of NLS for W32 even if no libintl has been found.  This is
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d052283..328089a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -17,11 +17,14 @@
 # License along with this program; if not, see <https://www.gnu.org/licenses/>.
 
 
-EXTRA_DIST = HACKING errorref.txt \
-	     yat2m.c
+EXTRA_DIST = HACKING errorref.txt
+
+bin_PROGRAMS = yat2m
+yat2m_SOURCES = yat2m.c
+yat2m_CFLAGS= -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\""
 
 DISTCLEANFILES = gpgrt.cps yat2m-stamp.tmp yat2m-stamp $(myman_pages)
-CLEANFILES = yat2m errorref.txt.x
+CLEANFILES = errorref.txt.x
 
 info_TEXINFOS = gpgrt.texi
 gpgrt_TEXINFOS = lgpl.texi gpl.texi
@@ -34,20 +37,15 @@ myman_pages   = gpg-error-config.1
 
 man_MANS = $(myman_pages)
 
-yat2m: yat2m.c
-	$(CC_FOR_BUILD) -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\"" \
-                -o $@ $(srcdir)/yat2m.c
-
-
 yat2m-stamp: $(myman_sources)
 	@rm -f yat2m-stamp.tmp
 	@touch yat2m-stamp.tmp
 	for file in $(myman_sources) ; do \
-              ./yat2m $(YAT2M_OPTIONS) --store \
+              $(YAT2M) $(YAT2M_OPTIONS) --store \
 	          `test -f '$$file' || echo '$(srcdir)/'`$$file ; done
 	@mv -f yat2m-stamp.tmp $@
 
-yat2m-stamp: yat2m
+yat2m-stamp: $(YAT2M)
 
 $(myman_pages) : yat2m-stamp
 	@if test -f $@; then :; else \
@@ -72,22 +70,9 @@ errorref.txt.x : errorref.txt
 	sed '/^##/ d' $< >$@
 	echo "# Installed by $(PACKAGE_NAME) $(PACKAGE_VERSION)" >>$@
 
-install-exec-hook:
-if CROSS_COMPILING
-	@echo "not install yat2m while cross-compiling"
-else
-	@echo "installing yat2m on the build system"; \
-         $(MKDIR_P) "$(DESTDIR)$(bindir)"; \
-	 $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
-	         yat2m "$(DESTDIR)$(bindir)/yat2m"
-endif
-
 install-data-local: errorref.txt.x
 	$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
 	$(INSTALL_DATA) errorref.txt.x $(DESTDIR)$(pkgdatadir)/errorref.txt
 
 uninstall-local:
 	- at rm $(DESTDIR)$(pkgdatadir)/errorref.txt
-if !CROSS_COMPILING
-	- at rm $(DESTDIR)$(bindir)/yat2m
-endif
-- 



More information about the Gnupg-devel mailing list