Move libgen.h out of IPC conditional code since it is not related directly to IPC; adjust IPC configuration so that IPC support is auto-disabled if the relevant header files or library functions are missing.

This commit is contained in:
Andrew Wood
2023-08-28 17:44:53 +01:00
parent 65eac50c21
commit 0bd1b82d3a
5 changed files with 24 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = subdir-objects no-dependencies
AUTOMAKE_OPTIONS = subdir-objects
SUBDIRS = po
+11 -1
View File
@@ -24,6 +24,7 @@ AC_CHECK_FUNCS([fpathconf sysconf posix_memalign posix_fadvise])
AC_CHECK_HEADERS([limits.h])
AC_CHECK_HEADERS([wctype.h])
AC_CHECK_HEADERS([termios.h])
AC_CHECK_HEADERS([libgen.h])
AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([libintl.h locale.h])
AH_BOTTOM([#include "config-aux.h"])
@@ -78,7 +79,16 @@ yes
], [LIBS="$LIBS -lc128"])
if test "$IPC_SUPPORT" = "yes"; then
AC_CHECK_HEADERS([sys/ipc.h sys/param.h libgen.h])
AC_CHECK_HEADERS([sys/ipc.h], [], [IPC_SUPPORT=no])
AC_CHECK_HEADERS([sys/msg.h], [], [IPC_SUPPORT=no])
AC_CHECK_HEADERS([sys/param.h])
if test "$IPC_SUPPORT" = "yes"; then
AC_CHECK_FUNCS([msgget], [], [IPC_SUPPORT=no])
fi
fi
if test "$IPC_SUPPORT" = "yes"; then
AC_DEFINE([HAVE_IPC], [1], [IPC support enabled])
fi
if test "$SPLICE_SUPPORT" = "yes"; then
-5
View File
@@ -22,11 +22,6 @@
# define N_(String) (String)
#endif
#undef HAVE_IPC
#ifdef HAVE_SYS_IPC_H
#define HAVE_IPC 1
#endif
#undef CURSOR_ANSWERBACK_BYTE_BY_BYTE
#ifndef _AIX
#define CURSOR_ANSWERBACK_BYTE_BY_BYTE 1
+9
View File
@@ -43,6 +43,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* IPC support enabled */
#undef HAVE_IPC
/* Define to 1 if you have the <libgen.h> header file. */
#undef HAVE_LIBGEN_H
@@ -61,6 +64,9 @@
/* Define to 1 if you have the <minix/config.h> header file. */
#undef HAVE_MINIX_CONFIG_H
/* Define to 1 if you have the `msgget' function. */
#undef HAVE_MSGGET
/* Define to 1 if you have the `posix_fadvise' function. */
#undef HAVE_POSIX_FADVISE
@@ -100,6 +106,9 @@
/* Define to 1 if you have the <sys/ipc.h> header file. */
#undef HAVE_SYS_IPC_H
/* Define to 1 if you have the <sys/msg.h> header file. */
#undef HAVE_SYS_MSG_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+3 -1
View File
@@ -35,10 +35,12 @@
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#endif /* HAVE_IPC */
/* for basename() */
#ifdef HAVE_LIBGEN_H
#include <libgen.h>
#endif
#endif /* HAVE_IPC */
/*