]> git.saurik.com Git - wxWidgets.git/blobdiff - configure.in
wxString docs are nearly complete (but don't compile :-( ), a brief threads
[wxWidgets.git] / configure.in
index 419be3c0b66b72a2f1c696becb3814284388d0e6..12c2f3346e9d99adaf045937611401a2ab4541aa 100644 (file)
@@ -235,10 +235,18 @@ dnl ------------------------------------------------------------------------
 dnl search path for includes and libraries
 dnl ------------------------------------------------------------------------
 
+dnl VZ: added standard locations for Xm.h for Irix, HP-UX and SunOS (19.02.99)
 SEARCH_INCLUDE="\
+    /usr/Motif-1.2/include    \
+    /usr/Motif-2.1/include    \
+                              \
+    /usr/include/Motif1.2     \
+    /opt/xpm/include/X11      \
+                              \
     /usr/Motif1.2/include     \
-    /usr/dt/include/Xm        \
-                             \
+    /usr/dt/include           \
+    /usr/include/Xm           \
+                                         \
     /usr/X11R6/include        \
     /usr/X11R5/include        \
     /usr/X11R4/include        \
@@ -279,19 +287,14 @@ SEARCH_INCLUDE="\
     /usr/lpp/Xamples/include  \
                               \
     /usr/local/include/gtk    \
-    /usr/local/include/Xm     \
     /usr/local/include/qt     \
-    /usr/X11R6/include/Xm     \
-    /usr/X11/include/Xm       \
     /usr/include/qt           \
                               \
     /usr/openwin/include      \
     /usr/openwin/share/include \
     "
 
-SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` \
-    /usr/dt/lib \
-    "
+SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` "
 
 dnl ------------------------------------------------------------------------
 dnl standard checks
@@ -447,7 +450,7 @@ AC_SUBST(GTK_JOYSTICK)
 dnl check for vprintf/vsprintf() which are GNU extensions
 AC_FUNC_VPRINTF
 dnl check for vsnprintf() which is another GNU extension
-AC_CHECK_FUNC(vsnprintf)
+AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
 
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
@@ -519,6 +522,7 @@ dnl   defines WORDS_BIGENDIAN if system is big endian
 AC_CHECK_SIZEOF(int *)
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
 dnl   defines the size of certain types of variables in SIZEOF_???
 
 dnl ############################
@@ -559,6 +563,60 @@ dnl   defines YYTEXT_POINTER  if yytext is char*
 dnl   defines LEX_OUTPUT_ROOT as to the base of the 
 dnl                           filename output by the lexer
 
+dnl ###################################
+dnl ##  Check for dynamic load module #
+dnl ###################################
+
+DL_LIBRARY=
+AC_CHECK_FUNCS(dlopen, AC_DEFINE(HAVE_LIBDL),
+[AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL) DL_LIBRARY="-ldl"],
+ [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD) DL_LIBRARY="-ldld"],
+   [AC_CHECK_FUNCS(shl_load, AC_DEFINE(HAVE_SHL_LOAD) )]
+  )]
+ )]
+)
+AC_SUBST(DL_LIBRARY)
+
+AC_CACHE_CHECK([for underscore before symbols], libltdl_cv_uscore, [
+  echo "main(){int i=1;} fnord(){int i=23; int ltuae=42;}" > conftest.c
+  ${CC} -c conftest.c > /dev/null
+  if (nm conftest.o | grep _fnord) > /dev/null; then
+    libltdl_cv_uscore=yes
+  else
+    libltdl_cv_uscore=no
+  fi
+  rm -f conftest*
+])
+
+if test x"$libltdl_cv_uscore" = xyes; then
+  if test x"$ac_cv_func_dlopen" = xyes ||
+     test x"$ac_cv_lib_dl_dlopen" = xyes ; then
+       AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+               libltdl_cv_need_uscore, [dnl
+               AC_TRY_RUN([
+#include <dlfcn.h>
+#include <stdio.h>
+fnord() { int i=42;}
+main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
+    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
+    if(ptr1 && !ptr2) exit(0); } exit(1); } 
+],     libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
+       libltdl_cv_need_uscore=no
+)])
+  fi
+fi
+
+if test x"$libltdl_cv_need_uscore" = xyes; then
+   AC_DEFINE(NEED_USCORE)
+fi
+
+dnl ##########################################
+dnl ##  Check for specific library functions #
+dnl ##########################################
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(strerror)
+
 dnl ------------------------------------------------------------------------
 dnl main includes
 dnl ------------------------------------------------------------------------
@@ -695,6 +753,7 @@ DEFAULT_wxUSE_IOSTREAMH=1
 
 DEFAULT_wxUSE_ZLIB=1
 DEFAULT_wxUSE_LIBPNG=1
