]> git.saurik.com Git - wxWidgets.git/blobdiff - acinclude.m4
hint to alpha colours added
[wxWidgets.git] / acinclude.m4
index 708e54862d9401ec6d5218a133da03f6d977874a..dcd3a5ecf74002a599ca28da3e104a124efdb353 100644 (file)
@@ -43,9 +43,10 @@ for ac_dir in $1 /usr/include;
 ])
 
 dnl ---------------------------------------------------------------------------
-dnl WX_PATH_FIND_LIBRARIES helper
+dnl call WX_PATH_FIND_LIBRARIES(search path, lib name), sets ac_find_libraries
+dnl to the full name of the file that was found or leaves it empty if not found
 dnl ---------------------------------------------------------------------------
-AC_DEFUN([WX_PATH_FIND_LIBRARIES_IN_PATH],
+AC_DEFUN([WX_PATH_FIND_LIBRARIES],
 [
   ac_find_libraries=
   for ac_dir in $1;
@@ -72,21 +73,6 @@ dnl NB: if any of directories in the list is not a subdir of /usr, code setting
 dnl     wx_cv_std_libpath needs to be updated
 AC_DEFUN([WX_STD_LIBPATH], [/usr/lib /usr/lib32 /usr/lib/64 /usr/lib64])
 
-dnl ---------------------------------------------------------------------------
-dnl call WX_PATH_FIND_LIBRARIES(search path, lib name), sets ac_find_libraries
-dnl to the full name of the file that was found or leaves it empty if not found
-dnl ---------------------------------------------------------------------------
-AC_DEFUN([WX_PATH_FIND_LIBRARIES],
-[
-  WX_PATH_FIND_LIBRARIES_IN_PATH($1, $2)
-  if test "x$ac_find_libraries" = "x" ; then
-    WX_PATH_FIND_LIBRARIES_IN_PATH(WX_STD_LIBPATH(), $2)
-    if test "x$ac_find_libraries" != "x" ; then
-      ac_find_libraries="default location"
-    fi
-  fi
-])
-
 dnl ---------------------------------------------------------------------------
 dnl Path to include, already defined
 dnl ---------------------------------------------------------------------------
@@ -349,10 +335,11 @@ AC_DEFUN([WX_ARG_SYS_WITH],
         ])
 
 dnl this macro checks for a command line argument and caches the result
-dnl usage: WX_ARG_WITH(option, helpmessage, variable-name)
+dnl usage: WX_ARG_WITH(option, helpmessage, variable-name, [withstring])
 AC_DEFUN([WX_ARG_WITH],
         [
-          AC_MSG_CHECKING([for --with-$1])
+         withstring=$4
+          AC_MSG_CHECKING([for --${withstring:-with}-$1])
           no_cache=0
           AC_ARG_WITH($1, [$2],
                       [
@@ -428,6 +415,47 @@ AC_DEFUN([WX_ARG_ENABLE],
         ])
 
 
+dnl Like WX_ARG_ENABLE but accepts a parameter.
+dnl
+dnl Usage:
+dnl   WX_ARG_ENABLE_PARAM(option, helpmessage, variable-name, enablestring)
+dnl
+dnl Example:
+dnl   WX_ARG_ENABLE_PARAM(foo, [[  --enable-foo[=bar] use foo]], wxUSE_FOO)
+dnl 
+dnl  --enable-foo       wxUSE_FOO=yes
+dnl  --disable-foo      wxUSE_FOO=no
+dnl  --enable-foo=bar   wxUSE_FOO=bar
+dnl  <not given>        value from configarg.cache or wxUSE_FOO=no
+dnl 
+AC_DEFUN([WX_ARG_ENABLE_PARAM],
+        [
+          enablestring=$4
+          AC_MSG_CHECKING([for --${enablestring:-enable}-$1])
+          no_cache=0
+          AC_ARG_ENABLE($1, [$2],
+                        [
+                          wx_cv_use_$1="$3='$enableval'"
+                        ],
+                        [
+                          LINE=`grep "$3" ${wx_arg_cache_file}`
+                          if test "x$LINE" != x ; then
+                            eval "DEFAULT_$LINE"
+                            wx_cv_use_$1='$3='$DEFAULT_$3
+                          else
+                            no_cache=1
+                            wx_cv_use_$1="$3=no"
+                          fi
+                        ])
+
+          eval "$wx_cv_use_$1"
+          if test "$no_cache" != 1; then
+            echo $wx_cv_use_$1 >> ${wx_arg_cache_file}.tmp
+          fi
+
+          AC_MSG_RESULT([$$3])
+        ])
+
 dnl ===========================================================================
 dnl Linker features test
 dnl ===========================================================================