Enable using PIC by default even for static libraries and several other
build-related fixes (warning fixes etc).

See https://github.com/wxWidgets/wxWidgets/pull/2008
This commit is contained in:
Vadim Zeitlin
2020-08-08 02:01:06 +02:00
19 changed files with 119 additions and 44 deletions

View File

@@ -83,6 +83,10 @@ function(wx_set_common_target_properties target_name)
RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}" RUNTIME_OUTPUT_DIRECTORY "${wxOUTPUT_DIR}${wxPLATFORM_LIB_DIR}"
) )
if(wxBUILD_PIC)
set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
if(MSVC) if(MSVC)
if(wxCOMMON_TARGET_PROPS_DEFAULT_WARNINGS) if(wxCOMMON_TARGET_PROPS_DEFAULT_WARNINGS)
set(MSVC_WARNING_LEVEL "/W3") set(MSVC_WARNING_LEVEL "/W3")
@@ -340,7 +344,7 @@ macro(wx_add_library name)
add_library(${name} ${wxBUILD_LIB_TYPE} ${src_files}) add_library(${name} ${wxBUILD_LIB_TYPE} ${src_files})
add_library(wx::${name_short} ALIAS ${name}) add_library(wx::${name_short} ALIAS ${name})
wx_set_target_properties(${name} ${wxADD_LIBRARY_IS_BASE}) wx_set_target_properties(${name} ${wxADD_LIBRARY_IS_BASE})
set_property(TARGET ${name} PROPERTY PROJECT_LABEL ${name_short}) set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})
# Setup install # Setup install
wx_install(TARGETS ${name} wx_install(TARGETS ${name}
@@ -498,6 +502,10 @@ function(wx_set_builtin_target_properties target_name)
set_target_properties(${target_name} PROPERTIES FOLDER "Third Party Libraries") set_target_properties(${target_name} PROPERTIES FOLDER "Third Party Libraries")
if(wxBUILD_SHARED OR wxBUILD_PIC)
set_target_properties(${target_name} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
wx_set_common_target_properties(${target_name} DEFAULT_WARNINGS) wx_set_common_target_properties(${target_name} DEFAULT_WARNINGS)
if(NOT wxBUILD_SHARED) if(NOT wxBUILD_SHARED)
wx_install(TARGETS ${name} ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}") wx_install(TARGETS ${name} ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}")
@@ -517,10 +525,7 @@ function(wx_add_builtin_library name)
add_library(${name} STATIC ${src_list}) add_library(${name} STATIC ${src_list})
add_library(wx::${name_short} ALIAS ${name}) add_library(wx::${name_short} ALIAS ${name})
wx_set_builtin_target_properties(${name}) wx_set_builtin_target_properties(${name})
set_property(TARGET ${name} PROPERTY PROJECT_LABEL ${name_short}) set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short})
if(wxBUILD_SHARED)
set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
endfunction() endfunction()
# List of third party libraries added via wx_add_thirdparty_library() # List of third party libraries added via wx_add_thirdparty_library()

View File

@@ -8,6 +8,8 @@
############################################################################# #############################################################################
if(wxUSE_EXPAT STREQUAL "builtin") if(wxUSE_EXPAT STREQUAL "builtin")
# TODO: implement building expat via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxexpat wx_add_builtin_library(wxexpat
src/expat/expat/lib/xmlparse.c src/expat/expat/lib/xmlparse.c
src/expat/expat/lib/xmlrole.c src/expat/expat/lib/xmlrole.c

View File

@@ -8,6 +8,8 @@
############################################################################# #############################################################################
if(wxUSE_LIBPNG STREQUAL "builtin") if(wxUSE_LIBPNG STREQUAL "builtin")
# TODO: implement building libpng via its CMake file, using
# add_subdirectory or ExternalProject_Add
if(NOT MSVC) if(NOT MSVC)
set(PNG_EXTRA_SOURCES set(PNG_EXTRA_SOURCES
src/png/mips/filter_msa_intrinsics.c src/png/mips/filter_msa_intrinsics.c

View File

@@ -8,7 +8,6 @@
############################################################################# #############################################################################
if(wxUSE_REGEX) if(wxUSE_REGEX)
# TODO: Forcing builtin until sys is implemented
set(wxUSE_REGEX builtin) set(wxUSE_REGEX builtin)
wx_add_builtin_library(wxregex wx_add_builtin_library(wxregex
src/regex/regcomp.c src/regex/regcomp.c
@@ -20,5 +19,3 @@ if(wxUSE_REGEX)
set(REGEX_LIBRARIES wxregex) set(REGEX_LIBRARIES wxregex)
set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/src/regex) set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/src/regex)
endif() endif()
#TODO: find external lib and include dir

View File

@@ -8,13 +8,8 @@
############################################################################# #############################################################################
if(wxUSE_LIBTIFF STREQUAL "builtin") if(wxUSE_LIBTIFF STREQUAL "builtin")
# TODO: implement building libtiff via ExternalProject_Add() # TODO: implement building libtiff via its CMake file, using
if(UNIX AND NOT APPLE) # add_subdirectory or ExternalProject_Add
message(WARNING "Builtin libtiff on unix is currently not supported")
wx_option_force_value(wxUSE_LIBTIFF OFF)
return()
endif()
if(WIN32) if(WIN32)
set(TIFF_PLATFORM_SRC src/tiff/libtiff/tif_win32.c) set(TIFF_PLATFORM_SRC src/tiff/libtiff/tif_win32.c)
elseif(UNIX) elseif(UNIX)

View File

@@ -8,6 +8,8 @@
############################################################################# #############################################################################
if(wxUSE_ZLIB STREQUAL "builtin") if(wxUSE_ZLIB STREQUAL "builtin")
# TODO: implement building zlib via its CMake file, using
# add_subdirectory or ExternalProject_Add
wx_add_builtin_library(wxzlib wx_add_builtin_library(wxzlib
src/zlib/adler32.c src/zlib/adler32.c
src/zlib/compress.c src/zlib/compress.c

View File

@@ -9,6 +9,7 @@ SET( WEBKIT2_VERSION 4.0)
set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND) set(WEBKIT2_INCLUDE_DIR WEBKIT2_INCLUDE_DIR-NOTFOUND)
set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND) set(WEBKIT2_LIBRARY WEBKIT2_LIBRARY-NOTFOUND)
set(WEBKIT2_JS_LIBRARY WEBKIT2_JS_LIBRARY-NOTFOUND)
set(WEBKIT2_LIBRARIES WEBKIT2_LIBRARIES-NOTFOUND) set(WEBKIT2_LIBRARIES WEBKIT2_LIBRARIES-NOTFOUND)
FIND_PATH(WEBKIT2_INCLUDE_DIR webkit2/webkit2.h FIND_PATH(WEBKIT2_INCLUDE_DIR webkit2/webkit2.h
@@ -20,6 +21,11 @@ FIND_LIBRARY(WEBKIT2_LIBRARY
NAMES ${WEBKIT2_NAMES} NAMES ${WEBKIT2_NAMES}
) )
SET(WEBKIT2_JS_NAMES "javascriptcoregtk-${WEBKIT2_VERSION}")
FIND_LIBRARY(WEBKIT2_JS_LIBRARY
NAMES ${WEBKIT2_JS_NAMES}
)
# Handle the QUIETLY and REQUIRED arguments and set WEBKIT2_FOUND to # Handle the QUIETLY and REQUIRED arguments and set WEBKIT2_FOUND to
# TRUE if all listed variables are TRUE. # TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
@@ -29,7 +35,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(
) )
IF(WEBKIT2_FOUND) IF(WEBKIT2_FOUND)
SET( WEBKIT2_LIBRARIES ${WEBKIT2_LIBRARY} ) SET( WEBKIT2_LIBRARIES ${WEBKIT2_LIBRARY} ${WEBKIT2_JS_LIBRARY} )
ELSE(WEBKIT2_FOUND) ELSE(WEBKIT2_FOUND)
SET( WEBKIT2_LIBRARIES ) SET( WEBKIT2_LIBRARIES )
ENDIF(WEBKIT2_FOUND) ENDIF(WEBKIT2_FOUND)

View File

@@ -64,6 +64,8 @@ else()
endif() endif()
wx_option(wxBUILD_STRIPPED_RELEASE "remove debug symbols in release build" ${wxBUILD_STRIPPED_RELEASE_DEFAULT}) wx_option(wxBUILD_STRIPPED_RELEASE "remove debug symbols in release build" ${wxBUILD_STRIPPED_RELEASE_DEFAULT})
mark_as_advanced(wxBUILD_STRIPPED_RELEASE) mark_as_advanced(wxBUILD_STRIPPED_RELEASE)
wx_option(wxBUILD_PIC "Enable position independent code (PIC)." ON)
mark_as_advanced(wxBUILD_PIC)
wx_option(wxUSE_NO_RTTI "disable RTTI support" OFF) wx_option(wxUSE_NO_RTTI "disable RTTI support" OFF)
# STL options # STL options

View File

@@ -42,7 +42,7 @@ wx_add_sample(docview docview.cpp doc.cpp view.cpp docview.h doc.h view.h
wx_add_sample(dragimag dragimag.cpp dragimag.h RES dragimag.rc wx_add_sample(dragimag dragimag.cpp dragimag.h RES dragimag.rc
DATA backgrnd.png shape01.png shape02.png shape03.png DATA backgrnd.png shape01.png shape02.png shape03.png
DEPENDS wxUSE_DRAGIMAGE) DEPENDS wxUSE_DRAGIMAGE)
wx_add_sample(drawing DATA pat4.bmp pat35.bmp pat36.bmp image.bmp mask.bmp) wx_add_sample(drawing DATA pat4.bmp pat35.bmp pat36.bmp image.bmp mask.bmp NAME drawingsample)
wx_add_sample(erase) wx_add_sample(erase)
wx_add_sample(event event.cpp gestures.cpp gestures.h chessboard.cpp chessboard.h) wx_add_sample(event event.cpp gestures.cpp gestures.h chessboard.cpp chessboard.h)
wx_add_sample(except DEPENDS wxUSE_EXCEPTIONS) wx_add_sample(except DEPENDS wxUSE_EXCEPTIONS)
@@ -71,7 +71,7 @@ wx_add_sample(image image.cpp canvas.cpp canvas.h cursor_png.c RES image.rc
DATA horse.png horse.jpg horse.bmp horse.gif horse.pcx horse.pnm DATA horse.png horse.jpg horse.bmp horse.gif horse.pcx horse.pnm
horse_ag.pnm horse_rg.pnm horse.tif horse.tga horse.xpm horse.cur horse_ag.pnm horse_rg.pnm horse.tif horse.tga horse.xpm horse.cur
horse.ico horse3.ani smile.xbm toucan.png cmyk.jpg cursor.png horse.ico horse3.ani smile.xbm toucan.png cmyk.jpg cursor.png
DEPENDS wxUSE_IMAGE) NAME imagesample DEPENDS wxUSE_IMAGE)
foreach(lang ar bg cs de fr it ka pl ru sv ja ja_JP.EUC-JP) foreach(lang ar bg cs de fr it ka pl ru sv ja ja_JP.EUC-JP)
list(APPEND INTERNAT_DATA_FILES ${lang}/internat.po ${lang}/internat.mo) list(APPEND INTERNAT_DATA_FILES ${lang}/internat.po ${lang}/internat.mo)
endforeach() endforeach()

View File

@@ -587,14 +587,11 @@ foreach(func
endforeach() endforeach()
# Check various functions # Check various functions
foreach(func wx_check_funcs(fsync
fsync snprintf vsnprintf strnlen strtoull
snprintf vsnprintf strnlen strtoull setpriority
setpriority gettimeofday
) )
string(TOUPPER ${func} func_upper)
check_function_exists(${func} HAVE_${func_upper})
endforeach()
if(MSVC) if(MSVC)
check_symbol_exists(vsscanf stdio.h HAVE_VSSCANF) check_symbol_exists(vsscanf stdio.h HAVE_VSSCANF)
@@ -643,7 +640,6 @@ cmake_pop_check_state()
if(HAVE_DLOPEN) if(HAVE_DLOPEN)
check_symbol_exists(dladdr dlfcn.h HAVE_DLADDR) check_symbol_exists(dladdr dlfcn.h HAVE_DLADDR)
endif() endif()
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
if(APPLE) if(APPLE)
set(wxUSE_EPOLL_DISPATCHER OFF) set(wxUSE_EPOLL_DISPATCHER OFF)

51
configure vendored
View File

@@ -634,6 +634,7 @@ WX_VERSION_TAG
DMALLOC_LIBS DMALLOC_LIBS
OPENGL_LIBS OPENGL_LIBS
LDFLAGS_GL LDFLAGS_GL
SAMPLES_CXXFLAGS
SAMPLES_SUBDIRS SAMPLES_SUBDIRS
DISTDIR DISTDIR
GUIDIST GUIDIST
@@ -889,7 +890,6 @@ RANLIB
USE_DPI_AWARE_MANIFEST USE_DPI_AWARE_MANIFEST
HOST_SUFFIX HOST_SUFFIX
HEADER_PAD_OPTION HEADER_PAD_OPTION
SAMPLES_CXXFLAGS
SAMPLES_RPATH_FLAG SAMPLES_RPATH_FLAG
DYLIB_RPATH_POSTLINK DYLIB_RPATH_POSTLINK
DYLIB_RPATH_INSTALL DYLIB_RPATH_INSTALL
@@ -1123,6 +1123,7 @@ enable_utf8only
enable_extended_rtti enable_extended_rtti
enable_optimise enable_optimise
enable_profile enable_profile
enable_pic
enable_no_rtti enable_no_rtti
enable_no_exceptions enable_no_exceptions
enable_permissive enable_permissive
@@ -2079,6 +2080,7 @@ Optional Features:
--enable-extended_rtti use extended RTTI (XTI) --enable-extended_rtti use extended RTTI (XTI)
--disable-optimise compile without optimisations --disable-optimise compile without optimisations
--enable-profile create code with profiling information --enable-profile create code with profiling information
--disable-pic don't use position independent code when building static libraries (shared libraries always use PIC)
--enable-no_rtti create code without RTTI information --enable-no_rtti create code without RTTI information
--enable-no_exceptions create code without C++ exceptions handling --enable-no_exceptions create code without C++ exceptions handling
--enable-permissive compile code disregarding strict ANSI --enable-permissive compile code disregarding strict ANSI
@@ -5939,6 +5941,35 @@ fi
eval "$wx_cv_use_profile" eval "$wx_cv_use_profile"
enablestring=disable
defaultval=
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
# Check whether --enable-pic was given.
if test "${enable_pic+set}" = set; then :
enableval=$enable_pic;
if test "$enableval" = yes; then
wx_cv_use_pic='wxUSE_PIC=yes'
else
wx_cv_use_pic='wxUSE_PIC=no'
fi
else
wx_cv_use_pic='wxUSE_PIC=${'DEFAULT_wxUSE_PIC":-$defaultval}"
fi
eval "$wx_cv_use_pic"
enablestring= enablestring=
defaultval= defaultval=
if test -z "$defaultval"; then if test -z "$defaultval"; then
@@ -26276,8 +26307,7 @@ $as_echo "yes" >&6; }
TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}" TOOLKIT_INCLUDE="${TOOLKIT_INCLUDE} ${QT5_CFLAGS}"
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}" GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS" wxUSE_PIC=yes
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS"
fi fi
fi fi
@@ -33152,6 +33182,11 @@ $as_echo "$as_me: WARNING: plugins require wxDynamicLibrary, disabling" >&2;}
fi fi
fi fi
if test "$wxUSE_PIC" = "no" -a "$wxUSE_SHARED" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: position independent code (PIC) can not be disabled for shared libraries" >&5
$as_echo "$as_me: WARNING: position independent code (PIC) can not be disabled for shared libraries" >&2;}
fi
if test "$wxUSE_FSWATCHER" = "yes"; then if test "$wxUSE_FSWATCHER" = "yes"; then
if test "$USE_WIN32" != 1; then if test "$USE_WIN32" != 1; then
@@ -38157,7 +38192,6 @@ TOOLKIT_LOWERCASE=`echo $TOOLKIT | tr '[A-Z]' '[a-z]'`
case "$TOOLKIT" in case "$TOOLKIT" in
GTK) GTK)
TOOLKIT_DESC="GTK+" TOOLKIT_DESC="GTK+"
@@ -40592,6 +40626,14 @@ then
#OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS" #OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
fi fi
if test "$wxUSE_PIC" = "yes" ; then
if test "$wxUSE_SHARED" = "no" ; then
CFLAGS="$CFLAGS $PIC_FLAG"
CXXFLAGS="$CXXFLAGS $PIC_FLAG"
fi
SAMPLES_CXXFLAGS="$SAMPLES_CXXFLAGS $PIC_FLAG"
fi
if test "$DEPS_TRACKING" = 1 -a "$wxUSE_MAC" = 1 ; then if test "$DEPS_TRACKING" = 1 -a "$wxUSE_MAC" = 1 ; then
if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then if test "x$wxUSE_UNIVERSAL_BINARY" != "xno" ; then
@@ -40690,6 +40732,7 @@ SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5

View File

@@ -678,6 +678,7 @@ WX_ARG_ENABLE(extended_rtti, [ --enable-extended_rtti use extended RTTI (XTI)]
WX_ARG_DISABLE(optimise, [ --disable-optimise compile without optimisations], wxUSE_OPTIMISE) WX_ARG_DISABLE(optimise, [ --disable-optimise compile without optimisations], wxUSE_OPTIMISE)
WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE) WX_ARG_ENABLE(profile, [ --enable-profile create code with profiling information], wxUSE_PROFILE)
WX_ARG_DISABLE(pic, [ --disable-pic don't use position independent code when building static libraries (shared libraries always use PIC)], wxUSE_PIC)
WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI) WX_ARG_ENABLE(no_rtti, [ --enable-no_rtti create code without RTTI information], wxUSE_NO_RTTI)
WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS) WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ exceptions handling], wxUSE_NO_EXCEPTIONS)
WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
@@ -3610,8 +3611,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}" GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
dnl build with position independent code if Qt needs it dnl build with position independent code if Qt needs it
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS" wxUSE_PIC=yes
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS"
fi fi
], ],
[ [
@@ -5586,6 +5586,10 @@ if test "$wxUSE_PLUGINS" = "yes" ; then
fi fi
fi fi
if test "$wxUSE_PIC" = "no" -a "$wxUSE_SHARED" = "yes"; then
AC_MSG_WARN([position independent code (PIC) can not be disabled for shared libraries])
fi
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl File system watcher checks dnl File system watcher checks
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
@@ -8269,7 +8273,6 @@ AC_SUBST(TOOLKIT_VERSION)
AC_SUBST(DYLIB_RPATH_INSTALL) AC_SUBST(DYLIB_RPATH_INSTALL)
AC_SUBST(DYLIB_RPATH_POSTLINK) AC_SUBST(DYLIB_RPATH_POSTLINK)
AC_SUBST(SAMPLES_RPATH_FLAG) AC_SUBST(SAMPLES_RPATH_FLAG)
AC_SUBST(SAMPLES_CXXFLAGS)
AC_SUBST(HEADER_PAD_OPTION) AC_SUBST(HEADER_PAD_OPTION)
AC_SUBST(HOST_SUFFIX) AC_SUBST(HOST_SUFFIX)
AC_SUBST(USE_DPI_AWARE_MANIFEST) AC_SUBST(USE_DPI_AWARE_MANIFEST)
@@ -8359,6 +8362,15 @@ then
#OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS" #OBJCXXFLAGS="-DWX_PRECOMP $CXXFLAGS"
fi fi
dnl cc/cxx option for position independent code
if test "$wxUSE_PIC" = "yes" ; then
if test "$wxUSE_SHARED" = "no" ; then
CFLAGS="$CFLAGS $PIC_FLAG"
CXXFLAGS="$CXXFLAGS $PIC_FLAG"
fi
SAMPLES_CXXFLAGS="$SAMPLES_CXXFLAGS $PIC_FLAG"
fi
dnl HACK ALERT!! dnl HACK ALERT!!
dnl For now, we need to alter bk-deps not to generate deps dnl For now, we need to alter bk-deps not to generate deps
dnl when we've configured a Universal binary build. dnl when we've configured a Universal binary build.
@@ -8501,6 +8513,7 @@ AC_SUBST(DISTDIR)
dnl additional subdirectories where we will build dnl additional subdirectories where we will build
AC_SUBST(SAMPLES_SUBDIRS) AC_SUBST(SAMPLES_SUBDIRS)
AC_SUBST(SAMPLES_CXXFLAGS)
dnl additional libraries and linker settings dnl additional libraries and linker settings
AC_SUBST(LDFLAGS_GL) AC_SUBST(LDFLAGS_GL)

View File

@@ -64,7 +64,7 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
{ {
for(y=0; y<m_height; y++) for(y=0; y<m_height; y++)
{ {
m_field[x+y*m_width] = ((float)rand()/RAND_MAX <PROB) m_field[x+y*m_width] = (rand()/(float)RAND_MAX <PROB)
? BG_HIDDEN | BG_BOMB ? BG_HIDDEN | BG_BOMB
: BG_HIDDEN; : BG_HIDDEN;
} }

View File

@@ -180,7 +180,11 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxUNIXaddress, wxSockAddress);
namespace namespace
{ {
#if defined(HAVE_GETHOSTBYNAME) #if defined(HAVE_GETHOSTBYNAME) && \
!defined(HAVE_FUNC_GETHOSTBYNAME_R_6) && \
!defined(HAVE_FUNC_GETHOSTBYNAME_R_5) && \
!defined(HAVE_FUNC_GETHOSTBYNAME_R_3)
hostent *deepCopyHostent(hostent *h, hostent *deepCopyHostent(hostent *h,
const hostent *he, const hostent *he,
char *buffer, char *buffer,

View File

@@ -3281,7 +3281,6 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
// Find the coordinate of the right most visible point: this is not the // Find the coordinate of the right most visible point: this is not the
// same as GetClientSize().x because the window might not be fully visible, // same as GetClientSize().x because the window might not be fully visible,
// it could be clipped by its parent. // it could be clipped by its parent.
const wxSize size = GetSize();
const int availableWidth = GetParent()->GetClientSize().x - GetPosition().x; const int availableWidth = GetParent()->GetClientSize().x - GetPosition().x;
int visibleWidth = wxMin(GetClientSize().x, int visibleWidth = wxMin(GetClientSize().x,
availableWidth - GetWindowBorderSize().x); availableWidth - GetWindowBorderSize().x);

View File

@@ -1174,11 +1174,20 @@ def processIface(iface, h_tmplt, cpp_tmplt, ih_tmplt, h_dest, cpp_dest, docstr_d
ih_text = ih_text % data ih_text = ih_text % data
# write out destination files # write out destination files
open(h_dest, 'w').write(h_text) # Use 'wb' with Python 2 to enforce LF newlines. This does not work with
open(cpp_dest, 'w').write(cpp_text) # Python 3, use 'newline':'\n' there (which in turn does not work with 2).
if sys.version_info[0] == 2:
acc = 'wb'
eol = {}
else:
acc = 'wt'
eol = {'newline':'\n'}
open(h_dest, acc, **eol).write(h_text)
open(cpp_dest, acc, **eol).write(cpp_text)
if docstr_dest: if docstr_dest:
open(docstr_dest, 'w').write(docstrings) open(docstr_dest, acc, **eol).write(docstrings)
open(ih_dest, 'w').write(ih_text) open(ih_dest, acc, **eol).write(ih_text)
def joinWithNewLines(values): def joinWithNewLines(values):

View File

@@ -331,7 +331,7 @@ set void MarkerSetBack=2042(int markerNumber, colour back)
# Set the background colour used for a particular marker number when its folding block is selected. # Set the background colour used for a particular marker number when its folding block is selected.
set void MarkerSetBackSelected=2292(int markerNumber, colour back) set void MarkerSetBackSelected=2292(int markerNumber, colour back)
# Enable/disable highlight for current folding bloc (smallest one that contains the caret) # Enable/disable highlight for current folding block (smallest one that contains the caret)
fun void MarkerEnableHighlight=2293(bool enabled,) fun void MarkerEnableHighlight=2293(bool enabled,)
# Add a marker to a line, returning an ID which can be used to find or delete the marker. # Add a marker to a line, returning an ID which can be used to find or delete the marker.

View File

@@ -622,7 +622,7 @@ void wxStyledTextCtrl::MarkerSetBackgroundSelected(int markerNumber, const wxCol
SendMsg(SCI_MARKERSETBACKSELECTED, markerNumber, wxColourAsLong(back)); SendMsg(SCI_MARKERSETBACKSELECTED, markerNumber, wxColourAsLong(back));
} }
// Enable/disable highlight for current folding bloc (smallest one that contains the caret) // Enable/disable highlight for current folding block (smallest one that contains the caret)
void wxStyledTextCtrl::MarkerEnableHighlight(bool enabled) void wxStyledTextCtrl::MarkerEnableHighlight(bool enabled)
{ {
SendMsg(SCI_MARKERENABLEHIGHLIGHT, enabled, 0); SendMsg(SCI_MARKERENABLEHIGHLIGHT, enabled, 0);

View File

@@ -868,7 +868,7 @@ public:
@section event_types Event Types @section event_types Event Types
The following is a brief description of when the control generates these The following is a brief description of when the control generates these
events and a list of which methods provide relevent information. Additional events and a list of which methods provide relevant information. Additional
details can be found in the Scintilla documentation details can be found in the Scintilla documentation
(http://www.scintilla.org/ScintillaDoc.html#Notifications). (http://www.scintilla.org/ScintillaDoc.html#Notifications).