X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/569c7d8ccb0c3f350b50f0f8435b6c6ac3d78cc8..a85b4023d15183d826fec483d573eae6464e4942:/configure.in diff --git a/configure.in b/configure.in index 06768cdcf4..e12e81c30b 100644 --- a/configure.in +++ b/configure.in @@ -915,6 +915,7 @@ if test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_RADIOBOX=no DEFAULT_wxUSE_RADIOBTN=no DEFAULT_wxUSE_RICHMSGDLG=no + DEFAULT_wxUSE_RICHTOOLTIP=no DEFAULT_wxUSE_REARRANGECTRL=no DEFAULT_wxUSE_SASH=no DEFAULT_wxUSE_SCROLLBAR=no @@ -987,6 +988,7 @@ WX_ARG_FEATURE(popupwin, [ --enable-popupwin use wxPopUpWindow class], WX_ARG_FEATURE(radiobox, [ --enable-radiobox use wxRadioBox class], wxUSE_RADIOBOX) WX_ARG_FEATURE(radiobtn, [ --enable-radiobtn use wxRadioButton class], wxUSE_RADIOBTN) WX_ARG_FEATURE(richmsgdlg, [ --enable-richmsgdlg use wxRichMessageDialog class], wxUSE_RICHMSGDLG) +WX_ARG_FEATURE(richtooltip, [ --enable-richtooltip use wxRichToolTip class], wxUSE_RICHTOOLTIP) WX_ARG_FEATURE(rearrangectrl,[ --enable-rearrangectrl use wxRearrangeList/Ctrl/Dialog], wxUSE_REARRANGECTRL) WX_ARG_FEATURE(sash, [ --enable-sash use wxSashWindow class], wxUSE_SASH) WX_ARG_FEATURE(scrollbar, [ --enable-scrollbar use wxScrollBar class and scrollable windows], wxUSE_SCROLLBAR) @@ -1382,10 +1384,34 @@ dnl ------------------------------------------------------------------------ dnl Platform specific tests dnl ------------------------------------------------------------------------ -dnl xlC needs -qunique under AIX so that one source file can be -dnl compiled to multiple object files and safely linked together. -if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then - CXXFLAGS="-qunique $CXXFLAGS" +if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then + dnl While g++ predefines _GNU_SOURCE by default, gcc does not, so do it + dnl explicitly to ensure that the tests done below using C compiler + dnl succeed, otherwise things like pthread_mutexattr_settype() (and many + dnl others) wouldn't be detected. + AC_DEFINE(_GNU_SOURCE) + + dnl For non-g++ compilers (including gcc, as mentioned above) we need to + dnl add this flag explicitly when building our own code later too. + GNU_SOURCE_FLAG="-D_GNU_SOURCE" + CFLAGS="$GNU_SOURCE_FLAG $CFLAGS" +fi + +if test "x$USE_AIX" = "x1"; then + dnl xlC needs -qunique under AIX so that one source file can be + dnl compiled to multiple object files and safely linked together. + if test "x$XLCXX" = "xyes"; then + CXXFLAGS="-qunique $CXXFLAGS" + fi + + dnl AIX sys/timer.h header #defines func_data as t_union.data breaking the + dnl compilation of GTK+ headers that use func_data as parameter name in + dnl several places. We could work around this by inserting "#undef + dnl func_data" in the code but IBM provides a possibility to disable this + dnl #define by pre-defining the symbol below and this seems to be simpler. + dnl And if we have any problems because of it we can always remove it and + dnl use the #undef approach. + CPPFLAGS="-D_LINUX_SOURCE_COMPAT $CPPFLAGS" fi dnl This case is for PowerPC OS X vs. everything else @@ -1707,20 +1733,22 @@ AC_CACHE_CHECK([for va_copy], [ AC_LANG_PUSH(C++) AC_LINK_IFELSE([ - #include - void foo(char *f, ...) - { - va_list ap1, ap2; - va_start(ap1, f); - va_copy(ap2, ap1); - va_end(ap2); - va_end(ap1); - } - int main() - { - foo("hi", 17); - return 0; - }], + AC_LANG_SOURCE([ + #include + void foo(char *f, ...) + { + va_list ap1, ap2; + va_start(ap1, f); + va_copy(ap2, ap1); + va_end(ap2); + va_end(ap1); + } + int main() + { + foo("hi", 17); + return 0; + }]) + ], wx_cv_func_va_copy=yes, wx_cv_func_va_copy=no ) @@ -1736,22 +1764,24 @@ else wx_cv_type_va_list_lvalue, [ AC_RUN_IFELSE([ - #include - int foo(char *f, ...) - { - va_list ap1, ap2; - va_start(ap1, f); - ap2 = ap1; - if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 ) - return 1; - va_end(ap2); - va_end(ap1); - return 0; - } - int main() - { - return foo("hi", 17); - }], + AC_LANG_SOURCE([ + #include + int foo(char *f, ...) + { + va_list ap1, ap2; + va_start(ap1, f); + ap2 = ap1; + if ( va_arg(ap1, int) != 17 || va_arg(ap2, int) != 17 ) + return 1; + va_end(ap2); + va_end(ap1); + return 0; + } + int main() + { + return foo("hi", 17); + }]) + ], wx_cv_type_va_list_lvalue=yes, wx_cv_type_va_list_lvalue=no, dnl assume most common case for cross-compiling... @@ -1780,7 +1810,7 @@ AC_CACHE_CHECK( dnl C compiler might support variadic macros when C++ one doesn't dnl (happens with gcc/g++ 2.95.4), so must use C++ one explicitly AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE( + AC_COMPILE_IFELSE([ AC_LANG_PROGRAM( [ #include @@ -1789,7 +1819,7 @@ AC_CACHE_CHECK( [ test("%s %d %p", "test", 1, 0); ] - ), + )], [wx_cv_have_variadic_macros=yes], [wx_cv_have_variadic_macros=no] ) @@ -1879,7 +1909,7 @@ WX_CPP_EXPLICIT dnl With Sun CC, temporaries have block scope by default. This flag is needed dnl to get the expression scope behaviour that conforms to the standard. if test "x$SUNCXX" = xyes; then - CXXFLAGS="-features=tmplife $CXXFLAGS" + CXXFLAGS="-features=tmplife $GNU_SOURCE_FLAG $CXXFLAGS" fi dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do @@ -2266,7 +2296,9 @@ case "${host}" in if test -f $libc; then save_LIBS="$LIBS" LIBS="$libc" - AC_LINK_IFELSE([int main() { return 0; }], + AC_LINK_IFELSE([ + AC_LANG_SOURCE([int main() { return 0; }]) + ], wx_cv_std_libpath=`echo $d | sed s@/usr/@@`) LIBS="$save_LIBS" if test "x$wx_cv_std_libpath" != "x"; then @@ -2358,7 +2390,7 @@ if test "$build" != "$host" -a "$GCC" = yes; then x_includes=$ac_find_includes fi if test -z "$x_libraries" -o "$x_libraries" = NONE; then - WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xt) + WX_PATH_FIND_LIBRARIES(Xt) x_libraries=$ac_find_libraries fi fi @@ -2371,45 +2403,6 @@ dnl ------------------------------------------------------------------------ dnl flush the cache because checking for libraries below might abort AC_CACHE_SAVE -dnl check for glibc version -dnl -dnl VZ: I have no idea why had this check been there originally, but now -dnl we could probably do without it by just always adding _GNU_SOURCE -if test "$USE_LINUX" = 1 -o "$USE_GNU" = 1; then - AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[ - AC_TRY_COMPILE([#include ], - [ - #if (__GLIBC__ < 2) || (__GLIBC_MINOR__ < 1) - not glibc 2.1 - #endif - ], - [ - wx_cv_lib_glibc21=yes - ], - [ - wx_cv_lib_glibc21=no - ] - ) - ]) - if test "$wx_cv_lib_glibc21" = "yes"; then - AC_DEFINE(wxHAVE_GLIBC2) - fi -fi - -dnl we may need _GNU_SOURCE for 2 things: -dnl -dnl 1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we -dnl only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE -dnl which breaks libtiff compilation, so it is simpler to just define -dnl _GNU_SOURCE to get everything) -dnl -dnl 2. for Unicode functions -if test "x$wx_cv_lib_glibc21" = "xyes"; then - if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then - AC_DEFINE(_GNU_SOURCE) - fi -fi - dnl Only add the -lm library if floating point functions cannot be used dnl without it. This check is important on cygwin because of the bizarre dnl way that they have organized functions into libraries. On cygwin, both @@ -2912,9 +2905,6 @@ if test "$USE_WIN32" = 1 ; then dnl install Win32-specific files in "make install" WIN32INSTALL=win32install - - dnl pbt.h is missing on Wine at least - AC_CHECK_HEADER([pbt.h],, [AC_DEFINE(NEED_PBT_H)], [ ]) fi if test "$wxUSE_GUI" = "yes"; then @@ -3138,7 +3128,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config dnl test for external libxpm if we're configured to use it if test "$wxUSE_GPE" = "yes"; then AC_MSG_CHECKING(for gpewidget library) - WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpewidget) + WX_PATH_FIND_LIBRARIES(gpewidget) if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) dnl -lgpewidget must be before all GTK libs and @@ -3151,7 +3141,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config fi dnl AC_MSG_CHECKING(for gpe library) - dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,gpe) + dnl WX_PATH_FIND_LIBRARIES(gpe) dnl if test "$ac_find_libraries" != "" ; then dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lgpe" @@ -3397,7 +3387,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config AC_MSG_CHECKING(for Motif/Lesstif library) - WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) + WX_PATH_FIND_LIBRARIES(Xm) if test "x$ac_find_libraries" != "x" ; then AC_MSG_RESULT(found in $ac_find_libraries) @@ -3536,7 +3526,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config dnl test for external libxpm if we're configured to use it if test "$wxUSE_LIBXPM" = "sys"; then AC_MSG_CHECKING(for Xpm library) - WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) + WX_PATH_FIND_LIBRARIES(Xpm) if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" @@ -3764,18 +3754,17 @@ USE_XINERAMA=0 if test "$wxUSE_DISPLAY" = "yes"; then dnl Xinerama is used for wxGTK1/wxX11/wxMotif only if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_X11" = 1 -o "$wxUSE_GTK1" = 1; then - AC_MSG_CHECKING([for Xinerama]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xinerama) + WX_FIND_LIB(Xinerama, XineramaQueryScreens) if test "$ac_find_libraries" != "" ; then - WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) - if test "$ac_path_to_link" != " -L/usr/lib" ; then - LDFLAGS="$LDFLAGS $ac_path_to_link" + if test "$ac_find_libraries" != "std" ; then + WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) + if test "$ac_path_to_link" != " -L/usr/lib" ; then + LDFLAGS="$LDFLAGS $ac_path_to_link" + fi fi USE_XINERAMA=1 GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXinerama" - AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) AC_MSG_WARN([Xinerama not found; disabling wxDisplay]) wxUSE_DISPLAY="no" fi @@ -3788,10 +3777,8 @@ fi if test "$wxUSE_DISPLAY" = "yes"; then dnl wxGTK2 needs Xxf86vm as well as Xinerama-using ports from above if test "$USE_XINERAMA" = 1 -o "$wxUSE_GTK" = 1; then - AC_MSG_CHECKING([for Xxf86vm extension]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],Xxf86vm) + WX_FIND_LIB(Xxf86vm, XF86VidModeQueryExtension) if test "$ac_find_libraries" != "" ; then - AC_MSG_RESULT([yes]) AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [ GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXxf86vm" @@ -3802,8 +3789,6 @@ if test "$wxUSE_DISPLAY" = "yes"; then #include #endif ]) - else - AC_MSG_RESULT([no]) fi fi fi @@ -3813,17 +3798,16 @@ dnl X11 session management dnl --------------------------------------------------------------------------- if test "$wxUSE_DETECT_SM" = "yes"; then if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_MAC" != 1 -a "$wxUSE_OLD_COCOA" != 1; then - AC_MSG_CHECKING([for -lSM - X11 session management]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],SM) + WX_FIND_LIB(SM, SmcOpenConnection) if test "$ac_find_libraries" != "" ; then - WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) - if test "$ac_path_to_link" != " -L/usr/lib" ; then + if test "$ac_find_libraries" != "std" ; then + WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) + if test "$ac_path_to_link" != " -L/usr/lib" ; then LDFLAGS="$LDFLAGS $ac_path_to_link" + fi fi GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lSM" - AC_MSG_RESULT([yes]) else - AC_MSG_RESULT([no]) AC_MSG_WARN([libSM not found; disabling session management detection]) wxUSE_DETECT_SM="no" fi @@ -3864,48 +3848,43 @@ if test "$wxUSE_OPENGL" = "yes" -o "$wxUSE_OPENGL" = "auto"; then AC_CHECK_HEADER(GL/glu.h, [ found_gl=0 - AC_MSG_CHECKING([for -lGL]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB /opt/graphics/OpenGL/lib],GL) + WX_FIND_LIB(GL, glBegin, [/opt/graphics/OpenGL/lib]) if test "$ac_find_libraries" != "" ; then - AC_MSG_RESULT([found in $ac_find_libraries]) - - WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) - if test "$ac_path_to_link" != " -L/usr/lib" ; then + if test "$ac_find_libraries" != "std" ; then + WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) + if test "$ac_path_to_link" != " -L/usr/lib" ; then LDFLAGS_GL="$ac_path_to_link" + fi fi dnl don't suppose that libGL and libGLU are always in the dnl same directory -- this is not true for some common dnl distributions - AC_MSG_CHECKING([for -lGLU]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],GLU) + WX_FIND_LIB(GLU, gluBeginCurve, [/opt/graphics/OpenGL/lib]) if test "$ac_find_libraries" != "" ; then + if test "$ac_find_libraries" != "std" ; then WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) if test "$ac_path_to_link" != " -L/usr/lib" -a \ - "$ac_path_to_link" != "$LDFLAGS_GL"; then - LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link" + "$ac_path_to_link" != "$LDFLAGS_GL" ; then + LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link" fi + fi found_gl=1 OPENGL_LIBS="-lGL -lGLU" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) fi - else - AC_MSG_RESULT([no]) fi if test "$found_gl" != 1; then - AC_MSG_CHECKING([for -lMesaGL]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],MesaGL) + WX_FIND_LIB(MesaGL, glEnable, [/opt/graphics/OpenGL/lib]) if test "$ac_find_libraries" != "" ; then + if test "$ac_find_libraries" != "std" ; then WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) - LDFLAGS_GL="$LDFLAGS$ac_path_to_link" - OPENGL_LIBS="-lMesaGL -lMesaGLU" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) + if test "$ac_path_to_link" != " -L/usr/lib" ; then + LDFLAGS_GL="$LDFLAGS_GL$ac_path_to_link" + fi + fi + OPENGL_LIBS="-lMesaGL -lMesaGLU" fi fi ],, [ ]) @@ -5831,7 +5810,11 @@ if test "$WXGTK2" = 1; then AC_DEFINE(wxUSE_LIBGNOMEPRINT) ], [ - AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing]) + if test "$wxUSE_GTKPRINT" = yes; then + AC_MSG_RESULT(no) + else + AC_MSG_WARN([libgnomeprintui not found, library will use standard PostScript printing]) + fi wxUSE_LIBGNOMEPRINT="no" ] ) @@ -7036,6 +7019,10 @@ if test "$wxUSE_RICHMSGDLG" = "yes"; then AC_DEFINE(wxUSE_RICHMSGDLG) fi +if test "$wxUSE_RICHTOOLTIP" = "yes"; then + AC_DEFINE(wxUSE_RICHTOOLTIP) +fi + if test "$wxUSE_SASH" = "yes"; then AC_DEFINE(wxUSE_SASH) SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS sashtest" @@ -7178,6 +7165,7 @@ fi if test "$wxUSE_TREELISTCTRL" = "yes"; then AC_DEFINE(wxUSE_TREELISTCTRL) USES_CONTROLS=1 + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS treelist" fi if test "$wxUSE_POPUPWIN" = "yes"; then @@ -7396,7 +7384,7 @@ if test "$wxUSE_WEBVIEW" = "yes"; then if test "$wxUSE_WEBVIEW_WEBKIT" = "yes"; then if test "$wxUSE_GTK" = 1; then AC_MSG_CHECKING([for webkitgtk libraries]) - WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],webkitgtk-1.0) + WX_PATH_FIND_LIBRARIES(webkitgtk-1.0) if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS]) if test "$ac_path_to_link" != " -L/usr/lib" ; then @@ -7463,7 +7451,7 @@ if test "$wxUSE_WEBVIEW" = "yes"; then AC_MSG_WARN([WebKit not available, disabling wxWebView]) fi elif test "$wxUSE_MSW" = 1; then - if test "wxUSE_WEBVIEW_IE" = "yes"; then + if test "$wxUSE_WEBVIEW_IE" = "yes"; then dnl TODO: Check for the required headers/libraries under Windows dnl too and do the right thing automatically there too. wxUSE_WEBVIEW="yes" @@ -7734,7 +7722,7 @@ if test "$wxUSE_MEDIACTRL" = "yes" -o "$wxUSE_MEDIACTRL" = "auto"; then if test "$wxUSE_GSTREAMER8" = "no"; then PKG_CHECK_MODULES(GST, - [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION gconf-2.0], + [gstreamer-$GST_VERSION gstreamer-plugins-base-$GST_VERSION], [ wxUSE_GSTREAMER="yes" GST_LIBS="$GST_LIBS -lgstinterfaces-$GST_VERSION" @@ -8386,9 +8374,9 @@ case "${host}" in dnl system packages are compiled with Sun CC and so pkg-config outputs dnl CC-specific "-mt" flag, remove it when using gcc if test "$GCC" = yes; then - CPPFLAGS=`echo $CPPFLAGS | sed 's/-mt//'` - LIBS=`echo $LIBS | sed 's/-mt//'` - EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-mt//'` + CPPFLAGS=`echo $CPPFLAGS | sed 's/-mt//g'` + LIBS=`echo $LIBS | sed 's/-mt//g'` + EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-mt//g'` fi ;; @@ -8396,9 +8384,9 @@ case "${host}" in dnl OTOH when using Sun CC under Linux, the flags contain gcc-specific dnl -pthreads which Sun CC doesn't know about if test "x$SUNCXX" = xyes; then - CPPFLAGS=`echo $CPPFLAGS | sed 's/-pthread//'` - LIBS=`echo $LIBS | sed 's/-pthread//'` - EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-pthread//'` + CPPFLAGS=`echo $CPPFLAGS | sed 's/-pthread//g'` + LIBS=`echo $LIBS | sed 's/-pthread//g'` + EXTRALIBS_GUI=`echo $EXTRALIBS_GUI | sed 's/-pthread//g'` fi ;; esac