]> git.saurik.com Git - wxWidgets.git/blobdiff - wxwin.m4
Added wxHtmlCell::[S|G]etId
[wxWidgets.git] / wxwin.m4
index cad993397413b96ffa917f22fd1c4fcb62a9c06f..36ddcf63058b08ebd5faa66dfb1c6544673e69b6 100644 (file)
--- a/wxwin.m4
+++ b/wxwin.m4
@@ -1,56 +1,73 @@
 dnl ---------------------------------------------------------------------------
 dnl Macros for wxWindows detection. Typically used in configure.in as:
 dnl
-dnl    AC_ARG_ENABLE(...)
-dnl    AC_ARG_WITH(...)
-dnl    ...
-dnl    AM_OPTIONS_WXCONFIG
-dnl    ...
-dnl    ...
-dnl    AM_PATH_WXCONFIG(2.3.2, wxWin=1)
+dnl     AC_ARG_ENABLE(...)
+dnl     AC_ARG_WITH(...)
+dnl        ...
+dnl     AM_OPTIONS_WXCONFIG
+dnl        ...
+dnl        ...
+dnl     AM_PATH_WXCONFIG(2.3.4, wxWin=1)
 dnl     if test "$wxWin" != 1; then
 dnl        AC_MSG_ERROR([
-dnl               wxWindows must be installed on your system
-dnl               but wx-config script couldn't be found.
-dnl     
-dnl               Please check that wx-config is in path, the directory
-dnl               where wxWindows libraries are installed (returned by
-dnl               'wx-config --libs' command) is in LD_LIBRARY_PATH or
-dnl               equivalent variable and wxWindows version is 2.3.2 or above.
+dnl                wxWindows must be installed on your system
+dnl                but wx-config script couldn't be found.
+dnl
+dnl                Please check that wx-config is in path, the directory
+dnl                where wxWindows libraries are installed (returned by
+dnl                'wx-config --libs' command) is in LD_LIBRARY_PATH or
+dnl                equivalent variable and wxWindows version is 2.3.4 or above.
 dnl        ])
 dnl     fi
 dnl     CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
 dnl     CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
 dnl     CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
-dnl     
+dnl
 dnl     LDFLAGS="$LDFLAGS $WX_LIBS"
 dnl ---------------------------------------------------------------------------
 
 dnl ---------------------------------------------------------------------------
 dnl AM_OPTIONS_WXCONFIG
 dnl
-dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config 
-dnl command line options
+dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
+dnl --wx-config command line options
 dnl ---------------------------------------------------------------------------
 
 AC_DEFUN(AM_OPTIONS_WXCONFIG,
 [
-   AC_ARG_WITH(wx-prefix, [  --with-wx-prefix=PREFIX   Prefix where wxWindows is installed (optional)],
-               wx_config_prefix="$withval", wx_config_prefix="")
-   AC_ARG_WITH(wx-exec-prefix,[  --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
-               wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
-   AC_ARG_WITH(wx-exec-prefix,[  --with-wx-config=CONFIG   wx-config script to use (optional)],
-               wx_config_name="$withval", wx_config_name="")
+    AC_ARG_WITH(wxdir,
+                [  --with-wxdir=PATH       Use uninstalled version of wxWindows in PATH],
+                [ wx_config_name="$withval/wx-config"
+                  wx_config_args="--inplace"])
+    AC_ARG_WITH(wx-config,
+                [  --with-wx-config=CONFIG wx-config script to use (optional)],
+                wx_config_name="$withval" )
+    AC_ARG_WITH(wx-prefix,
+                [  --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
+                wx_config_prefix="$withval", wx_config_prefix="")
+    AC_ARG_WITH(wx-exec-prefix,
+                [  --with-wx-exec-prefix=PREFIX
+                          Exec prefix where wxWindows is installed (optional)],
+                wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
 ])
 
 dnl ---------------------------------------------------------------------------
-dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
+dnl                  [, WX-LIBS]]])
 dnl
 dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
 dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
 dnl environment variable to override the default name of the wx-config script
 dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
 dnl case the macro won't even waste time on tests for its existence.
+dnl
+dnl Optional WX-LIBS argument contains comma-separated list of wxWindows
+dnl libraries to link against (it may include contrib libraries). If it is not
+dnl specified then WX_LIBS and WX_LIBS_STATIC will contain flags to link
+dnl with all of the core wxWindows libraries.
+dnl
+dnl Example use:
+dnl   AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net])
 dnl ---------------------------------------------------------------------------
 
 dnl
@@ -62,6 +79,7 @@ AC_DEFUN(AM_PATH_WXCONFIG,
   if test x${WX_CONFIG_NAME+set} != xset ; then
      WX_CONFIG_NAME=wx-config
   fi
+
   if test "x$wx_config_name" != x ; then
      WX_CONFIG_NAME="$wx_config_name"
   fi
@@ -69,20 +87,20 @@ AC_DEFUN(AM_PATH_WXCONFIG,
   dnl deal with optional prefixes
   if test x$wx_config_exec_prefix != x ; then
      wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
-     if test x${WX_CONFIG_NAME+set} != xset ; then
-        WX_CONFIG_PATH=$wx_config_exec_prefix/bin/$WX_CONFIG_NAME
-     fi
+     WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
   fi
   if test x$wx_config_prefix != x ; then
      wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
-     if test x${WX_CONFIG_NAME+set} != xset ; then
-        WX_CONFIG_PATH=$wx_config_prefix/bin/$WX_CONFIG_NAME
-     fi
+     WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
   fi
 
-  dnl don't search the PATH if we already have the full name
-  if test "x$WX_CONFIG_PATH" = "x" ; then
-    AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no)
+  dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
+  if test -x "$WX_CONFIG_NAME" ; then
+     AC_MSG_CHECKING(for wx-config)
+     WX_CONFIG_PATH="$WX_CONFIG_NAME"
+     AC_MSG_RESULT($WX_CONFIG_PATH)
+  else
+     AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
   fi
 
   if test "$WX_CONFIG_PATH" != "no" ; then
@@ -129,8 +147,13 @@ AC_DEFUN(AM_PATH_WXCONFIG,
     if test "x$wx_ver_ok" = x ; then
       no_wx=yes
     else
-      WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
-      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
+      if test "x$4" = "x" ; then
+        wx_libs_arg="--libs"
+      else
+        wx_libs_arg="--libs=$4"
+      fi
+      WX_LIBS=`$WX_CONFIG_WITH_ARGS $wx_libs_arg`
+      WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static $wx_libs_arg`
 
       dnl starting with version 2.2.6 wx-config has --cppflags argument
       wx_has_cppflags=""
@@ -174,10 +197,10 @@ AC_DEFUN(AM_PATH_WXCONFIG,
        ifelse([$2], , :, [$2])
     else
        if test "x$WX_VERSION" = x; then
-         dnl no wx-config at all
-         AC_MSG_RESULT(no)
+          dnl no wx-config at all
+          AC_MSG_RESULT(no)
        else
-         AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
+          AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
        fi
 
        WX_CFLAGS=""