2013-11-09 00:33:41 +00:00
|
|
|
# -*- sh -*-
|
2013-03-29 11:29:23 +00:00
|
|
|
# Site defaults for the MinGW configuration of GNU Emacs.
|
2013-05-16 09:44:44 +00:00
|
|
|
#
|
|
|
|
# This file's purpose is to short-circuit configure-time tests for
|
|
|
|
# which we want to provide the results instead of letting the
|
|
|
|
# 'configure' script do that. This is mainly for features that
|
|
|
|
# 'configure' tests that are implemented as part of Emacs sources, not
|
|
|
|
# as part of system libraries. The idea is to set shell variables
|
|
|
|
# that appear to the script as cached values.
|
|
|
|
#
|
|
|
|
# For each header file foo.h you want to supply test results, set the
|
|
|
|
# value of a shell variable ac_cv_header_foo_h. The value should be
|
|
|
|
# yes if the header is deemed to exist, no otherwise. Or it could be
|
|
|
|
# something else, if the value computed by 'configure' requires that.
|
2013-11-12 02:50:28 +00:00
|
|
|
# In general, since configure (when invoked from an MSYS environment)
|
|
|
|
# instructs GCC to use header files in nt/inc, you should not need to
|
|
|
|
# futz with header file tests. But there are exceptions, like with
|
|
|
|
# getopt.h below (which is a MinGW system header, but we do not want
|
|
|
|
# to use it).
|
2013-05-16 09:44:44 +00:00
|
|
|
#
|
|
|
|
# For each library function foo you want to supply test results, set
|
|
|
|
# the value of a shell variable ac_cv_func_foo. Again, the value is
|
|
|
|
# determined by what 'configure' expects; sometimes it could be "not
|
|
|
|
# needed" or whatever, see the examples below. In addition, you may
|
|
|
|
# need to set the various gl_cv_* variables for those tests that come
|
|
|
|
# from gnulib.
|
|
|
|
#
|
|
|
|
# In short, examine the test in 'configure' and push the knobs that
|
|
|
|
# are necessary to steer the test in the direction you need, by
|
2013-05-18 07:17:03 +00:00
|
|
|
# judiciously setting variables that control the test results.
|
2013-03-29 11:29:23 +00:00
|
|
|
|
|
|
|
# We want to use getopt.h from gnulib
|
|
|
|
ac_cv_header_getopt_h=no
|
|
|
|
|
2013-09-20 07:21:20 +00:00
|
|
|
# We don't want our struct timeval replaced due to Posix conformance
|
|
|
|
gl_cv_sys_struct_timeval_tv_sec=yes
|
|
|
|
|
2015-07-27 12:16:06 +00:00
|
|
|
# We don't want pthread.h to be picked up just because it defines timespec
|
|
|
|
gl_cv_sys_struct_timespec_in_pthread_h=no
|
|
|
|
# Or at all...
|
|
|
|
ac_cv_header_pthread_h=no
|
|
|
|
|
2013-05-15 17:06:26 +00:00
|
|
|
# ACL functions are implemented in w32.c
|
|
|
|
ac_cv_search_acl_get_file="none required"
|
|
|
|
ac_cv_func_acl_get_file=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
ac_cv_func_acl_set_file=yes
|
2013-05-15 17:06:26 +00:00
|
|
|
ac_cv_func_acl_free=yes
|
|
|
|
ac_cv_func_acl_from_text=yes
|
|
|
|
gl_cv_func_working_acl_get_file=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
# Autoconf's test program is not smart enough, and fails to detect gethostname
|
|
|
|
ac_cv_func_gethostname=yes
|
|
|
|
# Implemented as sys_select in w32proc.c
|
|
|
|
ac_cv_func_select=yes
|
2013-03-30 09:42:50 +00:00
|
|
|
ac_cv_func_pselect=yes
|
|
|
|
gl_cv_sig_pselect=yes
|
|
|
|
gl_cv_func_pselect_detects_ebadf=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
# Implemented as sys_shutdown in w32.c
|
|
|
|
ac_cv_func_shutdown=yes
|
|
|
|
# Implemented in w32proc.c
|
|
|
|
ac_cv_func_setitimer=yes
|
|
|
|
# Implemented as sys_sendto in w32.c
|
|
|
|
ac_cv_func_sendto=yes
|
2013-03-29 19:53:25 +00:00
|
|
|
# Implemented as sys_recvfrom in w32.c
|
|
|
|
ac_cv_func_recvfrom=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
# Implemented as sys_getsockname in w32.c
|
|
|
|
ac_cv_func_getsockname=yes
|
|
|
|
# Implemented as sys_getpeername in w32.c
|
|
|
|
ac_cv_func_getpeername=yes
|
2013-03-29 15:25:48 +00:00
|
|
|
# Implemented as sys_socket in w32.c
|
|
|
|
ac_cv_func_socket=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
# Implemented in w32.c
|
2013-08-04 15:32:12 +00:00
|
|
|
ac_cv_func_mkostemp=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
ac_cv_func_readlink=yes
|
2013-03-29 15:25:48 +00:00
|
|
|
ac_cv_func_symlink=yes
|
|
|
|
# Avoid run-time tests of readlink and symlink, which will fail
|
2013-03-29 11:29:23 +00:00
|
|
|
gl_cv_func_readlink_works=yes
|
2013-03-29 15:25:48 +00:00
|
|
|
gl_cv_func_symlink_works=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
ac_cv_func_readlinkat=yes
|
|
|
|
ac_cv_func_faccessat=yes
|
Make file descriptors close-on-exec when possible.
This simplifies Emacs a bit, since it no longer needs to worry
about closing file descriptors by hand in some cases.
It also fixes some unlikely races. Not all such races, as
libraries often open files internally without setting
close-on-exec, but it's an improvement.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
(GNULIB_TOOL_FLAGS): Avoid binary-io, close. Do not avoid fcntl.
* configure.ac (mkostemp): New function to check for.
(PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
* lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
* m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
otherwise, gnulib-tool complains given close-on-exec changes.
* nt/inc/ms-w32.h (pipe): Remove.
* nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
(gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
* src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
* src/callproc.c (Fcall_process) [!MSDOS]:
* src/emacs.c (main) [!DOS_NT]:
* src/nsterm.m (ns_term_init):
* src/process.c (create_process):
Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
* src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
* src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
Prefer mkostemp with O_CLOEXEC to mkstemp.
* src/callproc.c (relocate_fd) [!WINDOWSNT]:
* src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
now using pipe2.
* src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
Make the resulting file descriptor close-on-exec.
* src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
* src/lread.c (load_descriptor_list, load_descriptor_unwind):
Remove; no longer needed. All uses removed.
* src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
(close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
New functions.
(socket) [!SOCK_CLOEXEC]: Supply a substitute.
(Fmake_network_process, Fnetwork_interface_list):
(Fnetwork_interface_info, server_accept_connection):
Make newly-created socket close-on-exec.
* src/sysdep.c (emacs_open, emacs_fopen):
Make new-created descriptor close-on-exec.
* src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
* src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
Fixes: debbugs:14803
2013-07-07 18:00:14 +00:00
|
|
|
# Implemented in w32.c
|
|
|
|
ac_cv_func_fcntl=yes
|
|
|
|
gl_cv_func_fcntl_f_dupfd_cloexec=yes
|
|
|
|
gl_cv_func_fcntl_f_dupfd_works=yes
|
2013-03-29 11:29:23 +00:00
|
|
|
# We don't need fdopendir
|
2013-03-29 11:38:13 +00:00
|
|
|
ac_cv_func_fdopendir="not-needed"
|
2013-03-29 12:36:43 +00:00
|
|
|
gl_cv_func_fdopendir_works="no-but-not-needed-so-yes"
|
|
|
|
# Implemented in w32.c
|
2013-03-29 15:25:48 +00:00
|
|
|
ac_cv_func_lstat=yes
|
|
|
|
gl_cv_func_lstat_dereferences_slashed_symlink=yes
|
2013-03-29 12:36:43 +00:00
|
|
|
ac_cv_func_fstatat=yes
|
|
|
|
gl_cv_func_fstatat_zero_flag=yes
|
|
|
|
# Aliased to _commit in ms-w32.h
|
|
|
|
ac_cv_func_fsync=yes
|
2013-03-29 15:25:48 +00:00
|
|
|
ac_cv_func_fdatasync=yes
|
|
|
|
# Implemented in w32proc.c
|
|
|
|
ac_cv_func_pthread_sigmask=yes
|
2013-03-29 19:53:25 +00:00
|
|
|
# Avoid gnulib replacement
|
2013-03-30 09:42:50 +00:00
|
|
|
gl_threads_api=posix
|
2013-03-29 19:53:25 +00:00
|
|
|
gl_cv_func_pthread_sigmask_return_works=yes
|
|
|
|
gl_cv_func_pthread_sigmask_unblock_works="not relevant"
|
2013-03-29 15:25:48 +00:00
|
|
|
# Implemented in w32proc.c
|
|
|
|
emacs_cv_langinfo_codeset=yes
|
|
|
|
# Declared in ms-w32.h
|
|
|
|
ac_cv_have_decl_alarm=yes
|
|
|
|
# Avoid including the gnulib dup2 module
|
|
|
|
gl_cv_func_dup2_works=yes
|
|
|
|
# Defined in w32.c
|
|
|
|
ac_cv_func_getloadavg=yes
|
|
|
|
# Avoid compiling gnulib mktime
|
|
|
|
gl_cv_func_working_mktime=yes
|
|
|
|
# Implemented in w32.c
|
Make file descriptors close-on-exec when possible.
This simplifies Emacs a bit, since it no longer needs to worry
about closing file descriptors by hand in some cases.
It also fixes some unlikely races. Not all such races, as
libraries often open files internally without setting
close-on-exec, but it's an improvement.
* admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
(GNULIB_TOOL_FLAGS): Avoid binary-io, close. Do not avoid fcntl.
* configure.ac (mkostemp): New function to check for.
(PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
* lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
* m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
otherwise, gnulib-tool complains given close-on-exec changes.
* nt/inc/ms-w32.h (pipe): Remove.
* nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
(gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
* src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
* src/callproc.c (Fcall_process) [!MSDOS]:
* src/emacs.c (main) [!DOS_NT]:
* src/nsterm.m (ns_term_init):
* src/process.c (create_process):
Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
* src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
* src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
Prefer mkostemp with O_CLOEXEC to mkstemp.
* src/callproc.c (relocate_fd) [!WINDOWSNT]:
* src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
now using pipe2.
* src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
Make the resulting file descriptor close-on-exec.
* src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
* src/lread.c (load_descriptor_list, load_descriptor_unwind):
Remove; no longer needed. All uses removed.
* src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
(close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
New functions.
(socket) [!SOCK_CLOEXEC]: Supply a substitute.
(Fmake_network_process, Fnetwork_interface_list):
(Fnetwork_interface_info, server_accept_connection):
Make newly-created socket close-on-exec.
* src/sysdep.c (emacs_open, emacs_fopen):
Make new-created descriptor close-on-exec.
* src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
* src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
Fixes: debbugs:14803
2013-07-07 18:00:14 +00:00
|
|
|
ac_cv_func_pipe2=yes
|
2013-03-29 15:25:48 +00:00
|
|
|
ac_cv_have_decl_unsetenv=yes
|
|
|
|
ac_cv_func_unsetenv=yes
|
|
|
|
gt_cv_func_unsetenv_ret='int'
|
|
|
|
gl_cv_func_unsetenv_works=yes
|
|
|
|
gl_cv_func_stat_dir_slash=yes
|
|
|
|
gl_cv_func_stat_file_slash=yes
|
2013-03-29 19:53:25 +00:00
|
|
|
ac_cv_func_random=yes
|
2013-03-30 09:42:50 +00:00
|
|
|
# Implemented in w32.c as sys_putenv
|
|
|
|
gl_cv_func_svid_putenv=yes
|