sedlibmk.inp 18.4 KB
Newer Older
1 2 3 4
# -sedlibmk.inp-----------------------------------------------------------
# Configuration script for lib/Makefile under DJGPP v2.x
# ----------------------------------------------------------------------
#
Paul Eggert's avatar
Paul Eggert committed
5
# Copyright (C) 2011-2019 Free Software Foundation, Inc.
6 7 8 9 10 11 12 13 14 15 16 17 18
#
# This file is part of GNU Emacs.
#
# This file is free software; as a special exception, the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program 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.
#
# ----------------------------------------------------------------------
#
19 20
# Checklist to add a new gnulib module:
#
Eli Zaretskii's avatar
Eli Zaretskii committed
21 22 23
#  . If a module appears in gnulib.mk.in that is not required for the
#    MSDOS build, disable its building by setting the corresponding
#    OMIT_GNULIB_MODULE_foo variable to true.
24 25
#
#  . If the module defines functions that need to replace DJGPP
Eli Zaretskii's avatar
Eli Zaretskii committed
26 27 28
#    functions, edit the appropriate REPLACE_foo variables to 1:
#
#     /^REPLACE_CALLOC *=/s/@REPLACE_CALLOC@/1/
29
#
Eli Zaretskii's avatar
Eli Zaretskii committed
30 31 32 33 34
#    Note that this file already has a command to edit all the
#    REPLACE_foo variables to zero, so if some gnulib replacement
#    function is ever needed, the corresponding editing command such
#    as above should be placed before that catchall rule (search for
#    "REPLACE_" below).
35
#
Eli Zaretskii's avatar
Eli Zaretskii committed
36 37 38
#  . If the module generates a header from a .in.h file, edit the
#    corresponding variable to either an empty value or to the name of
#    the header.  Examples:
39 40 41 42
#
#       /^STDINT_H *=/s/@[^@\n]*@/stdint.h/  -- stdint.h is needed
#       /^STDDEF_H *=/s/@[^@\n]*@//          -- stddef.h is not needed
#
43
#  . Some of the headers are generated conditionally, and the
Eli Zaretskii's avatar
Eli Zaretskii committed
44 45 46 47
#    corresponding recipes are guarded by
#      ifneq (,$(GL_GENERATE_xxxx_H))
#    Depending on whether DJGPP uses the corresponding header, these
#    should be edited either to 1 (thus exposing the recipe) or
Paul Eggert's avatar
Paul Eggert committed
48
#    to nothing, which makes Make bypass the recipe away.  Example:
49
#
Eli Zaretskii's avatar
Eli Zaretskii committed
50 51
#       s/^@GL_GENERATE_STDBOOL_H@/1/
#       s/^@GL_GENERATE_STDINT_H@//
52
#
Eli Zaretskii's avatar
Eli Zaretskii committed
53 54 55 56
#  . Also edit the NEXT_foo_H and NEXT_AS_FIRST_DIRECTIVE_foo_H
#    variables as appropriately: to an empty value if the gnulib
#    header is not used, and to the corresponding DJGPP header name
#    otherwise.  Examples:
57 58 59 60 61 62
#
#     /^NEXT_STDDEF_H *=/s/@[^@\n]*@//
#     /^NEXT_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
#     /^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
#     /^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@//
#
Eli Zaretskii's avatar
Eli Zaretskii committed
63 64
#  . Note that some gnulib headers cannot be left unused: those for
#    which there's no corresponding foo_H variable in
Eli Zaretskii's avatar
Eli Zaretskii committed
65
#    lib/Makefile.in (example: stdio.h).  For these the "not
Eli Zaretskii's avatar
Eli Zaretskii committed
66 67
#    needed" path is not applicable.
#
68 69 70 71 72 73 74 75
#  . If the header is needed, edit all the variables it uses as
#    appropriate.  In general, if DJGPP has the corresponding feature,
#    the value of the corresponding HAVE_foo should be set to what
#    DJGPP has, and the corresponding GNULIB_foo variable should be
#    edited to zero.  If the feature is not available, the HAVE_foo
#    variable should be edited to zero and the corresponding
#    GNULIB_foo variable should be edited to 1 if the gnulib
#    replacement can work for DJGPP (a rare phenomenon), zero
Eli Zaretskii's avatar
Eli Zaretskii committed
76 77 78
#    otherwise.  Note that by default all HAVE_foo and GNULIB_foo
#    variables that don't have a specific editing rule will be edited
#    to zero.
79 80
#
#  . Some gnulib header files have more complex recipes in
Eli Zaretskii's avatar
Eli Zaretskii committed
81 82 83
#    msdos/autogen/Makefile.in than others.  The tell-tale sign of
#    such a recipe is that the input redirection from the .in.h file
#    is not present at the end of the command, like this:
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
#
#	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
#	} > $@-t && \
#	mv $@-t $@
#
#    as opposed to this:
#
#	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
#	      < $(srcdir)/sys_stat.in.h; \
#	} > $@-t && \
#	mv $@-t $@
#
#    For those recipes that do _not_ have redirection at the end of
#    the command, add a block of Sed commands like this:
#
#     /^stdio\.h:/,/^	[ 	]*mv /{
#       s/'\; \\ *$/' >> $@-t/
#     }
#
Eli Zaretskii's avatar
Eli Zaretskii committed
103 104 105 106 107 108 109 110 111 112
#    There's also a 3rd variety of script, which ends like this:
#
#             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
#             < $(srcdir)/string.in.h; \
#       } > $@-t && \
#       mv $@-t $@
#
#    For these, you will need Sed commands like those used for
#    string.h, see below.
#
113 114 115 116 117 118 119
#  . If the recipe for generating a header file uses 'cat', replace it with
#
#      sed -e ''
#
#    (if needed; there's already an edit command that should take care of
#     this).
#
Eli Zaretskii's avatar
Eli Zaretskii committed
120
# The following Awk script is useful for editing portions of
Eli Zaretskii's avatar
Eli Zaretskii committed
121 122 123
# msdos/autogen/Makefile.in into Sed commands that define the
# corresponding variables to zero (which is what is required in the
# absolute majority of cases):
Eli Zaretskii's avatar
Eli Zaretskii committed
124 125 126
#
#   { printf "/^%s *=/s/%s/0/\n",$1,$3}
#
127
# ----------------------------------------------------------------------
128 129 130 131 132
# Replace @..@ constants.
/^\# @configure_input@/s!@configure_input@!lib/Makefile.  Generated from Makefile.in by config.bat!
/^@SET_MAKE@$/s/@SET_MAKE@//
/^VPATH *=/s/@[^@\n]*@/./
s/@PACKAGE@/emacs/
Eli Zaretskii's avatar
Eli Zaretskii committed
133 134
/^@BUILDING_FOR_WINDOWSNT_TRUE@/s/@[^@\n]*@/#/
/^@BUILDING_FOR_WINDOWSNT_FALSE@/s/@[^@\n]*@//
135 136 137
/^ALLOCA *=/s/@[^@\n]*@//
/^ALSA_CFLAGS *=/s/@[^@\n]*@//
/^ALSA_LIBS *=/s/@[^@\n]*@//
Eli Zaretskii's avatar
Eli Zaretskii committed
138 139
/^AR *=/s/@[^@\n]*@/ar/
/^ARFLAGS *=/s/@[^@\n]*@/cru/
140
/^AWK *=/s/@[^@\n]*@/gawk/
Eli Zaretskii's avatar
Eli Zaretskii committed
141
/^AUTO_DEPEND *=/s/@AUTO_DEPEND@/yes/
142
/^CANNOT_DUMP *=/s/@[^@\n]*@/no/
Eli Zaretskii's avatar
Eli Zaretskii committed
143
/^CC *=/s/@[^@\n]*@/gcc -std=gnu99/
144 145 146 147 148 149 150 151
/^CPP *=/s/@[^@\n]*@/gcc -e/
/^CPPFLAGS *=/s/@[^@\n]*@//
/^CCDEPMODE *=/s/@[^@\n]*@/depmode=gcc3/
/^CFLAGS *=/s/@[^@\n]*@/-g -O2/
/^CYGPATH_W *=/s/@[^@\n]*@//
/^CYGWIN_OBJ *=/s/@[^@\n]*@//
/^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
/^C_SWITCH_SYSTEM *=/s/@C_SWITCH_SYSTEM@//
152
/^GNUSTEP_CFLAGS *=/s/@GNUSTEP_CFLAGS@//
153
/^C_SWITCH_X_SITE *=/s/@C_SWITCH_X_SITE@//
Eli Zaretskii's avatar
Eli Zaretskii committed
154
/^PROFILING_CFLAGS *=/s/@PROFILING_CFLAGS@//
155
/^GNULIB_WARN_CFLAGS *=/s/@GNULIB_WARN_CFLAGS@//
Eli Zaretskii's avatar
Eli Zaretskii committed
156
/^HYBRID_MALLOC *=/s/@HYBRID_MALLOC@//
157 158
/^WARN_CFLAGS *=/s/@WARN_CFLAGS@//
/^WERROR_CFLAGS *=/s/@WERROR_CFLAGS@//
159
/^DEFS *=/s/@[^@\n]*@//
160 161 162
/^DEPDIR *=/s/@[^@\n]*@/deps/
/^ECHO_N *=/s/@[^@\n]*@/-n/
/^EXEEXT *=/s/@[^@\n]*@/.exe/
163
/^EXECINFO_H *=/s/@[^@\n]*@/execinfo.h/
164
/^GETOPT_H *=/s/@[^@\n]*@/getopt.h/
165 166 167 168 169 170 171
#
# Gnulib stuff
/^BITSIZEOF_PTRDIFF_T *=/s/@BITSIZEOF_PTRDIFF_T@/32/
/^BITSIZEOF_SIG_ATOMIC_T *=/s/@BITSIZEOF_SIG_ATOMIC_T@/32/
/^BITSIZEOF_SIZE_T *=/s/@BITSIZEOF_SIZE_T@/32/
/^BITSIZEOF_WCHAR_T *=/s/@BITSIZEOF_WCHAR_T@/16/
/^BITSIZEOF_WINT_T *=/s/@BITSIZEOF_WINT_T@/32/
172
/^APPLE_UNIVERSAL_BUILD *=/s/@APPLE_UNIVERSAL_BUILD@/0/
173
#
Eli Zaretskii's avatar
Eli Zaretskii committed
174
# Most GNULIB_* are replaced with zero even though DJGPP does not have
175 176
# these features.  That's because the gnulib replacements cannot
# possibly work for DJGPP, so we prefer to fail the link than have a
Eli Zaretskii's avatar
Eli Zaretskii committed
177 178
# subtly botched executable.  Those replacements that _are_ needed
# should be before the last catch-all rule.
179 180
/^GNULIB_ATOLL *=/s/@GNULIB_ATOLL@/1/
/^GNULIB_DUP3 *=/s/@GNULIB_DUP3@/1/
181
/^GNULIB_ENVIRON *=/s/@GNULIB_ENVIRON@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
182
/^GNULIB_FDATASYNC *=/s/@GNULIB_FDATASYNC@/1/
183
/^GNULIB_GETLOADAVG *=/s/@GNULIB_GETLOADAVG@/1/
184
/^GNULIB_GL_UNISTD_H_GETOPT *=/s/@GNULIB_GL_UNISTD_H_GETOPT@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
185 186
/^GNULIB_MEMRCHR *=/s/@GNULIB_MEMRCHR@/1/
/^GNULIB_MKOSTEMP *=/s/@GNULIB_MKOSTEMP@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
187
/^GNULIB_MKTIME *=/s/@GNULIB_MKTIME@/1/
188
/^GNULIB_TIME_R *=/s/@GNULIB_TIME_R@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
189
/^GNULIB_TIMEGM *=/s/@GNULIB_TIMEGM@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
190
/^GNULIB_TIME_RZ *=/s/@GNULIB_TIME_RZ@/1/
191
/^GNULIB_UNSETENV *=/s/@GNULIB_UNSETENV@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
192
/^GNULIB_[^ =]* *= *@/s/@[^@\n]*@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
193 194
/^GSETTINGS_CFLAGS *=/s/@[^@\n]*@//
/^GSETTINGS_LIBS *=/s/@[^@\n]*@//
Eli Zaretskii's avatar
Eli Zaretskii committed
195 196
#
# Edit the HAVE_foo variables
197 198
/^HAVE_ATOLL *=/s/@HAVE_ATOLL@/0/
/^HAVE_CHOWN *=/s/@HAVE_CHOWN@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
199
/^HAVE_CLOSEDIR *=/s/@HAVE_CLOSEDIR@/1/
200 201
/^HAVE_DECL_GETPAGESIZE *=/s/@HAVE_DECL_GETPAGESIZE@/1/
/^HAVE_DECL_SETENV *=/s/@HAVE_DECL_SETENV@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
202 203 204 205 206
/^HAVE_DECL_STRDUP *=/s/@HAVE_DECL_STRDUP@/1/
# The following two rely on msdos/inttypes.h redirections
/^HAVE_DECL_STRTOIMAX *=/s/@HAVE_DECL_STRTOIMAX@/1/
/^HAVE_DECL_STRTOUMAX *=/s/@HAVE_DECL_STRTOUMAX@/1/
/^HAVE_DIRENT_H *=/s/@HAVE_DIRENT_H@/1/
207 208 209 210 211 212
/^HAVE_DUP2 *=/s/@HAVE_DUP2@/1/
/^HAVE_FSYNC *=/s/@HAVE_FSYNC@/1/
/^HAVE_FTRUNCATE *=/s/@HAVE_FTRUNCATE@/1/
/^HAVE_GETHOSTNAME *=/s/@HAVE_GETHOSTNAME@/1/
/^HAVE_GETLOGIN *=/s/@HAVE_GETLOGIN@/1/
/^HAVE_GETPAGESIZE *=/s/@HAVE_GETPAGESIZE@/1/
213
/^HAVE_INTTYPES_H *=/s/@HAVE_INTTYPES_H@/HAVE_INTTYPES_H/
214
/^HAVE_LINK *=/s/@HAVE_LINK@/1/
215 216
/^HAVE_LONG_LONG_INT *=/s/@HAVE_LONG_LONG_INT@/1/
/^HAVE_LSTAT *=/s/@HAVE_LSTAT@/HAVE_LSTAT/
217
/^HAVE_MAKEINFO *=/s/@HAVE_MAKEINFO@/yes/
Eli Zaretskii's avatar
Eli Zaretskii committed
218
/^HAVE_MAX_ALIGN_T *=/s/@HAVE_MAX_ALIGN_T@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
219
/^HAVE_MEMCHR *=/s/@HAVE_MEMCHR@/1/
220 221
/^HAVE_MKFIFO *=/s/@HAVE_MKFIFO@/1/
/^HAVE_MKNOD *=/s/@HAVE_MKNOD@/1/
222
/^HAVE_MKSTEMP *=/s/@HAVE_MKSTEMP@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
223
/^HAVE_OPENDIR *=/s/@HAVE_OPENDIR@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
224 225 226
/^HAVE_PCLOSE *=/s/@HAVE_PCLOSE@/1/
/^HAVE_POPEN *=/s/@HAVE_POPEN@/1/
/^HAVE_POSIX_SIGNALBLOCKING *=/s/@HAVE_POSIX_SIGNALBLOCKING@/1/
227
/^HAVE_RANDOM_H *=/s/@HAVE_RANDOM_H@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
228
/^HAVE_RAISE *=/s/@HAVE_RAISE@/1/
229
/^HAVE_RANDOM *=/s/@HAVE_RANDOM@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
230 231
/^HAVE_READDIR *=/s/@HAVE_READDIR@/1/
/^HAVE_REWINDDIR *=/s/@HAVE_REWINDDIR@/1/
232
/^HAVE_SETENV *=/s/@HAVE_SETENV@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
233
/^HAVE_SIGACTION *=/s/@HAVE_SIGACTION@/1/
234 235
/^HAVE_SIGNED_SIG_ATOMIC_T *=/s/@HAVE_SIGNED_SIG_ATOMIC_T@/1/
/^HAVE_SIGNED_WINT_T *=/s/@HAVE_SIGNED_WINT_T@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
236
/^HAVE_SIGSET_T *=/s/@HAVE_SIGSET_T@/1/
237
/^HAVE_SLEEP *=/s/@HAVE_SLEEP@/1/
238
/^HAVE_STDINT_H *=/s/@HAVE_STDINT_H@/HAVE_STDINT_H/
Eli Zaretskii's avatar
Eli Zaretskii committed
239 240
/^HAVE_STRPBRK *=/s/@HAVE_STRPBRK@/1/
/^HAVE_STRSEP *=/s/@HAVE_STRSEP@/1/
241 242 243
/^HAVE_STRTOD *=/s/@HAVE_STRTOD@/1/
/^HAVE_STRTOLL *=/s/@HAVE_STRTOLL@/1/
/^HAVE_STRTOULL *=/s/@HAVE_STRTOULL@/1/
244
/^HAVE_STRUCT_TIMEVAL *=/s/@HAVE_STRUCT_TIMEVAL@/1/
245 246
/^HAVE_SYMLINK *=/s/@HAVE_SYMLINK@/1/
/^HAVE_SYS_PARAM_H *=/s/@HAVE_SYS_PARAM_H@/1/
247
/^HAVE_SYS_TIME_H *=/s/@HAVE_SYS_TIME_H@/1/
248
/^HAVE_SYS_TYPES_H *=/s/@HAVE_SYS_TYPES_H@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
249
/^HAVE_TIMEGM *=/s/@HAVE_TIMEGM@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
250
/^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T *=/s/@HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@/1/
251
/^HAVE_UNISTD_H *=/s/@HAVE_UNISTD_H@/1/
252
/^HAVE_UNSIGNED_LONG_LONG_INT *=/s/@HAVE_UNSIGNED_LONG_LONG_INT@/1/
253
/^HAVE_USLEEP *=/s/@HAVE_USLEEP@/1/
254
/^HAVE_WCHAR_H *=/s/@HAVE_WCHAR_H@/1/
255 256 257
/^HAVE_WCHAR_T *=/s/@HAVE_WCHAR_T@/1/
/^HAVE__BOOL *=/s/@HAVE__BOOL@/1/
/^HAVE__EXIT *=/s/@HAVE__EXIT@/1/
Eli Zaretskii's avatar
Eli Zaretskii committed
258
/^HAVE_[^ =]* *= *@/s/@[^@\n]*@/0/
259 260 261 262
/^INCLUDE_NEXT *=/s/@INCLUDE_NEXT@/include_next/
/^INCLUDE_NEXT_AS_FIRST_DIRECTIVE *=/s/@[^@\n]*@/include_next/
/^LDFLAGS *=/s/@[^@\n]*@//
/^LD_FIRSTFLAG *=/s/@[^@\n]*@//
Eli Zaretskii's avatar
Eli Zaretskii committed
263 264
/^LIB_PTHREAD *=/s/@[^@\n]*@//
/^LIB_PTHREAD_SIGMASK *=/s/@[^@\n]*@//
265 266
/^LIBS *=/s/@[^@\n]*@//
/^MAKEINFO *=/s/@MAKEINFO@/makeinfo/
267 268
# MKDIR_P lines are edited further below
/^MKDIR_P *=/s/@MKDIR_P@//
Eli Zaretskii's avatar
Eli Zaretskii committed
269 270 271
/^NEXT_AS_FIRST_DIRECTIVE_DIRENT_H *=/s/@[^@\n]*@/<dirent.h>/
/^NEXT_AS_FIRST_DIRECTIVE_ERRNO_H *=/s/@[^@\n]*@//
/^NEXT_AS_FIRST_DIRECTIVE_FCNTL_H *=/s/@[^@\n]*@/<fcntl.h>/
272
/^NEXT_AS_FIRST_DIRECTIVE_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
273
/^NEXT_AS_FIRST_DIRECTIVE_LIMITS_H *=/s/@[^@\n]*@/<limits.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
274
/^NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
275
/^NEXT_AS_FIRST_DIRECTIVE_STDDEF_H *=/s/@[^@\n]*@/<stddef.h>/
276
/^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
277
/^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
278
/^NEXT_AS_FIRST_DIRECTIVE_STDLIB_H *=/s/@[^@\n]*@/<stdlib.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
279
/^NEXT_AS_FIRST_DIRECTIVE_STRING_H *=/s/@[^@\n]*@/<string.h>/
280
/^NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H *=/s/@[^@\n]*@//
281
/^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H *=/s!@[^@\n]*@!<sys/stat.h>!
282
/^NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H *=/s/@[^@\n]*@//
283
/^NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H *=/s!@[^@\n]*@!<sys/types.h>!
284 285
/^NEXT_AS_FIRST_DIRECTIVE_TIME_H *=/s/@[^@\n]*@/<time.h>/
/^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
286 287 288
/^NEXT_DIRENT_H *=/s/@[^@\n]*@/<dirent.h>/
/^NEXT_ERRNO_H *=/s/@[^@\n]*@//
/^NEXT_FCNTL_H *=/s/@[^@\n]*@/<fcntl.h>/
289
/^NEXT_GETOPT_H *=/s/@[^@\n]*@/<getopt.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
290
/^NEXT_LIMITS_H *=/s/@[^@\n]*@/<limits.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
291
/^NEXT_SIGNAL_H *=/s/@[^@\n]*@/<signal.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
292
/^NEXT_STDDEF_H *=/s/@[^@\n]*@/<stddef.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
293
/^NEXT_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
294
/^NEXT_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
295
/^NEXT_STDLIB_H *=/s/@[^@\n]*@/<stdlib.h>/
Eli Zaretskii's avatar
Eli Zaretskii committed
296
/^NEXT_STRING_H *=/s/@[^@\n]*@/<string.h>/
297
/^NEXT_SYS_SELECT_H *=/s/@[^@\n]*@//
298
/^NEXT_SYS_STAT_H *=/s!@[^@\n]*@!<sys/stat.h>!
299
/^NEXT_SYS_TIME_H *=/s/@[^@\n]*@//
300
/^NEXT_SYS_TYPES_H *=/s!@[^@\n]*@!<sys/types.h>!
301 302 303 304
/^NEXT_TIME_H *=/s/@[^@\n]*@/<time.h>/
/^NEXT_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/
/^OBJEXT *=/s/@[^@\n]*@/o/
/^PRAGMA_COLUMNS *=/s/@[^@\n]*@//
305
/^PRAGMA_SYSTEM_HEADER *=/s/@[^@\n]*@/\\\#pragma GCC system_header/
306
/^PTHREAD_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/
307
/^PTRDIFF_T_SUFFIX *=/s/@[^@\n]*@//
308
/^RANLIB *=/s/@[^@\n]*@/ranlib/
Eli Zaretskii's avatar
Eli Zaretskii committed
309 310
/^REPLACE_MKTIME *=/s/@[^@\n]*@/1/
# We don't want any other gnulib replacement functions
Eli Zaretskii's avatar
Eli Zaretskii committed
311
/^REPLACE_[^ =]* *= *@/s/@[^@\n]*@/0/
312 313
/^SIG_ATOMIC_T_SUFFIX *=/s/@SIG_ATOMIC_T_SUFFIX@//
/^SIZE_T_SUFFIX *=/s/@SIZE_T_SUFFIX@/u/
Eli Zaretskii's avatar
Eli Zaretskii committed
314
/^ALLOCA_H *=/s/@[^@\n]*@/alloca.h/
Eli Zaretskii's avatar
Eli Zaretskii committed
315 316 317
/^BYTESWAP_H *=/s/@[^@\n]*@/byteswap.h/
/^DIRENT_H *=/s/@[^@\n]*@//
/^ERRNO_H *=/s/@[^@\n]*@//
318
/^EXECINFO_H *=/s/@[^@\n]*@/execinfo.h/
Eli Zaretskii's avatar
Eli Zaretskii committed
319 320
/^GETOPT_CDEFS_H *=/s/@[^@\n]*@/getopt-cdefs.h/
/^LIMITS_H *=/s/@[^@\n]*@/limits.h/
321
/^STDALIGN_H *=/s/@[^@\n]*@/stdalign.h/
Eli Zaretskii's avatar
Eli Zaretskii committed
322
/^STDDEF_H *=/s/@[^@\n]*@/stddef.h/
323
/^STDINT_H *=/s/@[^@\n]*@/stdint.h/
324 325 326 327
/^SYS_TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/
/^TIME_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/
/^UNISTD_H_HAVE_WINSOCK2_H *=/s/@[^@\n]*@/0/
/^UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS *=/s/@[^@\n]*@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
328
/^UNISTD_H_DEFINES_STRUCT_TIMESPEC *=/s/@[^@\n]*@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
329
/^UNDEFINE_STRTOK_R *=/s/@UNDEFINE_STRTOK_R@/0/
330 331
/^WCHAR_T_SUFFIX *=/s/@WCHAR_T_SUFFIX@/h/
/^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@//
332 333
/^WINDOWS_64_BIT_OFF_T *=/s/@WINDOWS_64_BIT_OFF_T@/0/
/^WINDOWS_64_BIT_ST_SIZE *=/s/@WINDOWS_64_BIT_ST_SIZE@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
334 335
/^WINDOWS_STAT_INODES *=/s/@WINDOWS_STAT_INODES@/0/
/^WINDOWS_STAT_TIMESPEC *=/s/@WINDOWS_STAT_TIMESPEC@/0/
Eli Zaretskii's avatar
Eli Zaretskii committed
336 337
# Tailor lists of files to what we need
/am__append_[1-9][0-9]* *=.*gettext\.h/s/@[^@\n]*@/\#/
338
/am__append_2 *=.*verify\.h/s/@[^@\n]*@//
Eli Zaretskii's avatar
Eli Zaretskii committed
339
/^@gl_GNULIB_ENABLED_tempname_TRUE@/s/@[^@\n]*@//
Eli Zaretskii's avatar
Eli Zaretskii committed
340
/^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/
Eli Zaretskii's avatar
Eli Zaretskii committed
341 342
/^am__append_[1-9][0-9]* *=/,/^[^ 	]/{
  s/ *inttypes\.h//
343 344 345
  s| *sys/select\.h||
  s| *sys/time\.h||
}
346 347
/^am_libgnu_a_OBJECTS *=/,/^[^ 	]/{
  s/allocator\.\$(OBJEXT) //
348
  s/careadlinkat\.\$(OBJEXT) //
Eli Zaretskii's avatar
Eli Zaretskii committed
349 350
  s/pipe2\.\$(OBJEXT) //
  s/acl-errno-valid\.\$(OBJEXT) //
Eli Zaretskii's avatar
Eli Zaretskii committed
351 352 353
  s/acl-internal\.\$(OBJEXT) //
  s/get-permissions\.\$(OBJEXT) //
  s/set-permissions\.\$(OBJEXT) //
Eli Zaretskii's avatar
Eli Zaretskii committed
354 355 356
  s/qcopy-acl\.\$(OBJEXT) //
  s/openat-die\.\$(OBJEXT) //
  s/save-cwd\.\$(OBJEXT) //
357
}
358 359
/^srcdir *=/s/@[^@\n]*@/./
/^top_srcdir *=/s/@[^@\n]*@/../
360 361 362
/^top_builddir *=/s/@[^@\n]*@/../
s/@PRAGMA_SYSTEM_HEADER@/\#pragma GCC system_header/
s/@PRAGMA_COLUMNS@//
Eli Zaretskii's avatar
Eli Zaretskii committed
363 364 365 366
/^SYSTEM_TYPE *=/s/@SYSTEM_TYPE@/msdos/
/^ifneq (\$(SYSTEM_TYPE),windows-nt)/,/^endif/d
/^DEPDIR *=/a\
AUTO_DEPEND = yes
367 368
#
# Delete the recipes we don't want to get in our way.
Eli Zaretskii's avatar
Eli Zaretskii committed
369 370
/^\.\.\/config.status:/,/^Makefile:/c\
Makefile: $(srcdir)/Makefile.in
371 372
#
# Remove the dependencies on $(top_builddir)/config.status
Eli Zaretskii's avatar
Eli Zaretskii committed
373 374
s/ \.\.\/config.status//
s/ \$(top_builddir)\/config.status//
375 376 377 378 379 380 381
#
# Fix the include-dependency lines
s/^@AMDEP_TRUE@//
s/^@AMDEP_FALSE@/\#/
s/@am__include@/include/
s/@am__quote@//g
s/^@am__fastdepCC_TRUE@//
382
s/^@am__fastdepCC_FALSE@/\#/
383 384 385 386
#
# Fix the *-clean rules, to not use a Unixy `test' command.  Empty
# lists are replaced with a dummy file, to avoid an error message from
# "rm -f" with no arguments.
Eli Zaretskii's avatar
Eli Zaretskii committed
387 388
/^CLEANFILES *= *$/c\
CLEANFILES = xyzzy
389 390 391 392
/^CONFIG_CLEAN_FILES *= *$/c\
CONFIG_CLEAN_FILES = xyzzy
/^CONFIG_CLEAN_VPATH_FILES *= *$/c\
CONFIG_CLEAN_VPATH_FILES = xyzzy
393
s/^	-*test -z.*|| rm/	 -rm/
Eli Zaretskii's avatar
Eli Zaretskii committed
394
s/@echo /@djecho /
395
#
Eli Zaretskii's avatar
Eli Zaretskii committed
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
# Determine which headers to generate
s/= @GL_GENERATE_ALLOCA_H@/= 1/
s/= @GL_GENERATE_BYTESWAP_H@/= 1/
s/= @GL_GENERATE_EXECINFO_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@/= /
#
# Determine which modules to build and which to omit
/^noinst_LIBRARIES /a\
OMIT_GNULIB_MODULE_acl-permissions = true\
OMIT_GNULIB_MODULE_allocator = true\
OMIT_GNULIB_MODULE_at-internal = true\
OMIT_GNULIB_MODULE_careadlinkat = true\
OMIT_GNULIB_MODULE_cloexec = true\
OMIT_GNULIB_MODULE_dirent = true\
OMIT_GNULIB_MODULE_dirfd = true\
OMIT_GNULIB_MODULE_dup2 = true\
OMIT_GNULIB_MODULE_errno = true\
OMIT_GNULIB_MODULE_euidaccess = true\
OMIT_GNULIB_MODULE_faccessat = true\
OMIT_GNULIB_MODULE_fcntl = true\
OMIT_GNULIB_MODULE_fdopendir = true\
OMIT_GNULIB_MODULE_fstatat = true\
OMIT_GNULIB_MODULE_fsync = true\
OMIT_GNULIB_MODULE_getdtablesize = true\
OMIT_GNULIB_MODULE_getgroups = true\
OMIT_GNULIB_MODULE_gettimeofday = true\
OMIT_GNULIB_MODULE_group-member = true\
OMIT_GNULIB_MODULE_inttypes-incomplete = true\
OMIT_GNULIB_MODULE_localtime-buffer = true\
OMIT_GNULIB_MODULE_lstat = true\
OMIT_GNULIB_MODULE_open = true\
OMIT_GNULIB_MODULE_pipe2 = true\
OMIT_GNULIB_MODULE_pselect = true\
OMIT_GNULIB_MODULE_putenv = true\
OMIT_GNULIB_MODULE_qcopy-acl = true\
OMIT_GNULIB_MODULE_readlink = true\
OMIT_GNULIB_MODULE_readlinkat = true\
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
443
/^arg-nonnull\.h:/,/^[ 	][ 	]*mv /c\
444 445
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 > $@
446
/^cxxdefs\.h:/,/^[ 	][ 	]*mv /c\
447 448
cxxdefs.h: $(top_srcdir)/build-aux/snippet/cxxdefs.h\
	sed -n -e '/_GL_CXXDEFS/,$$p' < $(top_srcdir)/build-aux/snippet/cxxdefs.h > $@
