compile
You type in a program and the test is successful if it compiles
cleanly.
link
You type in a program and the test is successful if it both
compiles and links cleanly.
run
You type in a program and the test is successful if it
compiles and links cleanly then, when run with no arguments,
it exits with a zero status code. If you are concerned about
cross platform builds, then you should avoid "run" tests because
they do not work in a cross-build environment.
with
This form allows you to specify how to handle the presence of
the ``--with-<test-name>'' command line option, where
``test-name'' is the ``name of test'' you provide above.
The option defaults to disabled (without) state.
without
This form allows you to specify how to handle the presence of
the ``--without-<test-name>'' command line option. This
differs from ``with'' only in that it defaults to enabled (with).
withlib
This form combines several ``with'' options with a library
existence or functionality test. The ``test-name'' should
correspond to what you would use in the ``
-ltest-name''
link option. The ``with'' options provided are:
- --with-libtest-name=/install/prefix
- --with-libtest-name-include=/path/to/inc/dir
- --with-libtest-name-lib="-L/path/to/lib [ -lname ]"
The first of these is equivalent to:
- --with-libtest-name-include=/install/prefix/include
- --with-libtest-name-lib="-L/install/prefix/lib -ltest-name"
withconf
This form combines ``
withlib'' with a library config
script test. The ``
test-name'' should
correspond to what you would use in the ``
-ltest-name''
link option, and there should be an associated config script for
this library named, ``
test-name-config''. You
will be prompted for the options to provide.
If the user provides the configure option,
--with-libtest-name=/install/prefix
then this macro will search for ``test-name-config''
in both the bin directory under that directory as well as in the
``PATH'' variable.
enable
This is identical to ``with'', except that it uses
``enable/disable'' instead of ``with/without''.
disable
This is identical to ``without'', except that it uses
``enable/disable'' instead of ``with/without''.
test
This is an arbitrary shell script test. It will run in
a subshell, so do not set variables you intend to use later.
This script should ``exit 0'' to indicate success and ``exit 1''
for failure.
For example, to test to see if the "C" compiler accepts the
``--mumble'' option, you might code a test thus:
echo "int foo;"> conftest.c
${CC-cc} --mumble -c conftest.c
res=$?
rm -f conftest.*
exit $res