binutils-gdb/gdb/compile
Simon Marchi e8d8cce69b Import mkdtemp gnulib module, fix mingw build
Building with mingw currently fails:

  CXX    unittests/mkdir-recursive-selftests.o
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c: In function ‘void selftests::mkdir_recursive::test()’:
/home/emaisin/src/binutils-gdb/gdb/unittests/mkdir-recursive-selftests.c:49:20: error: ‘mkdtemp’ was not declared in this scope
   if (mkdtemp (base) == NULL)
                    ^
Commit

    e418a61a67 ("Move mkdir_recursive to common/filestuff.c")

moved this code, but also removed the HAVE_MKDTEMP guard which prevented
the mkdtemp call to be compiled on mingw.

We can either put back the HAVE_MKDTEMP ifdef, or import the gnulib
mkdtemp module, which provides the function for mingw.  Since the
mkdir_recursive is susceptible to be used on mingw at some point, I
think it would be nice to have it tested on mingw, so I did the latter.

Once built, I tested it on Windows (copied the resulting gdb.exe on a
Windows machine, ran it, and ran "maint selftest mkdir_recursive").  It
failed, because the temporary directory is hardcoded to "/tmp/...".  I
therefore added and used a new get_standard_temp_dir function, which
returns an appropriate temporary directory for the host platform.

gdb/ChangeLog:

	* common/pathstuff.c (get_standard_temp_dir): New.
	* common/pathstuff.h (get_standard_temp_dir): New.
	* config.in: Re-generate.
	* configure: Re-generate.
	* configure.ac: Don't check for mkdtemp.
	* gnulib/aclocal-m4-deps.mk: Re-generate.
	* gnulib/aclocal.m4: Re-generate.
	* gnulib/config.in: Re-generate.
	* gnulib/configure: Re-generate.
	* gnulib/import/Makefile.am: Re-generate.
	* gnulib/import/Makefile.in: Re-generate.
	* gnulib/import/m4/gnulib-cache.m4: Re-generate.
	* gnulib/import/m4/gnulib-comp.m4: Re-generate.
	* gnulib/import/m4/mkdtemp.m4: New file.
	* gnulib/import/mkdtemp.c: New file.
	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES):
	Add mkdtemp module.
	* unittests/mkdir-recursive-selftests.c (test): Use
	get_standard_temp_dir.
	(_initialize_mkdir_recursive_selftests): Remove HAVE_MKDTEMP
	ifdef.
	* compile/compile.c (get_compile_file_tempdir): Likewise.
2018-11-01 15:41:43 -04:00
..
compile-c-support.c compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-c-symbols.c compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-c-types.c compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-c.h compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-cplus-symbols.c compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-cplus-types.c Fix use-after-move in compile/compile-cplus-types.c 2018-09-17 13:11:07 -04:00
compile-cplus.h compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-internal.h compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-loc2c.c compile: Remove non-const reference parameters 2018-09-06 13:48:15 +01:00
compile-object-load.c Remove remaining cleanups from compile-object-load.c 2018-09-18 10:18:04 -06:00
compile-object-load.h Remove munmap_listp_free_cleanup 2018-09-18 10:18:04 -06:00
compile-object-run.c Remove munmap_listp_free_cleanup 2018-09-18 10:18:04 -06:00
compile-object-run.h
compile.c Import mkdtemp gnulib module, fix mingw build 2018-11-01 15:41:43 -04:00
compile.h python: Make gdb.execute("show commands") work (PR 23669) 2018-09-17 08:26:24 -04:00
gcc-c-plugin.h Add a C++ wrapper for GCC C plug-in 2018-08-10 11:14:25 -07:00
gcc-cp-plugin.h C++ compile support 2018-08-29 15:12:24 -07:00