From f726ca161c2617a400ce3823926813134ace287e Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 11 Feb 2022 20:19:34 +0800 Subject: [PATCH] Fix the DJGPP port * config.bat: * msdos/sed1v2.inp: * msdos/sedlibmk.inp: Update for present Emacs. * src/Makefile.in (MAKE_PDUMPER_FINGERPRINT): Fix indentation to not confuse sed*.inp. * src/conf_post.h [MSDOS]: Define some things gnulib wants. --- config.bat | 3 +++ msdos/sed1v2.inp | 16 +++++++++++++++- msdos/sedlibmk.inp | 27 +++++++++++++++------------ src/Makefile.in | 4 ++-- src/conf_post.h | 14 ++++++++++++++ 5 files changed, 49 insertions(+), 15 deletions(-) diff --git a/config.bat b/config.bat index 29742eec52b..d647ad5e679 100644 --- a/config.bat +++ b/config.bat @@ -310,6 +310,9 @@ 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 directorys in lib/ that MKDIR_P is supposed to create +Rem but I have no idea how to do that on MS-DOS. +mkdir lib\sys 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 diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index e041e4e5b8d..86f00c024a8 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -55,8 +55,10 @@ s/ *@LIBJPEG@// s/ *@LIBPNG@// s/ *@LIBGIF@// s/ *@LIBXPM@// +s/ *@WEBP_LIBS@// /^HAVE_NATIVE_COMP *=/s/@HAVE_NATIVE_COMP@/no/ /^HAVE_PDUMPER *=/s/@HAVE_PDUMPER@/no/ +/^HAVE_BE_APP *=/s/@HAVE_BE_APP@/no/ /^CHECK_STRUCTS *=/s/@CHECK_STRUCTS@// /^RUN_TEMACS \=/s/temacs/temacs.exe/ /^XFT_LIBS *=/s/@XFT_LIBS@// @@ -78,6 +80,10 @@ s/ *@LIBXPM@// /^NOTIFY_LIBS *=/s/@NOTIFY_LIBS@// /^NOTIFY_CFLAGS *=/s/@NOTIFY_CFLAGS@// /^GTK_OBJ *=/s/@GTK_OBJ@// +/^PGTK_OBJ *=/s/@PGTK_OBJ@// +/^PGTK_LIBS *=/s/@PGTK_LIBS@// +/^HAIKU_OBJ *=/s/@HAIKU_OBJ@// +/^HAIKU_CXX_OBJ *=/s/@HAIKU_CXX_OBJ@// /^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@// /^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/ /^LIBXMU *=/s/@LIBXMU@// @@ -110,6 +116,14 @@ s/ *@LIBXPM@// /^XFIXES_CFLAGS *=/s/@XFIXES_CFLAGS@// /^XDBE_LIBS *=/s/@XDBE_LIBS@// /^XDBE_CFLAGS *=/s/@XDBE_CFLAGS@// +/^XINPUT_LIBS *=/s/@XINPUT_LIBS@// +/^XINPUT_CFLAGS *=/s/@XINPUT_CFLAGS@// +/^XSYNC_LIBS *=/s/@XSYNC_LIBS@// +/^XSYNC_CFLAGS *=/s/@XSYNC_CFLAGS@// +/^WEBP_CFLAGS *=/s/@WEBP_CFLAGS@// +/^SQLITE3_LIBS *=/s/@SQLITE3_LIBS@// +/^HAIKU_LIBS *=/s/@HAIKU_LIBS@// +/^HAIKU_CFLAGS *=/s/@HAIKU_CFLAGS@// /^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@// /^WINDOW_SYSTEM_OBJ *=/s/@WINDOW_SYSTEM_OBJ@// /^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/ @@ -255,4 +269,4 @@ 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 +/mv \$@.tmp \$@/d diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 59ebec9e756..8602aaf449e 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -268,6 +268,8 @@ s/@PACKAGE@/emacs/ # MKDIR_P lines are edited further below # MKDIR_P is only used to create lib/malloc, and the folder is # already present in the distribution, so this should work fine. +# (No longer true as of Emacs 29, but the directories we need +# are created in config.bat!) /^MKDIR_P *=/s/@MKDIR_P@/echo/ /^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@// /^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@// @@ -403,18 +405,19 @@ s/^ -*test -z.*|| rm/ -rm/ s/@echo /@djecho / # # Determine which headers to generate -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/= @GL_GENERATE_ALLOCA_H_CONDITION@/= 1/ +s/= @GL_GENERATE_BYTESWAP_H_CONDITION@/= 1/ +s/= @GL_GENERATE_EXECINFO_H_CONDITION@/= 1/ +s/= @GL_GENERATE_IEEE754_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDALIGN_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDDEF_H_CONDITION@/= 1/ +s/= @GL_GENERATE_STDINT_H_CONDITION@/= 1/ +s/= @GL_GENERATE_LIMITS_H_CONDITION@/= 1/ +s/= @GL_GENERATE_ERRNO_H_CONDITION@/= / +s/= @GL_GENERATE_LIMITS_H_CONDITION@/= / +s/= @GL_GENERATE_GMP_H_CONDITION@/= 1/ +s/= @GL_GENERATE_GMP_GMP_H_CONDITION@/= / +s/= @GL_GENERATE_MINI_GMP_H_CONDITION@/= 1/ s/\$\(MKDIR_P\) malloc// # # Determine which modules to build and which to omit diff --git a/src/Makefile.in b/src/Makefile.in index 186e06735cc..3353fb16d79 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -681,9 +681,9 @@ $(LIBEGNU_ARCHIVE): $(config_h) $(MAKE) -C $(dir $@) all ifeq ($(HAVE_PDUMPER),yes) - MAKE_PDUMPER_FINGERPRINT = $(libsrc)/make-fingerprint$(EXEEXT) +MAKE_PDUMPER_FINGERPRINT = $(libsrc)/make-fingerprint$(EXEEXT) else - MAKE_PDUMPER_FINGERPRINT = +MAKE_PDUMPER_FINGERPRINT = endif ## We have to create $(etc) here because init_cmdargs tests its diff --git a/src/conf_post.h b/src/conf_post.h index 0b6260b287e..cee5a0878a1 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -182,6 +182,20 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ # define SIZE_MAX 4294967295U #endif +/* Things that lib/reg* wants. */ + +#define mbrtowc(pwc, s, n, ps) mbtowc ((pwc), (s), (n)) +#define wcrtomb(s, wc, ps) wctomb ((s), (wc)) +#define btowc(b) ((wchar_t) (b)) +#define towupper(chr) toupper (chr) +#define towlower(chr) tolower (chr) +#define iswalnum(chr) isalnum (chr) +#define wctype(name) ((wctype_t) 0) +#define iswctype(wc, type) false +#define mbsinit(ps) 1 + +#define MALLOC_0_IS_NONNULL 1 + /* We must intercept 'opendir' calls to stash away the directory name, so we could reuse it in readlinkat; see msdos.c. */ #define opendir sys_opendir -- 2.39.5