Commit 9589a40f7afc539c431a150328f29a61db140a40

sammy 2008-06-20T10:02:08

* Fix sf.net issue #1997905, thanks to Coleman Kane: + Check for the sed tool. + Do not use sed's -i flag: its behaviour across platforms is inconsistent.

diff --git a/configure.ac b/configure.ac
index e9f867c..cb803b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,8 +73,9 @@ AC_PATH_PROG(KPSEWHICH, kpsewhich, no)
 AC_PATH_PROG(DVIPS, dvips, no)
 AC_PATH_PROG(CONVERT, convert, no)
 AC_PATH_PROG(EPSTOPDF, epstopdf, no)
+AC_PATH_TOOL(SED, sed, no)
 if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no" -o "${EPSTOPDF}" = "no" \
-     -o "${CONVERT}" = "no"; then
+     -o "${CONVERT}" = "no" -o "${SED}" = "no"; then
   LATEX="no"
 fi
 if test "x${LATEX}" != "xno"; then
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 8fec306..eea2744 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -28,14 +28,17 @@ endif
 html/doxygen.css: stamp-doxygen
 stamp-doxygen: doxygen.cfg stamp-eps
 	$(DOXYGEN) $^
-	sed -i 's/%FTGL/FTGL/' html/*html
+	for file in html/*html; do \
+	  $(SED) -e 's/%FTGL/FTGL/' < $$file > $$file.tmp; \
+	  mv $$file.tmp $$file; \
+	done
 	touch $@
 
 latex/ftgl.pdf: stamp-latex
 stamp-latex: stamp-doxygen
 	rm -f latex/ftgl.tex latex/ftgl.pdf
 	mv latex/refman.tex latex/ftgl.tex
-	sed 's/setlength{/renewcommand{/' latex/ftgl.tex > latex/refman.tex
+	$(SED) -e 's/setlength{/renewcommand{/' < latex/ftgl.tex > latex/refman.tex
 	cd latex && $(MAKE) $(AM_CFLAGS) refman.pdf || (cat refman.log; exit 1)
 	mv latex/refman.pdf latex/ftgl.pdf
 	touch stamp-latex