X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3fd528b939f44c0e0535fc5f3aff40989fb67a45..e87271f35887a50e011c7c97fc63c35f5d623e50:/configure.in diff --git a/configure.in b/configure.in index 2bbce273d4..d71e25eff0 100644 --- a/configure.in +++ b/configure.in @@ -465,6 +465,7 @@ dnl ------------------------------------------------------------------------ dnl assume Unix USE_UNIX=1 +USE_WIN32=0 USE_LINUX= USE_SGI= USE_HPUX= @@ -583,6 +584,7 @@ case "${host}" in *-*-cygwin32* ) USE_UNIX=0 + USE_WIN32=1 AC_DEFINE(__WIN32__) AC_DEFINE(__WIN95__) AC_DEFINE(__WINDOWS__) @@ -593,6 +595,7 @@ case "${host}" in ;; *-*-mingw32* ) USE_UNIX=0 + USE_WIN32=1 AC_DEFINE(__WIN32__) AC_DEFINE(__WIN95__) AC_DEFINE(__WINDOWS__) @@ -1510,7 +1513,12 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then INCLUDE_SUBDIRS="$INCLUDE_SUBDIRS msw" dnl --- Quick & Dirty ; link against most/all libraries dnl --- This will bloat the executable, but it'll work for now... - LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32" + LIBS="$LIBS -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lcrtdll -ladvapi32 -lwsock32" + + dnl -mwindows is needed to avoid that spawning of a console window + if test "$wxUSE_MINGW" = 1; then + LDFLAGS="$LDFLAGS -mwindows" + fi TOOLKIT=MSW @@ -1595,18 +1603,30 @@ if test "$wxUSE_WINE" = 1; then fi if test "$wxUSE_MOTIF" = 1; then - dnl find the X11 include and library files - dnl defines x_includes and x_libraries - AC_PATH_XTRA - - if test "$no_x" = "yes"; then - AC_MSG_ERROR(X11 libraries not found, aborting) + AC_MSG_CHECKING(for X11 headers) + WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, X11/Intrinsic.h) + if test "$ac_find_includes" != "" ; then + AC_MSG_RESULT(found $ac_find_includes) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h) fi - TOOLKIT_INCLUDE="$X_CFLAGS" - GUI_TK_LIBRARY="$X_LIBS" + AC_MSG_CHECKING(for X11 libraries) + WX_PATH_FIND_LIBRARIES($SEARCH_LIB, X11) + if test "$ac_find_libraries" != "" ; then + WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE) + WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) - AC_MSG_CHECKING(for Motif/Lesstif includes) + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link" + TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include" + AC_MSG_RESULT(found at $ac_find_libraries) + else + AC_MSG_RESULT(no) + AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) + fi + + AC_MSG_CHECKING(for Motif/Lesstif headers) WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h) if test "$ac_find_includes" != "" ; then AC_MSG_RESULT(found $ac_find_includes) @@ -1621,7 +1641,7 @@ if test "$wxUSE_MOTIF" = 1; then WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE) WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) - CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link" TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include" AC_MSG_RESULT(found at $ac_find_libraries) else @@ -1633,7 +1653,7 @@ if test "$wxUSE_MOTIF" = 1; then WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt) if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) - CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link" AC_MSG_RESULT(found at $ac_find_libraries) else AC_MSG_RESULT(no) @@ -1645,7 +1665,7 @@ if test "$wxUSE_MOTIF" = 1; then WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) if test "$ac_find_libraries" != "" ; then WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) - CHECK_LINK="$GUI_TK_LIBRARY $ac_path_to_link" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link" XPM_LINK="-lXpm " AC_DEFINE(wxHAVE_LIB_XPM) AC_MSG_RESULT(found at $ac_find_libraries) @@ -1679,7 +1699,7 @@ dnl the name of the (libtool) library WX_LIBRARY="wx_${TOOLKIT_DIR}" dnl the sources, their dependenices and the headers - ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(JPEGOBJS) \$(PNGOBJS) \$(ZLIBOBJS)" + ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(JPEGOBJS) \$(PNGOBJS) \$(ZLIBOBJS) \$(IODBCOBJS)" ALL_DEPFILES="\$(GUIDEPS) \$(COMMONDEPS) \$(GENERICDEPS) \$(UNIXDEPS) \$(HTMLDEPS)" ALL_HEADERS="\$(GUIHEADERS) \$(HTML_HEADERS) \$(UNIX_HEADERS) \$(PROTOCOL_HEADERS) \$(GENERIC_HEADERS) \$(WX_HEADERS)" else @@ -1715,14 +1735,16 @@ WX_ALL= WX_ALL_INSTALLED= if test "$wxUSE_SHARED" = "yes"; then - dnl set target to shared - WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}" - case "${host}" in *-hp-hpux* ) + if test "$GCC" = yes ; then + SHARED_LD="${CC} -shared -o" + PIC_FLAG="-fPIC" + else + SHARED_LD="${CXX} -b -o" + PIC_FLAG="+Z" + fi WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}.sl" - SHARED_LD="${CXX} -b -o" - PIC_FLAG="+Z" WX_ALL=${WX_LIBRARY_NAME_SHARED} ;; *-*-linux* ) @@ -1802,6 +1824,10 @@ if test "$wxUSE_SHARED" = "yes"; then AC_MSG_ERROR(unknown system type ${host}.) esac + dnl set target to shared if not explicitly chose static before + if test "x$WX_TARGET_LIBRARY" = "x"; then + WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_SHARED}" + fi else dnl set target to static WX_TARGET_LIBRARY="${WX_LIBRARY_NAME_STATIC}" @@ -1945,6 +1971,8 @@ AC_CACHE_CHECK([for vsscanf], wx_cv_func_vsscanf, AC_LANG_RESTORE +if test "$USE_UNIX" = 1; then + dnl check for vfork() (even if it's the same as fork() in modern Unices) AC_CHECK_FUNCS(vfork) @@ -1971,6 +1999,9 @@ AC_CHECK_FUNCS(inet_addr) AC_CHECK_FUNCS(inet_aton) AC_CHECK_LIB(resolv, inet_aton) +fi +dnl Unix + dnl =========================================================================== dnl Now we have all the info we need - use it! dnl =========================================================================== @@ -2101,6 +2132,13 @@ if test "$wxUSE_THREADS" = "yes"; then CXXFLAGS="${CXXFLAGS} -D_REENTRANT" SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread" +else + dnl on some systems, _REENTRANT should bedefined if we want to use any _r() + dnl functions - add tests for other functions here as well + if test "$ac_cv_func_strtok_r" = "yes"; then + CFLAGS="${CFLAGS} -D_REENTRANT" + CXXFLAGS="${CXXFLAGS} -D_REENTRANT" + fi fi if test "$WXGTK12" = 1 ; then @@ -2359,15 +2397,15 @@ if test "$wxUSE_SOCKETS" = "yes"; then AC_MSG_CHECKING(the type of the third argument of getsockname) AC_TRY_COMPILE( [#include ], - [socklen_t len; getsockname(0, NULL, &len);], + [socklen_t len; getsockname(0, 0, &len);], AC_DEFINE(SOCKLEN_T, socklen_t) AC_MSG_RESULT(socklen_t), AC_TRY_COMPILE( [#include ], - [size_t len; getsockname(0, NULL, &len);], + [size_t len; getsockname(0, 0, &len);], AC_DEFINE(SOCKLEN_T, size_t) AC_MSG_RESULT(size_t), AC_TRY_COMPILE( [#include ], - [int len; getsockname(0, NULL, &len);], + [int len; getsockname(0, 0, &len);], AC_DEFINE(SOCKLEN_T, int) AC_MSG_RESULT(int), AC_MSG_RESULT(unknown) ) @@ -2459,9 +2497,12 @@ dnl ---------------------------------------------------------------- IODBC_C_SRC="" if test "$wxUSE_ODBC" = "yes" ; then - AC_DEFINE(wxUSE_ODBC) - WXODBCFLAG="-D_IODBC_" - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" + AC_DEFINE(wxUSE_ODBC) + WXODBCFLAG="-D_IODBC_" + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" + IODBCOBJS="\$(IODBC_OBJS)" +else + IODBCOBJS= fi dnl ---------------------------------------------------------------- @@ -2554,10 +2595,21 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then wxUSE_DRAG_AND_DROP=no fi + if test "$USE_WIN32" = 1; then + dnl check for ole headers and disable DnD if not present (earlier + dnl versions of mingw32 don't have them) + AC_CHECK_HEADERS(ole2.h) + if test "x$HAVE_OLE2_H" = x ; then + AC_MSG_WARN(Drag and drop disabled because OLE headers not found) + wxUSE_DRAG_AND_DROP=no + fi + fi + if test "$wxUSE_DRAG_AND_DROP" = "yes"; then AC_DEFINE(wxUSE_DRAG_AND_DROP) SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd" fi + fi if test "$wxUSE_SPLINES" = "yes" ; then @@ -2879,6 +2931,7 @@ AC_SUBST(GENERICOBJS) AC_SUBST(GUIDEPS) AC_SUBST(COMMONDEPS) AC_SUBST(GENERICDEPS) +AC_SUBST(IODBCOBJS) AC_SUBST(UNIXOBJS) AC_SUBST(UNIXDEPS) AC_SUBST(ALL_OBJECTS) @@ -2956,6 +3009,7 @@ AC_OUTPUT([ samples/resource/Makefile samples/sashtest/Makefile samples/scroll/Makefile + samples/scrollsub/Makefile samples/splitter/Makefile samples/text/Makefile samples/thread/Makefile