Alexandre Julliard : configure: Added a WINE_CHECK_LIB_FUNCS macro to check for functions

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 13 07:03:18 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 2d1a6274ee8c8fc8ac33f5ed53892711492321db
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2d1a6274ee8c8fc8ac33f5ed53892711492321db

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Feb 11 20:54:06 2006 +0100

configure: Added a WINE_CHECK_LIB_FUNCS macro to check for functions
when linking with specific libraries.

---

 aclocal.m4   |   10 ++++++++++
 configure    |   13 ++++++-------
 configure.ac |   17 ++++++-----------
 3 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index ef987a2..fb73a06 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -94,6 +94,16 @@ AS_IF([test AS_VAR_GET(ac_var) = yes],
   LINTFLAGS="$LINTFLAGS -D$1"])dnl
 AS_VAR_POPDEF([ac_var])])
 
+dnl **** Check for functions with some extra libraries ****
+dnl
+dnl Usage: WINE_CHECK_LIB_FUNCS(funcs,libs,[action-if-found,[action-if-not-found]])
+dnl
+AC_DEFUN([WINE_CHECK_LIB_FUNCS],
+[ac_wine_check_funcs_save_LIBS="$LIBS"
+LIBS="$LIBS $2"
+AC_CHECK_FUNCS([$1],[$3],[$4])
+LIBS="$ac_wine_check_funcs_save_LIBS"])
+
 dnl **** Check for ln ****
 dnl
 dnl Usage: WINE_PROG_LN
diff --git a/configure b/configure
index 5e8852a..daee535 100755
--- a/configure
+++ b/configure
@@ -9757,8 +9757,8 @@ fi
 
 fi
 
-    ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LDAPLIBS $LIBPTHREAD"
+    ac_wine_check_funcs_save_LIBS="$LIBS"
+LIBS="$LIBS $LDAPLIBS $LIBPTHREAD"
 
 
 
@@ -9867,7 +9867,7 @@ _ACEOF
 fi
 done
 
-    LIBS="$ac_save_LIBS"
+LIBS="$ac_wine_check_funcs_save_LIBS"
 fi
 
 FREETYPELIBS=""
@@ -10567,7 +10567,7 @@ _ACEOF
 fi
 
 
-ac_save_LIBS="$LIBS"
+ac_wine_check_funcs_save_LIBS="$LIBS"
 LIBS="$LIBS $LIBPTHREAD"
 
 
@@ -10575,8 +10575,7 @@ LIBS="$LIBS $LIBPTHREAD"
 for ac_func in \
         pthread_getattr_np \
         pthread_get_stackaddr_np \
-        pthread_get_stacksize_np \
-
+        pthread_get_stacksize_np
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -10676,7 +10675,7 @@ _ACEOF
 fi
 done
 
-LIBS="$ac_save_LIBS"
+LIBS="$ac_wine_check_funcs_save_LIBS"
 
 # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
diff --git a/configure.ac b/configure.ac
index 7765266..6532db1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -553,14 +553,12 @@ then
              LDAPLIBS="-lldap_r -llber"],,
              [$LIBPTHREAD])],,
              [$LIBPTHREAD])
-    ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LDAPLIBS $LIBPTHREAD"
-    AC_CHECK_FUNCS(\
+    WINE_CHECK_LIB_FUNCS(\
 	ldap_count_references \
 	ldap_first_reference \
 	ldap_next_reference \
-	ldap_parse_reference)
-    LIBS="$ac_save_LIBS"
+	ldap_parse_reference,
+        [$LDAPLIBS $LIBPTHREAD])
 fi
 
 dnl **** Check for FreeType 2 ****
@@ -689,14 +687,11 @@ AC_CHECK_TYPES([pthread_rwlock_t, pthrea
 #include <pthread.h>])
 
 dnl **** Check for pthread functions ****
-ac_save_LIBS="$LIBS"
-LIBS="$LIBS $LIBPTHREAD"
-AC_CHECK_FUNCS(\
+WINE_CHECK_LIB_FUNCS(\
         pthread_getattr_np \
         pthread_get_stackaddr_np \
-        pthread_get_stacksize_np \
-)
-LIBS="$ac_save_LIBS"
+        pthread_get_stacksize_np,
+        [$LIBPTHREAD])
 
 dnl **** Check for aRts Sound Server ****
 AC_PATH_PROG(ARTSCCONFIG, artsc-config)




More information about the wine-cvs mailing list