MS-DOS cross-compilation w/ DJGPP

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2001-12-15 23:15:39 +00:00
parent d00407b2c6
commit f9bc168497
3 changed files with 712 additions and 654 deletions

1304
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -384,6 +384,7 @@ dnl ------------------------------------------------------------------------
dnl assume Unix
USE_UNIX=1
USE_WIN32=0
USE_DOS=0
USE_BEOS=0
USE_MAC=0
@ -561,6 +562,15 @@ case "${host}" in
DEFAULT_DEFAULT_wxUSE_MSW=1
;;
*-pc-msdosdjgpp )
USE_UNIX=0
USE_DOS=1
AC_DEFINE(__DOS__)
PROGRAM_EXT=".exe"
DEFAULT_DEFAULT_wxUSE_MGL=1
DEFAULT_DEFAULT_wxUSE_SHARED=0
;;
*-pc-os2_emx | *-pc-os2-emx )
AC_DEFINE(__EMX__)
PROGRAM_EXT=".exe"
@ -1419,7 +1429,7 @@ 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 ; then
if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 ; then
CC=$host_alias-gcc
CXX=$host_alias-c++
AR=$host_alias-ar
@ -2031,8 +2041,6 @@ equivalent variable and GTK+ is version 1.2.3 or above.
fi
if test "$wxUSE_MGL" = 1; then
dnl FIXME_MGL - test for MGL's variants for freebsd etc.
AC_MSG_CHECKING(for SciTech MGL library)
if test "x$MGL_ROOT" = x ; then
AC_MSG_RESULT(not found)
@ -2041,7 +2049,19 @@ equivalent variable and GTK+ is version 1.2.3 or above.
AC_MSG_RESULT($MGL_ROOT)
fi
mgl_os=linux/gcc/glibc
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
;;
*-pc-msdosdjgpp )
mgl_os=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
@ -2254,7 +2274,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)"
if test "$TOOLKIT" != "MSW"; then
if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then
ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)"
fi
@ -2901,20 +2921,21 @@ AC_FUNC_VPRINTF
dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS here,
dnl do it manually
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS() here,
dnl do it manually. We can't use AC_TRY_COMPILE(), either, because it doesn't
dnl check if the symbol is available at linking time
dnl we use AC_TRY_COMPILE() here instead of AC_TRY_RUN() to make the checks
dnl work for cross-compilation, but AC_TRY_COMPILE() normally only compiles
dnl we use AC_TRY_LINK() here instead of AC_TRY_RUN() to make the checks
dnl work for cross-compilation, but AC_TRY_LINK() normally only compiles
dnl one function while we need at least 2 - hence the ugly hack below. To
dnl understand why it works, remember that AC_TRY_COMPILE() just prepends
dnl understand why it works, remember that AC_TRY_LINK() just prepends
dnl "int main() {" in the beginning of the code and "; return 0; }" at the
dnl end...
dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
dnl we'll find under MSW if it exists.
dnl final note: AC_TRY_COMPILE will only be executed if there is nothing in
dnl final note: AC_TRY_LINK will only be executed if there is nothing in
dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
dnl runs
@ -2922,7 +2943,7 @@ dnl runs
dnl check for vsnprintf() - a safe version of vsprintf()
AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
[
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <stdio.h>
#include <stdarg.h>
], [
@ -2943,7 +2964,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
], [
wx_cv_func_vsnprintf=yes
], [
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <stdio.h>
#include <stdarg.h>
], [
@ -2972,7 +2993,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
if test "$wx_cv_func_vsnprintf" = yes; then
AC_DEFINE(HAVE_VSNPRINTF)
else
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
fi
dnl check for vsscanf()
@ -3773,7 +3794,11 @@ if test "$wxUSE_DATETIME" = "yes"; then
[
wx_cv_var_timezone=__timezone
],
AC_MSG_ERROR(no timezone variable)
[
if test "$USE_DOS" = 0 ; then
AC_MSG_ERROR(no timezone variable)
fi
]
)
]
)
@ -3783,7 +3808,9 @@ if test "$wxUSE_DATETIME" = "yes"; then
)
dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
if test "x$wx_cv_var_timezone" != x ; then
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
fi
dnl check for localtime (it's POSIX, but the check can do no harm...)
AC_CHECK_FUNCS(localtime)

View File

@ -88,6 +88,9 @@
/* PowerPC Darwin & Mac OS X */
#undef __POWERPC__
/* MS-DOS with DJGPP */
#undef __DOS__
/* Stupid hack; __WINDOWS__ clashes with wx/defs.h */
#ifndef __WINDOWS__
#undef __WINDOWS__