diff options
Diffstat (limited to 'lib/wx/configure.in')
-rw-r--r--[-rwxr-xr-x] | lib/wx/configure.in | 143 |
1 files changed, 92 insertions, 51 deletions
diff --git a/lib/wx/configure.in b/lib/wx/configure.in index 9c55e544a4..dbe237cd74 100755..100644 --- a/lib/wx/configure.in +++ b/lib/wx/configure.in @@ -2,18 +2,19 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 2008-2013. All Rights Reserved. +dnl Copyright Ericsson AB 2008-2016. All Rights Reserved. dnl -dnl The contents of this file are subject to the Erlang Public License, -dnl Version 1.1, (the "License"); you may not use this file except in -dnl compliance with the License. You should have received a copy of the -dnl Erlang Public License along with this software. If not, it can be -dnl retrieved online at http://www.erlang.org/. +dnl Licensed under the Apache License, Version 2.0 (the "License"); +dnl you may not use this file except in compliance with the License. +dnl You may obtain a copy of the License at dnl -dnl Software distributed under the License is distributed on an "AS IS" -dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -dnl the License for the specific language governing rights and limitations -dnl under the License. +dnl http://www.apache.org/licenses/LICENSE-2.0 +dnl +dnl Unless required by applicable law or agreed to in writing, software +dnl distributed under the License is distributed on an "AS IS" BASIS, +dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +dnl See the License for the specific language governing permissions and +dnl limitations under the License. dnl dnl %CopyrightEnd% @@ -71,30 +72,14 @@ WXERL_CAN_BUILD_DRIVER=true LM_WINDOWS_ENVIRONMENT +USER_CFLAGS=$CFLAGS + if test X"$MIXED_CYGWIN_VC" = X"yes" -o X"$MIXED_MSYS_VC" = X"yes"; then CFLAGS="-Owx" fi -## Check that we are in 32 bits mode on darwin -## (wxWidgets require that it currently uses 32-bits Carbon) -## Otherwise skip building wxErlang AC_CHECK_SIZEOF(void *) -# case $ac_cv_sizeof_void_p-$host_os in -# 8-darwin*) -# if test X"$WX_BUILDING_INSIDE_ERLSRC" != X"true" ; then -# AC_MSG_ERROR([Can not use 64bits wxWidgets on Darwin]) -# else -# echo "Can not combine 64bits erlang with wxWidgets on MacOSX, wx will not be useable" > ./CONF_INFO -# WXERL_CAN_BUILD_DRIVER=false -# AC_MSG_WARN([Can not combine 64bits erlang with wxWidgets on MacOSX, wx will not be useable]) -# fi -# WXERL_CAN_BUILD_DRIVER=false -# ;; -# *) -# ;; -# esac - PTHR_CFLAGS="-D_THREAD_SAFE -D_REENTRANT" OBJC_CC=$CC @@ -103,8 +88,12 @@ CXXFLAGS="" dnl NOTE: CPPFLAGS will be included in CFLAGS at the end case $host_os in darwin*) + AC_MSG_CHECKING([Checking wxWidgets for min version:]) + WX_CC=`wx-config --cc` + MAC_MIN=`echo "$WX_CC" | sed 's/^[[^ ]]*\ *//'` + AC_MSG_RESULT([$MAC_MIN]) + AC_MSG_CHECKING([if compiler accepts -ObjC]) - saved_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -ObjC" AC_TRY_COMPILE([],[;], accept_objc_flag=true, accept_objc_flag=false) if test "X$accept_objc_flag" = "Xtrue"; then @@ -171,18 +160,18 @@ case $host_os in OBJC_CFLAGS="-ObjC" fi fi - CFLAGS="$saved_CFLAGS -Wno-deprecated-declarations" + CFLAGS="$USER_CFLAGS $MAC_MIN -Wno-deprecated-declarations" CPPFLAGS="$CPPFLAGS -D_MACOSX $PTHR_CFLAGS" ;; mingw32) - CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0500 -D_WINDOWS -D_UNICODE -DUNICODE" - CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0500" + CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0600 -D_WINDOWS -D_UNICODE -DUNICODE" + CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600" AC_MSG_WARN([Reverting to 32-bit time_t]) CPPFLAGS="$CPPFLAGS -D_USE_32BIT_TIME_T" ;; win32) - CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0500 -D_WINDOWS -D_UNICODE -DUNICODE" - CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0500" + CFLAGS="$CFLAGS -DWIN32 -DWINVER=0x0600 -D_WINDOWS -D_UNICODE -DUNICODE" + CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600" ;; *) CFLAGS="$CFLAGS -Wno-deprecated-declarations" @@ -195,7 +184,7 @@ AC_SUBST(OBJC_CFLAGS) case $host_os in darwin*) - LDFLAGS="-bundle -flat_namespace -undefined warning -fPIC $LDFLAGS" + LDFLAGS="$MAC_MIN -bundle -flat_namespace -undefined warning -fPIC $LDFLAGS" # Check sizof_void_p as future will hold 64bit MacOS wx if test $ac_cv_sizeof_void_p = 4; then LDFLAGS="-m32 $LDFLAGS" @@ -223,15 +212,20 @@ dnl ---------------------------------------------------------------------- case $host_os in mingw32) DEBUG_CFLAGS="-g -Wall -DDEBUG $CFLAGS" - CFLAGS="-g -Wall -O2 -fomit-frame-pointer -fno-strict-aliasing $CFLAGS" + CFLAGS="-g -Wall -O2 $CFLAGS -fomit-frame-pointer -fno-strict-aliasing" ;; win32) - DEBUG_CFLAGS="-g -Wall -DDEBUG $CFLAGS" + DEBUG_CFLAGS="-g -Wall $CFLAGS -DDEBUG" CFLAGS="-g -Wall -O2 $CFLAGS" ;; + darwin*) + DEBUG_CFLAGS="-g -Wall -fPIC $CFLAGS -DDEBUG" + # omit-frame-pointer causes seg faults with 10.9 and clang + CFLAGS="-g -Wall -fPIC $CFLAGS -fno-strict-aliasing" + ;; *) - DEBUG_CFLAGS="-g -Wall -fPIC -DDEBUG $CFLAGS" - CFLAGS="-g -Wall -O2 -fPIC -fomit-frame-pointer -fno-strict-aliasing $CFLAGS" + DEBUG_CFLAGS="-g -Wall -fPIC $CFLAGS -DDEBUG" + CFLAGS="-g -Wall -O2 -fPIC $CFLAGS -fomit-frame-pointer -fno-strict-aliasing" ;; esac @@ -283,11 +277,12 @@ fi AC_SUBST(GL_LIBS) +DEBUG_CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS $CPPFLAGS" +DEBUG_CFLAGS="$DEBUG_CFLAGS $CPPFLAGS $C_ONLY_FLAGS" + CXXFLAGS="$CXXFLAGS $CFLAGS $CPPFLAGS" CFLAGS="$CFLAGS $CPPFLAGS $C_ONLY_FLAGS" -DEBUG_CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS $CPPFLAGS" -DEBUG_CFLAGS="$DEBUG_CFLAGS $CPPFLAGS $C_ONLY_FLAGS" AC_SUBST(DEBUG_CFLAGS) AC_SUBST(DEBUG_CXXFLAGS) @@ -413,7 +408,22 @@ define(wx_warn_text,[ fi else AC_MSG_CHECKING(for wxWidgets in standard locations) - + + # Check whether --with-wxdir was given. + AC_MSG_NOTICE(OptionCheck: [$with_wxdir $with_wx_prefix]) + + if test "${with_wxdir+set}" = set; then : + withval=$with_wxdir; CWXWIN0=$withval + else + # Check whether --with-wx-prefix was given. + if test "${with_wx_prefix+set}" = set; then : + withval=$with_wx_prefix; CWXWIN0=$withval + else + echo Setting it empty + CWXWIN0="" + fi + fi + if test "x$MIXED_MSYS" = "xyes"; then CWXWIN_CONFIG=`win2msys_path.sh $wx_config_name 2>/dev/null` else @@ -432,21 +442,29 @@ else else CWXWIN_PROG=`cygpath -d "$PROGRAMFILES" | cygpath -f - 2>/dev/null` fi - CWXWIN3=$CWXWIN_PROG/wxWidgets-2.*.* - CWXWIN4=$CWXWIN_PROG/wxMSW-2.*.* - CWX_DOCUMENTED="/opt/local/pgm/wxMSW-2.*.* /opt/local/pgm/wxWidgets-2.*.*" + + CWXWIN3="$CWXWIN_PROG/wxWidgets-3.*.* $CWXWIN_PROG/wxWidgets-2.*.*" + CWXWIN4="$CWXWIN_PROG/wxMSW-3.*.* $CWXWIN_PROG/wxMSW-2.*.*" + + DOC_OPT=/opt/local/pgm + CWX_DOCUMENTED="$DOC_OPT/wxWidgets-2.*.* $DOC_OPT/wxMSW-2.*.*" + CWX_DOCUMENTED="$DOC_OPT/wxWidgets-3.*.* $DOC_OPT/wxMSW-3.*.* $CWX_DOCUMENTED" + case $ac_cv_sizeof_void_p in 8) - CWX_DOCUMENTED="/opt/local64/pgm/wxMSW-2.*.* /opt/local64/pgm/wxWidgets-2.*.* $CWX_DOCUMENTED" + DOC_OPT64=/opt/local64/pgm + CWX_DOCUMENTED="$DOC_OPT64/wxWidgets-2.*.* $DOC_OPT64/wxMSW-2.*.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="$DOC_OPT64/wxWidgets-3.*.* $DOC_OPT64/wxMSW-3.*.* $CWX_DOCUMENTED" ;; *) true ;; - esac - - CWXPATH="$CWXWIN1 $CWXWIN2 $CWX_DOCUMENTED $CWXWIN3.* $CWXWIN4.*" + esac + + CWXPATH="$CWXWIN0 $CWXWIN1 $CWXWIN2 $CWX_DOCUMENTED $CWXWIN3 $CWXWIN4" for dir in $CWXPATH; do + AC_MSG_NOTICE(Checking: [$dir]) if test -f $dir/include/wx/wx.h; then WXINCLUDE_MSVC=$dir/include/msvc WXINCLUDE_PLAIN=$dir/include @@ -454,12 +472,14 @@ else WX_CFLAGS="-EHsc -D_UNICODE -DUNICODE -I$WXINCLUDE_MSVC -I$WXINCLUDE_PLAIN -I$WXINCLUDE_CONTRIB -D__WXMSW__" WX_CXXFLAGS="-TP $WX_CFLAGS" WX_LIBDIR=$dir/lib/vc_lib + WX_LIBDIR64=$dir/lib/vc_x64_lib WX_RESCOMP="rc.sh -I$WXINCLUDE_PLAIN -D __WIN32__" RC_FILE_TYPE=res - for lib in $WX_LIBDIR/wxbase*.lib $WX_LIBDIR2/wxbase*.lib; do - maybe=`echo $lib | egrep 'wxbase[[0-9]]*u\.lib'` + for lib in $WX_LIBDIR $WX_LIBDIR64; do + maybe=`ls $lib/wxbase*.lib | egrep 'wxbase[[0-9]]*u\.lib'` if test '!' -z "$maybe"; then corelib_number=`echo $maybe | sed 's,.*\([[0-9]].\)u\.lib,\1,'` + WX_LIBDIR=$lib break fi done @@ -665,6 +685,27 @@ if test "x$GCC" = xyes; then LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CXXFLAGS]) fi +dnl ---------------------------------------------------------------------- +dnl Enable -fsanitize= flags. +dnl ---------------------------------------------------------------------- + +m4_define(DEFAULT_SANITIZERS, [address,undefined]) +AC_ARG_ENABLE( + sanitizers, + AS_HELP_STRING( + [--enable-sanitizers@<:@=comma-separated list of sanitizers@:>@], + [Default=DEFAULT_SANITIZERS]), +[ +case "$enableval" in + no) sanitizers= ;; + yes) sanitizers="-fsanitize=DEFAULT_SANITIZERS" ;; + *) sanitizers="-fsanitize=$enableval" ;; +esac +CFLAGS="$CFLAGS $sanitizers" +CXXFLAGS="$CXXFLAGS $sanitizers" +LDFLAGS="$LDFLAGS $sanitizers" +]) + ############################################################################# dnl |