1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

Remove special logic for the obscure CMU C library's libc.h

* acinclude.m4 (GUILE_HEADER_LIBC_WITH_UNISTD): removed
* configure.ac: remove GUILE_HEADER_LIBC_WITH_UNISTD, don't check for libc.h
* libguile/filesys.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion
* libguile/posix.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion
This commit is contained in:
Mike Gran 2022-09-15 14:50:32 -07:00
parent df8e772f3c
commit e9db8a29e4
4 changed files with 1 additions and 56 deletions

View file

@ -44,51 +44,6 @@ struct utime blah;
fi]) fi])
dnl
dnl Apparently, at CMU they have a weird version of libc.h that is
dnl installed in /usr/local/include and conflicts with unistd.h.
dnl In these situations, we should not #include libc.h.
dnl This test arranges to #define LIBC_H_WITH_UNISTD_H iff libc.h is
dnl present on the system, and is safe to #include.
dnl
AC_DEFUN([GUILE_HEADER_LIBC_WITH_UNISTD],
[
AC_CHECK_HEADERS(libc.h unistd.h)
AC_CACHE_CHECK(
[whether libc.h and unistd.h can be included together],
guile_cv_header_libc_with_unistd,
[
if test "$ac_cv_header_libc_h" = "no"; then
guile_cv_header_libc_with_unistd="no"
elif test "$ac_cv_header_unistd_h" = "no"; then
guile_cv_header_libc_with_unistd="yes"
else
AC_TRY_COMPILE(
[
# include <libc.h>
# include <unistd.h>
],
[],
[guile_cv_header_libc_with_unistd=yes],
[guile_cv_header_libc_with_unistd=no]
)
fi
]
)
if test "$guile_cv_header_libc_with_unistd" = yes; then
AC_DEFINE([LIBC_H_WITH_UNISTD_H], 1,
[Define this if we should include <libc.h> when we've already
included <unistd.h>. On some systems, they conflict, and libc.h
should be omitted. See GUILE_HEADER_LIBC_WITH_UNISTD in
aclocal.m4.])
fi
]
)
dnl This is needed when we want to check for the same function repeatedly dnl This is needed when we want to check for the same function repeatedly
dnl with other parameters, such as libraries, varying. dnl with other parameters, such as libraries, varying.
dnl dnl

View file

@ -417,7 +417,7 @@ AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
# sched.h - missing on MinGW # sched.h - missing on MinGW
# sys/sendfile.h - non-POSIX, found in glibc # sys/sendfile.h - non-POSIX, found in glibc
# #
AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h memory.h process.h \ AC_CHECK_HEADERS([complex.h fenv.h io.h memory.h process.h \
sys/dir.h sys/ioctl.h sys/select.h \ sys/dir.h sys/ioctl.h sys/select.h \
sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \ sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
sys/utime.h unistd.h utime.h pwd.h grp.h sys/utsname.h \ sys/utime.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
@ -443,8 +443,6 @@ AC_CHECK_TYPE(socklen_t, ,
AC_CHECK_TYPES([struct ip_mreq], , , [#include <netinet/in.h>]) AC_CHECK_TYPES([struct ip_mreq], , , [#include <netinet/in.h>])
GUILE_HEADER_LIBC_WITH_UNISTD
AC_TYPE_GETGROUPS AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_TYPE_MODE_T AC_TYPE_MODE_T

View file

@ -58,10 +58,6 @@
#endif #endif
#include <time.h> #include <time.h>
#ifdef LIBC_H_WITH_UNISTD_H
#include <libc.h>
#endif
#ifdef HAVE_PWD_H #ifdef HAVE_PWD_H
#include <pwd.h> #include <pwd.h>
#endif #endif

View file

@ -42,10 +42,6 @@
#endif #endif
#include <time.h> #include <time.h>
#ifdef LIBC_H_WITH_UNISTD_H
# include <libc.h>
#endif
#ifdef HAVE_PWD_H #ifdef HAVE_PWD_H
# include <pwd.h> # include <pwd.h>
#endif #endif