X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/18dbb1f63083c3b737b763d18f83b3d4e4af3504..44d5b352ae4bd753dd5d6d79e70f08816efae4af:/configure.in diff --git a/configure.in b/configure.in index 528f013ed2..6491de70b1 100644 --- a/configure.in +++ b/configure.in @@ -587,9 +587,27 @@ if test "$USE_BEOS" = 1; then INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS be" fi -dnl Linux: test for libc5/glibc2: glibc2 has gettext() included +dnl check for glibc version if test "$USE_LINUX" = 1; then - AC_CHECK_LIB(c,gettext,AC_DEFINE(wxHAVE_GLIBC2)) + AC_CACHE_CHECK([for glibc 2.1 or later], wx_lib_glibc21, + AC_TRY_COMPILE([#include ], + [ + #if !__GLIBC_PREREQ(2, 1) + #error not glibc2.1 + #endif + ], + [ + wx_lib_glibc21=yes + ], + [ + wx_lib_glibc21=no + ] + ) + ) + + if test "$wx_lib_glibc21" = "yes"; then + AC_DEFINE(wxHAVE_GLIBC2) + fi fi dnl --------------------------------------------------------------------------- @@ -705,6 +723,7 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_MSGDLG=no DEFAULT_wxUSE_NUMBERDLG=no DEFAULT_wxUSE_TEXTDLG=no + DEFAULT_wxUSE_SPLASH=no DEFAULT_wxUSE_STARTUP_TIPS=no DEFAULT_wxUSE_PROGRESSDLG=no DEFAULT_wxUSE_WIZARDDLG=no @@ -863,6 +882,7 @@ else DEFAULT_wxUSE_MSGDLG=yes DEFAULT_wxUSE_NUMBERDLG=yes DEFAULT_wxUSE_TEXTDLG=yes + DEFAULT_wxUSE_SPLASH=yes DEFAULT_wxUSE_STARTUP_TIPS=yes DEFAULT_wxUSE_PROGRESSDLG=yes DEFAULT_wxUSE_WIZARDDLG=yes @@ -1253,6 +1273,7 @@ WX_ARG_ENABLE(fontdlg, [ --enable-fontdlg use wxFontDialog], wxUSE_F WX_ARG_ENABLE(dirdlg, [ --enable-dirdlg use wxDirDialog], wxUSE_DIRDLG) WX_ARG_ENABLE(msgdlg, [ --enable-msgdlg use wxMessageDialog], wxUSE_MSGDLG) WX_ARG_ENABLE(numberdlg, [ --enable-numberdlg use wxNumberEntryDialog], wxUSE_NUMBERDLG) +WX_ARG_ENABLE(splash, [ --enable-splash use wxSplashScreen], wxUSE_SPLASH) WX_ARG_ENABLE(textdlg, [ --enable-textdlg use wxTextDialog], wxUSE_TEXTDLG) WX_ARG_ENABLE(tipdlg, [ --enable-tipdlg use startup tips], wxUSE_STARTUP_TIPS) WX_ARG_ENABLE(progressdlg, [ --enable-progressdlg use wxProgressDialog], wxUSE_PROGRESSDLG) @@ -2284,9 +2305,8 @@ if test "$wxUSE_SHARED" = "yes"; then fi ;; *-*-darwin* ) - TOOLKIT_DEF="${TOOLKIT_DEF} -D__UNIX__ -D__DARWIN__ -D__POWERPC__" - CFLAGS="${CFLAGS} -fno-common" - CPPFLAGS="${CPPFLAGS} -fno-common" + TOOLKIT_DEF="${TOOLKIT_DEF} -D__UNIX__ -D__DARWIN__ -D__POWERPC__" + CPPFLAGS="${CPPFLAGS} -fno-common" SHARED_LD="${CXX} -dynamiclib -o" PIC_FLAG="-dynamic -fPIC" if test "$wxUSE_OPENGL" = "yes"; then @@ -2297,9 +2317,9 @@ if test "$wxUSE_SHARED" = "yes"; then WX_ALL="CREATE_LINKS" fi dnl add the resources target for wxMac - if test "$wxUSE_MAC" = 1 ; then - WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.r" - fi + if test "$wxUSE_MAC" = 1 ; then + WX_ALL="${WX_ALL} ./lib/lib${WX_LIBRARY}-${WX_RELEASE}.r" + fi dnl the name of the shared library WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" WX_LIBRARY_NAME_SHARED_GL="lib${WX_LIBRARY}_gl-${WX_RELEASE}.dylib.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" @@ -2802,6 +2822,35 @@ fi dnl check for vfork() (even if it's the same as fork() in modern Unices) AC_CHECK_FUNCS(vfork) +dnl get the library function to use for wxGetDiskSpace() +AC_CACHE_CHECK(for statfs, wx_cv_func_statfs, + AC_TRY_COMPILE( + [ + #include + ], + [ + long l; + struct statfs fs; + statfs("/", &fs); + l = fs.f_bsize; + l += fs.f_blocks; + l += fs.f_bavail; + ], + [ + wx_cv_func_statfs=yes + ], + [ + wx_cv_func_statfs=no + ] + ) +) + +if test "$wx_cv_func_statfs" = "yes"; then + AC_DEFINE(HAVE_STATFS) +else + AC_MSG_WARN([wxGetDiskSpace() function won't work without statfs()]) +fi + dnl check for fcntl() or at least flock() needed by Unix implementation of dnl wxSingleInstanceChecker if test "$wxUSE_SNGLINST_CHECKER" = "yes"; then @@ -3051,6 +3100,14 @@ if test "$wxUSE_THREADS" = "yes" ; then dnl defined, we do it by directly assigned dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr + dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ + dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining + dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is + dnl simpler to just define _GNU_SOURCE to get everything) + if test "x$wx_lib_glibc21" = "xyes"; then + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + fi + AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t, [ AC_TRY_COMPILE([#include ], @@ -3095,7 +3152,7 @@ if test "$wxUSE_THREADS" = "yes" ; then dnl building MT programs under Solaris with the native compiler requires -mt dnl switch if test "$USE_SOLARIS" = "yes" -a "$GCC" != "yes"; then - CFLAGS="${CFLAGS} -mt" + CPPFLAGS="${CFLAGS} -mt" CXXFLAGS="${CXXFLAGS} -mt" LDFLAGS="${LDFLAGS} -mt" fi @@ -3109,8 +3166,7 @@ if test "$wxUSE_THREADS" = "yes"; then dnl must define _REENTRANT for multithreaded code except for Darwin/Mac OS X if test "$USE_DARWIN" != 1; then - CFLAGS="${CFLAGS} -D_REENTRANT" - CXXFLAGS="${CXXFLAGS} -D_REENTRANT" + CPPFLAGS="${CPPFLAGS} -D_REENTRANT" fi SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread" @@ -3120,8 +3176,7 @@ else if test "$ac_cv_func_strtok_r" = "yes"; then AC_MSG_CHECKING(if -D_REENTRANT is needed) if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then - CFLAGS="${CFLAGS} -D_REENTRANT" - CXXFLAGS="${CXXFLAGS} -D_REENTRANT" + CPPFLAGS="${CPPFLAGS} -D_REENTRANT" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -3148,8 +3203,8 @@ fi if test "$wxUSE_MAC" = 1 ; then TOOLKIT_DEF="${TOOLKIT_DEF} -DTARGET_CARBON" - CFLAGS="${CFLAGS} -fpascal-strings" - CPPFLAGS="${CPPFLAGS} -cpp-precomp -fpascal-strings" + CPPFLAGS="${CPPFLAGS} -fpascal-strings" + CXXFLAGS="${CXXFLAGS} -cpp-precomp" AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez) AC_CHECK_PROG(DEREZ, Derez, Derez, /Developer/Tools/Derez) RESCOMP=${REZ} @@ -3545,7 +3600,7 @@ if test "$wxUSE_STREAMS" = "yes" ; then AC_DEFINE(wxUSE_STREAMS) fi -dnl ------------------------------------------------------------------------ +dnl --------------------------------------------------------------------------- dnl time/date functions dnl ------------------------------------------------------------------------ @@ -3650,8 +3705,7 @@ if test "$wxUSE_DATETIME" = "yes"; then ], [ struct timeval tv; - struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); ], wx_cv_func_gettimeofday_has_2_args=yes, AC_TRY_COMPILE( @@ -3664,7 +3718,10 @@ if test "$wxUSE_DATETIME" = "yes"; then gettimeofday(&tv); ], wx_cv_func_gettimeofday_has_2_args=no, - wx_cv_func_gettimeofday_has_2_args=unknown + [ + AC_MSG_WARN([failed to determine number of gettimeofday() arguments]) + wx_cv_func_gettimeofday_has_2_args=unknown + ] ) ) AC_LANG_RESTORE @@ -4444,6 +4501,10 @@ if test "$wxUSE_PROGRESSDLG" = "yes"; then fi fi +if test "$wxUSE_SPLASH" = "yes"; then + AC_DEFINE(wxUSE_SPLASH) +fi + if test "$wxUSE_STARTUP_TIPS" = "yes"; then if test "$wxUSE_CONSTRAINTS" != "yes"; then AC_MSG_WARN(Startup tips requires constraints and won't be compiled without them) @@ -4476,6 +4537,18 @@ fi AC_DEFINE_UNQUOTED(WXWIN_OS_DESCRIPTION, $OSINFO) +dnl --------------------------------------------------------------------------- +dnl define the variable containing the installation prefix (used in dcpsg.cpp) +dnl --------------------------------------------------------------------------- + +if test "x$prefix" != "xNONE"; then + wxPREFIX=$prefix +else + wxPREFIX=$ac_default_prefix +fi + +AC_DEFINE_UNQUOTED(wxINSTALL_PREFIX, "$wxPREFIX") + dnl --------------------------------------------------------------------------- dnl Output the makefiles and such from the results found above dnl ---------------------------------------------------------------------------