2004-09-13  Juan M. Guerrero  <st001906@hrz1.hrz.tu-darmstadt.de>

	* api/import-system-wisdom.c: Allow for an OS specific wisdom file name
	prefix (djgpp support).

	* doc/fftw3.texi: Added djgpp specific info.

	* tests/Makefile.am: Added $(EXEEXT) to the bench dependency in all
	check targets.

	* tools/fftw-wisdom-to-conf.in: Check the environment variable TMPDIR
	before defaulting to /tmp (djgpp support).

	* tools/fftw_wisdom.1.in: Added djgpp specific info.




diff -apruNU4 fftw-3.0.1.orig/api/import-system-wisdom.c fftw-3.0.1/api/import-system-wisdom.c
--- fftw-3.0.1.orig/api/import-system-wisdom.c	2003-03-15 20:29:42.000000000 +0000
+++ fftw-3.0.1/api/import-system-wisdom.c	2004-09-13 15:48:12.000000000 +0000
@@ -32,11 +32,18 @@ int X(import_system_wisdom)(void)
 {
 #if defined(__WIN32__) || defined(WIN32) || defined(_WINDOWS)
      return 0; /* TODO? */
 #else
+#  if !defined(WISDOM_PREFIX)
+#    if defined(__DJGPP__)
+#      define WISDOM_PREFIX "/dev/env/DJDIR/etc/fftw/"
+#    else
+#      define WISDOM_PREFIX "/etc/fftw/"
+#    endif
+#  endif
 
      FILE *f;
-     f = fopen("/etc/fftw/" WISDOM_NAME, "r");
+     f = fopen(WISDOM_PREFIX WISDOM_NAME, "r");
      if (f) {
           int ret = X(import_wisdom_from_file)(f);
           fclose(f);
           return ret;
diff -apruNU4 fftw-3.0.1.orig/doc/fftw3.texi fftw-3.0.1/doc/fftw3.texi
--- fftw-3.0.1.orig/doc/fftw3.texi	2003-06-06 02:30:04.000000000 +0000
+++ fftw-3.0.1/doc/fftw3.texi	2004-09-13 15:48:12.000000000 +0000
@@ -479,9 +479,9 @@ The basic usage of FFTW to compute a one
 @}
 @end example
 
 (When you compile, you must also link with the @code{fftw3} library,
-e.g. @code{-lfftw3 -lm} on Unix systems.)
+e.g. @code{-lfftw3 -lm} on Unix systems or @code{-lfftw -lm} on DJGPP systems.)
 
 First you allocate the input and output arrays.  You can allocate them
 in any way that you like, but we recommend using @code{fftw_malloc},
 which behaves like
@@ -594,10 +594,11 @@ bit-compatible with the C99 complex type
 typecast.)
 
 Single and long-double precision versions of FFTW may be installed; to
 use them, replace the @code{fftw_} prefix by @code{fftwf_} or
-@code{fftwl_} and link with @code{-lfftw3f} or @code{-lfftw3l}, but
-use the @emph{same} @code{<fftw3.h>} header file.
+@code{fftwl_} and link with @code{-lfftw3f} or @code{-lfftw3l} (@code{-lfftwf}
+on DJGPP systems; there is still no long double precision library available on
+DJGPP systems), but use the @emph{same} @code{<fftw3.h>} header file.
 @cindex precision
 
 Many more flags exist besides @code{FFTW_MEASURE} and
 @code{FFTW_ESTIMATE}.  For example, use @code{FFTW_PATIENT} if you're
@@ -1644,9 +1645,10 @@ the risk of sub-optimal plans.
 Nevertheless, if the choice is between using @code{FFTW_ESTIMATE} or
 using possibly-suboptimal wisdom (created on the same machine, but for a
 different binary), the wisdom is likely to be better.  For this reason,
 we provide a function to import wisdom from a standard system-wide
-location (@code{/etc/fftw/wisdom} on Unix):
+location (@code{/etc/fftw/wisdom} on Unix and
+@code{/dev/env/DJGG/etc/fftw/wisdom} on djgpp):
 @cindex wisdom, system-wide
 
 @example
 int fftw_import_system_wisdom(void);
