1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00
emacs/nt/mingw-cfg.site

176 lines
6.3 KiB
Plaintext
Raw Permalink Normal View History

# -*- sh -*-
# Site defaults for the MinGW configuration of GNU Emacs.
#
# 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.
# 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).
#
# 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.
# We want to use getopt.h from gnulib
ac_cv_header_getopt_h=no
# We don't want our struct timeval replaced due to Posix conformance
gl_cv_sys_struct_timeval_tv_sec=yes
# 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
# We don't want to check for these functions
# because they are implemented in libwinpthread.
ac_cv_search_clock_gettime="none required"
ac_cv_func_clock_gettime=no
ac_cv_func_clock_settime=no
# ACL functions are implemented in w32.c
ac_cv_search_acl_get_file="none required"
ac_cv_func_acl_get_file=yes
ac_cv_func_acl_set_file=yes
ac_cv_func_acl_free=yes
ac_cv_func_acl_from_text=yes
gl_cv_func_working_acl_get_file=yes
# 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
ac_cv_func_pselect=yes
gl_cv_sig_pselect=yes
gl_cv_func_pselect_detects_ebadf=yes
# 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
# Implemented as sys_recvfrom in w32.c
ac_cv_func_recvfrom=yes
# 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
# Implemented as sys_getaddrinfo in w32.c
ac_cv_func_getaddrinfo=yes
# Implemented as an inline function in ws2tcpip.h
ac_cv_func_gai_strerror=yes
# Implemented in w32.c
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
gl_cv_func_readlink_works=yes
gl_cv_func_readlink_trailing_slash=yes
gl_cv_func_readlink_truncate=yes
2013-03-29 15:25:48 +00:00
gl_cv_func_symlink_works=yes
ac_cv_func_readlinkat=yes
ac_cv_func_faccessat=yes
# Avoid compiling Gnulib's canonicalize-lgpl.c, which fails
ac_cv_func_canonicalize_file_name=yes
# Implemented in w32.c
ac_cv_func_realpath=yes
gl_cv_func_realpath_works=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
# We don't need fdopendir
ac_cv_func_fdopendir="not-needed"
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
ac_cv_func_fstatat=yes
gl_cv_func_fstatat_zero_flag=yes
ac_cv_func_fchmodat=yes
gl_cv_func_fchmodat_works="not-needed-so-yes"
ac_cv_func_lchmod=yes
ac_cv_func_futimens=not-needed
gl_cv_func_futimens_works="not-needed-so-yes"
ac_cv_func_utimensat=yes
gl_cv_func_utimensat_works=yes
ac_cv_func_explicit_bzero=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
# Avoid gnulib replacement
gl_threads_api=posix
gl_cv_func_pthread_sigmask_return_works=yes
gl_cv_func_pthread_sigmask_unblock_works="not relevant"
gl_cv_func_pthread_sigmask_macro=no
2013-03-29 15:25:48 +00:00
# Implemented in w32proc.c
am_cv_langinfo_codeset=yes
emacs_cv_langinfo__nl_paper_width=yes
2013-03-29 15:25:48 +00:00
# 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
ac_cv_func_random=yes
# Implemented in w32.c as sys_putenv
gl_cv_func_svid_putenv=yes
# Implemented in w32heap.c
ac_cv_func_sbrk=yes
ac_cv_func_getrlimit=yes
ac_cv_func_setrlimit=yes
Fix compiler warnings in the MinGW build * configure.ac [mingw32]: Don't add -Wpointer-sign, and add -Wno-pointer-sign, to keep the noise level down. * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable -Wredundant-decls, as that produces a lot of noise due to redeclaration of time-related functions by gnulib. * nt/runemacs.c (set_user_model_id): Fix argument type of 'SetCurrentProcessExplicitAppUserModelID'. * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't declare 'dpyinfo', as it is unused. (xpm_load): Fix warnings about pointer signedness. * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant prototypes. (sys_spawnve): Avoid warnings about discarding 'const' qualifier. (sys_select): Provide prototype. (g_b_init_compare_string_w): Move declaration to file scope. * src/w32heap.c (dumped_data_commit): Now static. (FREEABLE_P): Avoid warnings about pointer comparison with integer. (mmap_realloc): Cast to 'char *' for arithmetics on void pointers. * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr) (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear): Provide prototypes. * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove redundant prototypes. (w32_get_internal_run_time, map_w32_filename): Provide prototype. (init_environment, sys_ctime): Avoid warnings about discarding 'const' qualifier. Include utimens.h. (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir) (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock) (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide prototypes. (sys_rename_replace): Use %d to avoid compiler warnings. (_wsa_errlist): Make the message text 'const char *', to avoid compilation warnings. (dynlib_reset_last_error): Move prototype to file scope. (w32_get_resource): First argument is now 'const char *'. * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype. (otf_features): Second argument is no 'const char *'. * src/w32term.c (free_frame_menubar, x_wm_set_size_hint) (x_set_window_size): Remove redundant prototypes. (XChangeGC, XGetGCValues, w32_draw_underwave) (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave) (x_calc_absolute_position, x_destroy_window): Now static. (menubar_selection_callback): Move prototype to file scope. * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant declaration. (w32_to_x_charset): Fix warnings about discarding 'const' qualifier. (w32font_full_name): Fix warnings about implicit conversion of 'float' to 'double'. * src/w32reg.c (w32_get_rdb_resource): Fix warnings about discarding 'const' qualifier. * src/w32menu.c (syms_of_w32menu, globals_of_w32menu) (set_frame_menubar): Remove redundant prototypes. (menubar_selection_callback, w32_menu_display_help): Provide prototypes. (simple_dialog_show): Avoid warnings about discarding 'const' qualifier. * src/w32fns.c (syms_of_w32fns, globals_of_w32fns) (free_frame_menubar, w32_strerror, x_set_menu_bar_lines) (x_set_tool_bar_lines, x_set_internal_border_width): Remove redundant prototypes. (current_popup_menu): Remove redundant declaration. (colormap_t): Member 'name' is now 'const char *'. (add_system_logical_colors_to_map): Fix signed/unsigned warnings. (x_decode_color, x_set_border_pixel) (x_clear_under_internal_border, x_set_name, hook_w32_key) (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now static. (w32_load_cursor, w32_key_to_modifier, map_keypad_keys) (w32_msg_worker, w32_last_error): Provide prototypes. (funhook, lookup_vk_code): Avoid warnings about missing parentheses. (x_default_font_parameter, Fw32_notification_notify): Avoid warnings about discarding 'const' qualifier. (Fx_create_frame): Avoid warnings about empty body of 'else'. (x_screen_planes): Ifdef away unused function. (Fx_show_tip): Remove unused variables. (Fw32_battery_status): Avoid warnings about implicit promotion from float to double. (Fw32_notification_notify): Initialize 'timeout'. * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only define the TIMER_SETTIME_RUNNING value if it will be used. * src/w32notify.c (send_notifications): Ifdef away an empty if clause. Remove unused variable. (watch_end, watch_completion): Provide prototypes. * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused. * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix warning with pointer signedness. * src/gnutls.c (gnutls_x509_crt_get_signature) (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and don't load them from the GnuTLS library, as they are no longer used. * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't define, as it's unused. * src/unexw32.c (open_input_file, open_output_file) (close_file_data): Remove redundant prototypes. (_start): provide prototype. (mainCRTStartup): Move prototype to file level. (find_section): Use type-cast to shut up compiler warnings. (offset_to_section, relocate_offset): Now static. (find_section): First argument is now a 'const char *'. (offset_to_section): Ifdef away, as it's unused. * src/w32heap.h (find_section): Adjust prototype. * src/dynlib.c (dynlib_reset_last_error): Provide prototype. * src/dired.c (directory_files_internal_w32_unwind): Avoid warnings about missing prototypes. (is_slow_fs) [WINDOWSNT]: Provide prototype at file level. (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer signedness. * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]: Fix warnings about pointer signedness. * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's unused. * src/sysdep.c (_getpid): Remove redundant prototype. (sys_subshell) [DOS_NT]: Don't define 'status', it's unused. [!MSDOS]: Don't define 'st', it's unused. (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused. (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness. * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define n_to_read, as it is not used. (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused. * src/w32font.h (syms_of_w32font): Remove redundant prototype. * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro. * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are not used by DOS_NT builds, to avoid compiler warnings. * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant declaration. * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut up compiler warnings. * src/w32term.h (x_set_window_size, x_get_focus_frame) (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame) (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon) (x_free_frame_resources, x_real_positions) (display_x_get_resource): Remove redundant prototypes. * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp) (sys_rename, gettimeofday): Provide prototypes. * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant declarations. * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'. (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname) (close_winsock, initialize_sockets, w32_set_user_model_id) (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add prototypes. (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness difference. (w32_set_user_model_id): Update prototype of SetCurrentProcessExplicitAppUserModelID to avoid compiler warnings. (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to shut up compiler warnings. * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
2016-05-21 17:06:33 +00:00
# GCC warnings that produce too much noise
gl_cv_warn_c__Wredundant_decls=no
# We don't want to compile lib/copy-file-range.c because it isn't used
# on Windows, and because compiling it triggers a warning about a
# missing prototype, since lib/unistd.h, where Gnulib has its
# prototype, isn't built on Windows.
gl_cv_func_copy_file_range=yes
# We don't want to build Emacs so it depends on bcrypt.dll, since then
# it will refuse to start on systems where that DLL is absent.
gl_cv_lib_assume_bcrypt=no
# Force 'ac_cv_func_strsignal' to no as mingw64 libgccjit exports this
# symbol erroneously
# <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45303#83>.
ac_cv_func_strsignal=no
# Don't build the Gnulib free.c: it is not needed, since the w32
# implementation of 'free' doesn't touch errno, and it emits a
# compilation warning.
gl_cv_func_free_preserves_errno=yes
# Don't build the Gnulib nanosleep module: it requires W2K or later,
# and MinGW does have nanosleep.
gl_cv_func_nanosleep=yes
# Suppress configure-time diagnostic from unnecessary libxattr check,
# as xattr will not be supported here.
enable_xattr=no