RHEL5: Old pod2man didn't have --stderr or -u options.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 11 Mar 2011 10:47:05 +0000 (10:47 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 11 Mar 2011 10:47:05 +0000 (10:47 +0000)
configure.ac
podwrapper.sh.in

index 6690a2c..cd78875 100644 (file)
@@ -249,6 +249,27 @@ AC_CHECK_PROG([POD2HTML],[pod2html],[pod2html],[no])
 test "x$POD2HTML" = "xno" &&
      AC_MSG_ERROR([pod2html must be installed])
 
 test "x$POD2HTML" = "xno" &&
      AC_MSG_ERROR([pod2html must be installed])
 
+dnl Check if pod2man, pod2text take --stderr and -u options (not in RHEL 5).
+AC_MSG_CHECKING([if pod2man takes --stderr option])
+if "$POD2MAN" --stderr >/dev/null 2>&1; then
+    AC_MSG_RESULT([yes])
+    POD2_STDERR_OPTION="--stderr"
+else
+    AC_MSG_RESULT([no])
+    POD2_STDERR_OPTION=""
+fi
+AC_SUBST([POD2_STDERR_OPTION])
+
+AC_MSG_CHECKING([if pod2man takes -u option])
+if "$POD2MAN" -u >/dev/null 2>&1; then
+    AC_MSG_RESULT([yes])
+    POD2_UTF8_OPTION="-u"
+else
+    AC_MSG_RESULT([no])
+    POD2_UTF8_OPTION=""
+fi
+AC_SUBST([POD2_UTF8_OPTION])
+
 dnl Check for mkisofs.
 AC_PATH_PROGS([MKISOFS],[mkisofs],[no],
         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
 dnl Check for mkisofs.
 AC_PATH_PROGS([MKISOFS],[mkisofs],[no],
         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
index c766054..c883c6a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash -
 # podwrapper.sh
 #!/bin/bash -
 # podwrapper.sh
-# Copyright (C) 2010 Red Hat Inc.
+# Copyright (C) 2010-2011 Red Hat Inc.
 # @configure_input@
 #
 # This program is free software; you can redistribute it and/or modify
 # @configure_input@
 #
 # This program is free software; you can redistribute it and/or modify
@@ -30,6 +30,8 @@ PACKAGE_VERSION="@PACKAGE_VERSION@"
 POD2MAN="@POD2MAN@"
 POD2TEXT="@POD2TEXT@"
 POD2HTML="@POD2HTML@"
 POD2MAN="@POD2MAN@"
 POD2TEXT="@POD2TEXT@"
 POD2HTML="@POD2HTML@"
+POD2_STDERR_OPTION="@POD2_STDERR_OPTION@"
+POD2_UTF8_OPTION="@POD2_UTF8_OPTION@"
 
 # This script could be run with any current directory, so if a source
 # or build path is required it must be relative to the following
 
 # This script could be run with any current directory, so if a source
 # or build path is required it must be relative to the following
@@ -164,7 +166,7 @@ fi
 
 # Now generate the final output format(s).
 if [ -n "$man_output" ]; then
 
 # Now generate the final output format(s).
 if [ -n "$man_output" ]; then
-    "$POD2MAN" --stderr -u \
+    "$POD2MAN" "$POD2_STDERR_OPTION" "$POD2_UTF8_OPTION" \
         --section "$section" -c "Virtualization Support" --name "$name" \
         --release "$PACKAGE_NAME-$PACKAGE_VERSION" \
         < $tmpdir/full.pod > "$man_output".tmp
         --section "$section" -c "Virtualization Support" --name "$name" \
         --release "$PACKAGE_NAME-$PACKAGE_VERSION" \
         < $tmpdir/full.pod > "$man_output".tmp
@@ -172,7 +174,7 @@ if [ -n "$man_output" ]; then
 fi
 
 if [ -n "$text_output" ]; then
 fi
 
 if [ -n "$text_output" ]; then
-    "$POD2TEXT" --stderr -u \
+    "$POD2TEXT" "$POD2_STDERR_OPTION" "$POD2_UTF8_OPTION" \
         < $tmpdir/full.pod > "$text_output".tmp
     mv "$text_output".tmp "$text_output"
 fi
         < $tmpdir/full.pod > "$text_output".tmp
     mv "$text_output".tmp "$text_output"
 fi