4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-28 03:27:46 +08:00

configury: define HAVE_REGEX_FILES

Allow to specify if the regex files in newlib/libc/posix are built
or not.  Cygein is about to switch to MUSL regex, and the BSD regex
files collide with the definitions in MUSL's regex.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2023-03-01 21:18:58 +01:00
parent c553a95243
commit 9ac8084ec1
6 changed files with 431 additions and 376 deletions

File diff suppressed because it is too large Load Diff

29
newlib/configure vendored
View File

@ -809,6 +809,8 @@ HAVE_LIBC_SYS_AMDGCN_DIR_FALSE
HAVE_LIBC_SYS_AMDGCN_DIR_TRUE
HAVE_LIBC_SYS_A29KHIF_DIR_FALSE
HAVE_LIBC_SYS_A29KHIF_DIR_TRUE
HAVE_REGEX_FILES_FALSE
HAVE_REGEX_FILES_TRUE
HAVE_UNIX_DIR_FALSE
HAVE_UNIX_DIR_TRUE
HAVE_SYSCALL_DIR_FALSE
@ -938,6 +940,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -1049,6 +1052,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1301,6 +1305,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1438,7 +1451,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1591,6 +1604,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -5346,6 +5360,15 @@ else
fi
if test x${regex_files} != x; then
HAVE_REGEX_FILES_TRUE=
HAVE_REGEX_FILES_FALSE='#'
else
HAVE_REGEX_FILES_TRUE='#'
HAVE_REGEX_FILES_FALSE=
fi
if test "${sys_dir}" = a29khif; then
HAVE_LIBC_SYS_A29KHIF_DIR_TRUE=
HAVE_LIBC_SYS_A29KHIF_DIR_FALSE='#'
@ -7517,6 +7540,10 @@ if test -z "${HAVE_UNIX_DIR_TRUE}" && test -z "${HAVE_UNIX_DIR_FALSE}"; then
as_fn_error $? "conditional \"HAVE_UNIX_DIR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_REGEX_FILES_TRUE}" && test -z "${HAVE_REGEX_FILES_FALSE}"; then
as_fn_error $? "conditional \"HAVE_REGEX_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBC_SYS_A29KHIF_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_A29KHIF_DIR_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBC_SYS_A29KHIF_DIR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View File

@ -43,6 +43,8 @@
# stdio64_dir "stdio64" to build libc/stdio64, "" otherwise
# syscall_dir "syscalls" to build libc/syscalls, "" otherwise
# unix_dir "unix" to build libc/unix, "" otherwise
# regex_files "regex" to build libc/psoix/reg*.c, "" otherwise
# Set by default. Requires posix_dir to be set.
# lpfx library object prefix - generated when no libtool
# crt1 name of crt1 object if one is provided
# crt1_dir directory where crt1 object is found
@ -63,6 +65,7 @@ stdio64_dir=
xdr_dir=
syscall_dir=
unix_dir=
regex_files=regex
noinclude=
mach_add_setjmp=
crt1=
@ -421,6 +424,7 @@ fi
case "${host}" in
*-*-cygwin*)
posix_dir=posix
regex_files= # newlib's BSD regex collides with Cygwin's MUSL regex
xdr_dir=xdr
;;
*-*-netware*)

View File

@ -10,6 +10,10 @@ AM_CONDITIONAL(HAVE_XDR_DIR, test x${xdr_dir} != x)
AM_CONDITIONAL(HAVE_SYSCALL_DIR, test x${syscall_dir} != x)
AM_CONDITIONAL(HAVE_UNIX_DIR, test x${unix_dir} != x)
dnl Cygwin doesn't want the regex functions in the posix dir,
dnl so we need a way to define this. Requires posix_dir.
AM_CONDITIONAL(HAVE_REGEX_FILES, test x${regex_files} != x)
dnl We always recur into sys and machine, and let them decide what to do.
m4_foreach_w([SYS_DIR], [
a29khif amdgcn arm

View File

@ -4,10 +4,14 @@ libc_a_SOURCES += \
%D%/closedir.c %D%/collate.c %D%/collcmp.c %D%/creat.c %D%/dirfd.c \
%D%/fnmatch.c %D%/glob.c %D%/_isatty.c %D%/isatty.c \
%D%/opendir.c %D%/readdir.c %D%/readdir_r.c \
%D%/regcomp.c %D%/regerror.c %D%/regexec.c %D%/regfree.c \
%D%/rewinddir.c %D%/sleep.c %D%/usleep.c \
%D%/telldir.c %D%/ftw.c %D%/nftw.c
if HAVE_REGEX_FILES
libc_a_SOURCES += \
%D%/regcomp.c %D%/regerror.c %D%/regexec.c %D%/regfree.c
endif
%C%_ELIX_2_SOURCES = \
%D%/scandir.c %D%/seekdir.c

View File

@ -375,6 +375,9 @@
/* nano version of malloc is used. */
#undef _NANO_MALLOC
/* "The newlib version in string format." */
#undef _NEWLIB_VERSION
/* Verify _REENT_CHECK macros allocate memory successfully. */
#undef _REENT_CHECK_VERIFY
@ -422,4 +425,13 @@
/* Define if wide char orientation is supported. */
#undef _WIDE_ORIENT
/* "The newlib minor version number." */
#undef __NEWLIB_MINOR__
/* "The newlib patch level." */
#undef __NEWLIB_PATCHLEVEL__
/* "The newlib major version number." */
#undef __NEWLIB__
#endif /* !__NEWLIB_H__ */