annotate m4/tmpfile.m4 @ 13138:0ea8feb1eb60

Rename gl_TMPFILE.
author Bruno Haible <bruno@clisp.org>
date Sun, 04 Apr 2010 16:26:00 +0200
parents fd3c9fa89efe
children 97fc9a21a8fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13137
fd3c9fa89efe tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
1 # tmpfile.m4 serial 1
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 11007
diff changeset
2 # Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
8162
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 # This file is free software; the Free Software Foundation
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 # gives unlimited permission to copy and/or distribute it,
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 # with or without modifications, as long as this notice is preserved.
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # Written by Ben Pfaff.
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
13137
fd3c9fa89efe tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
9 # Check whether to use a replacement tmpfile() function.
fd3c9fa89efe tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
10
8162
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 # The native Windows tmpfile function always tries to put the temporary
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # file in the root directory. (This behaviour is even documented in
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # Microsoft's documentation!) This often fails for ordinary users who
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 # don't have the permissions to write in the root directory.
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 #
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 # We can't test for tmpfile even at runtime, since our test program
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 # might be running with privileges that allow it to write to the root
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 # directory, even though tmpfile wouldn't work in general. Instead,
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 # just test for a Windows platform (excluding Cygwin).
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
13138
0ea8feb1eb60 Rename gl_TMPFILE.
Bruno Haible <bruno@clisp.org>
parents: 13137
diff changeset
21 AC_DEFUN([gl_FUNC_TMPFILE], [
13137
fd3c9fa89efe tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
22 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
8162
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 AC_CACHE_CHECK([whether tmpfile should be overridden],
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 [gl_cv_func_tmpfile_unusable],
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 [AC_EGREP_CPP([choke me], [
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 choke me
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #endif
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 ],
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 [gl_cv_func_tmpfile_unusable=yes],
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 [gl_cv_func_tmpfile_unusable=no])])
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 if test $gl_cv_func_tmpfile_unusable = yes; then
13137
fd3c9fa89efe tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
33 REPLACE_TMPFILE=1
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8162
diff changeset
34 AC_LIBOBJ([tmpfile])
8162
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 gl_PREREQ_TMPFILE
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 fi
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 ])
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 # Prerequisites of lib/tmpfile.c.
46995f2e94ca New module 'tmpfile'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 AC_DEFUN([gl_PREREQ_TMPFILE], [:])