Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -30,7 +30,6 @@ endif
 
 # Where to install things:
 
-PREFIX:=/usr/local
 
 
 # Program:
@@ -52,20 +51,13 @@ TUXPAINT_DATA_PREFIX=$(PREFIX)/share/tuxpaint
 # Docs and man page:
 
 DOC_PREFIX=$(PREFIX)/share/doc/tuxpaint-config/
-MAN_PREFIX=$(PREFIX)/share/man/
+MAN_PREFIX=$(PREFIX)/man/
 
 
 # Tux Paint's 'System-wide' Config file:
 
-ifeq ($(PREFIX),/usr)
-  CONFDIR=/etc/tuxpaint
-else ifeq ($(SYSNAME),Haiku)
-  CONFDIR=$(shell finddir B_USER_SETTINGS_DIRECTORY)/TuxPaint
-else
-  CONFDIR=$(PREFIX)/etc/tuxpaint
-endif
+CONFDIR=${SYSCONFDIR}/tuxpaint
 
-
 # Icons and launchers:
 
 ICON_PREFIX=$(PREFIX)/share/pixmaps/
@@ -75,7 +67,7 @@ NEWICON_PREFIX:=$(PREFIX)/share/icons/hicolor
 
 # Locale files
 
-LOCALE_PREFIX=${DESTDIR}$(PREFIX)/share/locale/
+LOCALE_PREFIX=$(PREFIX)/share/locale/
 
 
 # Libraries, paths, and flags:
@@ -92,7 +84,6 @@ UNIBREAK_CFLAGS=`pkg-config --cflags libunibreak`
 UNIBREAK_LIB=`pkg-config --libs libunibreak`
 
 # Default CFLAGS:
-CFLAGS=-O2 -Wall
 
 # The entire set of CFLAGS:
 ALL_CFLAGS=$(CFLAGS) $(FLTK_CFLAGS) $(UNIBREAK_CFLAGS) \
@@ -217,15 +208,8 @@ install-win32:
 # (depending on the *PREFIX variables at the top, you probably need
 # to do this as superuser ("root"))
 
-install:	install-bin install-data install-man install-doc \
+install:	install-bin install-man install-doc \
 		install-icon install-gettext
-	@echo
-	@echo "All done! Now (preferably NOT as 'root' superuser),"
-	@echo "you can type the command 'tuxpaint-config' to run the"
-	@echo "configuration tool!"
-	@echo
-	@echo "Enjoy!"
-	@echo
 
 
 # "make clean" deletes the program, the compiled objects and the
@@ -260,32 +244,23 @@ uninstall:
 # and the 24-color 32x32 XPM (for other Window managers):
 
 install-icon:
-	@echo
-	@echo "...Installing launcher icon graphics..."
-	@install -d ${DESTDIR}$(ICON_PREFIX)
-	@install -m 644 data/images/icon.png ${DESTDIR}$(ICON_PREFIX)tuxpaint-config.png
-	@install -d ${DESTDIR}$(X11_ICON_PREFIX)
-	@install -m 644 data/images/icon32x32.xpm ${DESTDIR}$(X11_ICON_PREFIX)tuxpaint-config.xpm
-	@install -d ${DESTDIR}$(NEWICON_PREFIX)/16x16/apps
-	@install -d ${DESTDIR}$(NEWICON_PREFIX)/32x32/apps
-	@install -d ${DESTDIR}$(NEWICON_PREFIX)/48x48/apps
-	@cp data/images/icon16x16.png ${DESTDIR}$(NEWICON_PREFIX)/16x16/apps/tuxpaint-config.png
-	@cp data/images/icon32x32.png ${DESTDIR}$(NEWICON_PREFIX)/32x32/apps/tuxpaint-config.png
-	@cp data/images/icon48x48.png ${DESTDIR}$(NEWICON_PREFIX)/48x48/apps/tuxpaint-config.png
-	@echo
-	@echo "...Installing launcher..."
-	@install -d ${DESTDIR}$(PREFIX)/share/applications/
-	@install -m 644 src/tuxpaint-config.desktop ${DESTDIR}$(PREFIX)/share/applications/
+	${BSD_INSTALL_DATA_DIR} $(ICON_PREFIX)
+	${BSD_INSTALL_DATA} data/images/icon.png $(ICON_PREFIX)tuxpaint-config.png
+	${BSD_INSTALL_DATA} data/images/icon32x32.xpm $(ICON_PREFIX)tuxpaint-config.xpm
+	${BSD_INSTALL_DATA_DIR} $(NEWICON_PREFIX)/16x16/apps
+	${BSD_INSTALL_DATA} data/images/icon16x16.png $(NEWICON_PREFIX)/16x16/apps/tuxpaint-config.png
+	${BSD_INSTALL_DATA_DIR} $(NEWICON_PREFIX)/32x32/apps
+	${BSD_INSTALL_DATA} data/images/icon32x32.png $(NEWICON_PREFIX)/32x32/apps/tuxpaint-config.png
+	${BSD_INSTALL_DATA_DIR} $(NEWICON_PREFIX)/48x48/apps
+	${BSD_INSTALL_DATA} data/images/icon48x48.png $(NEWICON_PREFIX)/48x48/apps/tuxpaint-config.png
+	${BSD_INSTALL_DATA_DIR} $(PREFIX)/share/applications/
+	${BSD_INSTALL_DATA} src/tuxpaint-config.desktop $(PREFIX)/share/applications/
 
 
 # Install the program:
 
 install-bin:
