Better portability patch for systems that don't define SYS_NMLN.
This commit is contained in:
@@ -76,6 +76,42 @@ AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h unistd.h)
|
||||
AC_CHECK_HEADERS(curses.h ncurses.h)
|
||||
|
||||
dnl Check for particular preprocessor macros
|
||||
|
||||
dnl Checking if sys/utsname.h is present and defines SYS_NMLN or _SYS_NAMELEN
|
||||
AC_CHECK_HEADER(sys/utsname.h,
|
||||
|
||||
AC_MSG_CHECKING(if sys/utsname.h defines SYS_NMLN)
|
||||
AC_TRY_RUN([[
|
||||
#include <sys/utsname.h>
|
||||
int main() {
|
||||
char kver[SYS_NMLN];
|
||||
return 0;
|
||||
}
|
||||
]], [
|
||||
dnl then
|
||||
AC_DEFINE(HAVE_SYS_NMLN)
|
||||
AC_MSG_RESULT(yes) ], [
|
||||
dnl else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_CHECKING(if sys/utsname.h defines _SYS_NAMELEN)
|
||||
AC_TRY_RUN([[
|
||||
#include <sys/utsname.h>
|
||||
int main() {
|
||||
char kver[_SYS_NAMELEN];
|
||||
return 0;
|
||||
}
|
||||
]], [
|
||||
dnl then
|
||||
AC_DEFINE(HAVE__SYS_NAMELEN)
|
||||
AC_MSG_RESULT(yes) ], [
|
||||
dnl else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN([sys/utsname.h does not define SYS_NMLN or _SYS_NAMELEN])],[:])
|
||||
],[:])
|
||||
|
||||
, [AC_MSG_WARN([LCDproc client requires sys/utsname.h.])])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
|
||||
Reference in New Issue
Block a user