@@ -1687,9 +1689,10 @@ All programs using FFTW should include i
 #include <fftw3.h>
 @end example
 
 You must also link to the FFTW library.  On Unix, this
-means adding @code{-lfftw3 -lm} at the @emph{end} of the link command.
+means adding @code{-lfftw3 -lm} or @code{-lfftw -lm} on
+DJGPP systems at the @emph{end} of the link command.
 
 @menu
 * Complex numbers::             
 * Precision::                   
@@ -1751,10 +1754,12 @@ interfaces, you:
 @itemize @bullet
 
 @item
 Link to the single/long-double libraries; on Unix, @code{-lfftw3f} or
-@code{-lfftw3l} instead of (or in addition to) @code{-lfftw3}.  (You
-can link to the different-precision libraries simultaneously.)
+@code{-lfftw3l} instead of (or in addition to) @code{-lfftw3}.  On
+DJGPP systems use @code{-lfftwf}; there is still no long double precision
+library available on DJGPP.  (You can link to the different-precision
+libraries simultaneously.)
 
 @item
 Include the @emph{same} @code{<fftw3.h>} header file.
 
@@ -3148,9 +3153,9 @@ read pointer is unspecified.
 @code{NULL}-terminated string @code{input_string}.
 
 @code{fftw_import_system_wisdom} reads wisdom from an
 implementation-defined standard file (@code{/etc/fftw/wisdom} on Unix
-and GNU systems).
+and GNU systems and @code{/dev/env/DJDIR/etc/fftw/wisdom} on djgpp).
 @cindex wisdom, system-wide
 
 The return value of these import routines is @code{1} if the wisdom was
 read successfully and @code{0} otherwise. Note that, in all of these
diff -apruNU4 fftw-3.0.1.orig/tests/Makefile.am fftw-3.0.1/tests/Makefile.am
--- fftw-3.0.1.orig/tests/Makefile.am	2003-05-08 01:09:42.000000000 +0000
+++ fftw-3.0.1/tests/Makefile.am	2004-09-13 15:48:12.000000000 +0000
@@ -15,9 +15,9 @@ bench_SOURCES = bench.c hook.c
 bench_LDADD = $(LIBFFTWTHREADS)				\
 $(top_builddir)/libfftw3@PREC_SUFFIX@.la		\
 $(top_builddir)/libbench2/libbench2.a $(THREADLIBS)
 
-check-local: bench
+check-local: bench$(EXEEXT)
 	perl -w $(srcdir)/check.pl -r -c=30 -v `pwd`/bench
 	@echo "--------------------------------------------------------------"
 	@echo "         FFTW transforms passed basic tests!"
 	@echo "--------------------------------------------------------------"
@@ -27,9 +27,9 @@ if THREADS
 	@echo "         FFTW threaded transforms passed basic tests!"
 	@echo "--------------------------------------------------------------"
 endif
 
-bigcheck: bench
+bigcheck: bench$(EXEEXT)
 	perl -w $(srcdir)/check.pl -a -v `pwd`/bench
 	@echo "--------------------------------------------------------------"
 	@echo "         FFTW transforms passed big tests!"
 	@echo "--------------------------------------------------------------"
@@ -41,9 +41,9 @@ if THREADS
 	@echo "         FFTW threaded transforms passed big tests!"
 	@echo "--------------------------------------------------------------"
 endif
 
-smallcheck: bench
+smallcheck: bench$(EXEEXT)
 	perl -w $(srcdir)/check.pl -r -c=1 -v `pwd`/bench
 	perl -w $(srcdir)/check.pl -r --estimate -c=5 -v `pwd`/bench
 	@echo "--------------------------------------------------------------"
 	@echo "         FFTW transforms passed a few tests!"
@@ -54,9 +54,9 @@ if THREADS
 	@echo "         FFTW threaded transforms passed a few tests!"
 	@echo "--------------------------------------------------------------"
 endif
 
