dnl USE_UNIX must be set and not USE_WIN32
SO_SUFFIX=dll
PROGRAM_EXT=".exe"
- RESCOMP=windres
DEFAULT_DEFAULT_wxUSE_MSW=1
DEFAULT_STD_FLAG=no
;;
dnl FIXME: we should do a better job of testing for these
CC=winegcc
CXX=wineg++
- RESCOMP=wrc
LDFLAGS_GUI="-mwindows"
fi
dnl flush the cache because checking for programs might abort
AC_CACHE_SAVE
-dnl cross-compiling support: we're cross compiling if the build system is
-dnl different from the target one (assume host and target be always the same)
-if test "$build" != "$host" ; then
- if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX" = 1; then
- CC=$host_alias-gcc
- CXX=$host_alias-c++
- AR=$host_alias-ar
- RANLIB=$host_alias-ranlib
- DLLTOOL=$host_alias-dlltool
- RESCOMP=$host_alias-windres
- STRIP=$host_alias-strip
- elif test "x$CC" '!=' "x"; then
- echo "You set CC, I assume you know what you are doing."
- else
- AC_MSG_ERROR($build_alias -> $host_alias cross compilation not supported yet.)
- fi
-fi
-
dnl C-compiler checks
dnl defines CC with the compiler to use
dnl defines GCC with yes if using gcc
dnl ar command
dnl defines AR with the appropriate command
-AC_CHECK_PROG(AR, ar, ar)
+AC_CHECK_TOOL(AR, ar)
if test "x$AR" = "x" ; then
AC_MSG_ERROR([ar is needed to build wxWidgets])
fi
esac
dnl strip command
-dnl defines STRIP as strip or nothing if not found
-AC_CHECK_PROG(STRIP, strip, strip, true)
+dnl defines STRIP as strip or nothing (true) if not found
+AC_CHECK_TOOL(STRIP, strip, true)
+
+dnl Win32 tools
+if test "$wxUSE_WINE" = "yes"; then
+ AC_CHECK_TOOL(RESCOMP, wrc)
+else
+ case "${host}" in
+ *-*-cygwin* | *-*-mingw32* )
+ AC_CHECK_TOOL(RESCOMP, windres)
+ AC_CHECK_TOOL(DLLTOOL, dlltool)
+ ;;
+ esac
+fi
dnl does make support "-include" (only GNU make does AFAIK)?
AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu,
AC_MSG_ERROR([can't link a simple motif program])
fi
+ dnl this seems to be needed under IRIX and shouldn't do any harm
+ dnl elsewhere
+ AC_CHECK_LIB(Sgm, [SgCreateList], [libsgm_link=" -lSgm"])
+
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $TOOLKIT_INCLUDE"
AC_MSG_CHECKING([for Motif 2])
])
CFLAGS=$save_CFLAGS
- GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
+ GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"
TOOLKIT=MOTIF
GUIDIST=MOTIF_DIST
fi
[
char *buf;
va_list ap;
- const char *fmt = "%s";
- vsnprintf(buf, 10u, fmt, 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)
+
+ dnl we know there is a vsnprintf declaration, but some old headers
+ dnl may have one taking a "char *" format instead of "const char *"
+ AC_CACHE_CHECK([if vsnprintf declaration is broken], wx_cv_func_broken_vsnprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ va_list ap;
+ const char *fmt = "%s";
+ vsnprintf(buf, 10u, fmt, ap);
+ ],
+ wx_cv_func_broken_vsnprintf_decl=no,
+ wx_cv_func_broken_vsnprintf_decl=yes
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_broken_vsnprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_BROKEN_VSNPRINTF_DECL)
+ fi
fi
fi
],
[
char *buf;
- const char *fmt = "%s";
- snprintf(buf, 10u, fmt, "wx");
+ snprintf(buf, 10u, "%s", "wx");
],
wx_cv_func_snprintf_decl=yes,
wx_cv_func_snprintf_decl=no
if test "$wx_cv_func_snprintf_decl" = "yes"; then
AC_DEFINE(HAVE_SNPRINTF_DECL)
+
+ dnl we know there is an snprintf declaration, but some old headers
+ dnl may have one taking a "char *" format instead of "const char *"
+ AC_CACHE_CHECK([if snprintf declaration is broken], wx_cv_func_broken_snprintf_decl,
+ [
+ AC_TRY_COMPILE(
+ [
+ #include <stdio.h>
+ #include <stdarg.h>
+ #ifdef __MSL__
+ #if __MSL__ >= 0x6000
+ namespace std {}
+ using namespace std;
+ #endif
+ #endif
+ ],
+ [
+ char *buf;
+ const char *fmt = "%s";
+ snprintf(buf, 10u, fmt, "wx");
+ ],
+ wx_cv_func_broken_snprintf_decl=no,
+ wx_cv_func_broken_snprintf_decl=yes
+ )
+ ]
+ )
+
+ if test "$wx_cv_func_broken_snprintf_decl" = "yes"; then
+ AC_DEFINE(HAVE_BROKEN_SNPRINTF_DECL)
+ fi
fi
fi
AC_BAKEFILE([m4_include(autoconf_inc.m4)])
-if test "$wxUSE_WINE" = "yes"; then
- RESCOMP=wrc
-fi
-
if test "$wxUSE_SHARED" = "yes"; then
dnl We get the shared build linker from bakefile, since it