-	@echo
-	@echo "...Installing program itself..."
-	@install -d ${DESTDIR}${BIN_PREFIX}
-	@cp tuxpaint-config ${DESTDIR}$(BIN_PREFIX)
-	@chmod a+rx,g-w,o-w ${DESTDIR}$(BIN_PREFIX)/tuxpaint-config$(EXE_EXT)
+	${BSD_INSTALL_PROGRAM} tuxpaint-config $(BIN_PREFIX)
 
 
 # Install the data (sound, graphics, fonts):
@@ -301,29 +276,15 @@ install-data:
 # Install the text documentation:
 
 install-doc:
-	@echo
-	@echo "...Installing documentation..."
-	@echo "(English)"
-	@install -d ${DESTDIR}$(DOC_PREFIX)
-	@install -d ${DESTDIR}$(DOC_PREFIX)/html
-	@cp docs/AUTHORS.txt ${DESTDIR}$(DOC_PREFIX)
-	@cp docs/CHANGES.txt ${DESTDIR}$(DOC_PREFIX)
-	@cp docs/COPYING.txt ${DESTDIR}$(DOC_PREFIX)
-	@cp docs/README.txt ${DESTDIR}$(DOC_PREFIX)
-	@cp docs/html/README.html ${DESTDIR}$(DOC_PREFIX)/html
-	@cp docs/TODO.txt ${DESTDIR}$(DOC_PREFIX)
-	@echo "(...Setting permissions)"
-	@chmod -R a+rx,g-w,o-w ${DESTDIR}$(DOC_PREFIX)
+	${BSD_INSTALL_DATA_DIR} $(DOC_PREFIX)
+	${BSD_INSTALL_DATA} docs/README.txt $(DOC_PREFIX)
 
 
 # Install the man page:
 
 install-man:
-	@echo "...Installing man pages..."
-	@install -d ${DESTDIR}$(MAN_PREFIX)/man1/
-	@cp src/tuxpaint-config.1 ${DESTDIR}$(MAN_PREFIX)/man1/
-	@gzip -9f ${DESTDIR}$(MAN_PREFIX)/man1/tuxpaint-config.1
-	@chmod a+rx,g-w,o-w ${DESTDIR}$(MAN_PREFIX)/man1/tuxpaint-config.1.gz
+	${BSD_INSTALL_MAN_DIR} $(MAN_PREFIX)/man1/
+	${BSD_INSTALL_MAN} src/tuxpaint-config.1 $(MAN_PREFIX)/man1/
 
 
 # Build the program!
@@ -331,14 +292,14 @@ install-man:
 tuxpaint-config:	obj/tuxpaint-config.o obj/tuxpaint-config2.o	\
 			obj/defaults.o $(ARCH_LIBS)
 	@echo Linking
-	$(CXX) $(ALL_CFLAGS) -o tuxpaint-config obj/tuxpaint-config.o 	\
+	$(CXX) $(ALL_CFLAGS) -liconv -lintl -o tuxpaint-config obj/tuxpaint-config.o 	\
 			obj/tuxpaint-config2.o obj/defaults.o $(ARCH_LIBS) \
 			$(FLTK_LIBS) $(ARCH_LINKS) $(PAPER_LIB) $(UNIBREAK_LIB) $(PANGO_LIBS)
 
 
 # Build the object for the program!
 
-obj/tuxpaint-config.o:	src/tuxpaint-config.cxx src/tuxpaint-config2.h src/defaults.h src/version.h src/about.h src/debug.h
+obj/tuxpaint-config.o:	src/tuxpaint-config.cxx src/tuxpaint-config2.h src/defaults.h obj src/version.h src/about.h src/debug.h
 	@echo Compiling tuxpaint-config.cxx
 	$(CXX) $(ALL_CFLAGS) -c src/tuxpaint-config.cxx -o obj/tuxpaint-config.o
 
@@ -346,7 +307,7 @@ obj/tuxpaint-config2.o:	src/tuxpaint-config2.cxx src/t
 	@echo Compiling tuxpaint-config2.cxx
 	$(CXX) $(ALL_CFLAGS) $(PANGO_CFLAGS) -c src/tuxpaint-config2.cxx -o obj/tuxpaint-config2.o
 
-obj/defaults.o:	src/defaults.cxx src/defaults.h
+obj/defaults.o:	src/defaults.cxx obj src/defaults.h
 	@echo Compiling defaults.cxx
 	$(CXX) $(ALL_CFLAGS) -c src/defaults.cxx -o obj/defaults.o
 
