version 1.5, 2002/01/28 14:40:26 |
version 1.9, 2002/03/19 17:42:48 |
| |
[ AC_REQUIRE_CPP() | [ AC_REQUIRE_CPP() |
| |
chk_message_obj="$1" | chk_message_obj="$1" |
nel_dir_lnk="$2" | nel_test_lib="$2" |
nel_libraries="$3" | is_mandatory="$3" |
nel_test_lib="$4" | |
is_mandatory="$5" | |
| |
if test $is_mandatory = "yes" | if test $is_mandatory = "yes" |
then | then |
| |
AC_MSG_CHECKING(for -l$nel_test_lib) | AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed ().])]) |
| |
if test $nel_libraries | |
then | |
NEL_TEST_LIBS="-L$nel_libraries -l$nel_test_lib" | |
| |
else | |
NEL_TEST_LIBS="$nel_dir_lnk -l$nel_test_lib" | |
fi | |
| |
_CPPFLAGS="$CPPFLAGS" | |
| |
CPPFLAGS="$CXXFLAGS $NEL_TEST_LIBS" | |
| |
AC_TRY_LINK( , , have_nel_test_libraries="yes", have_nel_test_libraries="no") | |
| |
CPPFLAGS="$_CPPFLAGS" | |
| |
if test "$have_nel_test_libraries" = "yes" | |
then | |
AC_MSG_RESULT(yes) | |
else | |
if test "$is_mandatory" = "yes" | |
then | |
AC_MSG_ERROR([$chk_message_obj must be installed ().]) | |
else | |
AC_MSG_RESULT(no) | |
fi | |
fi | |
fi | fi |
]) | ]) |
| |
| |
e.g. /usr/local/nel/lib]) | e.g. /usr/local/nel/lib]) |
| |
| |
nel_misc_lib="nelmisc" | |
nel_net_lib="nelnet" | |
nel_3d_lib="nel3d" | |
nel_pacs_lib="nelpacs" | |
nel_sound_lib="nelsound" | |
nel_ai_lib="nelai" | |
| |
nelmisc_is_mandatory="$1" | nelmisc_is_mandatory="$1" |
nelnet_is_mandatory="$2" | nelnet_is_mandatory="$2" |
nel3d_is_mandatory="$3" | nel3d_is_mandatory="$3" |
| |
nelsound_is_mandatory="$5" | nelsound_is_mandatory="$5" |
nelai_is_mandatory="$6" | nelai_is_mandatory="$6" |
| |
nelconfig_libs_args="" | dnl Check for nel-config |
| AC_PATH_PROG(NEL_CONFIG, nel-config, no) |
| |
if test "$nelnet_is_mandatory" != "yes" | dnl |
| dnl Configure options (--with-nel*) have precendence |
| dnl over nel-config only set variables if they are not |
| dnl specified |
| dnl |
| if test "$NEL_CONFIG" != "no" |
then | then |
nelconfig_libs_args="$nelconfig_libs_args --without-network" | if test -z "$with_nel" -a -z "$with_nel_include" |
fi | |
| |
if test "$nel3d_is_mandatory" != "yes" | |
then | then |
nelconfig_libs_args="$nelconfig_libs_args --without-3d" | CXXFLAGS="$CXXFLAGS `nel-config --cflags`" |
fi | fi |
| |
if test "$nelpacs_is_mandatory" != "yes" | if test -z "$with_nel" -a -z "$with_nel_lib" |
then | then |
nelconfig_libs_args="$nelconfig_libs_args --without-pacs" | LDFLAGS="`nel-config --ldflags` $LDFLAGS" |
fi | fi |
| |
if test "$nelsound_is_mandatory" != "yes" | |
then | |
nelconfig_libs_args="$nelconfig_libs_args --without-sound" | |
fi | fi |
| |
if test "$nelai_is_mandatory" != "yes" | dnl |
| dnl Set nel_libraries and nel_includes according to |
| dnl user specification (--with-nel*) if any. |
| dnl --with-nel-include and --with-nel-lib have precendence |
| dnl over --with-nel |
| dnl |
| if test "$with_nel" = "no" |
then | then |
nelconfig_libs_args="$nelconfig_libs_args --without-ai" | dnl The user explicitly disabled the use of the NeL |
fi | AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel]) |
| |
dnl Check for nel-config | |
AC_PATH_PROG(NEL_CONFIG, nel-config, no) | |
| |
if test "$NEL_CONFIG" = "no" | |
then | |
have_nel_config="no" | |
else | else |
NEL_CFLAGS=`nel-config --cflags` | if test "$with_nel" -a "$with_nel" != "yes" |
NEL_LIBS=`nel-config --libs $nelconfig_libs_args` | |
| |
nel_dir_lnk=`echo '$NEL_LIBS' | sed -e 's/[[:space:]]*-l[^[:space:]]*//g'` | |
| |
have_nel_config="yes" | |
fi | |
| |
if test "$with_nel" | |
then | then |
nel_includes="$with_nel/include" | nel_includes="$with_nel/include" |
nel_libraries="$with_nel/lib" | nel_libraries="$with_nel/lib" |
fi | fi |
| fi |
| |
if test "$with_nel_include" | if test "$with_nel_include" |
then | then |
| |
nel_libraries="$with_nel_lib" | nel_libraries="$with_nel_lib" |
fi | fi |
| |
| dnl |
| dnl Set compilation variables |
| dnl |
if test "$nel_includes" | if test "$nel_includes" |
then | then |
NEL_CFLAGS="-I$nel_includes" | CXXFLAGS="$CXXFLAGS -I$nel_includes" |
fi | fi |
| |
if test "$nel_libraries" | if test "$nel_libraries" |
then | then |
NEL_LIBS="-L$nel_libraries" | LDFLAGS="-L$nel_libraries $LDFLAGS" |
fi | fi |
| |
dnl Checking for NeL headers | dnl |
| dnl Collect headers information and bark if missing and |
| dnl mandatory |
| dnl |
| |
MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) | MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory) |
MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) | MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory) |
MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) | MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory) |
| |
MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) | MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory) |
MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) | MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory) |
| |
dnl Checking for NeL libraries | dnl |
MY_NEL_LIB_CHK([NeL Misc], $nel_dir_lnk, $nel_libraries, $nel_misc_lib, $nelmisc_is_mandatory) | dnl Collect libraries information and bark if missing and |
MY_NEL_LIB_CHK([NeL Network], $nel_dir_lnk, $nel_libraries, $nel_net_lib, $nelnet_is_mandatory) | dnl mandatory |
MY_NEL_LIB_CHK([NeL 3D], $nel_dir_lnk, $nel_libraries, $nel_3d_lib, $nel3d_is_mandatory) | dnl |
MY_NEL_LIB_CHK([NeL PACS], $nel_dir_lnk, $nel_libraries, $nel_pacs_lib, $nelpacs_is_mandatory) | |
MY_NEL_LIB_CHK([NeL Sound], $nel_dir_lnk, $nel_libraries, $nel_sound_lib, $nelsound_is_mandatory) | MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory) |
MY_NEL_LIB_CHK([NeL AI], $nel_dir_lnk, $nel_libraries, $nel_ai_lib, $nelai_is_mandatory) | MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory) |
| MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory) |
| MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory) |
| MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory) |
| MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory) |
| |
]) | ]) |
| |
| |
path to the STLPort library files directory. | path to the STLPort library files directory. |
e.g. /usr/local/stlport/lib]) | e.g. /usr/local/stlport/lib]) |
| |
| if test "$with_debug" = "full" |
| then |
| stlport_lib="stlport_gcc_stldebug" |
| else |
stlport_lib="stlport_gcc" | stlport_lib="stlport_gcc" |
| fi |
| |
if test "$with_stlport" = no | if test "$with_stlport" = no |
then | then |
dnl The user explicitly disabled the use of the STLPorts | dnl The user explicitly disabled the use of the STLPorts |
AC_MSG_CHECKING(STLPort) | AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport]) |
have_stlport="disabled" | |
AC_MSG_RESULT(disabled (*** EXPERIMENTAL ***)) | |
else | else |
if test "$with_stlport" | stlport_includes="/usr/include/stlport" |
| if test "$with_stlport" -a "$with_stlport" != yes |
then | then |
stlport_includes="$with_stlport/stlport" | stlport_includes="$with_stlport/stlport" |
stlport_libraries="$with_stlport/lib" | stlport_libraries="$with_stlport/lib" |
| |
| if test ! -d "$stlport_includes" |
| then |
| stlport_includes="$with_stlport/include/stlport" |
| fi |
fi | fi |
fi | fi |
| |
if test -z "$have_stlport" -a "$with_stlport_include" | if test "$with_stlport_include" |
then | then |
stlport_includes="$with_stlport_include" | stlport_includes="$with_stlport_include" |
fi | fi |
| |
if test -z "$have_stlport" -a "$with_stlport_lib" | if test "$with_stlport_lib" |
then | then |
stlport_libraries="$with_stlport_lib" | stlport_libraries="$with_stlport_lib" |
fi | fi |
| |
if test -z "$have_stlport" | AC_LANG_SAVE |
then | AC_LANG_CPLUSPLUS |
| |
dnl Put STLPorts includes in CXXFLAGS | dnl Put STLPorts includes in CXXFLAGS |
if test "$stlport_includes" | if test "$stlport_includes" |
then | then |
CXXFLAGS="$CXXFLAGS -I$stlport_includes" | CXXFLAGS="$CXXFLAGS -I$stlport_includes" |
fi | fi |
| |
dnl Put STLPorts libraries in LIBS | dnl Put STLPorts libraries directory in LIBS |
if test "$stlport_libraries" | if test "$stlport_libraries" |
then | then |
LIBS="-L$stlport_libraries $LIBS -l$stlport_lib" | LIBS="-L$stlport_libraries $LIBS" |
| else |
| stlport_libraries='default' |
fi | fi |
| |
dnl Test the headers | dnl Test the headers |
AC_MSG_CHECKING(for STLPort headers) | |
| |
_CPPFLAGS="$CPPFLAGS" | |
| |
CPPFLAGS="$CXXFLAGS" | AC_CHECK_HEADER(algorithm, |
| |
AC_EGREP_CPP( yo_stlport, | |
[#include <algorithm> | |
#ifdef __SGI_STL_PORT | |
yo_stlport | |
#endif], | |
have_stlport_headers="yes", | have_stlport_headers="yes", |
have_stlport_headers="no" ) | have_stlport_headers="no" ) |
| |
| AC_MSG_CHECKING(for STLPort headers) |
| |
if test "$have_stlport_headers" = "yes" | if test "$have_stlport_headers" = "yes" |
then | then |
AC_MSG_RESULT([$stlport_includes]) | AC_MSG_RESULT([$stlport_includes]) |
| |
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) |
fi | fi |
| |
dnl Test the libraries | AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no") |
AC_MSG_CHECKING(for STLPort libraries) | |
| |
CPPFLAGS="$CXXFLAGS $LIBS" | AC_MSG_CHECKING(for STLPort library) |
| |
AC_TRY_LINK( , , have_stlport_libraries="yes", have_stlport_libraries="no") | if test "$have_stlport_libraries" != "no" |
| |
CPPFLAGS="$_CPPFLAGS" | |
| |
if test "$have_stlport_libraries" = "yes" | |
then | then |
AC_MSG_RESULT([$stlport_libraries]) | AC_MSG_RESULT([$stlport_libraries]) |
else | else |
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) |
fi | fi |
| |
if test "$have_stlport_headers" = "yes" \ | if test "$have_stlport_headers" = "yes" && |
&& test "$have_stlport_libraries" = "yes" | test "$have_stlport_libraries" != "no" |
then | then |
have_stlport="yes" | have_stlport="yes" |
else | else |
| |
AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) | AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).]) |
fi | fi |
| |
fi | AC_LANG_RESTORE |
| |
]) | ]) |
| |