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(defer-init-cwd,
105 AC_HELP_STRING([--with-defer-init-cwd],
106 [defer initialization of current working directory]),
107 [ case "${withval}" in
108 yes) DEFER_INIT_CWD=-DDEFER_INIT_CWD=1 ;;
110 *) AC_MSG_ERROR(bad value ${withval} for --with-defer-init-cwd) ;;
112 [with_defer_init_cwd=no])
113 AC_SUBST(DEFER_INIT_CWD)
115 AC_ARG_WITH(cplant_yod,
116 AC_HELP_STRING([--with-cplant-yod],[build cplant yod I/O driver]),
117 [ case "${withval}" in
118 yes) if test x${with_stdfd_dev} != xyes; then
120 AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes)
123 *) AC_MSG_ERROR(bad value ${withval} for --with-cplant-yod);;
125 [with_cplant_yod=no])
126 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
128 AC_ARG_WITH(cplant_tests,
129 AC_HELP_STRING([--with-cplant-tests=<cplant-build-path>],
130 [build libsysio tests for cplant platform]),
131 [ case "${withval}" in
132 yes) AC_MSG_ERROR(need path to compiler for --with-cplant-tests);;
133 no) with_cplant_tests=no;;
138 [ if test x${with_cplant_yod} != xyes; then
140 AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes)
142 [ AC_MSG_ERROR(path not found ${CC} for --with-cplant-tests) ]);;
144 [with_cplant_tests=no])
145 AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno)
148 AC_HELP_STRING([--with-sockets],
149 [build sockets interface driver (EXPERIMENTAL)]),
150 [ case "${withval}" in
153 *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;;
156 AM_CONDITIONAL(WITH_SOCKETS_DRIVER, test x$with_sockets = xyes)
158 AC_ARG_WITH(lustre-hack,
159 AC_HELP_STRING([--with-lustre-hack],
160 [have hacking code which needed to support liblustre driver (EXPERIMENTAL)]),
161 [ case "${withval}" in
164 *) AC_MSG_ERROR(bad value ${withval} for --with-lustre-hack) ;;
166 [with_lustre_hack=no])
167 AM_CONDITIONAL(WITH_LUSTRE_HACK, test x$with_lustre_hack = xyes)
168 if test x$with_lustre_hack = xyes; then
169 AC_DEFINE(HAVE_LUSTRE_HACK)
172 # We keep the original values in `$config_*' and never modify them, so we
173 # can write them unchanged into config.make. Everything else uses
174 # $machine, $vendor, and $os, and changes them whenever convenient.
175 config_machine=$host_cpu config_vendor=$host_vendor config_os=$host_os
177 # Don't allow vendor == "unknown"
178 test "$config_vendor" = unknown && config_vendor=
179 config_os="`echo $config_os | sed 's/^unknown-//'`"
181 # Some configurations imply other options.
183 gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
184 # These systems always use GNU tools.
185 gnu_ld=yes gnu_as=yes ;;
188 # i586-linuxaout is mangled into i586-pc-linux-gnuaout
189 linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
191 gnu* | linux* | freebsd* | netbsd* | sysv4* | solaris2* | irix6*)
192 # These systems (almost) always use the ELF format.
196 # These systems are always xcoff
202 machine=$config_machine
203 vendor=$config_vendor
206 # config.guess on some IBM machines says `rs6000' instead of `powerpc'.
208 if test "$machine" = rs6000; then
212 # If we can't provoke the declaration of stat64 then we assume the
213 # environment supports 64-bit file support naturally. Beware!
214 AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required)
216 #include <sys/types.h>
217 #include <sys/stat.h>
218 #include <unistd.h>], [
219 struct stat64 st64;],
220 sysio_largefile64_source_required=no,
221 sysio_largefile64_source_required=maybe)
222 if test x$sysio_largefile64_source_required = xmaybe; then
224 #define _LARGEFILE64_SOURCE
225 #include <sys/types.h>
226 #include <sys/stat.h>
227 #include <unistd.h>], [
228 struct stat64 st64;],
229 sysio_largefile64_source_required=yes,
230 sysio_largefile64_source_required=no)
232 AC_MSG_RESULT($sysio_largefile64_source_required)
233 if test x$sysio_largefile64_source_required = xyes; then
234 AC_DEFINE(_LARGEFILE64_SOURCE)
237 # Alpha linux defines
239 AC_MSG_CHECKING(for alpha linux)
241 if test `expr ${machine} : "alpha"` = 5 && \
242 test `expr ${os} : "linux"` = 5; then
244 AC_DEFINE(ALPHA_LINUX)
246 AC_MSG_RESULT($alpha_linux_env)
247 AM_CONDITIONAL(TEST_ALPHA_ARG, test x$alpha_linux_env = xyes)
251 AC_MSG_CHECKING(for __st_ino)
253 #include <sys/stat.h>],
258 AC_MSG_RESULT($have__st_ino)
259 if test x$have__st_ino = xyes; then
260 AC_DEFINE(HAVE__ST_INO)
265 AC_MSG_CHECKING(for st_gen)
267 #include <sys/stat.h>],
272 AC_MSG_RESULT($have_st_gen)
273 if test x$have_st_gen = xyes; then
274 AC_DEFINE(HAVE_GENERATION)
277 AC_MSG_CHECKING(whether .text pseudo-op must be used)
278 AC_CACHE_VAL(sysio_asm_dot_text, [dnl
279 cat > conftest.s <<EOF
283 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
284 sysio_asm_dot_text=.text
287 if test -z "$sysio_dot_text"; then
293 AC_CACHE_CHECK(for assembler global-symbol directive,
294 sysio_asm_global_directive, [dnl
295 sysio_asm_global_directive=UNKNOWN
296 for ac_globl in .globl .global .EXPORT; do
297 cat > conftest.s <<EOF
298 ${sysio_asm_dot_text}
302 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
303 sysio_asm_global_directive=${ac_globl}
306 test $sysio_asm_global_directive != UNKNOWN && break
308 if test $sysio_asm_global_directive = UNKNOWN; then
309 AC_MSG_ERROR(cannot determine asm global directive)
311 # AC_DEFINE_UNQUOTED(ASM_GLOBAL_DIRECTIVE, ${sysio_asm_global_directive})
314 AC_CACHE_CHECK(for .set assembler directive,
315 sysio_asm_set_directive, [dnl
316 cat > conftest.s<<EOF
317 ${sysio_asm_dot_text}
320 ${sysio_asm_global_directive} bar
322 # The alpha-dec-osf1 assembler gives only a warning for `.set'
323 # (but it doesn't work), so we must do a linking check to be sure.
324 cat > conftest1.c <<EOF
326 main () { printf ("%d\n", bar); }
328 if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
329 -o conftest conftest.s conftest1.c 1>&AC_FD_CC 2>&AC_FD_CC; then
330 sysio_asm_set_directive=yes
332 sysio_asm_set_directive=no
335 #if test $sysio_asm_set_directive = yes; then
336 # AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
339 AC_CACHE_CHECK(for assembler .weak directive, sysio_asm_weak_directive,
341 cat > conftest.s <<EOF
346 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
347 sysio_asm_weak_directive=yes
349 sysio_asm_weak_directive=no
353 if test $sysio_asm_weak_directive = no; then
354 AC_CACHE_CHECK(for assembler .weakext directive,
355 sysio_asm_weakext_directive, [dnl
356 cat > conftest.s <<EOF
358 ${sysio_asm_global_directive} foo
362 ${sysio_asm_global_directive} baz
365 if ${CC-cc} $CFLAGS -c conftest.s 2>/dev/null; then
366 sysio_asm_weakext_directive=yes
368 sysio_asm_weakext_directive=no
373 if test x$sysio_asm_weak_directive = xyes; then
374 AC_DEFINE(HAVE_ASM_WEAK_DIRECTIVE)
376 if test x$sysio_asm_weakext_directive = xyes; then
377 AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE)