1: #
2: # $Author: misho $
3: # $Id: configure.in,v 1.39.2.1 2013/08/20 22:20:52 misho Exp $
4: #
5: AC_INIT(libaitio, 5.7, 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:
31: # Checks for header files.
32: AC_CHECK_HEADERS([stdlib.h string.h sys/ioctl.h termios.h unistd.h])
33:
34: # Checks for typedefs, structures, and compiler characteristics.
35: AC_C_INLINE
36:
37: # Checks for library functions.
38: AC_FUNC_MMAP
39: AC_CHECK_FUNCS([bzero memset munmap])
40: AC_CHECK_FUNCS([pthread_create pthread_exit])
41: AC_CHECK_FUNCS([shm_open shm_unlink])
42:
43: # It's stupid, but not all platforms have union semun, even those that need it.
44: AC_MSG_CHECKING(looking for union semun in sys/sem.h)
45: AC_TRY_COMPILE([
46: #include <sys/types.h>
47: #include <sys/ipc.h>
48: #include <sys/sem.h>
49: ],[
50: union semun arg;
51: semctl(0, 0, 0, arg);
52: ], [
53: AC_DEFINE(HAVE_UNION_SEMUN,, [union semun])
54: ] msg=yes, msg=no )
55: AC_MSG_RESULT([$msg])
56:
57: DEBUG=no
58: AC_MSG_CHECKING(Debug Build)
59: AC_ARG_ENABLE(debug,
60: [ --enable-debug Build library with debug information and additional messages],
61: [ DEBUG=$enableval
62: case "$enableval" in
63: yes)
64: CFLAGS="-g ${CFLAGS}"
65: ;;
66: *)
67: AC_DEFINE(NDEBUG,, [Build w/o assert() support])
68: ;;
69: esac ],)
70: AC_MSG_RESULT($DEBUG)
71:
72: AIO=no
73: AC_MSG_CHECKING(AIO Build)
74: AC_ARG_ENABLE(aio,
75: [ --enable-aio Build library with AIO operations ],
76: [ AIO=$enableval
77: case "$enableval" in
78: yes)
79: AC_DEFINE(AIO_OPS,, [Build library with AIO operations])
80: ;;
81: *)
82: ;;
83: esac ],)
84: AC_MSG_RESULT($AIO)
85:
86: AC_CONFIG_FILES([Makefile
87: inc/Makefile
88: lib/Makefile
89: src/Makefile])
90: AC_OUTPUT
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>