WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2)
-WX_ARG_ENABLE(compat22, [ --disable-compat22 disable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2, disable)
+WX_ARG_ENABLE(compat22, [ --enable-compat22 enable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2)
+WX_ARG_ENABLE(compat24, [ --disable-compat24 disable wxWindows 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, disable)
AC_ARG_ENABLE(rpath, [ --enable-rpath=DIR output the rpath flag from wx-config], [wxRPATH_DIR="$enableval"])
fi
if test "$wxUSE_MGL" = 1; then
- AC_MSG_CHECKING(for SciTech MGL library)
+ AC_MSG_CHECKING(for SciTech MGL library)
if test "x$MGL_ROOT" = x ; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR([Cannot find MGL library. Make sure MGL_ROOT is set.])
AC_MSG_RESULT($MGL_ROOT)
fi
+ AC_MSG_CHECKING(for libmgl location)
dnl Find MGL library that we want
dnl FIXME_MGL - test for MGL variants for freebsd etc.
case "${host}" in
*-*-linux* )
- mgl_os="linux/gcc/glibc*"
+ if test "x$wxUSE_SHARED" = xyes ; then
+ mgl_os_candidates="linux/gcc/glibc.so linux/gcc/glibc"
+ else
+ mgl_os_candidates="linux/gcc/glibc linux/gcc/glibc.so"
+ fi
;;
*-pc-msdosdjgpp )
- mgl_os=dos32/dj2
+ mgl_os_candidates="dos32/dj2"
;;
*)
AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
esac
mgl_lib_type=""
-
- if test "$wxUSE_DEBUG_FLAG" = yes ; then
- if test -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.a -o \
- -f $MGL_ROOT/lib/debug/$mgl_os/libmgl.so; then
- mgl_lib_type=debug
- fi
- fi
- if test "x$mgl_lib_type" = x ; then
- if test -f $MGL_ROOT/lib/release/$mgl_os/libmgl.a -o \
- -f $MGL_ROOT/lib/release/$mgl_os/libmgl.so; then
- mgl_lib_type=release
- else
- AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
+ mgl_os=""
+
+ for mgl_os_i in $mgl_os_candidates ; do
+ if test "x$mgl_os" = x ; then
+ if test "$wxUSE_DEBUG_FLAG" = yes ; then
+ if test -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.a -o \
+ -f $MGL_ROOT/lib/debug/$mgl_os_i/libmgl.so; then
+ mgl_lib_type=debug
+ mgl_os=$mgl_os_i
+ fi
+ fi
+ if test "x$mgl_lib_type" = x ; then
+ if test -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.a -o \
+ -f $MGL_ROOT/lib/release/$mgl_os_i/libmgl.so; then
+ mgl_lib_type=release
+ mgl_os=$mgl_os_i
+ fi
+ fi
fi
- fi
+ done
+ if test "x$mgl_os" = x ; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR([Cannot find MGL libraries, make sure they are compiled.])
+ fi
+ AC_MSG_RESULT("$MGL_ROOT/lib/$mgl_lib_type/$mgl_os")
+
wxUSE_UNIVERSAL="yes"
TOOLKIT_INCLUDE="-I$MGL_ROOT/include"
AC_LANG_CPLUSPLUS
dnl check for vsnprintf() -- a safe version of vsprintf())
+dnl
+dnl the trouble here is that on some systems (notable HP-UX) this function is
+dnl present in libc but not in the system headers and so AC_CHECK_FUNCS (which,
+dnl stupidly, provides a dummy function declaration inside its extension)
+dnl succeeds, even with C++ compiler, but the compilation of wxWindows fails
+dnl
+dnl so we first check if the function is in the library
AC_CHECK_FUNCS(vsnprintf)
+if test "$ac_cv_func_vsnprintf" = "yes"; then
+ dnl yes it is -- now check if it is in the headers
+ AC_CACHE_CHECK([for vsnprintf declaration], wx_cv_func_vsnprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ ],
+ [
+ char *buf;
+ va_list ap;
+ vsnprintf(buf, 10u, "%s", ap);
+ ],
+ wx_cv_func_vsnprintf_decl=yes,
+ wx_cv_func_vsnprintf_decl=no
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_vsnprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_VSNPRINTF_DECL)
+ fi
+fi
+
if test "$wxUSE_UNICODE" = yes; then
dnl also look if we have wide char IO functions
AC_CHECK_FUNCS(fputwc wprintf vswprintf)
+
dnl MinGW has a vswprintf with a different prototype, and
dnl a _vsnwprintf with the correct prototype, but AC_CHECK_FUNCS
dnl finds it even if it is not declared in some versions...
],
[
long l;
- statvfs_t fs;
+ struct statvfs fs;
statvfs("/", &fs);
l = fs.f_bsize;
l += fs.f_blocks;
fi
fi
+dnl ---------------------------------------------------------------------------
+dnl compatibility level
+dnl ---------------------------------------------------------------------------
+
if test "$WXWIN_COMPATIBILITY_2" = "yes"; then
AC_DEFINE(WXWIN_COMPATIBILITY_2)
WXWIN_COMPATIBILITY_2_2="yes"
fi
-if test "x$WXWIN_COMPATIBILITY_2_2" != "xno"; then
+if test "x$WXWIN_COMPATIBILITY_2_2" = "xyes"; then
AC_DEFINE(WXWIN_COMPATIBILITY_2_2)
+
+ WXWIN_COMPATIBILITY_2_4="yes"
+fi
+
+if test "x$WXWIN_COMPATIBILITY_2_4" != "xno"; then
+ AC_DEFINE(WXWIN_COMPATIBILITY_2_4)
fi
dnl ---------------------------------------------------------------------------
AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX")
+dnl define the variables used in wx-config
+top_builddir=`pwd`
+
dnl ---------------------------------------------------------------------------
dnl Output the makefiles and such from the results found above
dnl ---------------------------------------------------------------------------
AC_SUBST(TOOLCHAIN_DLL_DEFS)
dnl wx-config options
+AC_SUBST(top_builddir)
AC_SUBST(host_alias)
AC_SUBST(cross_compiling)
AC_SUBST(WXCONFIG_LIBS)
echo " What level of wxWindows compatibility should be enabled?"
echo " wxWindows 2.0 ${WXWIN_COMPATIBILITY_2:-no}"
-echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-yes}"
+echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-no}"
+echo " wxWindows 2.4 ${WXWIN_COMPATIBILITY_2_4:-yes}"
echo " Which libraries should wxWindows use?"
echo " jpeg ${wxUSE_LIBJPEG-none}"