11 AC_MSG_WARN('***' ${host_os}: Unsupported OS target)
15 AM_INIT_AUTOMAKE([subdir-objects])
27 AC_HELP_STRING([--with-lib-dir=<sysio lib build directory>],
28 [directory for sysio library]),
29 [ case "${withval}" in
30 "yes"|"no"|"") have_lib_dir=no ;;
31 *) LIBBUILD_DIR=${withval};
32 test -d ${LIBBUILD_DIR} || mkdir ${LIBBUILD_DIR} ||
35 [ LIBBUILD_DIR=`pwd`/lib;
36 test -d ${LIBBUILD_DIR} || mkdir ${LIBBUILD_DIR} || have_lib_dir=no;])
37 if test x${have_lib_dir} = xyes; then
38 echo "Using sysio library directory ${LIBBUILD_DIR}"
40 AC_MSG_ERROR(Need writeable path to sysio library directory ${LIBBUILD_DIR})
42 AC_SUBST(LIBBUILD_DIR)
44 AC_ARG_WITH(native_driver,
45 AC_HELP_STRING([--with-native-driver],[build native test driver]),
46 [ case "${withval}" in
49 *) AC_MSG_ERROR(bad value ${withval} for --with-native-driver) ;;
51 [with_native_driver=yes;])
52 AM_CONDITIONAL(WITH_NATIVE_DRIVER, test x$with_native_driver = xyes)
54 AC_ARG_WITH(incore-driver,
55 AC_HELP_STRING([--with-incore-driver],[build incore test driver]),
56 [ case "${withval}" in
59 *) AC_MSG_ERROR(bad value ${withval} for --with-incore-driver) ;;
61 [with_incore_driver=yes])
62 AM_CONDITIONAL(WITH_INCORE_DRIVER, test x$with_incore_driver = xyes)
65 AC_HELP_STRING([--with-tests],[build tests]),
66 [ case "${withval}" in
69 *) AC_MSG_ERROR(bad value ${withval} for --with-tests) ;;
72 AM_CONDITIONAL(WITH_TESTS, test x$with_tests = xyes)
74 AC_ARG_WITH(automount,
75 AC_HELP_STRING([--with-automount@<:@=<automount-file-name>@:>@],
76 [with automounts @<:@<automount-file-name>=.mount@:>@]),
77 [ if test x${withval} = xyes; then
78 AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\".mount\\\""
79 elif test x${withval} != x; then
80 AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\"${withval}\\\""
84 AC_ARG_WITH(stdfd-dev,
85 AC_HELP_STRING([--with-stdfd-dev],
86 [build standard file descriptors pseudo-driver]),
87 [ case "${withval}" in
90 *) AC_MSG_ERROR(bad value ${withval} for --with-stdfd-dev) ;;
93 AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes)
95 AC_ARG_WITH(zero-sum-memory,
96 AC_HELP_STRING([--with-zero-sum-memory],
97 [free all dynamically allocated memory at the end -- useful for debugging]),
98 [ case "${withval}" in
99 yes) ZERO_SUM_MEMORY=-DZERO_SUM_MEMORY=1 ;;
101 *) AC_MSG_ERROR(bad value ${withval} for --with-zero-sum-memory) ;;
103 [with_zero_sum_memory=no])
104 AC_SUBST(ZERO_SUM_MEMORY)
106 AC_ARG_WITH(defer-init-cwd,
107 AC_HELP_STRING([--with-defer-init-cwd],
108 [defer initialization of current working directory]),
109 [ case "${withval}" in
110 yes) DEFER_INIT_CWD=-DDEFER_INIT_CWD=1 ;;
112 *) AC_MSG_ERROR(bad value ${withval} for --with-defer-init-cwd) ;;
114 [with_defer_init_cwd=no])
115 AC_SUBST(DEFER_INIT_CWD)
118 AC_HELP_STRING([--with-tracing],
119 [enable tracing support]),
120 [ case "${withval}" in
121 yes) TRACING=-DSYSIO_TRACING=1 ;;
123 *) AC_MSG_ERROR(bad value ${withval} for --with-tracing) ;;
125 [TRACING=-DSYSIO_TRACING=1])
128 AC_ARG_WITH(cplant_yod,
129 AC_HELP_STRING([--with-cplant-yod],[build cplant yod I/O driver]),
130 [ case "${withval}" in
131 yes) if test x${with_stdfd_dev} != xyes; then
133 AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes)
136 *) AC_MSG_ERROR(bad value ${withval} for --with-cplant-yod);;
138 [with_cplant_yod=no])
139 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
141 AC_ARG_WITH(cplant_tests,
142 AC_HELP_STRING([--with-cplant-tests=<cplant-build-path>],
143 [build libsysio tests for cplant platform]),
144 [ case "${withval}" in
145 yes) AC_MSG_ERROR(need path to compiler for --with-cplant-tests);;
146 no) with_cplant_tests=no;;
151 [ if test x${with_cplant_yod} != xyes; then
153 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
155 [ AC_MSG_ERROR(path not found ${CC} for --with-cplant-tests) ]);;
157 [with_cplant_tests=no])
158 AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno)
161 AC_HELP_STRING([--with-sockets],
162 [build sockets interface driver (EXPERIMENTAL)]),
163 [ case "${withval}" in
166 *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;;
169 AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes)
171 AC_ARG_WITH(lustre-hack,
172 AC_HELP_STRING([--with-lustre-hack],
173 [have hacking code which needed to support liblustre driver (EXPERIMENTAL)]),
174 [ case "${withval}" in
177 *) AC_MSG_ERROR(bad value ${withval} for --with-lustre-hack) ;;
179 [with_lustre_hack=no])
180 AM_CONDITIONAL(WITH_LUSTRE_HACK, test x$with_lustre_hack = xyes)
181 if test x$with_lustre_hack = xyes; then
182 AC_DEFINE(HAVE_LUSTRE_HACK)
185 AC_ARG_WITH(alternate-symbols,
186 AC_HELP_STRING([--with-alternate-symbols@<:@=<qualifier>@:>@],
187 [Prepend standard, public, symbols with a unique qualifer]),
188 [ case "${withval}" in
189 yes) SYSIO_LABEL_NAMES=-DSYSIO_LABEL_NAMES=sysio_ ;;
191 *) SYSIO_LABEL_NAMES=-DSYSIO_LABEL_NAMES="${withval}" ;;
193 AC_SUBST(SYSIO_LABEL_NAMES)
195 # We keep the original values in `$config_*' and never modify them, so we
196 # can write them unchanged into config.make. Everything else uses
197 # $machine, $vendor, and $os, and changes them whenever convenient.
198 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
200 # Don't allow vendor == "unknown"
201 test "$config_vendor" = unknown && config_vendor=
202 config_os="`echo $config_os | sed 's/^unknown-//'`"
204 # Some configurations imply other options.
206 gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
207 # These systems always use GNU tools.
208 gnu_ld=yes gnu_as=yes ;;
211 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
212 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
214 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
215 # These systems (almost) always use the ELF format.
219 # These systems are always xcoff
225 machine=$config_machine
226 vendor=$config_vendor
229 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
231 if test "$machine" = rs6000; then
237 AC_DEFINE(_XOPEN_SOURCE, 600)
240 # ... and always needed...
241 AC_DEFINE(__USE_LARGEFILE64)
242 AC_DEFINE(_LARGE_FILES)
243 AC_DEFINE(_LARGE_FILE_API)
244 AC_DEFINE(_ALL_SOURCE)
245 AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
249 AC_MSG_CHECKING(for symlink support)
251 #include <sys/types.h>
252 #include <sys/stat.h>
258 symlink_support="yes",
261 AC_MSG_RESULT($symlink_support)
263 if test x$symlink_support = xyes; then
264 AC_MSG_CHECKING(if readlink returns int)
268 extern int readlink(const char *, char *, size_t);
270 readlink_returns_int="yes",
271 readlink_returns_int="no"
273 AC_MSG_RESULT($readlink_returns_int)
274 if test x$readlink_returns_int = no; then
275 AC_DEFINE(HAVE_POSIX_1003_READLINK,
277 [readlink returns ssize_t])
281 AC_MSG_CHECKING(if readlink returns ssize_t)
285 ssize_t readlink(const char *, char *, size_t);
288 AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t])
293 # If we can't provoke the declaration of stat64 then we assume the
294 # environment supports 64-bit file support naturally. Beware!
295 AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required)
297 #include <sys/types.h>
298 #include <sys/stat.h>
299 #include <unistd.h>], [
300 struct stat64 st64;],
301 sysio_largefile64_source_required=no,
302 sysio_largefile64_source_required=maybe)
303 if test x$sysio_largefile64_source_required = xmaybe; then
305 #define _LARGEFILE64_SOURCE
306 #include <sys/types.h>
307 #include <sys/stat.h>
308 #include <unistd.h>], [
309 struct stat64 st64;],
310 sysio_largefile64_source_required=yes,
311 sysio_largefile64_source_required=no)
313 AC_MSG_RESULT($sysio_largefile64_source_required)
314 if test x$sysio_largefile64_source_required = xyes; then
315 AC_DEFINE(_LARGEFILE64_SOURCE)
318 # Alpha linux defines
320 AC_MSG_CHECKING(for alpha linux)
322 if test `expr ${machine} : "alpha"` = 5 && \
323 test `expr ${os} : "linux"` = 5; then
325 AC_DEFINE(ALPHA_LINUX)
327 AC_MSG_RESULT($alpha_linux_env)
328 AM_CONDITIONAL(TEST_ALPHA_ARG, test x$alpha_linux_env = xyes)
332 AC_MSG_CHECKING(for __st_ino)
334 #include <sys/stat.h>],
339 AC_MSG_RESULT($have__st_ino)
340 if test x$have__st_ino = xyes; then
341 AC_DEFINE(HAVE__ST_INO)
346 AC_MSG_CHECKING(for st_gen)
348 #include <sys/stat.h>],
353 AC_MSG_RESULT($have_st_gen)
354 if test x$have_st_gen = xyes; then
355 AC_DEFINE(HAVE_GENERATION)
358 AC_MSG_CHECKING(whether .text pseudo-op must be used)
359 AC_CACHE_VAL(sysio_asm_dot_text, [dnl
360 cat > conftest.s <<EOF
364 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
365 sysio_asm_dot_text=.text
368 if test -z "$sysio_dot_text"; then
374 AC_CACHE_CHECK(for assembler global-symbol directive,
375 sysio_asm_global_directive, [dnl
376 sysio_asm_global_directive=UNKNOWN
377 for ac_globl in .globl .global .EXPORT; do
378 cat > conftest.s <<EOF
379 ${sysio_asm_dot_text}
383 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
384 sysio_asm_global_directive=${ac_globl}
387 test $sysio_asm_global_directive != UNKNOWN && break
389 if test $sysio_asm_global_directive = UNKNOWN; then
390 AC_MSG_ERROR(cannot determine asm global directive)
392 # AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${sysio_asm_global_directive})
395 AC_CACHE_CHECK(for .set assembler directive,
396 sysio_asm_set_directive, [dnl
397 cat > conftest.s<<EOF
398 ${sysio_asm_dot_text}
401 ${sysio_asm_global_directive} bar
403 # The alpha-dec-osf1 assembler gives only a warning for `.set'
404 # (but it doesn't work), so we must do a linking check to be sure.
405 cat > conftest1.c <<EOF
407 main () { printf ("%d\n", bar); }
409 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
410 -o conftest conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then
411 sysio_asm_set_directive=yes
413 sysio_asm_set_directive=no
416 #if test $sysio_asm_set_directive = yes; then
417 # AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
420 AC_CACHE_CHECK(for assembler .weak directive, sysio_asm_weak_directive,
422 cat > conftest.s <<EOF
427 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
428 sysio_asm_weak_directive=yes
430 sysio_asm_weak_directive=no
434 if test $sysio_asm_weak_directive = no; then
435 AC_CACHE_CHECK(for assembler .weakext directive,
436 sysio_asm_weakext_directive, [dnl
437 cat > conftest.s <<EOF
439 ${sysio_asm_global_directive} foo
443 ${sysio_asm_global_directive} baz
446 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
447 sysio_asm_weakext_directive=yes
449 sysio_asm_weakext_directive=no
454 if test x$sysio_asm_weak_directive = xyes; then
455 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
457 if test x$sysio_asm_weakext_directive = xyes; then
458 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)