Skip to contentSkip to conversation

Don't try to use help2man when cross-compiling

PATCH In review Colin Watson 3 participants 6 messages Sep 10, 2009 – Sep 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't try to use help2man when cross-compiling

John Taylor reported that this patch fixes one of his problems in
http://savannah.gnu.org/bugs/?27349. It's been a while since I had anything to do with Autoconf's cross-compiling support, so does this look reasonable? The "cross_compiling" variable was added in a considerably older version of Autoconf than we already require.

2009-09-10 Colin Watson <[email protected]>

	* configure.ac: Don't look for help2man when cross-compiling.  Fixes
	part of bug #27349.
configure.ac +3 -1
Index: configure.ac
===================================================================
@@ -147,7 +147,9 @@
 
 # These are not a "must".
 AC_PATH_PROG(RUBY, ruby)
-AC_PATH_PROG(HELP2MAN, help2man)
+if test "x$cross_compiling" = xno; then
+  AC_PATH_PROG(HELP2MAN, help2man)
+fi
 
 #
 # Checks for host programs.

Thanks,

Signature · 1 line
Colin Watson                                       [[email protected]]
#1 lore raw

Am Donnerstag, den 10.09.2009, 16:37 +0100 schrieb Colin Watson:

Quoted 11 lines

John Taylor reported that this patch fixes one of his problems in
http://savannah.gnu.org/bugs/?27349. It's been a while since I had anything to do with Autoconf's cross-compiling support, so does this look reasonable? The "cross_compiling" variable was added in a considerably older version of Autoconf than we already require.

2009-09-10 Colin Watson <[email protected]>

	* configure.ac: Don't look for help2man when cross-compiling.  Fixes
	part of bug #27349.

Hm maybe there should be a warning, that there won't be any man pages (even though they would be anyway only the --help output)

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#2 lore raw
In reply to Colin Watson
Quoted 16 lines · Colin Watson

John Taylor reported that this patch fixes one of his problems in
http://savannah.gnu.org/bugs/?27349. It's been a while since I had anything to do with Autoconf's cross-compiling support, so does this look reasonable? The "cross_compiling" variable was added in a considerably older version of Autoconf than we already require.

2009-09-10 Colin Watson <[email protected]>

	* configure.ac: Don't look for help2man when cross-compiling.  Fixes
	part of bug #27349.

Index: configure.ac
===================================================================

configure.ac line 152

Quoted 7 lines
configure.ac +3 -1
@@ -147,7 +147,9 @@
 
 # These are not a "must".
 AC_PATH_PROG(RUBY, ruby)
-AC_PATH_PROG(HELP2MAN, help2man)
+if test "x$cross_compiling" = xno; then
+  AC_PATH_PROG(HELP2MAN, help2man)
+fi

Autoconf documentation says you can test for $cross_compiling being set to "yes", but is unclear about the variable being defined or not when we're not cross-compiling.

Maybe we should test "x$cross_compiling" != xyes instead?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#3 lore raw
Quoted 7 lines · Robert Millan
Quoted 6 lines · Colin Watson

Index: configure.ac
===================================================================

configure.ac +0 -0
@@ -147,7 +147,9 @@
 
Quoted 10 lines

configure.ac line 152

Quoted 6 lines
configure.ac +3 -1
 # These are not a "must".
 AC_PATH_PROG(RUBY, ruby)
-AC_PATH_PROG(HELP2MAN, help2man)
+if test "x$cross_compiling" = xno; then
+  AC_PATH_PROG(HELP2MAN, help2man)
+fi

Autoconf documentation says you can test for $cross_compiling being set to "yes", but is unclear about the variable being defined or not when we're not cross-compiling.

It's always set during initialisation.

Quoted 1 line

Maybe we should test "x$cross_compiling" != xyes instead?

This is probably a good idea anyway. AC_RUN_IFELSE just checks against yes, so I think it's the right thing to do. Furthermore, if we move this down to after the compiler checks then we get a more reliable test.

Revised patch follows, also addressing Felix's comment. Is this better?

2009-09-10 Colin Watson <[email protected]>

	* configure.ac: Don't look for help2man when cross-compiling.  Fixes
	part of bug #27349.
configure.ac +6 -1
Index: configure.ac
===================================================================
@@ -147,7 +147,6 @@
 
 # These are not a "must".
 AC_PATH_PROG(RUBY, ruby)
-AC_PATH_PROG(HELP2MAN, help2man)
 
 #
 # Checks for host programs.
@@ -171,6 +170,12 @@
   ASFLAGS="$ASFLAGS -DAPPLE_CC=1"
 fi
 
+if test "x$cross_compiling" = xyes; then
+  AC_MSG_WARN([cannot generate manual pages while cross compiling])
+else
+  AC_PATH_PROG(HELP2MAN, help2man)
+fi
+
 # Check for functions.
 AC_CHECK_FUNCS(posix_memalign memalign asprintf)
 

Thanks,

Signature · 1 line
Colin Watson                                       [[email protected]]
#4 lore raw
Quoted 21 lines · Colin Watson
Quoted 7 lines · Robert Millan
Quoted 6 lines · Colin Watson

Index: configure.ac
===================================================================

configure.ac +0 -0
@@ -147,7 +147,9 @@
 
Quoted 10 lines

configure.ac

Quoted 6 lines
configure.ac +3 -1
 # These are not a "must".
 AC_PATH_PROG(RUBY, ruby)
-AC_PATH_PROG(HELP2MAN, help2man)
+if test "x$cross_compiling" = xno; then
+  AC_PATH_PROG(HELP2MAN, help2man)
+fi

Autoconf documentation says you can test for $cross_compiling being set to "yes", but is unclear about the variable being defined or not when we're not cross-compiling.

It's always set during initialisation.

Quoted 7 lines
Quoted 1 line

Maybe we should test "x$cross_compiling" != xyes instead?

This is probably a good idea anyway. AC_RUN_IFELSE just checks against yes, so I think it's the right thing to do. Furthermore, if we move this down to after the compiler checks then we get a more reliable test.

Revised patch follows, also addressing Felix's comment. Is this better?

Looks fine.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#5 lore raw
Quoted 4 lines · Robert Millan
Quoted 1 line · Colin Watson

Revised patch follows, also addressing Felix's comment. Is this better?

Looks fine.

Committed, thanks.

Signature · 1 line
Colin Watson                                       [[email protected]]