9 AC_MSG_WARN('***' ${host_os}: Unsupported OS target)
13 AM_INIT_AUTOMAKE([subdir-objects])
25 AC_HELP_STRING([--with-lib-dir=<sysio lib build directory>],
26 [directory for sysio library]),
27 [ case "${withval}" in
28 "yes"|"no"|"") have_lib_dir=no ;;
29 *) LIBBUILD_DIR=${withval};
30 test -d ${LIBBUILD_DIR} || mkdir ${LIBBUILD_DIR} ||
33 [ LIBBUILD_DIR=`pwd`/lib;
34 test -d ${LIBBUILD_DIR} || mkdir ${LIBBUILD_DIR} || have_lib_dir=no;])
35 if test x${have_lib_dir} = xyes; then
36 echo "Using sysio library directory ${LIBBUILD_DIR}"
38 AC_MSG_ERROR(Need writeable path to sysio library directory ${LIBBUILD_DIR})
40 AC_SUBST(LIBBUILD_DIR)
42 AC_ARG_WITH(native_driver,
43 AC_HELP_STRING([--with-native-driver],[build native test driver]),
44 [ case "${withval}" in
47 *) AC_MSG_ERROR(bad value ${withval} for --with-native-driver) ;;
49 [with_native_driver=yes;])
50 AM_CONDITIONAL(WITH_NATIVE_DRIVER, test x$with_native_driver = xyes)
52 AC_ARG_WITH(incore-driver,
53 AC_HELP_STRING([--with-incore-driver],[build incore test driver]),
54 [ case "${withval}" in
57 *) AC_MSG_ERROR(bad value ${withval} for --with-incore-driver) ;;
59 [with_incore_driver=yes])
60 AM_CONDITIONAL(WITH_INCORE_DRIVER, test x$with_incore_driver = xyes)
63 AC_HELP_STRING([--with-tests],[build tests]),
64 [ case "${withval}" in
67 *) AC_MSG_ERROR(bad value ${withval} for --with-tests) ;;
70 AM_CONDITIONAL(WITH_TESTS, test x$with_tests = xyes)
72 AC_ARG_WITH(automount,
73 AC_HELP_STRING([--with-automount@<:@=<automount-file-name>@:>@],
74 [with automounts @<:@<automount-file-name>=.mount@:>@]),
75 [ if test x${withval} = xyes; then
76 AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\".mount\\\""
77 elif test x${withval} != x; then
78 AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\"${withval}\\\""
82 AC_ARG_WITH(stdfd-dev,
83 AC_HELP_STRING([--with-stdfd-dev],
84 [build standard file descriptors pseudo-driver]),
85 [ case "${withval}" in
88 *) AC_MSG_ERROR(bad value ${withval} for --with-stdfd-dev) ;;
91 AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes)
93 AC_ARG_WITH(zero-sum-memory,
94 AC_HELP_STRING([--with-zero-sum-memory],
95 [free all dynamically allocated memory at the end -- useful for debugging]),
96 [ case "${withval}" in
97 yes) ZERO_SUM_MEMORY=-DZERO_SUM_MEMORY=1 ;;
99 *) AC_MSG_ERROR(bad value ${withval} for --with-zero-sum-memory) ;;
101 [with_zero_sum_memory=no])
102 AC_SUBST(ZERO_SUM_MEMORY)
104 AC_ARG_WITH(cplant_yod,
105 AC_HELP_STRING([--with-cplant-yod],[build cplant yod I/O driver]),
106 [ case "${withval}" in
107 yes) if test x${with_stdfd_dev} != xyes; then
109 AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes)
112 *) AC_MSG_ERROR(bad value ${withval} for --with-cplant-yod);;
114 [with_cplant_yod=no])
115 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
117 AC_ARG_WITH(cplant_tests,
118 AC_HELP_STRING([--with-cplant-tests=<cplant-build-path>],
119 [build libsysio tests for cplant platform]),
120 [ case "${withval}" in
121 yes) AC_MSG_ERROR(need path to compiler for --with-cplant-tests);;
122 no) with_cplant_tests=no;;
127 [ if test x${with_cplant_yod} != xyes; then
129 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
131 [ AC_MSG_ERROR(path not found ${CC} for --with-cplant-tests) ]);;
133 [with_cplant_tests=no])
134 AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno)
137 AC_HELP_STRING([--with-sockets],
138 [build sockets interface driver (EXPERIMENTAL)]),
139 [ case "${withval}" in
142 *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;;
145 AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes)
147 AC_ARG_WITH(lustre-hack,
148 AC_HELP_STRING([--with-lustre-hack],
149 [have hacking code which needed to support liblustre driver (EXPERIMENTAL)]),
150 [ case "${withval}" in
153 *) AC_MSG_ERROR(bad value ${withval} for --with-lustre-hack) ;;
155 [with_lustre_hack=no])
156 AM_CONDITIONAL(WITH_LUSTRE_HACK, test x$with_lustre_hack = xyes)
157 if test x$with_lustre_hack = xyes; then
158 AC_DEFINE(HAVE_LUSTRE_HACK)
161 # We keep the original values in `$config_*' and never modify them, so we
162 # can write them unchanged into config.make. Everything else uses
163 # $machine, $vendor, and $os, and changes them whenever convenient.
164 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
166 # Don't allow vendor == "unknown"
167 test "$config_vendor" = unknown && config_vendor=
168 config_os="`echo $config_os | sed 's/^unknown-//'`"
170 # Some configurations imply other options.
172 gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
173 # These systems always use GNU tools.
174 gnu_ld=yes gnu_as=yes ;;
177 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
178 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
180 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
181 # These systems (almost) always use the ELF format.
185 # These systems are always xcoff
191 machine=$config_machine
192 vendor=$config_vendor
195 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
197 if test "$machine" = rs6000; then
201 # If we can't provoke the declaration of stat64 then we assume the
202 # environment supports 64-bit file support naturally. Beware!
203 AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required)
205 #include <sys/types.h>
206 #include <sys/stat.h>
207 #include <unistd.h>], [
208 struct stat64 st64;],
209 sysio_largefile64_source_required=no,
210 sysio_largefile64_source_required=maybe)
211 if test x$sysio_largefile64_source_required = xmaybe; then
213 #define _LARGEFILE64_SOURCE
214 #include <sys/types.h>
215 #include <sys/stat.h>
216 #include <unistd.h>], [
217 struct stat64 st64;],
218 sysio_largefile64_source_required=yes,
219 sysio_largefile64_source_required=no)
221 AC_MSG_RESULT($sysio_largefile64_source_required)
222 if test x$sysio_largefile64_source_required = xyes; then
223 AC_DEFINE(_LARGEFILE64_SOURCE)
226 # Alpha linux defines
228 AC_MSG_CHECKING(for alpha linux)
230 if test `expr ${machine} : "alpha"` = 5 && \
231 test `expr ${os} : "linux"` = 5; then
233 AC_DEFINE(ALPHA_LINUX)
235 AC_MSG_RESULT($alpha_linux_env)
236 AM_CONDITIONAL(TEST_ALPHA_ARG, test x$alpha_linux_env = xyes)
238 # check for 64 bit stat, fstat, truncate, ftruncate syscalls
240 AC_MSG_CHECKING(for 64 bit stat and truncate syscalls)
242 #include <sys/stat.h>
244 extern int syscall();],
248 syscall(SYS_stat64,path,&buf);
249 syscall(SYS_fstat64,fd,&buf);
250 syscall(SYS_truncate64, path, buf.st_size);
251 syscall(SYS_ftruncate64, fd, buf.st_size);
253 sysstat64_exists=yes,
255 AC_MSG_RESULT($sysstat64_exists)
256 if test x$sysstat64_exists = xno; then
257 AC_DEFINE(USE_NATIVE_STAT)
260 # Check for fdatasync syscall
262 AC_MSG_CHECKING(for fdatasync system call)
263 if test x$alpha_linux_env = xyes; then
264 _syscallnum=SYS_osf_fdatasync
266 _syscallnum=SYS_fdatasync
270 extern int syscall();],
272 syscall(SYS_fdatasync, fd);],
273 syscall_fdatasync_exists=yes,
274 syscall_fdatasync_exists=no)
275 AC_MSG_RESULT($syscall_fdatasync_exists)
276 if test x$syscall_fdatasync_exists = xyes; then
277 AC_DEFINE_UNQUOTED(NATIVE_FDATASYNC, $_syscallnum)
280 # Check for SYS_utime
282 AC_MSG_CHECKING(for utime system call)
285 extern int syscall();],
286 [syscall(SYS_utime);],
287 syscall_utime_exists=yes,
288 syscall_utime_exists=no)
289 AC_MSG_RESULT($syscall_utime_exists)
290 if test x$syscall_utime_exists = xno; then
291 AC_DEFINE(USE_NATIVE_UTIME)
295 AC_MSG_CHECKING(for __st_ino)
297 #include <sys/stat.h>],
302 AC_MSG_RESULT($have__st_ino)
303 if test x$have__st_ino = xyes; then
304 AC_DEFINE(HAVE__ST_INO)
309 AC_MSG_CHECKING(for st_gen)
311 #include <sys/stat.h>],
316 AC_MSG_RESULT($have_st_gen)
317 if test x$have_st_gen = xyes; then
318 AC_DEFINE(HAVE_GENERATION)
321 AC_MSG_CHECKING(whether .text pseudo-op must be used)
322 AC_CACHE_VAL(sysio_asm_dot_text, [dnl
323 cat > conftest.s <<EOF
327 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
328 sysio_asm_dot_text=.text
331 if test -z "$sysio_dot_text"; then
337 AC_CACHE_CHECK(for assembler global-symbol directive,
338 sysio_asm_global_directive, [dnl
339 sysio_asm_global_directive=UNKNOWN
340 for ac_globl in .globl .global .EXPORT; do
341 cat > conftest.s <<EOF
342 ${sysio_asm_dot_text}
346 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
347 sysio_asm_global_directive=${ac_globl}
350 test $sysio_asm_global_directive != UNKNOWN && break
352 if test $sysio_asm_global_directive = UNKNOWN; then
353 AC_MSG_ERROR(cannot determine asm global directive)
355 # AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${sysio_asm_global_directive})
358 AC_CACHE_CHECK(for .set assembler directive,
359 sysio_asm_set_directive, [dnl
360 cat > conftest.s<<EOF
361 ${sysio_asm_dot_text}
364 ${sysio_asm_global_directive} bar
366 # The alpha-dec-osf1 assembler gives only a warning for `.set'
367 # (but it doesn't work), so we must do a linking check to be sure.
368 cat > conftest1.c <<EOF
370 main () { printf ("%d\n", bar); }
372 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
373 -o conftest conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then
374 sysio_asm_set_directive=yes
376 sysio_asm_set_directive=no
379 #if test $sysio_asm_set_directive = yes; then
380 # AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
383 AC_CACHE_CHECK(for assembler .weak directive, sysio_asm_weak_directive,
385 cat > conftest.s <<EOF
390 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
391 sysio_asm_weak_directive=yes
393 sysio_asm_weak_directive=no
397 if test $sysio_asm_weak_directive = no; then
398 AC_CACHE_CHECK(for assembler .weakext directive,
399 sysio_asm_weakext_directive, [dnl
400 cat > conftest.s <<EOF
402 ${sysio_asm_global_directive} foo
406 ${sysio_asm_global_directive} baz
409 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
410 sysio_asm_weakext_directive=yes
412 sysio_asm_weakext_directive=no
417 if test x$sysio_asm_weak_directive = xyes; then
418 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
420 if test x$sysio_asm_weakext_directive = xyes; then
421 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)