aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav HÃ¥llberg <gustav@gmail.com>2009-01-01 02:01:20 (GMT)
committerGustav HÃ¥llberg <gustav@gmail.com>2009-01-16 23:41:03 (GMT)
commitefc0358298b9b6fe666233c3967a52e514d1fa8f (patch)
treea247fa0571ca0cbdb570222b36821752a9be2770
parent87cdaae6e546c5aaa8b5db086572d5bfbe69c97a (diff)
downloadpowwow-efc0358298b9b6fe666233c3967a52e514d1fa8f.zip
powwow-efc0358298b9b6fe666233c3967a52e514d1fa8f.tar.gz
powwow-efc0358298b9b6fe666233c3967a52e514d1fa8f.tar.bz2
support different man page encodings
-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