aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.old4
-rw-r--r--Makefile.am9
-rw-r--r--configure.in21
-rw-r--r--powwow.6.utf-8 (renamed from powwow.6)0
4 files changed, 34 insertions, 0 deletions
diff --git a/ChangeLog.old b/ChangeLog.old
index c5ef1dd..95af66e 100644
--- a/ChangeLog.old
+++ b/ChangeLog.old
@@ -1,5 +1,9 @@
2008-12-31 dain
+ * powwow.6: Supprt automatically converting man page to different
+ encodings by setting MAN_PAGE_ENCODING when running
+ configure. Defaults to UTF-8 on all hosts except OS X (darwin),
+ where it is ISO-8859-1.
* build: Fixed build out of the box on OS X by turning on
--enable-bsd by default on darwin hosts.
* cmd2.c: Fixed some problems related to binding keys with the
diff --git a/Makefile.am b/Makefile.am
index af85e1c..5da8f73 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,5 +22,14 @@ EXTRA_DIST = README README.follow README.term README.modules \
powwow.doc powwow.help powwow.6 plugtest.c debian/rules \
debian/control debian/changelog
+CLEANFILES = powwow.6
+
+powwow.6: powwow.6.utf-8
+if MAN_PAGE_ENCODING_IS_UTF_8
+ cp $< $@
+else
+ iconv -f UTF-8 -t "$(MAN_PAGE_ENCODING)" < $< > $@
+endif
+
plugtest.so: plugtest.c
gcc -shared -o plugtest.so plugtest.c
diff --git a/configure.in b/configure.in
index e46e902..e9f5636 100644
--- a/configure.in
+++ b/configure.in
@@ -48,6 +48,27 @@ AS_IF([ test "${enable_bsd}" = yes ],
[ AC_DEFINE(USE_SGTTY)
AC_DEFINE(BSD_LIKE) ])
+AC_MSG_CHECKING([man page encoding])
+if test -z "${MAN_PAGE_ENCODING}"; then
+ case "${host_os}" in
+ darwin*) MAN_PAGE_ENCODING=ISO-8859-1 ;;
+ *) MAN_PAGE_ENCODING=UTF-8 ;;
+ esac
+fi
+AC_SUBST([MAN_PAGE_ENCODING])
+AC_MSG_RESULT([${MAN_PAGE_ENCODING}])
+
+if test "${MAN_PAGE_ENCODING}" != UTF-8; then
+ AC_CHECK_PROG([ICONV], [iconv], [iconv], [])
+ if test -z "${ICONV}" -a "${MAN_PAGE_ENCODING}" != UTF-8; then
+ AC_MSG_WARN([Forcing man page encoding to UTF-8])
+ MAN_PAGE_ENCODING=UTF-8
+ fi
+fi
+
+AM_CONDITIONAL([MAN_PAGE_ENCODING_IS_UTF_8],
+ [test "${MAN_PAGE_ENCODING}" = UTF-8 ])
+
# Checks for programs.
AC_PROG_CC
diff --git a/powwow.6 b/powwow.6.utf-8
index 6e5fce2..6e5fce2 100644
--- a/powwow.6
+++ b/powwow.6.utf-8