Blob Blame History Raw
diff -up gxemul-0.6.0/configure.BAD gxemul-0.6.0/configure
--- gxemul-0.6.0/configure.BAD	2010-02-15 17:39:08.890669091 -0500
+++ gxemul-0.6.0/configure	2010-02-15 17:42:53.566765806 -0500
@@ -1013,6 +1013,17 @@ echo "checking for 'make install' prefix
 
 ###############################################################################
 
+# On some platforms, the man pages are in /usr/man, but on Linux, /usr/share/man is the 
+# correct location. This can be overridden by passing MANDIR=/foo/bar at configure.
+
+DEFAULTMANDIR=/usr/share/man
+
+if [ "z$MANDIR" = z ]; then
+	MANDIR="$DEFAULTMANDIR"
+fi
+
+###############################################################################
+
 INCLUDE=-Iinclude/
 DINCLUDE=-I../include/
 INCLUDE2=-I../../include/
@@ -1033,6 +1044,7 @@ echo "CPU_TOOLS=$CPU_TOOLS" >> _Makefile
 echo "DOXYGEN=$DOXYGEN" >> _Makefile.header
 echo "VALGRIND=$VALGRIND" >> _Makefile.header
 echo "PREFIX=$PREFIX" >> _Makefile.header
+echo "MANDIR=$MANDIR" >> _Makefile.header
 echo "" >> _Makefile.header
 
 #  Create list of unit testable classes:
diff -up gxemul-0.6.0/Makefile.skel.BAD gxemul-0.6.0/Makefile.skel
--- gxemul-0.6.0/Makefile.skel.BAD	2010-02-15 17:43:10.980800498 -0500
+++ gxemul-0.6.0/Makefile.skel	2010-02-15 17:43:34.918650887 -0500
@@ -4,6 +4,7 @@
 
 BIN=gxemul
 LIBS=$(XLIB) $(OTHERLIBS)
+DESTDIR=
 
 all: build
 
@@ -31,17 +32,17 @@ documentation: build
 
 install: documentation test
 	@echo Installing binaries, man page, and documentation...
-	mkdir -p $(PREFIX)/bin
-	cp -f $(BIN) $(PREFIX)/bin/
-	mkdir -p $(PREFIX)/man/man1
-	cp -f man/gxemul.1 $(PREFIX)/man/man1/
-	mkdir -p $(PREFIX)/share/doc/gxemul
-	cp -R doc/* $(PREFIX)/share/doc/gxemul/
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
+	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin/
+	mkdir -p $(DESTDIR)$(MANDIR)/man1
+	cp -f man/gxemul.1 $(DESTDIR)$(MANDIR)/man1/
+	mkdir -p $(DESTDIR)$(PREFIX)/share/doc/gxemul
+	cp -R doc/* $(DESTDIR)$(PREFIX)/share/doc/gxemul/
 
 uninstall:
 	@echo Removing binaries, man pages, and documentation...
 	rm -f $(PREFIX)/bin/gxemul
-	rm -f $(PREFIX)/man/man1/gxemul.1
+	rm -f $(MANDIR)/man1/gxemul.1
 	rm -rf $(PREFIX)/share/doc/gxemul
 
 clean: