Merge branch 'osx.11'

Minor fixes and improvements for building under OS X 10.11 (El Capitan).
This commit is contained in:
Vadim Zeitlin
2016-03-21 01:08:54 +01:00
8 changed files with 1034 additions and 2544 deletions

View File

@@ -87,17 +87,6 @@ AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER_LATER_THAN],
AC_LANG_POP($2)
])
dnl CodeWarrior Metrowerks compiler defines __MWERKS__ for both C and C++
AC_DEFUN([AC_BAKEFILE_PROG_MWCC],
[
_AC_BAKEFILE_LANG_COMPILER(Metrowerks, C, __MWERKS__, MWCC=yes)
])
AC_DEFUN([AC_BAKEFILE_PROG_MWCXX],
[
_AC_BAKEFILE_LANG_COMPILER(Metrowerks, C++, __MWERKS__, MWCXX=yes)
])
dnl IBM xlC compiler defines __xlC__ for both C and C++
AC_DEFUN([AC_BAKEFILE_PROG_XLCC],
[
@@ -190,46 +179,6 @@ AC_DEFUN([AC_BAKEFILE_PROG_COMPAQCXX],
_AC_BAKEFILE_LANG_COMPILER(Compaq, C++, __DECCXX, COMPAQCXX=yes)
])
dnl ===========================================================================
dnl macros to detect specialty compiler options
dnl ===========================================================================
dnl Figure out if we need to pass -ext o to compiler (MetroWerks)
AC_DEFUN([AC_BAKEFILE_METROWERKS_EXTO],
[AC_CACHE_CHECK([if the _AC_LANG compiler requires -ext o], bakefile_cv_[]_AC_LANG_ABBREV[]_exto,
dnl First create an empty conf test
[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
dnl Now remove .o and .c.o or .cc.o
rm -f conftest.$ac_objext conftest.$ac_ext.o
dnl Now compile the test
AS_IF([AC_TRY_EVAL(ac_compile)],
dnl If the test succeeded look for conftest.c.o or conftest.cc.o
[for ac_file in `(ls conftest.* 2>/dev/null)`; do
case $ac_file in
conftest.$ac_ext.o)
bakefile_cv_[]_AC_LANG_ABBREV[]_exto="-ext o"
;;
*)
;;
esac
done],
[AC_MSG_FAILURE([cannot figure out if compiler needs -ext o: cannot compile])
]) dnl AS_IF
rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext
]) dnl AC_CACHE_CHECK
if test "x$bakefile_cv_[]_AC_LANG_ABBREV[]_exto" '!=' "x"; then
if test "[]_AC_LANG_ABBREV[]" = "c"; then
CFLAGS="$bakefile_cv_[]_AC_LANG_ABBREV[]_exto $CFLAGS"
fi
if test "[]_AC_LANG_ABBREV[]" = "cxx"; then
CXXFLAGS="$bakefile_cv_[]_AC_LANG_ABBREV[]_exto $CXXFLAGS"
fi
fi
]) dnl AC_DEFUN
dnl ===========================================================================
dnl Macros to do all of the compiler detections as one macro
dnl ===========================================================================
@@ -253,14 +202,6 @@ AC_DEFUN([_AC_BAKEFILE_PROG_COMPILER],
dnl if we're using gcc, we can't be using any of incompatible compilers
if test "x$G$1" != "xyes"; then
if test "x$1" = "xC"; then
AC_BAKEFILE_METROWERKS_EXTO
if test "x$bakefile_cv_c_exto" '!=' "x"; then
unset ac_cv_prog_cc_g
_AC_PROG_CC_G
fi
fi
dnl most of these compilers are only used under well-defined OS so
dnl don't waste time checking for them on other ones
case `uname -s` in
@@ -269,10 +210,7 @@ AC_DEFUN([_AC_BAKEFILE_PROG_COMPILER],
;;
Darwin)
AC_BAKEFILE_PROG_MW$1
if test "$MW$1" != "yes"; then
AC_BAKEFILE_PROG_XL$1
fi
AC_BAKEFILE_PROG_XL$1
;;
IRIX*)

View File

@@ -501,10 +501,6 @@ AC_DEFUN([AC_BAKEFILE_DEPS],
DEPSMODE=gcc
DEPSFLAG="-MMD"
AC_MSG_RESULT([gcc])
elif test "x$MWCC" = "xyes"; then
DEPSMODE=mwcc
DEPSFLAG="-MM"
AC_MSG_RESULT([mwcc])
elif test "x$SUNCC" = "xyes"; then
DEPSMODE=unixcc
DEPSFLAG="-xM1"
@@ -843,34 +839,6 @@ if test ${D}DEPSMODE = gcc ; then
fi
exit 0
elif test ${D}DEPSMODE = mwcc ; then
${D}* || exit ${D}?
# Run mwcc again with -MM and redirect into the dep file we want
# NOTE: We can't use shift here because we need ${D}* to be valid
prevarg=
for arg in ${D}* ; do
if test "${D}prevarg" = "-o"; then
objfile=${D}arg
else
case "${D}arg" in
-* )
;;
* )
srcfile=${D}arg
;;
esac
fi
prevarg="${D}arg"
done
objfilebase=\`basename ${D}objfile\`
builddir=\`dirname ${D}objfile\`
depsdir=${D}builddir/${D}DEPSDIRBASE
mkdir -p ${D}depsdir
${D}* ${D}DEPSFLAG >${D}{depsdir}/${D}{objfilebase}.d
exit 0
elif test ${D}DEPSMODE = unixcc; then
${D}* || exit ${D}?
# Run compiler again with deps flag and redirect into the dep file.

3359
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1065,12 +1065,12 @@ if test -n "$wxWITH_CXX"; then
dnl autoconf, not run, time.
case "$wxWITH_CXX" in
11)
AX_CXX_COMPILE_STDCXX(11,,optional)
if test -n "$wxWITH_CXX_IS_OPTIONAL"; then
AX_CXX_COMPILE_STDCXX(11,,optional)
else
AX_CXX_COMPILE_STDCXX(11)
if test "$HAVE_CXX11" != 1; then
AC_MSG_FAILURE([C++11 support was requested but is not available])
fi
fi
have_cxxN=$HAVE_CXX11
;;
14)
@@ -1078,6 +1078,10 @@ if test -n "$wxWITH_CXX"; then
dnl and not --enable-cxx14 option.
AX_CXX_COMPILE_STDCXX(14)
dnl Notice that because it's not optional, the macro doesn't define
dnl HAVE_CXX14. We don't use it anyhow so far, so it doesn't
dnl matter, but we could need to do it ourselves here in the future.
dnl If we have C++14, we necessarily have C++11 too.
HAVE_CXX11=1
;;
@@ -7576,6 +7580,10 @@ elif test "$GXX" = yes ; then
dnl other ones
if test "$WXGTK3" = 1 -o "$wxUSE_MAC" = 1 ; then
CXXWARNINGS="$CXXWARNINGS -Wno-deprecated-declarations"
dnl CXXWARNINGS is not used for Objective-C++ code compilation, but we
dnl want to avoid these warnings in it too when building wxOSX.
OBJCXXFLAGS="$OBJCXXFLAGS -Wno-deprecated-declarations"
fi
fi
@@ -7606,22 +7614,6 @@ dnl only stuff to it
WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS`
if test "x$MWCC" = "xyes"; then
dnl Correct MW 8.3 to be more similar to GCC. In particular we
dnl must use <regex.h> from system not our local copy on OS X,
dnl but must use local not system on OS 9.
dnl The following should make all -I paths usable for <> includes
dnl while first checking in real system paths. With 8.3 using
dnl -gccincludes it will actually check local paths before system
dnl even for <> which is totally wrong.
dnl Note that because this absolutely needs to be before any -I
dnl that we have to tack it on to the end of the compiler commandline.
CC="$CC -cwd source -I-"
CXX="$CXX -cwd source -I-"
fi
LIBS=`echo $LIBS`
EXTRALIBS="$LDFLAGS $LDFLAGS_VERSIONING $LIBS $DMALLOC_LIBS"
EXTRALIBS_XML="$EXPAT_LINK"

