[For LASSEN capability. Change this to '#undef HAVE_LASSEN', if you
dont want LASSEN.])
-# Checks for libraries.
-if test $prefix = NONE; then
- prefix=$ac_default_prefix
-fi
-LIBDIR="-L$prefix/lib"
+# Standard libraries
LIBS="-lz -lm"
# The order of the libraries is important.
#
# If mounting with shared libraries we may have to specify all possible libraries.
# First check with simple LIBS list, if it fails, then expand the list.
-
-AC_CHECK_LIB(implode, _implode, ,,$LIBDIR)
-AC_CHECK_LIB(jpeg, jpeg_CreateCompress,,,$LIBDIR)
-AC_CHECK_LIB(df, DFopen, ,,$LIBDIR)
-AC_CHECK_LIB(mfhdf, SDstart, ,,$LIBDIR)
-AC_CHECK_LIB(tsdistk, TKopen, ,,$LIBDIR)
+AC_SEARCH_LIBS(_implode, implode)
+AC_SEARCH_LIBS(jpeg_CreateCompress, jpeg )
+AC_SEARCH_LIBS(DFopen, df )
+AC_SEARCH_LIBS(SDstart, mfhdf )
+AC_SEARCH_LIBS(TKopen, tsdistk)
# Check if yywrap is defined in toolkit, and add $LEXLIB to LIBS if not.
YYWRAP=""
-AC_CHECK_LIB(tsdistk, yywrap, YYWRAP="yes",,$LIBDIR)
+AC_SEARCH_LIBS(yywrap, tsdistk, YYWRAP="yes")
if test "$YYWRAP" = ""; then
LIBS="$LIBS $LEXLIB"
fi
+# Test for Windows vs. Unix
+case "${host}" in
+ *mingw32*) SYS="WIN" ;;
+ *cygwin*) SYS="WIN" ;;
+ *) SYS="UNIX" ;;
+esac
+AC_SUBST([SYS])
+AM_CONDITIONAL([SYS_WIN], test "$SYS" = "WIN")
+AM_CONDITIONAL([SYS_UNIX], test "$SYS" = "UNIX")
+
+# Check for relative build
+AC_ARG_ENABLE(relative, [AS_HELP_STRING([--enable-relative],
+ [enable runtime search paths @<:@default=no@:>@])],
+ [DOTS=".."; ac_default_prefix="/"])
+AC_SUBST([DOTS])
+
AC_MSG_RESULT(LIBS = $LIBS)
AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile])
AC_OUTPUT