Home | History | Annotate | Line # | Download | only in librumpuser
configure.ac revision 1.1
      1 #
      2 # Rump kernel POSIX hypervisor autoconf support.
      3 #
      4 # NOTE!  regen by doing the following
      5 #   1) autoreconf -iv
      6 #   2) edit rumpuser_port.h (search for RUMPUSER_CONFIG for instructions)
      7 #   3) rm -rf autom4te.cache
      8 #   4) commit to NetBSD, pullup to repo.rumpkernel.org
      9 #
     10 
     11 AC_PREREQ([2.66])
     12 AC_INIT([rumpuser-posix], [999], [http://rumpkernel.org/])
     13 
     14 AC_CONFIG_HEADERS([rumpuser_config.h])
     15 AC_CONFIG_AUX_DIR([build-aux])
     16 AC_CONFIG_MACRO_DIR([m4])
     17 
     18 AC_LANG([C])
     19 
     20 AC_SYS_LARGEFILE
     21 
     22 AC_CHECK_HEADERS([sys/cdefs.h sys/param.h sys/sysctl.h sys/disk.h \
     23 	sys/disklabel.h sys/dkio.h sys/atomic.h paths.h])
     24 
     25 AC_CANONICAL_TARGET
     26 
     27 AC_CHECK_TYPES([clockid_t, register_t])
     28 
     29 AC_CHECK_FUNCS([kqueue chflags strsuftoll setprogname getprogname	\
     30 	clock_gettime getenv_r posix_memalign memalign aligned_alloc	\
     31 	arc4random_buf getsubopt fsync_range __quotactl])
     32 
     33 AC_TRY_LINK_FUNC([clock_nanosleep],,
     34         AC_CHECK_LIB([rt], [clock_nanosleep])
     35 )
     36 AC_TRY_LINK_FUNC([clock_gettime],,
     37         AC_CHECK_LIB([rt], [clock_gettime])
     38 )
     39 AC_CHECK_LIB([dl], [dlinfo],
     40 	AC_DEFINE([HAVE_DLINFO], 1, [dlinfo]),
     41 	AC_TRY_LINK_FUNC([dlinfo], AC_DEFINE([HAVE_DLINFO], 1, [dlinfo])))
     42 
     43 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len],,,[#include <netinet/in.h>])
     44 
     45 dnl
     46 dnl pthread_setname() sillyness is a bit longer; we need the signature
     47 dnl
     48 SAVE_CFLAGS="${CFLAGS}"
     49 CFLAGS="${SAVE_CFLAGS} -Werror"
     50 SAVE_LIBS="${LIBS}"
     51 LIBS="${LIBS} -lpthread"
     52 AC_MSG_CHECKING([for two-argument pthread_setname_np()])
     53 AC_COMPILE_IFELSE(
     54 	[AC_LANG_PROGRAM(
     55 		[[#define _GNU_SOURCE
     56 		  #include <pthread.h>]],
     57 		[[pthread_t pt;]
     58 		[pthread_setname_np(pt, "x");return 0;]])
     59 	],[
     60 		AC_MSG_RESULT([yes])
     61 		AC_DEFINE(HAVE_PTHREAD_SETNAME2, [1],
     62 		    [Define to 1 if you have 2-arg pthread_setname_np()])
     63 	],[
     64 		AC_MSG_RESULT([no])
     65 ])
     66 AC_MSG_CHECKING([for three-argument pthread_setname_np()])
     67 AC_COMPILE_IFELSE(
     68 	[AC_LANG_PROGRAM(
     69 		[[#define _GNU_SOURCE
     70 		  #include <pthread.h>]],
     71 		[[pthread_t pt;]
     72 		[pthread_setname_np(pt, "X", (void *)0);return 0;]])
     73 	],[
     74 		AC_MSG_RESULT([yes])
     75 		AC_DEFINE(HAVE_PTHREAD_SETNAME3, [1],
     76 		    [Define to 1 if you have 3-arg pthread_setname_np()])
     77 	],[
     78 		AC_MSG_RESULT([no])
     79 ])
     80 LIBS="${SAVELIBS}"
     81 
     82 AC_MSG_CHECKING([for ioctl cmd being int])
     83 AC_COMPILE_IFELSE(
     84 	[AC_LANG_PROGRAM(
     85 		[[#include <sys/ioctl.h>
     86 		  #include <unistd.h>
     87 		  int ioctl(int fd, int, ...);]],
     88 		[[]
     89 		[return 0;]])
     90 	],[
     91 		AC_MSG_RESULT([yes])
     92 		AC_DEFINE(HAVE_IOCTL_CMD_INT, [1],
     93 		    [Define to 1 if ioctl()'s cmd arg is int])
     94 	],[
     95 		AC_MSG_RESULT([no])
     96 ])
     97 CFLAGS="${SAVE_CFLAGS}"
     98 
     99 AC_OUTPUT
    100