diff options
Diffstat (limited to 'lib/wx/configure.in')
-rwxr-xr-x | lib/wx/configure.in | 98 |
1 files changed, 71 insertions, 27 deletions
diff --git a/lib/wx/configure.in b/lib/wx/configure.in index 7b35fed672..6a0d649ccd 100755 --- a/lib/wx/configure.in +++ b/lib/wx/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 2008-2012. All Rights Reserved. +dnl Copyright Ericsson AB 2008-2013. 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 @@ -80,26 +80,26 @@ fi ## 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 +# 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 OBJC_CFLAGS="" - +CXXFLAGS="" dnl NOTE: CPPFLAGS will be included in CFLAGS at the end case $host_os in darwin*) @@ -111,12 +111,13 @@ case $host_os in AC_MSG_RESULT([yes]) C_ONLY_FLAGS="-ObjC" else - dnl We are probebly trying to build with a non-Apple gcc, + dnl We are probably trying to build with a non-Apple gcc, dnl which is good as long as we do not try to build Cocoa dnl code. We need an Apple compiler for just that (Objective C) AC_MSG_RESULT([no]) AC_MSG_CHECKING([for a Cocoa compliant Objective C compiler]) SEARCHFOR="" + SEARCHFORXX="" save_IFS=$IFS IFS=: set $PATH @@ -124,19 +125,29 @@ case $host_os in while test X"$1" != X""; do dnl Add all possible paths to a real apple gcc SEARCHFOR="$1/gcc-apple-4.2 $SEARCHFOR" + SEARCHFORXX="$1/g++-apple-4.2 $SEARCHFORXX" shift done dnl Add LLVM compilers, they will work in this case SEARCHFOR="/usr/bin/clang /usr/bin/gcc $SEARCHFOR" + SEARCHFORXX="/usr/bin/clang /usr/bin/g++ $SEARCHFORXX" APPLE_CC="" + APPLE_CXX="" dnl SEARCHFOR is reversed, so we want to find the last existing dnl executable in the list + IFS=" " + set $SEARCHFORXX for x in $SEARCHFOR; do if test -x $x; then APPLE_CC=$x fi + if test -x "$1"; then + APPLE_CXX="$1" + fi + shift done - if test X$APPLE_CC = X; then + IFS=$save_IFS + if test X$APPLE_CC = X -o X$APPLE_CXX = X; then AC_MSG_RESULT([no]) dnl Complete failure, we cannot build Cocoa code if test X"$WX_BUILDING_INSIDE_ERLSRC" != X"true" ; then @@ -150,12 +161,17 @@ case $host_os in else dnl We think we found an Apple compiler and will add dnl Apple specific options - AC_MSG_RESULT($APPLE_CC) + AC_MSG_RESULT([$APPLE_CC ($APPLE_CXX)]) + dnl We should use this compiler for all of wx - hack... + CC=$APPLE_CC + CXX=$APPLE_CXX + dnl Both clang and gcc accept these flags... + #CXXFLAGS="-x c++ $CXXFLAGS" OBJC_CC=$APPLE_CC OBJC_CFLAGS="-ObjC" fi fi - CFLAGS=$saved_CFLAGS + CFLAGS="$saved_CFLAGS -Wno-deprecated-declarations" CPPFLAGS="$CPPFLAGS -D_MACOSX $PTHR_CFLAGS" ;; mingw32) @@ -169,6 +185,7 @@ case $host_os in CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0500" ;; *) + CFLAGS="$CFLAGS -Wno-deprecated-declarations" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE $PTHR_CFLAGS" ;; esac @@ -252,12 +269,24 @@ else AC_CHECK_HEADERS([gl/gl.h],[],[],[#include <windows.h>]) fi +if test X"$host_os" != X"win32" ; then + AC_CHECK_HEADERS([GL/glu.h], [], + [AC_CHECK_HEADERS([OpenGL/glu.h])]) + if test X"$ac_cv_header_GL_glu_h" != Xyes && + test X"$ac_cv_header_OpenGL_glu_h" != Xyes + then + AC_MSG_WARN([No GLU headers found, wx will NOT be usable]) + fi +else + AC_CHECK_HEADERS([gl/glu.h],[],[],[#include <windows.h>]) +fi + AC_SUBST(GL_LIBS) -CXXFLAGS="$CFLAGS $CPPFLAGS" +CXXFLAGS="$CXXFLAGS $CFLAGS $CPPFLAGS" CFLAGS="$CFLAGS $CPPFLAGS $C_ONLY_FLAGS" -DEBUG_CXXFLAGS="$DEBUG_CFLAGS $CPPFLAGS" +DEBUG_CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS $CPPFLAGS" DEBUG_CFLAGS="$DEBUG_CFLAGS $CPPFLAGS $C_ONLY_FLAGS" AC_SUBST(DEBUG_CFLAGS) AC_SUBST(DEBUG_CXXFLAGS) @@ -308,7 +337,15 @@ if test "$cross_compiling" = "yes"; then echo "Cross compilation of the wx driver is not supported yet, wx will NOT be usable" > ./CONF_INFO WXERL_CAN_BUILD_DRIVER=false elif test X"$MIXED_CYGWIN_VC" == X"no" -a X"$MIXED_MSYS_VC" == X"no"; then - m4_include(wxwin.m4) + WX_VERSION=`wx-config --version` + case $WX_VERSION in + 2.8.*) + m4_include(wxwin-2.8.m4) + ;; + *) + m4_include(wxwin-2.9.m4) + ;; + esac AM_OPTIONS_WXCONFIG reqwx=2.8.4 @@ -395,12 +432,12 @@ else else CWXWIN_PROG=`cygpath -d "$PROGRAMFILES" | cygpath -f - 2>/dev/null` fi - CWXWIN3=$CWXWIN_PROG/wxWidgets-2.8 - CWXWIN4=$CWXWIN_PROG/wxMSW-2.8 - CWX_DOCUMENTED="/opt/local/pgm/wxMSW-2.8.* /opt/local/pgm/wxWidgets-2.8.*" + CWXWIN3=$CWXWIN_PROG/wxWidgets-2.*.* + CWXWIN4=$CWXWIN_PROG/wxMSW-2.*.* + CWX_DOCUMENTED="/opt/local/pgm/wxMSW-2.*.* /opt/local/pgm/wxWidgets-2.*.*" case $ac_cv_sizeof_void_p in 8) - CWX_DOCUMENTED="/opt/local64/pgm/wxMSW-2.8.* /opt/local64/pgm/wxWidgets-2.8.* $CWX_DOCUMENTED" + CWX_DOCUMENTED="/opt/local64/pgm/wxMSW-2.*.* /opt/local64/pgm/wxWidgets-2.*.* $CWX_DOCUMENTED" ;; *) true @@ -442,6 +479,7 @@ else fi fi done + if test -z "$WX_LIBS_STATIC"; then AC_MSG_RESULT([failed]) if test X"$WX_BUILDING_INSIDE_ERLSRC" != X"true" ; then @@ -621,6 +659,12 @@ fi dnl - if test "$WXERL_CAN_BUILD_DRIVER" != "false" AC_SUBST(WXERL_CAN_BUILD_DRIVER) +if test "x$GCC" = xyes; then + # Treat certain GCC warnings as errors + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) + LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CXXFLAGS]) +fi + ############################################################################# dnl |