Eli Zaretskii's avatar
Eli Zaretskii committed
449 450 451
/^warn-on-use\.h:/,/^[ 	][ 	]*mv /c\
warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h\
	sed -n -e '/^.ifndef/,$$p' < $(top_srcdir)/build-aux/snippet/warn-on-use.h > $@
452
s/^	[ 	]*{ echo \(.*\); \\/	 djecho \1 > $@-t/
453
s/^	[ 	]*{ echo \(.*\) && \\/	 djecho \1 > $@-t/
454
s/^	[ 	]*cat \(.*\); \\/	 sed -e '' \1 >> $@-t/
Eli Zaretskii's avatar
Eli Zaretskii committed
455
s/^          sed -e/	  sed -e/
456
s/ \&\& \\ *$//
457 458
s/\.in-h\;  *\\$/.in-h >> $@-t/
/^	[ 	]*} /d
459 460 461
/^stdio\.h:/,/^	[ 	]*mv /{
  s/'\; \\ *$/' >> $@-t/
}
462 463 464 465 466 467
/^stdlib\.h:/,/^	[ 	]*mv /{
  s/'\; \\ *$/' >> $@-t/
}
/^unistd\.h:/,/^	[ 	]*mv /{
  s/'\; \\ *$/' >> $@-t/
}
Eli Zaretskii's avatar
Eli Zaretskii committed
468 469 470 471
/^string\.h:/,/^	[ 	]*mv /{
  s/'\; \\ *$/' >> $@-t/
  /< \$(srcdir)\/string\.in-h >>/d
}
Eli Zaretskii's avatar
Eli Zaretskii committed
472
s!\$(MKDIR_P)[ 	][ 	]*sys!command.com /c "if not exist sys\\stat.h md sys"!
473 474 475
/^	@for dir in/,/^[^	 ]/c\
	-rm -rf $(MOSTLYCLEANDIRS)
/^	 *-test . /d
Eli Zaretskii's avatar
Eli Zaretskii committed
476 477 478 479 480
#
# Fix the Automake verbosity stuff
/^	 *\$(AM_V_at)/s/\$(AM_V_at)//
/^	 *\$(AM_V_AR)/s/\$(AM_V_AR)//
/^	 *\$(AM_V_CC)/s/\$(AM_V_CC)//