+DEFAULT_wxUSE_LIBJPEG=0
 DEFAULT_wxUSE_ODBC=1
 
 DEFAULT_wxUSE_TIMEDATE=1
@@ -702,6 +761,7 @@ DEFAULT_wxUSE_INTL=1
 DEFAULT_wxUSE_CONFIG=1
 DEFAULT_wxUSE_STREAMS=1
 DEFAULT_wxUSE_SERIAL=1
+DEFAULT_wxUSE_DYNLIB_CLASS=1
 
 DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=1
 DEFAULT_WX_NORMALIZED_PS_FONTS=1
@@ -710,6 +770,7 @@ DEFAULT_wxUSE_POSTSCRIPT=1
 DEFAULT_wxUSE_IPC=1
 DEFAULT_wxUSE_RESOURCES=1
 DEFAULT_wxUSE_CLIPBOARD=1
+DEFAULT_wxUSE_TOOLTIPS=1
 DEFAULT_wxUSE_DRAG_AND_DROP=1
 
 DEFAULT_wxUSE_MDI_ARCHITECTURE=1
@@ -784,6 +845,10 @@ AC_OVERRIDES(threads,threads,
 **--with-threads          for enabling threads,
 wxUSE_THREADS)
 
+AC_OVERRIDES(dynlib,dynlib,
+**--with-dynlib           to compile wxLibrary class,
+wxUSE_DYNLIB_CLASS)
+
 dnl ----------------------------------------------------------------
 dnl user options for libraries
 dnl ----------------------------------------------------------------
@@ -796,6 +861,10 @@ AC_OVERRIDES(libpng,libpng,
 **--with-libpng           use libpng (PNG image format),
 wxUSE_LIBPNG)
 
+AC_OVERRIDES(libjpeg,libjpeg,
+**--with-libjpeg          use libjpeg (JPEG image format),
+wxUSE_LIBJPEG)
+
 AC_OVERRIDES(odbc,odbc,
 **--with-odbc             use iODBC and wxODBC classes,
 wxUSE_ODBC)
@@ -884,6 +953,10 @@ AC_OVERRIDES(clipboard,clipboard,
 **--with-clipboard        use wxClipboard classes,
 wxUSE_CLIPBOARD)
 
+AC_OVERRIDES(tooltips,tooltips,
+**--with-tooltips         use tooltips,
+wxUSE_TOOLTIPS)
+
 AC_OVERRIDES(dnd,dnd,
 **--with-dnd              use Drag'n'Drop classes,
 wxUSE_DRAG_AND_DROP)
@@ -916,6 +989,13 @@ if test "$wxUSE_UNIX" = 1 ; then
   AC_DEFINE(__UNIX__)
 fi
 
+dnl ----------------------------------------------------------------
+dnl Linux: test for libc5/glibc2: glibc2 has gettext() included
+dnl ----------------------------------------------------------------
+if test "$USE_LINUX" = 1; then
+       AC_CHECK_LIB(c,gettext,AC_DEFINE(wxHAVE_GLIBC2))
+fi
+
 dnl ----------------------------------------------------------------
 dnl search for toolkit (widget sets)
 dnl ----------------------------------------------------------------
@@ -970,7 +1050,7 @@ fi
 
 if test "$wxUSE_MOTIF" = 1; then
    AC_MSG_CHECKING(for Motif/Lesstif includes)
-   AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,Xm.h)
+   AC_PATH_FIND_INCLUDES($SEARCH_INCLUDE,Xm/Xm.h)
    if test "$ac_find_includes" != "" ; then
      AC_MSG_RESULT(found $ac_find_includes)
      AC_MSG_CHECKING(for Motif/Lesstif library)
@@ -1006,11 +1086,11 @@ if test "$wxUSE_MOTIF" = 1; then
      AC_MSG_ERROR(no)
   fi
   
-  GUI_TK_LINK="-lXm -lXmu -lXt -lXpm -lX11 -lm"
-  GUI_TK_LINK="$CHECK_LINK $GUI_TK_LINK"
+  GUI_TK_LINK="-lXm -lXpm -lXmu -lXt -lX11 -lm"
+  GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
   TOOLKIT=MOTIF
   TOOLKIT_DEF="__WXMOTIF__ -D__LINUX__ -D__UNIX__"
-  WX_LINK=-lwx_motif
+  WX_LINK=-lwx_motif2
   MAKEINCLUDE=../motif.inc
 fi
 
@@ -1033,6 +1113,8 @@ dnl ----------------------------------------------------------------
 dnl Register compile options for makefiles and setup.h
 dnl ----------------------------------------------------------------
 
