From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: Emacs pretest 28.0.90 is out Date: Sat, 11 Dec 2021 17:42:31 +0800 Message-ID: <87r1aj32bc.fsf@yahoo.com> References: <831r2mug6n.fsf@gnu.org> <83zgpat0di.fsf@gnu.org> <87v8zy9c4o.fsf@yahoo.com> <87r1am9bsz.fsf@yahoo.com> <83wnkesz7r.fsf@gnu.org> <87mtl9apcx.fsf@yahoo.com> <83v8zxucaz.fsf@gnu.org> <87ilvxao13.fsf@yahoo.com> <83r1alub0m.fsf@gnu.org> <83pmq5ua9p.fsf@gnu.org> <83o85pu9u0.fsf@gnu.org> <83mtl9u9c8.fsf@gnu.org> <87a6h99uk5.fsf@yahoo.com> <875yrx9tlo.fsf@yahoo.com> <831r2kua9o.fsf@gnu.org> <877dcc6bw7.fsf@yahoo.com> <87wnkc4lrj.fsf@yahoo.com> <83lf0ssfho.fsf@gnu.org> <87o85o3q7h.fsf@yahoo.com> <83sfuzr2b0.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32827"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 11 10:43:49 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvyuy-0008Nm-Vq for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 10:43:49 +0100 Original-Received: from localhost ([::1]:44532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvyux-0001V2-P3 for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 04:43:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvyu1-0000fC-40 for emacs-devel@gnu.org; Sat, 11 Dec 2021 04:42:49 -0500 Original-Received: from sonic310-23.consmr.mail.ne1.yahoo.com ([66.163.186.204]:38225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvytx-000731-3a for emacs-devel@gnu.org; Sat, 11 Dec 2021 04:42:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639215762; bh=nWkg7oQ7I5Cj7l4l8uKVwNzqYgmLdPHeRJ/Uz+NK0D0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=KonISUNcLp4JXuNOmIdgs2rC+GNTkm5XP0Gjy9fRe0aG8YRgWJ3lxg7OJK1Z4Qx/YXTLN/yj5ijp6EdJ/jzmpUNivlMyAcGo2S1kRNHvWza3m2vWDk2hzCFEE8Xxg275GwYsKBghOqif3BBaROXiHJifoi46/9BJ5HgfAL1zZPW1wowavnZXaxEh/d/jQ9zeX6brftmXLEXvtb2pAGCj6G0XBdGCBV6DRndy4nhvjULAlHlLnxKBAnBiP30b02UxtaOjTgPOGmXMbSKvF60188Fpb7BoT75hV9plqnXzRLhWxm3STsGVuHAx3jsWe+EkDh8uV7UfwbbsHhTKaaxPZA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1639215762; bh=7xvTDar/6tYCQDVQ0CTy2/EcllY7vyhiKYiU05HD9kh=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=HfNXMlSUa4rLXgwDX5FNnI6xQEqhHh6gfaEK78WempKH8oXg1I1BvKgUuE9AKfjYrW4+P0bu44mznvT5E9jg49jsxabzq8UfkcsKaFyV369LVQmcOfrbGw5bYVzx+huVecz5M8OJChHn0jyRZehFb+l2MY8KSKv7dagVhD3LFDM1Wpe9sqQ4zHOhJo98Vt9WFYwnvgF5aCLGCl6epSN6ifDuZJqP/fJ95Z7sb5vvgvMe6pYUKkNcrt1ZoNijAbZxMqj5QNKm/v25SZ5KvDAMcbkvu3TbjEUzXzHeo33eXeuEoi/BGptFLOoEy4ppKa1v27T5o+agnjmrF0GtXQnYXA== X-YMail-OSG: yo2llpEVM1l8rwhz7vVX10ZRCBijTzPJCoTDfiLlX2r8eyrfMePZVlZRA9C5Jsd hddrRbhK9_s0eE0dYVenDZmXluIpcxoxo.J5C4S39X.8bChzuYnengVgEgt8S0mGSjagOnOeNRmj QkXCHiv78QB2chSCKF4EEZVujM.mLwKFqmJ08QtVPdh.xkukiI7pcS8ugLmq5Y9zBgukuruF04dr kgUkTC.tDnWq.W0tOE8w2Lv6G0iDV57WXsG.RFJojDDI_Sztl2PReVsqYTzkVDXqGdnQFWAfUrvu 0.n7rsQXElFPehlsGxM8.gIUk8SXW5NP7ic_IleHt9zmyogWWc05Tn_2nJnhUYXhmYlqbZoSdZEx 3iZU7QKKxc_nND4cYfcTUNN7fzncYbZIr_yb6QVmIqUEXlaNpwiEeswzTVLl5MWCZqkDfN2Vk0E2 _a7N1VTE5CFbb4Lao85HvFA4bVl.bCK4m54cvMmCe065m8lUmvYfDaFNR_Lr4CXV4lG_BTajjoVj 1rEP26HqXW5U2QxkUzYov6IZfG1MC6Y41boWInhBdWgvj7gaOUGJzrO1SEMHyzkqyz_nC9nys5D7 kxvso3vSLQAjbNUPLU_dY73kkup8pmXQ.xbHWL9DYnL.Ihyi5yxNMdASTjAgW13Qn4I_xCnUNmei cSXKsvb4PNB9dDidQTTRQ.Ygv0B.I19S8Vxi7h.o9jJh0pR6s_UFPloaF2DxCxAWYWmc8FaCTCKb TRFx5ewFiTtY1.OTeCBPByUDWm2e6dp8VulyWNeQhKcxmsoC1SWmnrW1G7aU7IU80aGmSaUH.j_q u9rZZxmNSqkG7Zco_BN.Ku2Y8mFM0pK_rVVkjYtXwa X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 11 Dec 2021 09:42:42 +0000 Original-Received: by kubenode502.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e685a9f654b362eb737b947cd77725f3; Sat, 11 Dec 2021 09:42:36 +0000 (UTC) In-Reply-To: <83sfuzr2b0.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 11 Dec 2021 10:08:51 +0200") X-Mailer: WebService/1.1.19415 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.204; envelope-from=luangruo@yahoo.com; helo=sonic310-23.consmr.mail.ne1.yahoo.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281665 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > And in any case, even if you want not to go through a temporary file, > I'd prefer to edit the original recipe in sed1v2.inp instead of adding > a DOS-specific recipe, as the former is safer for changes on the > release branch. Thanks, I opted to implement this option, and it works well. I also implemented futimens (and based on that, utimensat), and fixed the rest of the issues you outlined above. If the following patch looks good to you, I will install it on emacs-28. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-the-DJGPP-port.patch Content-Transfer-Encoding: 8bit >From 08891c91c8ae9fe2311b6cb3feddff8b80fcd632 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 10 Dec 2021 21:36:59 +0800 Subject: [PATCH] Fix the DJGPP port * config.bat: * msdos/sed1v2.inp: * msdos/sed2v2.inp: * msdos/sed3v2.inp: * msdos/sedlibmk.inp: Update for Emacs 28. * msdos/langinfo.h: New file. * lisp/loadup.el: Use correct path to temacs when dumping on MS-DOS. * src/callproc.c (environ) [MSDOS]: New declaration. (child_setup, emacs_spawn): Update MS-DOS parts for Emacs 28. * src/fileio.c (Fcopy_file): Don't use copy_file_range on MS-DOS. * src/msdos.c (initialize_msdos_display): Add `defined_color_hook'. (openat, fchmodat, futimens, utimensat): New functions. * src/msdos.h (FRAME_X_DISPLAY): New macro. * src/process.c: Make some more things conditional on subprocess support. (PIPECONN_P, PIPECONN1_P) [!subprocesses]: New placeholder macros. (Fnum_processors): Return 1 on MSDOS. (open_channel_for_module): Avoid subprocess specific code on MSDOS. --- config.bat | 7 +++- lisp/loadup.el | 4 +- msdos/langinfo.h | 20 ++++++++++ msdos/sed1v2.inp | 24 +++++++++++- msdos/sed2v2.inp | 1 + msdos/sed3v2.inp | 1 + msdos/sedlibmk.inp | 63 +++++++++++++++++++------------ src/callproc.c | 27 ++++++++++++++ src/fileio.c | 2 + src/msdos.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++ src/msdos.h | 2 + src/process.c | 17 +++++++-- src/thread.h | 1 + 13 files changed, 230 insertions(+), 31 deletions(-) create mode 100644 msdos/langinfo.h diff --git a/config.bat b/config.bat index cba7336099..e4332cd326 100644 --- a/config.bat +++ b/config.bat @@ -283,6 +283,7 @@ If Exist execinfo.in.h update execinfo.in.h execinfo.in-h If Exist fcntl.in.h update fcntl.in.h fcntl.in-h If Exist getopt.in.h update getopt.in.h getopt.in-h If Exist getopt-cdefs.in.h update getopt-cdefs.in.h getopt-cdefs.in-h +If Exist ieee754.in.h update ieee754.in.h ieee754.in-h If Exist inttypes.in.h update inttypes.in.h inttypes.in-h If Exist limits.in.h update limits.in.h limits.in-h If Exist signal.in.h update signal.in.h signal.in-h @@ -293,6 +294,7 @@ If Exist stdint.in.h update stdint.in.h stdint.in-h If Exist stdio.in.h update stdio.in.h stdio.in-h If Exist stdlib.in.h update stdlib.in.h stdlib.in-h If Exist string.in.h update string.in.h string.in-h +If Exist sys_random.in.h update sys_random.in.h sys_random.in-h If Exist sys_select.in.h update sys_select.in.h sys_select.in-h If Exist sys_stat.in.h update sys_stat.in.h sys_stat.in-h If Exist sys_time.in.h update sys_time.in.h sys_time.in-h @@ -308,10 +310,13 @@ rm -f makefile.tmp sed -f ../msdos/sedlibcf.inp < gnulib.mk-in > gnulib.tmp sed -f ../msdos/sedlibmk.inp < gnulib.tmp > gnulib.mk rm -f gnulib.tmp -Rem Create .d files for new files in lib/ +Rem Create .d files for new files in lib/ and lib/malloc/ If Not Exist deps\stamp mkdir deps for %%f in (*.c) do @call ..\msdos\depfiles.bat %%f echo deps-stamp > deps\stamp +If Not Exist deps\malloc\stamp mkdir deps\malloc +for %%f in (malloc\*.c) do @call ..\msdos\depfiles.bat %%f +echo deps-stamp > deps\malloc\stamp cd .. rem ---------------------------------------------------------------------- Echo Configuring the lisp directory... diff --git a/lisp/loadup.el b/lisp/loadup.el index e8ecb67d56..4da0ff7385 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -549,7 +549,9 @@ (lexical-binding nil)) (if (member tmp-dump-mode '("pdump" "pbootstrap")) (dump-emacs-portable (expand-file-name output invocation-directory)) - (dump-emacs output "temacs") + (dump-emacs output (if (eq system-type 'ms-dos) + "temacs.exe" + "temacs")) (message "%d pure bytes used" pure-bytes-used)) (setq success t)) (unless success diff --git a/msdos/langinfo.h b/msdos/langinfo.h new file mode 100644 index 0000000000..a74c3f7f8e --- /dev/null +++ b/msdos/langinfo.h @@ -0,0 +1,20 @@ +/* Replacement langinfo.h file for building GNU Emacs on MS-DOS with DJGPP. + +Copyright (C) 2021 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +#define nl_langinfo(ignore) "cp437" diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 5d82af66d9..60f67e4303 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -55,6 +55,10 @@ s/ *@LIBJPEG@// s/ *@LIBPNG@// s/ *@LIBGIF@// s/ *@LIBXPM@// +/^HAVE_NATIVE_COMP *=/s/@HAVE_NATIVE_COMP@/no/ +/^HAVE_PDUMPER *=/s/@HAVE_PDUMPER@/no/ +/^CHECK_STRUCTS *=/s/@CHECK_STRUCTS@// +/^RUN_TEMACS \=/s/temacs/temacs.exe/ /^XFT_LIBS *=/s/@XFT_LIBS@// /^XCB_LIBS *=/s/@XCB_LIBS@// /^FONTCONFIG_CFLAGS *=/s/@FONTCONFIG_CFLAGS@// @@ -150,6 +154,18 @@ s/ *@LIBXPM@// /^CANNOT_DUMP *=/s/@CANNOT_DUMP@/no/ /^W32_OBJ *=/s/@W32_OBJ@// /^W32_LIBS *=/s/@W32_LIBS@// +/^JSON_OBJ *=/s/@JSON_OBJ@// +/^JSON_CFLAGS *=/s/@JSON_CFLAGS@// +/^JSON_LIBS *=/s/@JSON_LIBS@// +/^LIBGCCJIT_OBJ *=/s/@LIBGCCJIT_OBJ@// +/^LIBGCCJIT_CFLAGS *=/s/@LIBGCCJIT_CFLAGS@// +/^LIBGCCJIT_LIBS *=/s/@LIBGCCJIT_LIBS@// +/^HARFBUZZ_CFLAGS *=/s/@HARFBUZZ_CFLAGS@// +/^HARFBUZZ_LIBS *=/s/@HARFBUZZ_LIBS@// +/^LCMS2_CFLAGS *=/s/@LCMS2_CFLAGS@// +/^LCMS2_LIBS *=/s/@LCMS2_LIBS@// +/^LIBGMP *=/s/@LIBGMP@// +/^DYNLIB_OBJ *=/s/@DYNLIB_OBJ@// /^version *=/s/@[^@\n]*@// /^EMACSRES *=/s/@EMACSRES@// /^W32_RES_LINK *=/s/@W32_RES_LINK@// @@ -162,6 +178,7 @@ s/ *@LIBXPM@// /^AUTO_DEPEND *=/s/@AUTO_DEPEND@/yes/ /^PAXCTL_dumped *=/s/=.*$/=/ /^PAXCTL_notdumped *=/s/=.*$/=/ +/^DUMPING *=/s/@DUMPING@/unexec/ /^lisp\.mk:/,/^$/c\ lisp.mk: $(lispsource)/loadup.el\ @rm -f $@\ @@ -183,6 +200,7 @@ lisp.mk: $(lispsource)/loadup.el\ /^ *ifneq (\$(PAXCTL_dumped),)/,/^ *endif/d /^ *ln /s/ln /cp / /^ fi/d +/ifeq (\$(HAVE_NATIVE_COMP):\$(NATIVE_DISABLED),yes:)/,/endif/d /^ *\$(RUN_TEMACS) /i\ stubedit temacs.exe minstack=1024k /^ *LC_ALL=C \$(RUN_TEMACS)/i\ @@ -214,8 +232,8 @@ s/echo.*buildobj.lst/dj&/ /^ -\{0,1\}rm -f/s/\\#/#/ /^ echo.* buildobj.h/s|echo |djecho | /^buildobj\.h:/,/^ *\$(AM_V_at)mv /{ - /^ *\$(AM_V_GEN)for /,/^ *done /c\ - djecho "$(ALLOBJS)" | sed -e 's/^ */"/' -e 's/ *$$/"/' -e 's/ */", "/g' >>$@.tmp + /^ *\$(AM_V_GEN)for /,/mv \$@.tmp \$@/c\ + djecho "$(ALLOBJS)" | sed -e 's/^ */"/' -e 's/ *$$/"/' -e 's/ */", "/g' >>$@ } # Remove or replace dependencies we cannot have /^\.PRECIOUS: /s!\.\./config.status !! @@ -236,3 +254,5 @@ s| -I\$(srcdir)/\.\./lib|| s| -I\$(top_srcdir)/lib|| s| -I\. -I\$(srcdir)| -I.| /^ *test "X/d +/\$(CC) -o \$@.tmp/s/\$@.tmp/\$@/ +/mv \$@.tmp \$@/d \ No newline at end of file diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 5238f2dfc6..ae5d46fe86 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -37,6 +37,7 @@ /^#undef HAVE_STRUCT_UTIMBUF *$/s/^.*$/#define HAVE_STRUCT_UTIMBUF 1/ /^#undef LOCALTIME_CACHE *$/s/^.*$/#define LOCALTIME_CACHE 1/ /^#undef HAVE_TZSET *$/s/^.*$/#define HAVE_TZSET 1/ +/^#undef HAVE_UNEXEC *$/s/^.*$/#define HAVE_UNEXEC 1/ /^#undef HAVE_RINT *$/s/^.*$/#define HAVE_RINT 1/ /^#undef HAVE_C99_STRTOLD *$/s/^.*$/#define HAVE_C99_STRTOLD 1/ /^#undef HAVE_DIFFTIME *$/s/^.*$/#define HAVE_DIFFTIME 1/ diff --git a/msdos/sed3v2.inp b/msdos/sed3v2.inp index 8b9bb0679b..f7c9eb05ba 100644 --- a/msdos/sed3v2.inp +++ b/msdos/sed3v2.inp @@ -34,6 +34,7 @@ /^LIBS_SYSTEM *=/s/@[^@\n]*@//g /^LIB_CLOCK_GETTIME *=/s/@[^@\n]*@//g /^LIB_TIMER_TIME *=/s/@[^@\n]*@//g +/^LIB_GETRANDOM *=/s/@[^@\n]*@//g /^CFLAGS *=/s!=.*$!=-O2 -g! /^CPPFLAGS *=/s/@CPPFLAGS@// /^LDFLAGS *=/s/@LDFLAGS@// diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 825be84968..b3b94297d6 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -144,7 +144,7 @@ s/@PACKAGE@/emacs/ /^CPP *=/s/@[^@\n]*@/gcc -e/ /^CPPFLAGS *=/s/@[^@\n]*@// /^CCDEPMODE *=/s/@[^@\n]*@/depmode=gcc3/ -/^CFLAGS *=/s/@[^@\n]*@/-g -O2/ +/^CFLAGS *=/s/@[^@\n]*@/-g -O2 -I$\(srcdir\)\/..\/msdos/ /^CYGPATH_W *=/s/@[^@\n]*@// /^CYGWIN_OBJ *=/s/@[^@\n]*@// /^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@// @@ -170,28 +170,28 @@ s/@PACKAGE@/emacs/ /^BITSIZEOF_WCHAR_T *=/s/@BITSIZEOF_WCHAR_T@/16/ /^BITSIZEOF_WINT_T *=/s/@BITSIZEOF_WINT_T@/32/ /^APPLE_UNIVERSAL_BUILD *=/s/@APPLE_UNIVERSAL_BUILD@/0/ -# -# Most GNULIB_* are replaced with zero even though DJGPP does not have -# these features. That's because the gnulib replacements cannot +# Most GL_GNULIB_* are replaced with zero even though DJGPP does not +# have these features. That's because the gnulib replacements cannot # possibly work for DJGPP, so we prefer to fail the link than have a # subtly botched executable. Those replacements that _are_ needed # should be before the last catch-all rule. -/^GNULIB_ATOLL *=/s/@GNULIB_ATOLL@/1/ -/^GNULIB_DUP3 *=/s/@GNULIB_DUP3@/1/ -/^GNULIB_ENVIRON *=/s/@GNULIB_ENVIRON@/1/ -/^GNULIB_FDATASYNC *=/s/@GNULIB_FDATASYNC@/1/ -/^GNULIB_GETLOADAVG *=/s/@GNULIB_GETLOADAVG@/1/ -/^GNULIB_GL_UNISTD_H_GETOPT *=/s/@GNULIB_GL_UNISTD_H_GETOPT@/1/ -/^GNULIB_MEMRCHR *=/s/@GNULIB_MEMRCHR@/1/ -/^GNULIB_MKOSTEMP *=/s/@GNULIB_MKOSTEMP@/1/ -/^GNULIB_MKTIME *=/s/@GNULIB_MKTIME@/1/ -/^GNULIB_TIME_R *=/s/@GNULIB_TIME_R@/1/ -/^GNULIB_TIMEGM *=/s/@GNULIB_TIMEGM@/1/ -/^GNULIB_TIME_RZ *=/s/@GNULIB_TIME_RZ@/1/ -/^GNULIB_UNSETENV *=/s/@GNULIB_UNSETENV@/1/ -/^GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/ -/^GSETTINGS_CFLAGS *=/s/@[^@\n]*@// -/^GSETTINGS_LIBS *=/s/@[^@\n]*@// +/^GL_GNULIB_ATOLL *=/s/@GL_GNULIB_ATOLL@/1/ +/^GL_GNULIB_DUP3 *=/s/@GL_GNULIB_DUP3@/1/ +/^GL_GNULIB_ENVIRON *=/s/@GL_GNULIB_ENVIRON@/1/ +/^GL_GNULIB_FDATASYNC *=/s/@GL_GNULIB_FDATASYNC@/1/ +/^GL_GNULIB_GETLOADAVG *=/s/@GL_GNULIB_GETLOADAVG@/1/ +/^GL_GNULIB_UNISTD_H_GETOPT *=/s/@GL_GNULIB_UNISTD_H_GETOPT@/1/ +/^GL_GNULIB_MEMRCHR *=/s/@GL_GNULIB_MEMRCHR@/1/ +/^GL_GNULIB_MEMPCPY *=/s/@GL_GNULIB_MEMPCPY@/1/ +/^GL_GNULIB_MKOSTEMP *=/s/@GL_GNULIB_MKOSTEMP@/1/ +/^GL_GNULIB_MKTIME *=/s/@GL_GNULIB_MKTIME@/1/ +/^GL_GNULIB_TIME_R *=/s/@GL_GNULIB_TIME_R@/1/ +/^GL_GNULIB_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/1/ +/^GL_GNULIB_TIME_RZ *=/s/@GL_GNULIB_TIME_RZ@/1/ +/^GL_GNULIB_UNSETENV *=/s/@GL_GNULIB_UNSETENV@/1/ +/^GL_GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/ +/^GL_GSETTINGS_CFLAGS *=/s/@[^@\n]*@// +/^GL_GSETTINGS_LIBS *=/s/@[^@\n]*@// # # Edit the HAVE_foo variables /^HAVE_ATOLL *=/s/@HAVE_ATOLL@/0/ @@ -253,6 +253,7 @@ s/@PACKAGE@/emacs/ /^HAVE_USLEEP *=/s/@HAVE_USLEEP@/1/ /^HAVE_WCHAR_H *=/s/@HAVE_WCHAR_H@/1/ /^HAVE_WCHAR_T *=/s/@HAVE_WCHAR_T@/1/ +/^HAVE_LIBGMP *=/s/@HAVE_LIBGMP@/0/ /^HAVE__BOOL *=/s/@HAVE__BOOL@/1/ /^HAVE__EXIT *=/s/@HAVE__EXIT@/1/ /^HAVE_[^ =]* *= *@/s/@[^@\n]*@/0/ @@ -265,7 +266,9 @@ s/@PACKAGE@/emacs/ /^LIBS *=/s/@[^@\n]*@// /^MAKEINFO *=/s/@MAKEINFO@/makeinfo/ # MKDIR_P lines are edited further below -/^MKDIR_P *=/s/@MKDIR_P@// +# MKDIR_P is only used to create lib/malloc, and the folder is +# already present in the distribution, so this should work fine. +/^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@// @@ -309,6 +312,7 @@ s/@PACKAGE@/emacs/ /^REPLACE_MKTIME *=/s/@[^@\n]*@/1/ # We don't want any other gnulib replacement functions /^REPLACE_[^ =]* *= *@/s/@[^@\n]*@/0/ +/^LIB_GETRANDOM[^ =]* *= *@/s/@[^@\n]*@// /^SIG_ATOMIC_T_SUFFIX *=/s/@SIG_ATOMIC_T_SUFFIX@// /^SIZE_T_SUFFIX *=/s/@SIZE_T_SUFFIX@/u/ /^ALLOCA_H *=/s/@[^@\n]*@/alloca.h/ @@ -317,18 +321,23 @@ s/@PACKAGE@/emacs/ /^ERRNO_H *=/s/@[^@\n]*@// /^EXECINFO_H *=/s/@[^@\n]*@/execinfo.h/ /^GETOPT_CDEFS_H *=/s/@[^@\n]*@/getopt-cdefs.h/ +/^GMP_H *=/s/@[^@\n]*@/gmp.h/ /^LIMITS_H *=/s/@[^@\n]*@/limits.h/ +/^IEEE754_H *=/s/@[^@\n]*@/ieee754.h/ /^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/ /^STDDEF_H *=/s/@[^@\n]*@/stddef.h/ /^STDINT_H *=/s/@[^@\n]*@/stdint.h/ /^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/ /^TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/ +/^TIME_H_DEFINES_TIME_UTC *=/s/@[^@\n]*@/0/ +/^UNISTD_H_HAVE_SYS_RANDOM_H *=/s/@[^@\n]*@/0/ /^UNISTD_H_HAVE_WINSOCK2_H *=/s/@[^@\n]*@/0/ /^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS *=/s/@[^@\n]*@/0/ /^UNISTD_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/ /^UNDEFINE_STRTOK_R *=/s/@UNDEFINE_STRTOK_R@/0/ /^WCHAR_T_SUFFIX *=/s/@WCHAR_T_SUFFIX@/h/ /^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@// +/^GNULIBHEADERS_OVERRIDE_WINT_T *=/s/@[^@\n]*@/0/ /^WINDOWS_64_BIT_OFF_T *=/s/@WINDOWS_64_BIT_OFF_T@/0/ /^WINDOWS_64_BIT_ST_SIZE *=/s/@WINDOWS_64_BIT_ST_SIZE@/0/ /^WINDOWS_STAT_INODES *=/s/@WINDOWS_STAT_INODES@/0/ @@ -337,7 +346,7 @@ s/@PACKAGE@/emacs/ /am__append_[1-9][0-9]* *=.*gettext\.h/s/@[^@\n]*@/\#/ /am__append_2 *=.*verify\.h/s/@[^@\n]*@// /^@gl_GNULIB_ENABLED_tempname_TRUE@/s/@[^@\n]*@// -/^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o memrchr.o sig2str.o time_r.o time_rz.o timegm.o mktime.o getloadavg.o pthread_sigmask.o mkostemp.o fpending.o fdatasync.o execinfo.o/ +/^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o getrandom.o memrchr.o mempcpy.o regex.o memmem.o sig2str.o sigdescr_np.o time_r.o time_rz.o timegm.o mktime.o mini-gmp-gnulib.o getloadavg.o pthread_sigmask.o mkostemp.o fpending.o execinfo.o tempname.o/ /^am__append_[1-9][0-9]* *=/,/^[^ ]/{ s/ *inttypes\.h// s| *sys/select\.h|| @@ -394,15 +403,19 @@ s/^ -*test -z.*|| rm/ -rm/ s/@echo /@djecho / # # Determine which headers to generate -s/= @GL_GENERATE_ALLOCA_H@/= 1/ +s/= @GL_GENERATE_ALLOCA_H_TRUE@/= 1/ s/= @GL_GENERATE_BYTESWAP_H@/= 1/ s/= @GL_GENERATE_EXECINFO_H@/= 1/ +s/= @GL_GENERATE_IEEE754_H@/= 1/ s/= @GL_GENERATE_STDALIGN_H@/= 1/ s/= @GL_GENERATE_STDDEF_H@/= 1/ s/= @GL_GENERATE_STDINT_H@/= 1/ s/= @GL_GENERATE_LIMITS_H@/= 1/ s/= @GL_GENERATE_ERRNO_H@/= / s/= @GL_GENERATE_LIMITS_H@/= / +s/= @GL_GENERATE_GMP_GMP_H@/= 1/ +s/= @GL_GENERATE_MINI_GMP_H@/= 1/ +s/\$\(MKDIR_P\) malloc// # # Determine which modules to build and which to omit /^noinst_LIBRARIES /a\ @@ -413,6 +426,7 @@ OMIT_GNULIB_MODULE_careadlinkat = true\ OMIT_GNULIB_MODULE_cloexec = true\ OMIT_GNULIB_MODULE_dirent = true\ OMIT_GNULIB_MODULE_dirfd = true\ +OMIT_GNULIB_MODULE_scratch_buffer = true\ OMIT_GNULIB_MODULE_dup2 = true\ OMIT_GNULIB_MODULE_errno = true\ OMIT_GNULIB_MODULE_euidaccess = true\ @@ -439,7 +453,8 @@ OMIT_GNULIB_MODULE_strtoimax = true\ OMIT_GNULIB_MODULE_strtoll = true\ OMIT_GNULIB_MODULE_symlink = true\ OMIT_GNULIB_MODULE_sys_select = true\ -OMIT_GNULIB_MODULE_sys_time = true +OMIT_GNULIB_MODULE_sys_time = true\ +OMIT_GNULIB_MODULE_crypto\/md5 = true /^arg-nonnull\.h:/,/^[ ][ ]*mv /c\ arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h\ sed -n -e '/GL_ARG_NONNULL/,$$p' < $(top_srcdir)/build-aux/snippet/arg-nonnull.h > $@ diff --git a/src/callproc.c b/src/callproc.c index fad81694b0..f7c55d0486 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -25,6 +25,10 @@ Copyright (C) 1985-1988, 1993-1995, 1999-2021 Free Software Foundation, #include #include +#ifdef MSDOS +extern char **environ; +#endif + #include #include @@ -1200,6 +1204,11 @@ exec_failed (char const *name, int err) child_setup (int in, int out, int err, char **new_argv, char **env, const char *current_dir) { +#ifdef MSDOS + char *pwd_var; + char *temp; + ptrdiff_t i; +#endif #ifdef WINDOWSNT int cpid; HANDLE handles[3]; @@ -1252,6 +1261,22 @@ child_setup (int in, int out, int err, char **new_argv, char **env, exec_failed (new_argv[0], errnum); #else /* MSDOS */ + i = strlen (current_dir); + pwd_var = xmalloc (i + 5); + temp = pwd_var + 4; + memcpy (pwd_var, "PWD=", 4); + stpcpy (temp, current_dir); + + if (i > 2 && IS_DEVICE_SEP (temp[1]) && IS_DIRECTORY_SEP (temp[2])) + { + temp += 2; + i -= 2; + } + + /* Strip trailing slashes for PWD, but leave "/" and "//" alone. */ + while (i > 2 && IS_DIRECTORY_SEP (temp[i - 1])) + temp[--i] = 0; + pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); xfree (pwd_var); if (pid == -1) @@ -1583,11 +1608,13 @@ emacs_spawn (pid_t *newpid, int std_in, int std_out, int std_err, signal (SIGPROF, SIG_DFL); #endif +#ifdef subprocesses /* Stop blocking SIGCHLD in the child. */ unblock_child_signal (oldset); if (pty_flag) child_setup_tty (std_out); +#endif if (std_err < 0) std_err = std_out; diff --git a/src/fileio.c b/src/fileio.c index 7e3bebca9e..b1f464cf98 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2286,6 +2286,7 @@ DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, off_t insize = st.st_size; ssize_t copied; +#ifndef MSDOS for (newsize = 0; newsize < insize; newsize += copied) { /* Copy at most COPY_MAX bytes at a time; this is min @@ -2300,6 +2301,7 @@ DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, break; maybe_quit (); } +#endif /* MSDOS */ /* Fall back on read+write if copy_file_range failed, or if the input is empty and so could be a /proc file. read+write will diff --git a/src/msdos.c b/src/msdos.c index 5da01c9e7c..06cc3e4f0a 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -1874,6 +1874,7 @@ initialize_msdos_display (struct terminal *term) term->redeem_scroll_bar_hook = 0; term->judge_scroll_bars_hook = 0; term->read_socket_hook = &tty_read_avail_input; /* from keyboard.c */ + term->defined_color_hook = &tty_defined_color; /* from xfaces.c */ } int @@ -3915,6 +3916,43 @@ readlinkat (int fd, char const *name, char *buffer, size_t buffer_size) return readlink (name, buffer, buffer_size); } + +int +openat (int fd, const char * path, int oflag, int mode) +{ + /* Rely on a hack: an open directory is modeled as file descriptor 0, + as in fstatat. FIXME: Add proper support for openat. */ + char fullname[MAXPATHLEN]; + + if (fd != AT_FDCWD) + { + if (strlen (dir_pathname) + strlen (path) + 1 >= MAXPATHLEN) + { + errno = ENAMETOOLONG; + return -1; + } + sprintf (fullname, "%s/%s", dir_pathname, path); + path = fullname; + } + + return open (path, oflag, mode); +} + +int +fchmodat (int fd, const char *path, mode_t mode, int flags) +{ + if (fd != AT_FDCWD) + { + if (strlen (dir_pathname) + strlen (path) + 1 >= MAXPATHLEN) + { + errno = ENAMETOOLONG; + return -1; + } + } + + return chmod (path, mode); +} + char * careadlinkat (int fd, char const *filename, char *buffer, size_t buffer_size, @@ -3942,6 +3980,60 @@ careadlinkat (int fd, char const *filename, return buffer; } +int +futimens (int fd, const struct timespec times[2]) +{ + struct tm *tm; + struct ftime ft; + time_t t; + + block_input (); + if (times[1].tv_sec == UTIME_NOW) + t = time (NULL); + else + t = times[1].tv_sec; + + tm = localtime (&t); + ft.ft_tsec = min (59, tm->tm_sec); + ft.ft_min = tm->tm_min; + ft.ft_hour = tm->tm_hour; + ft.ft_day = tm->tm_mday; + ft.ft_month = tm->tm_mon + 1; + ft.ft_year = max (0, tm->tm_year - 80); + unblock_input (); + + return setftime (fd, &ft); +} + +int +utimensat (int dirfd, const char *pathname, + const struct timespec times[2], int flags) +{ + int fd; + char fullname[MAXPATHLEN]; + + if (dirfd != AT_FDCWD) + { + if (strlen (dir_pathname) + strlen (pathname) + 1 >= MAXPATHLEN) + { + errno = ENAMETOOLONG; + return -1; + } + sprintf (fullname, "%s/%s", dir_pathname, pathname); + pathname = fullname; + } + + /* Rely on a hack: dirfd in its current usage in Emacs is always + AT_FDCWD. */ + + fd = open (pathname, O_WRONLY); + + if (fd < 0) + return -1; + + return futimens (fd, times); +} + /* Emulate faccessat(2). */ int faccessat (int dirfd, const char * path, int mode, int flags) diff --git a/src/msdos.h b/src/msdos.h index f7d3b0d702..d58b60ef5d 100644 --- a/src/msdos.h +++ b/src/msdos.h @@ -86,6 +86,8 @@ #define O_CLOEXEC 0 typedef int Pixmap; typedef int Display; typedef int Window; + +#define FRAME_X_DISPLAY(ignored) NULL #define PIX_TYPE unsigned long #define XDISPLAY diff --git a/src/process.c b/src/process.c index 6731f8808f..75ba191fa1 100644 --- a/src/process.c +++ b/src/process.c @@ -40,7 +40,10 @@ Copyright (C) 1985-1988, 1993-1996, 1998-1999, 2001-2021 Free Software #include #include -#endif /* subprocesses */ +#else +#define PIPECONN_P(p) false +#define PIPECONN1_P(p) false +#endif #ifdef HAVE_SETRLIMIT # include @@ -152,6 +155,7 @@ #define ASYNC_RETRY_NSEC 100000000 when exiting. */ bool inhibit_sentinels; +#ifdef subprocesses union u_sockaddr { struct sockaddr sa; @@ -164,8 +168,6 @@ #define ASYNC_RETRY_NSEC 100000000 #endif }; -#ifdef subprocesses - #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif @@ -8238,9 +8240,13 @@ DEFUN ("num-processors", Fnum_processors, Snum_processors, 0, 1, 0, If QUERY is `all', also count processors not available. */) (Lisp_Object query) { +#ifndef MSDOS return make_uint (num_processors (EQ (query, Qall) ? NPROC_ALL : EQ (query, Qcurrent) ? NPROC_CURRENT : NPROC_CURRENT_OVERRIDABLE)); +#else + return make_fixnum (1); +#endif } #ifdef subprocesses @@ -8285,10 +8291,15 @@ open_channel_for_module (Lisp_Object process) { CHECK_PROCESS (process); CHECK_TYPE (PIPECONN_P (process), Qpipe_process_p, process); +#ifndef MSDOS int fd = dup (XPROCESS (process)->open_fd[SUBPROCESS_STDOUT]); if (fd == -1) report_file_error ("Cannot duplicate file descriptor", Qnil); return fd; +#else + /* PIPECONN_P returning true shouldn't be possible on MSDOS. */ + emacs_abort (); +#endif } diff --git a/src/thread.h b/src/thread.h index cf3ce922c4..b316e916d1 100644 --- a/src/thread.h +++ b/src/thread.h @@ -26,6 +26,7 @@ #define THREAD_H #endif #ifdef MSDOS +#include /* struct rpl_timespec */ #include /* sigset_t */ #endif -- 2.33.1 --=-=-=--