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.
This commit is contained in:
Po Lu 2022-02-11 20:19:34 +08:00
parent 20da50619f
commit f726ca161c
5 changed files with 49 additions and 15 deletions

View file

@ -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

View file

@ -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
/mv \$@.tmp \$@/d

View file

@ -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]*@/<dirent.h>/
/^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

View file

@ -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

View file

@ -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