1: #
2: # $Author: misho $
3: # $Id: configure.in,v 1.45.2.1 2013/11/22 15:09:55 misho Exp $
4: #
5: AC_INIT(libaitio, 6.3, misho@elwix.org)
6: AC_CONFIG_SRCDIR([src/aitio.c])
7: AC_CONFIG_HEADERS([inc/config.h])
8:
9: ac_cv_func_malloc_0_nonnull="yes"
10: ac_cv_func_realloc_0_nonnull="yes"
11:
12: # Checks for programs.
13: AC_PROG_CC
14: AC_PROG_INSTALL
15:
16: AC_CANONICAL_HOST
17: AC_CANONICAL_TARGET
18:
19: AC_CHECK_TOOL(MKDEP, mkdep, no)
20: AC_SUBST(MKDEP)
21:
22: CFLAGS="-Wall -O2 -fPIC -I/usr/local/include ${CFLAGS}"
23: LDFLAGS="-L/usr/local/lib ${LDFLAGS}"
24:
25: AC_CHECK_LIB([crypto], [EVP_CipherInit_ex])
26: AC_CHECK_LIB([pthread], [pthread_mutex_init])
27: AC_CHECK_LIB([util], [forkpty])
28: AC_CHECK_LIB([rt], [aio_read])
29: AC_CHECK_LIB([elwix], [crcFletcher16])
30: AC_CHECK_LIB([aitsched], [schedRead])
31:
32: # Checks for header files.
33: AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h termios.h unistd.h])
34:
35: # Checks for typedefs, structures, and compiler characteristics.
36: AC_C_INLINE
37:
38: # Checks for library functions.
39: AC_FUNC_MMAP
40: AC_CHECK_FUNCS([bzero memset munmap])
41: AC_CHECK_FUNCS([pthread_create pthread_exit])
42: AC_CHECK_FUNCS([shm_open shm_unlink])
43:
44: # It's stupid, but not all platforms have union semun, even those that need it.
45: AC_MSG_CHECKING(looking for union semun in sys/sem.h)
46: AC_TRY_COMPILE([
47: #include <sys/types.h>
48: #include <sys/ipc.h>
49: #include <sys/sem.h>
50: ],[
51: union semun arg;
52: semctl(0, 0, 0, arg);
53: ], [
54: AC_DEFINE(HAVE_UNION_SEMUN,, [union semun])
55: ] msg=yes, msg=no )
56: AC_MSG_RESULT([$msg])
57:
58: DEBUG=no
59: AC_MSG_CHECKING(Debug Build)
60: AC_ARG_ENABLE(debug,
61: [ --enable-debug Build library with debug information and additional messages],
62: [ DEBUG=$enableval
63: case "$enableval" in
64: yes)
65: CFLAGS="-g ${CFLAGS}"
66: ;;
67: *)
68: AC_DEFINE(NDEBUG,, [Build w/o assert() support])
69: ;;
70: esac ],)
71: AC_MSG_RESULT($DEBUG)
72:
73: AIO=no
74: AC_MSG_CHECKING(AIO Build)
75: AC_ARG_ENABLE(aio,
76: [ --enable-aio Build library with AIO operations ],
77: [ AIO=$enableval
78: case "$enableval" in
79: yes)
80: AC_DEFINE(AIO_OPS,, [Build library with AIO operations])
81: ;;
82: *)
83: ;;
84: esac ],)
85: AC_MSG_RESULT($AIO)
86:
87: AC_CONFIG_FILES([Makefile
88: inc/Makefile
89: lib/Makefile
90: src/Makefile])
91: AC_OUTPUT
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>