Annotation of embedaddon/istgt/configure.in, revision 1.1.1.1
1.1 misho 1: # -*- Autoconf -*-
2: # Process this file with autoconf to produce a configure script.
3:
4: AC_PREREQ(2.62)
5: AC_INIT(istgt, 0.4)
6: AC_CONFIG_SRCDIR([src/istgt.c])
7: AC_CONFIG_HEADERS([src/config.h])
8:
9: # Checks for programs.
10: AC_PROG_CC
11: AC_PROG_INSTALL
12: AC_PROG_RANLIB
13: AC_PROG_SED
14:
15: # Checks for libraries.
16: AC_CHECK_LIB([pthread], [pthread_create])
17: AC_CHECK_LIB([crypto], [MD5_Update])
18: AC_CHECK_LIB([cam], [cam_open_spec_device])
19:
20: # Checks for header files.
21: AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
22:
23: # Checks for typedefs, structures, and compiler characteristics.
24: AC_C_INLINE
25: AC_TYPE_INT32_T
26: AC_TYPE_INT64_T
27: AC_TYPE_OFF_T
28: AC_TYPE_PID_T
29: AC_TYPE_SIZE_T
30: AC_TYPE_SSIZE_T
31: AC_STRUCT_ST_BLOCKS
32: AC_TYPE_UINT16_T
33: AC_TYPE_UINT32_T
34: AC_TYPE_UINT64_T
35: AC_TYPE_UINT8_T
36:
37: # Checks for library functions.
38: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
39: AC_FUNC_MALLOC
40: AC_FUNC_REALLOC
41: AC_CHECK_FUNCS([ftruncate memset realpath socket strcasecmp strchr strncasecmp strspn strtol strtoull])
42:
43: # check compatibility
44: AC_SYS_LARGEFILE
45: AC_CHECK_HEADERS([aio.h sched.h uuid.h sys/disk.h sys/disklabel.h])
46: AC_CHECK_HEADERS([pthread.h])
47: AC_CHECK_HEADERS([pthread_np.h], [], [],
48: [#if HAVE_PTHREAD_H
49: #include <pthread.h>
50: #endif
51: ])
52: AC_CHECK_FUNCS([strlcpy arc4random srandomdev pthread_yield sched_yield])
53: AC_CHECK_FUNCS([pthread_set_name_np setproctitle])
54: AC_SUBST(MKDEP)
55: AC_PATH_PROG(MKDEP, "mkdep")
56: #if test -z "$MKDEP"; then
57: # AC_PATH_PROG(MKDEP, "makedepend")
58: #fi
59:
60: # paths
61: configdir="$ac_default_prefix/etc/istgt"
62: mediadir="/var/istgt"
63: if test "$prefix" != "NONE"; then
64: configdir="$prefix/etc/istgt"
65: fi
66: AC_ARG_WITH(configdir,
67: [ --with-configdir=DIR (default $ac_default_prefix/etc/istgt)],
68: [case $withval in
69: yes|no)
70: ;;
71: *)
72: configdir="$withval"
73: ;;
74: esac])
75: AC_SUBST(configdir)
76: AC_ARG_WITH(mediadir,
77: [ --with-mediadir=DIR (default /var/istgt)],
78: [case $withval in
79: yes|no)
80: ;;
81: *)
82: mediadir="$withval"
83: ;;
84: esac])
85: AC_SUBST(mediadir)
86:
87: # test for -Wall
88: saved_CFLAGS="$CFLAGS"
89: AC_MSG_CHECKING([whether the C compiler accepts -Wall])
90: CFLAGS="$CFLAGS -Wall"
91: AC_TRY_COMPILE(,,
92: AC_MSG_RESULT(yes); saved_CFLAGS="$CFLAGS",
93: AC_MSG_RESULT(no))
94: CFLAGS="$saved_CFLAGS"
95:
96: # check enable features
97: AC_MSG_CHECKING([whether to use debug mode])
98: AC_ARG_ENABLE(debug,
99: [ --enable-debug enable debug(logging) ],
100: AC_MSG_RESULT(yes); AC_DEFINE(DEBUG, 1, [Define if enable debug]),
101: AC_MSG_RESULT(no))
102: AC_SUBST(DEBUG)
103:
104: AC_MSG_CHECKING([which syslog facility to use])
105: AC_ARG_WITH(logfacility,
106: [ --with-logfacility syslog facility to log with (default "local7")],
107: [case $with_logfacility in
108: daemon|auth|authpriv|local0|local1|local2|local3|local4|local5|local6|local7)
109: logfacility=$with_logfacility
110: ;;
111: *) AC_MSG_ERROR(["unsupported facility $with_logfacility"])
112: ;;
113: esac],
114: [logfacility="local7"])
115: AC_DEFINE_UNQUOTED(DEFAULT_LOG_FACILITY, "$logfacility", [syslog facility])
116: AC_MSG_RESULT("$logfacility")
117:
118: AC_MSG_CHECKING([which syslog priority to use])
119: AC_ARG_WITH(logpriority,
120: [ --with-logpriority syslog priority to log with (default "info")],
121: [case $with_logpriority in
122: emerg|alert|crit|err|warning|notice|info|debug)
123: logpriority=$with_logpriority
124: ;;
125: *) AC_MSG_ERROR(["unsupported priority $with_logpriority"])
126: ;;
127: esac],
128: [logpriority="info"])
129: AC_DEFINE_UNQUOTED(DEFAULT_LOG_PRIORITY, "$logpriority", [syslog priority])
130: AC_MSG_RESULT("$logpriority")
131:
132: #AC_MSG_CHECKING([whether to use asynchronous io])
133: #AC_ARG_WITH(aio,
134: # [ --with-aio use aio (default "no")],
135: # [case $with_aio in
136: # yes)
137: # AC_DEFINE(USE_AIO, 1, [use aio])
138: # AC_MSG_RESULT(yes)
139: # ;;
140: # *)
141: # AC_MSG_RESULT(no)
142: # ;;
143: # esac],
144: # AC_MSG_RESULT(no))
145: #AC_SUBST(USE_AIO)
146:
147: AC_CHECK_HEADERS([sys/types.h])
148: AC_CHECK_HEADERS([machine/atomic.h], [], [],
149: [#if HAVE_SYS_TYPES_H
150: #include <sys/types.h>
151: #endif
152: ])
153: AC_CHECK_HEADERS([sys/atomic.h])
154:
155: # for FeeeBSD
156: #AC_CHECK_FUNCS([atomic_store_rel_int atomic_load_acq_int])
157: #AC_CHECK_FUNCS([atomic_cmpset_ptr atomic_cmpset_64 atomic_cmpset_32])
158:
159: # for NetBSD
160: #AC_CHECK_FUNCS([atomic_swap_uint atomic_or_uint_nv])
161: #AC_CHECK_FUNCS([atomic_cas_ptr atomic_cas_64 atomic_cas_32])
162:
163: atomic="no"
164: AC_MSG_CHECKING([for atomic operations])
165: AC_TRY_LINK([#if HAVE_SYS_TYPES_H
166: #include <sys/types.h>
167: #endif
168: #include <machine/atomic.h>
169: ],
170: [
171: int x, y;
172: atomic_store_rel_int(&x, 1);
173: y = atomic_load_acq_int(&x);
174: ],
175: [AC_DEFINE(USE_ATOMIC, [1], [Use atomic])
176: AC_DEFINE(HAVE_ATOMIC_STORE_REL_INT, [1], [Define 1 if you have the function.])
177: AC_DEFINE(HAVE_ATOMIC_LOAD_ACQ_INT, [1], [Define 1 if you have the function.])
178: atomic="yes"]
179: )
180: if test $atomic = "no"; then
181: AC_TRY_LINK([
182: #if HAVE_SYS_TYPES_H
183: #include <sys/types.h>
184: #endif
185: #include <sys/atomic.h>
186: ],
187: [
188: unsigned int x, y;
189: atomic_swap_uint(&x, 1);
190: y = atomic_or_uint_nv(&x, 0);
191: ],
192: [AC_DEFINE(USE_ATOMIC, [1], [Use atomic])
193: AC_DEFINE(HAVE_ATOMIC_SWAP_UINT, [1], [Define 1 if you have the function.])
194: AC_DEFINE(HAVE_ATOMIC_OR_UINT_NV, [1], [Define 1 if you have the function.])
195: atomic="yes"]
196: )
197: fi
198: AC_TRY_LINK([
199: #if HAVE_SYS_TYPES_H
200: #include <sys/types.h>
201: #endif
202: #include <sys/atomic.h>
203: ],
204: [
205: membar_producer();
206: ],
207: [AC_DEFINE(HAVE_MEMBAR_PRODUCER, [1], [Define 1 if you have the function.])]
208: )
209: AC_MSG_RESULT($atomic)
210:
211: AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile doc/Makefile])
212: AC_CONFIG_FILES([src/build.h])
213: AC_OUTPUT
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>