View File

@@ -2,20 +2,13 @@
. `dirname $0`/makeunixtags.sh
create_tags osx
osx_port=${1-cocoa}
if [[ $osx_port = carbon ]]; then
ext=cpp
else
ext=mm
fi
ctags --totals --c++-kinds=+px --language-force=c++ \
-f osx_$osx_port.tags \
-a \
-I @misc/scripts/ctags.ignore \
include/wx/osx/core/*.h \
include/wx/osx/core/private/*.h \
include/wx/osx/private/*.h \
include/wx/osx/$osx_port/*.h \
include/wx/osx/$osx_port/private/*.h \
include/wx/osx/cocoa/*.h \
include/wx/osx/cocoa/private/*.h \
src/osx/core/*.cpp \
src/osx/$osx_port/*.$ext
src/osx/cocoa/*.mm

View File

@@ -182,7 +182,7 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win,
HIRect headerRect = CGRectMake( x, y, w, h );
if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
win->RefreshRect(rect);
}
else
{
@@ -271,7 +271,7 @@ void wxRendererMac::DrawTreeItemButton( wxWindow *win,
HIRect headerRect = CGRectMake( x, y, w, h );
if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
win->RefreshRect(rect);
}
else
{
@@ -423,7 +423,7 @@ wxRendererMac::DrawMacThemeButton(wxWindow *win,
HIRect headerRect = CGRectMake( x, y, w, h );
if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
win->RefreshRect(rect);
}
else
{
@@ -668,7 +668,7 @@ void wxRendererMac::DrawTextCtrl(wxWindow* win, wxDC& dc,
HIRect hiRect = CGRectMake( x, y, w, h );
if ( !wxHasCGContext(win, dc) )
{
win->Refresh( &rect );
win->RefreshRect(rect);
}
else
{

View File

@@ -126,7 +126,7 @@ public:
#endif
}
virtual bool AddAction(wxWindowID actionid, const wxString &label)
virtual bool AddAction(wxWindowID actionid, const wxString &label) wxOVERRIDE
{
if (m_actions.size() >= 1) // Currently only 1 actions are supported
return false;

View File

@@ -2109,19 +2109,12 @@ bool wxWidgetCocoaImpl::ShowWithEffect(bool show,
return ShowViewOrWindowWithEffect(m_wxPeer, show, effect, timeout);
}
/* note that the drawing order between siblings is not defined under 10.4 */
/* only starting from 10.5 the subview order is respected */
/* NSComparisonResult is typedef'd as an enum pre-Leopard but typedef'd as
* NSInteger post-Leopard. Pre-Leopard the Cocoa toolkit expects a function
* returning int and not NSComparisonResult. Post-Leopard the Cocoa toolkit
* expects a function returning the new non-enum NSComparsionResult.
* Hence we create a typedef named CocoaWindowCompareFunctionResult.
*/
#if defined(NSINTEGER_DEFINED)
typedef NSComparisonResult CocoaWindowCompareFunctionResult;
// To avoid warnings about incompatible pointer types with Xcode 7, we need to
// constrain the comparison function arguments instead of just using "id".
#if __has_feature(objc_kindof)
typedef __kindof NSView* KindOfView;
#else
typedef int CocoaWindowCompareFunctionResult;
typedef id KindOfView;
#endif
class CocoaWindowCompareContext
@@ -2135,19 +2128,20 @@ public:
// Cocoa sorts subviews in-place.. make a copy
m_subviews = [subviews copy];
}
~CocoaWindowCompareContext()
{ // release the copy
[m_subviews release];
}
NSView* target()
{ return m_target; }
NSArray* subviews()
{ return m_subviews; }
/* Helper function that returns the comparison based off of the original ordering */
CocoaWindowCompareFunctionResult CompareUsingOriginalOrdering(id first, id second)
NSComparisonResult CompareUsingOriginalOrdering(KindOfView first,
KindOfView second)
{
NSUInteger firstI = [m_subviews indexOfObjectIdenticalTo:first];
NSUInteger secondI = [m_subviews indexOfObjectIdenticalTo:second];
@@ -2157,14 +2151,14 @@ public:
// sortSubviewsUsingFunction:context:. Thus we don't bother checking. Particularly because
// that case should never occur anyway because that would imply a multi-threaded GUI call
// which is a big no-no with Cocoa.
// Subviews are ordered from back to front meaning one that is already lower will have an lower index.
NSComparisonResult result = (firstI < secondI)
? NSOrderedAscending /* -1 */
: (firstI > secondI)
? NSOrderedDescending /* 1 */
: NSOrderedSame /* 0 */;
? NSOrderedAscending /* -1 */
: (firstI > secondI)
? NSOrderedDescending /* 1 */
: NSOrderedSame /* 0 */;
return result;
}
private:
@@ -2178,7 +2172,7 @@ private:
* the target view is always higher than every other view. When comparing two views neither of
* which is the target, it returns the correct response based on the original ordering
*/
static CocoaWindowCompareFunctionResult CocoaRaiseWindowCompareFunction(id first, id second, void *ctx)
static NSComparisonResult CocoaRaiseWindowCompareFunction(KindOfView first, KindOfView second, void *ctx)
{
CocoaWindowCompareContext *compareContext = (CocoaWindowCompareContext*)ctx;
// first should be ordered higher
@@ -2192,22 +2186,21 @@ static CocoaWindowCompareFunctionResult CocoaRaiseWindowCompareFunction(id first
void wxWidgetCocoaImpl::Raise()
{
NSView* nsview = m_osxView;
NSView* nsview = m_osxView;
NSView *superview = [nsview superview];
CocoaWindowCompareContext compareContext(nsview, [superview subviews]);
[superview sortSubviewsUsingFunction:
CocoaRaiseWindowCompareFunction
context: &compareContext];
[superview sortSubviewsUsingFunction: CocoaRaiseWindowCompareFunction
context: &compareContext];
}
/* Causes Cocoa to lower the target view to the bottom of the Z-Order by telling the sort function that
* the target view is always lower than every other view. When comparing two views neither of
* which is the target, it returns the correct response based on the original ordering
*/
static CocoaWindowCompareFunctionResult CocoaLowerWindowCompareFunction(id first, id second, void *ctx)
static NSComparisonResult CocoaLowerWindowCompareFunction(KindOfView first, KindOfView second, void *ctx)
{
CocoaWindowCompareContext *compareContext = (CocoaWindowCompareContext*)ctx;
// first should be ordered lower
@@ -2221,14 +2214,13 @@ static CocoaWindowCompareFunctionResult CocoaLowerWindowCompareFunction(id first
void wxWidgetCocoaImpl::Lower()
{
NSView* nsview = m_osxView;
NSView* nsview = m_osxView;
NSView *superview = [nsview superview];
CocoaWindowCompareContext compareContext(nsview, [superview subviews]);
[superview sortSubviewsUsingFunction:
CocoaLowerWindowCompareFunction
context: &compareContext];
[superview sortSubviewsUsingFunction: CocoaLowerWindowCompareFunction
context: &compareContext];
}
void wxWidgetCocoaImpl::ScrollRect( const wxRect *WXUNUSED(rect), int WXUNUSED(dx), int WXUNUSED(dy) )