Allow compiling wxMotif/GTK/X11 for Cygwin/XFree

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mattia Barbon
2002-07-17 16:58:05 +00:00
parent b18b32a196
commit 17234b2644
5 changed files with 827 additions and 756 deletions

1505
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -234,15 +234,10 @@ case "${host}" in
;;
*-*-cygwin* | *-*-mingw32* )
USE_UNIX=0
USE_WIN32=1
dnl MBN: some of the defines have been moved after toolkit detection
dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin
dnl USE_UNIX must be set and not USE_WIN32
SO_SUFFIX=dll
AC_DEFINE(__WIN32__)
AC_DEFINE(__WIN95__)
AC_DEFINE(__WINDOWS__)
AC_DEFINE(__GNUWIN32__)
AC_DEFINE(STRICT)
AC_DEFINE(WINVER, 0x0400)
PROGRAM_EXT=".exe"
RESCOMP=windres
DEFAULT_DEFAULT_wxUSE_MSW=1
@@ -284,11 +279,6 @@ case "${host}" in
AC_MSG_ERROR(unknown system type ${host}.)
esac
if test "$USE_UNIX" = 1 ; then
wxUSE_UNIX=yes
AC_DEFINE(__UNIX__)
fi
dnl ---------------------------------------------------------------------------
dnl command line options for configure
dnl ---------------------------------------------------------------------------
@@ -1121,6 +1111,42 @@ else
AC_MSG_RESULT(base ($host_alias hosted) only)
fi
dnl ---------------------------------------------------------------------------
dnl When we are using Cygwin with Motif/GTK+, we want it to appear like
dnl 'just' a POSIX platform, so the Win32 API must not be available
dnl ---------------------------------------------------------------------------
define_win32=0
case "${host}" in
*-*-cygwin*)
if test "$wxUSE_MSW" = 1 ; then
define_win32=1
fi
;;
*-*-mingw*)
define_win32=1
;;
esac
if test "$define_win32" = 1 ; then
USE_UNIX=0
USE_WIN32=1
AC_DEFINE(__WIN32__)
AC_DEFINE(__WIN95__)
AC_DEFINE(__WINDOWS__)
AC_DEFINE(__GNUWIN32__)
AC_DEFINE(STRICT)
AC_DEFINE(WINVER, 0x0400)
else
USE_UNIX=1
USE_WIN32=0
fi
if test "$USE_UNIX" = 1 ; then
wxUSE_UNIX=yes
AC_DEFINE(__UNIX__)
fi
dnl ---------------------------------------------------------------------------
dnl Checks for programs
dnl ---------------------------------------------------------------------------
@@ -2197,7 +2223,16 @@ equivalent variable and GTK+ is version 1.2.3 or above.
)
fi
GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt -lX11"
dnl MBN: this should really be an AC_TRY_LINK, but it is faster
dnl to special case it
xt_needs_sm_ice=
case "${host}" in
*-*-cygwin* )
xt_needs_sm_ice=" -lSM -lICE"
;;
esac
GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt${xt_needs_sm_ice} -lX11"
TOOLKIT_VPATH="\${top_srcdir}/src/motif${PATH_IFS}\${top_srcdir}/src/motif/xmcombo"
TOOLKIT=MOTIF
GUIDIST=MOTIF_DIST
@@ -2429,7 +2464,7 @@ case "${host}" in
dnl FIXME: is this GL stuff actually even used for wxMSW? should it be??
if test "$cross_compiling" != "yes"; then
if test "$cross_compiling" != "yes" -a "$TOOLKIT_DIR" = "msw"; then
WX_LIBRARY="wxmsw${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
WX_LIBRARY_GL="wxmsw_gl${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}"
WX_LIBRARY_NAME_SHARED="${WX_LIBRARY}.${SO_SUFFIX}"
@@ -3207,8 +3242,9 @@ if test "$TOOLKIT" != "MSW"; then
dnl and finally the userland threads
THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r"
;;
*-*-darwin*)
*-*-darwin* | *-*-cygwin* )
dnl Darwin / Mac OS X just uses -lpthread tested below
dnl and so does Cygwin
THREAD_OPTS=""
;;
*-*-aix*)

View File

@@ -303,6 +303,8 @@ typedef _TUCHAR wxUChar;
# if wxUSE_WCHAR_T
# ifdef HAVE_WCHAR_H
// include wchar.h to get wcslen() declaration used by wx/buffer.h
// stddef.h is needed for Cygwin
# include <stddef.h>
# include <wchar.h>
# elif defined(HAVE_WCSTR_H)
// old compilers have wcslen() here

View File

@@ -56,9 +56,7 @@ bool wxDir::HasFiles(const wxString& spec)
}
// we have a (much) faster version for Unix
// MBN: Cygwin should use the Unix version, but with the current build sistem
// this is painful
#if defined(__CYGWIN__) || !defined(__UNIX_LIKE__) || defined(__WXMAC__)
#if (defined(__CYGWIN__) && defined(__WINDOWS__)) || !defined(__UNIX_LIKE__) || defined(__WXMAC__)
bool wxDir::HasSubDirs(const wxString& spec)
{

View File

@@ -1477,7 +1477,9 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
}
#endif // __DJGPP__
#ifdef __CYGWIN__
// MBN: we hope that in the case the user is compiling a GTK+/Motif app,
// he needs Unix as opposed to Win32 pathnames
#if defined( __CYGWIN__ ) && defined( __WINDOWS__ )
// another example of DOS/Unix mix (Cygwin)
wxString pathUnix = buf;
cygwin_conv_to_full_win32_path(pathUnix, buf);