+EXTRA_LINK=
+
 WXDEBUG=
 if test "$wxUSE_DEBUG_GDB" = 1 ; then
   wxUSE_DEBUG_INFO=1
@@ -1043,7 +1125,7 @@ else
     WXDEBUG="-g"
     wxUSE_OPTIMISE=0
   else
-    WX_LINK="-s $WX_LINK"
+    EXTRA_LINK="-s $EXTRA_LINK"
   fi
 fi
 AC_SUBST(WXDEBUG)
@@ -1062,7 +1144,6 @@ if test "$wxUSE_MEM_TRACING" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_GLOBAL_MEMORY_OPERATORS,$wxUSE_MEM_TRACING)
 fi
 
-EXTRA_LINK=
 if test "$wxUSE_DMALLOC" = 1 ; then
   EXTRA_LINK="$EXTRA_LINK -ldmalloc"
 fi
@@ -1117,6 +1198,14 @@ if test "$wxUSE_LIBPNG" = 1 ; then
 fi
 AC_SUBST(PNG_C_SRC)
 
+JPEG_LINK=""
+if test "$wxUSE_LIBJPEG" = 1 ; then
+  AC_DEFINE_UNQUOTED(wxUSE_LIBJPEG,$wxUSE_LIBJPEG)
+  AC_CHECK_LIB(jpeg) 
+  JPEG_LINK="-ljpeg"
+fi
+AC_SUBST(JPEG_LINK)
+
 IODBC_C_SRC=""
 if test "$wxUSE_ODBC" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_ODBC,$wxUSE_ODBC) 
@@ -1148,6 +1237,31 @@ if test "$wxUSE_SERIAL" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_SERIAL,$wxUSE_SERIAL)
 fi
 
+dnl ------------------------------------------------------------------------
+dnl wxLibrary class
+dnl ------------------------------------------------------------------------
+
+HAVE_DL_FUNCS=0
+if test "$wxUSE_DYNLIB_CLASS" = "1"; then
+    dnl the test is a bit complicated because we check for dlopen() both with
+    dnl and without -ldl
+    AC_CHECK_FUNCS(dlopen,
+        [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1],
+        [AC_CHECK_LIB(dl, dlopen,
+            [AC_DEFINE(HAVE_DLOPEN) HAVE_DL_FUNCS=1])])
+    AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD) HAVE_DL_FUNCS=1])
+
+    if test "$HAVE_DL_FUNCS" = 0; then
+        AC_MSG_WARN("--with-dynlib will be disabled because no function was found to load a shared library on this platform")
+
+        wxUSE_DYNLIB_CLASS=0
+    fi
+fi
+
+if test "$wxUSE_DYNLIB_CLASS" = 1 ; then
+  AC_DEFINE_UNQUOTED(wxUSE_DYNLIB_CLASS,$wxUSE_DYNLIB_CLASS)
+fi
+
 dnl ----------------------------------------------------------------
 dnl Register Prolog and Resources options for makefiles and setup.h
 dnl ----------------------------------------------------------------
@@ -1220,6 +1334,10 @@ if test "$wxUSE_CLIPBOARD" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_CLIPBOARD,$wxUSE_CLIPBOARD)
 fi
 
+if test "$wxUSE_TOOLTIPS" = 1 ; then
+  AC_DEFINE_UNQUOTED(wxUSE_TOOLTIPS,$wxUSE_TOOLTIPS)
+fi
+
 if test "$wxUSE_DRAG_AND_DROP" = 1 ; then
   AC_DEFINE_UNQUOTED(wxUSE_DRAG_AND_DROP,$wxUSE_DRAG_AND_DROP)
 fi
@@ -1235,13 +1353,6 @@ if test "$wxUSE_HELP" = 1 ; then
 fi
 AC_SUBST(HELP)
 
-dnl ----------------------------------------------------------------
-dnl select  dynamic loader (used by iODBC to load drivers)
-dnl ----------------------------------------------------------------
-
-AC_CHECK_LIB(dl,main,[DL_LIBRARY=-ldl],[DL_LIBRARY=])
-AC_SUBST(DL_LIBRARY)
-
 dnl ----------------------------------------------------------------
 dnl thread support
 dnl ----------------------------------------------------------------
@@ -1397,7 +1508,7 @@ case "${canonical}" in
 esac
 
 if test "x$GCC" = xyes; then
-  CFLAGS="${CFLAGS} -Wall -Wno-unused -Wno-uninitialized -D_REENTRANT -DLEX_SCANNER"
+  CFLAGS="${CFLAGS} -Wall -Wno-unused -Wno-uninitialized -D_REENTRANT -DLEX_SCANNER -DHAVE_LIBDL"
 fi
 
 if test "x$GXX" = xyes; then