Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 301)
+++ /trunk/Makefile.in	(revision 302)
@@ -39,4 +39,5 @@
 mandir = @mandir@
 datarootdir = @datarootdir@
+mytmpdir = @mytmpdir@
 
 configfile = @myconffile@
@@ -530,4 +531,7 @@
 install-program: $(PROGRAMS) sstrip
 	@$(mkinstalldirs) $(DESTDIR)$(sbindir)
+	@if test x$(mytmpdir) != x; then \
+		$(mkinstalldirs) $(DESTDIR)$(mytmpdir); \
+	fi
 	@list='$(PROGRAMS)'; for p in $$list; do \
 	  if test -f $$p; then \
@@ -677,4 +681,7 @@
 	rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
 	echo "#! /bin/sh"                        > $$STAGE/setup.sh; \
+	if test x$(mytmpdir) != x; then \
+	echo  "./mkinstalldirs @mytmpdir@ || exit 1"    >> $$STAGE/setup.sh; \
+	fi; \
 	echo  "./mkinstalldirs @sbindir@ || exit 1"     >> $$STAGE/setup.sh; \
 	echo  "./mkinstalldirs @sysconfdir@ || exit 1"  >> $$STAGE/setup.sh; \
@@ -794,4 +801,7 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
+	if test x$(mytmpdir) != x; then \
+	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
+	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
@@ -817,4 +827,7 @@
 	chmod +x debian/rules; \
 	echo $(sbindir)     | sed s,^/,,  > debian/dirs; \
+	if test x$(mytmpdir) != x; then \
+	echo $(mytmpdir)    | sed s,^/,, >> debian/dirs; \
+	fi; \
 	echo $(sysconfdir)  | sed s,^/,, >> debian/dirs; \
 	echo etc/init.d                  >> debian/dirs; \
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 301)
+++ /trunk/configure.ac	(revision 302)
@@ -2465,17 +2465,19 @@
 AC_SUBST(mytrust)
 
+mytmpdir=
+
 AC_ARG_WITH(tmp-dir,
         [  --with-tmp-dir=PFX		set directory for temporary files [[HOME]]],
         [
 	if test "x${cross_compiling}" = xyes; then
-		my_tmp_dir="$withval"
-		AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
+		mytmpdir="$withval"
+		AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
 	else
 		if test -d "${withval}"; then
-			my_tmp_dir="$withval"
-			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
+			mytmpdir="$withval"
+			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
 		else
-			my_tmp_dir="$withval"
-			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${my_tmp_dir}") )
+			mytmpdir="$withval"
+			AC_DEFINE_UNQUOTED(SH_TMPDIR, _("${mytmpdir}") )
 			AC_MSG_WARN([--with-tmp-dir: tmp directory ${withval} does not exist])
 		fi
@@ -2483,4 +2485,7 @@
 	]
 )
+
+AC_SUBST(mytmpdir)
+
 
 dnl