-paranoid-check: bench
+paranoid-check: bench$(EXEEXT)
 if THREADS
 	perl -w $(srcdir)/check.pl -a -o=exhaustive --nthreads=10 --paranoid `pwd`/bench
 	perl -w $(srcdir)/check.pl -a -o=exhaustive --nthreads=7 --paranoid `pwd`/bench
 	perl -w $(srcdir)/check.pl -a -o=exhaustive --nthreads=3 --paranoid `pwd`/bench
diff -apruNU4 fftw-3.0.1.orig/tools/fftw-wisdom-to-conf.in fftw-3.0.1/tools/fftw-wisdom-to-conf.in
--- fftw-3.0.1.orig/tools/fftw-wisdom-to-conf.in	2003-07-03 21:56:58.000000000 +0000
+++ fftw-3.0.1/tools/fftw-wisdom-to-conf.in	2004-09-13 15:48:12.000000000 +0000
@@ -56,9 +56,9 @@ void ${prefix}configure_planner(void *pl
     struct solvtab_s { void (*reg)(void *); const char *reg_nam; };
     extern void ${prefix}solvtab_exec(const struct solvtab_s s[], void *);
 EOF
 
-tmp=/tmp/fftw-wisdom-to-conf$$
+tmp="${TMPDIR-/tmp}/fftw-wisdom-to-conf$$"
 sed 's/ *(//' | cut -d" " -f1 | grep -v -- - | egrep -v '^ *\)*$' > $tmp
 
 cat $tmp | sort | uniq | while read reg_nam; do
     echo "    extern void $reg_nam(void *);"
diff -apruNU4 fftw-3.0.1.orig/tools/fftw_wisdom.1.in fftw-3.0.1/tools/fftw_wisdom.1.in
--- fftw-3.0.1.orig/tools/fftw_wisdom.1.in	2003-03-15 20:29:42.000000000 +0000
+++ fftw-3.0.1/tools/fftw_wisdom.1.in	2004-09-13 15:48:12.000000000 +0000
@@ -39,8 +39,11 @@ home page:
 Programs using FFTW can be written to load wisdom from an arbitrary file,
 string, or other source.  Moreover, it is likely that many FFTW-using
 programs will load the \fBsystem wisdom\fR file, which is stored in
 .I /etc/fftw/wisdom@PREC_SUFFIX@
+(or in
+.I /dev/env/DJDIR/etc/fftw/wisdom@PREC_SUFFIX@
+on DJGPP systems)
 by default.
 .I fftw@PREC_SUFFIX@-wisdom
 can be used to create or add to such wisdom files.  In its most
 typical usage, the wisdom file can be created to pre-plan a canonical
@@ -54,8 +57,11 @@ fftw@PREC_SUFFIX@-wisdom -v -c -o wisdom
 option) and the output
 .I wisdom@PREC_SUFFIX@
 file can then be copied (as root) to
 .I /etc/fftw/
+(or to
+.I /dev/env/DJDIR/etc/fftw/
+on DJGPP systems)
 or whatever.
 
 The
 .I fftw@PREC_SUFFIX@-wisdom
@@ -65,8 +71,11 @@ can be changed via the
 option, as in the example above.
 
 If the system wisdom file
 .I /etc/fftw/wisdom@PREC_SUFFIX@
+(or
+.I /dev/env/DJDIR/etc/fftw/wisdom@PREC_SUFFIX@
+on DJGPP systems)
 already exists, then
 .I fftw@PREC_SUFFIX@-wisdom
 reads this existing wisdom (unless the
 .B -n
@@ -165,8 +174,11 @@ mode).
 .TP
 \fB\-n\fR, \fB\--no-system-wisdom\fR
 Do not import the system wisdom from
 .I /etc/fftw/wisdom@PREC_SUFFIX@
+(or from
+.I /dev/env/DJDIR/etc/fftw/wisdom@PREC_SUFFIX@
+on DJGPP systems)
 (which is normally read by default).
 .TP
 \fB\-w\fR \fIfile\fR, \fB\--wisdom-file\fR=\fIfile\fR
 Import wisdom from
