From 29dd9d1e90c8ccefa2f8bdc6463694edc3a909d7 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 31 Dec 2007 14:36:48 -0500 Subject: [PATCH] Test for sys/syscall.h in configure to fix dietlibc build problem When compiling with dietlibc, sys/syscall.h isn't supported; as of dietlibc 0.30, it exists but it references a non-existent asm/unistd.h header file. So we have to test for its existence and avoid using it in lib/uuid/gen_uuid.c if it is not supported. Signed-off-by: "Theodore Ts'o" --- configure | 3 ++- configure.in | 2 +- lib/uuid/gen_uuid.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 8b88bcd..8ecc41a 100755 --- a/configure +++ b/configure @@ -11589,7 +11589,8 @@ fi -for ac_header in stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if_dl.h netinet/in.h utime.h + +for ac_header in stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h sys/syscall.h net/if_dl.h netinet/in.h utime.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then diff --git a/configure.in b/configure.in index d337a24..16bab32 100644 --- a/configure.in +++ b/configure.in @@ -611,7 +611,7 @@ if test $cross_compiling = no; then else AC_CHECK_PROGS(BUILD_CC, gcc cc) fi -AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if_dl.h netinet/in.h utime.h) +AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h stdint.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mman.h sys/mkdev.h sys/prctl.h sys/queue.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h sys/syscall.h net/if_dl.h netinet/in.h utime.h) AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,, [[ #if HAVE_SYS_QUEUE_H diff --git a/lib/uuid/gen_uuid.c b/lib/uuid/gen_uuid.c index 892f6e2..78fb336 100644 --- a/lib/uuid/gen_uuid.c +++ b/lib/uuid/gen_uuid.c @@ -72,7 +72,7 @@ #ifdef HAVE_NET_IF_DL_H #include #endif -#ifdef __linux__ +#if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H) #include #endif -- 1.8.3.1