summaryrefslogtreecommitdiff
path: root/m4/mingw.m4
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-02-21 13:37:53 +0100
committerDavid Tardon <dtardon@redhat.com>2012-02-21 14:01:01 +0100
commit743a56fcce564c461c4ad86ad55edb069cc764bc (patch)
treeca37c5f7dec679675378d7ee79a99607017177ed /m4/mingw.m4
parent634b211632847dcb04b31f478296e5e6d732ac73 (diff)
allow to pass default dll list
Diffstat (limited to 'm4/mingw.m4')
-rw-r--r--m4/mingw.m490
1 files changed, 56 insertions, 34 deletions
diff --git a/m4/mingw.m4 b/m4/mingw.m4
index 952b2eddb7fd..35d638c9565d 100644
--- a/m4/mingw.m4
+++ b/m4/mingw.m4
@@ -1,36 +1,25 @@
-# libo_FIND_MINGW_EXTERNAL_DLLS([library-names],[variable],[?exclude])
+# libo_FIND_MINGW_EXTERNAL_DLLS([library-names],[variable],[?exclude],[?default-value])
# uses: CC, SED, WITH_MINGW
# --------------------------------------------------------------------
AC_DEFUN([libo_FIND_MINGW_EXTERNAL_DLLS],
[if test "$WITH_MINGW" = yes -a -n "$CC"; then
_libo_mingw_libdir=`$CC -print-sysroot`/mingw/lib
- for _libo_mingw_lib in $1; do
- _libo_mingw_lib="$_libo_mingw_libdir/$_libo_mingw_lib.la"
- _libo_mingw_find_dll([$_libo_mingw_lib],[$3],[_libo_mingw_new_dll])
- if test -n "$_libo_mingw_new_dll"; then
- _libo_mingw_new_dlls="$_libo_mingw_new_dll"
- fi
-
- _libo_mingw_get_libtool_var([dependency_libs],[$_libo_mingw_lib],[_libo_mingw_dep_libs])
- for _libo_mingw_dep_lib in $_libo_mingw_dep_libs; do
- if test "${_libo_mingw_dep_lib%.la}" != "$_libo_mingw_dep_lib"; then
- _libo_mingw_new_dll=''
- _libo_mingw_find_dll([$_libo_mingw_dep_lib],[$3],[_libo_mingw_new_dll])
- if test -n "$_libo_mingw_new_dll"; then
- _libo_mingw_new_dlls="$_libo_mingw_new_dlls $_libo_mingw_new_dll"
- fi
- fi
- done
- $2="$_libo_mingw_new_dlls"
- done
+ _libo_mingw_found_la=
+ _libo_mingw_test_la([$1],[_libo_mingw_found_la],[$_libo_mingw_libdir])
+ if test "$_libo_mingw_found_la" = yes; then
+ _libo_mingw_find_dlls([$1],[$2],[$3],[$_libo_mingw_libdir])
+ else
+ # no .la files found, use defaults
+ $2="$4"
+ fi
fi[]dnl
]) # libo_FIND_MINGW_EXTERNAL_DLLS
-# libo_ADD_MINGW_EXTERNAL_DLLS([library-names],[variable])
+# libo_ADD_MINGW_EXTERNAL_DLLS([library-names],[variable],[?default-value])
# uses: CC, SED, WITH_MINGW
# --------------------------------------------------------
AC_DEFUN([libo_ADD_MINGW_EXTERNAL_DLLS],
-[libo_FIND_MINGW_EXTERNAL_DLLS([$1],[_libo_mingw_found_dlls],[$$2])
+[libo_FIND_MINGW_EXTERNAL_DLLS([$1],[_libo_mingw_found_dlls],[$$2],[$3])
if test -n "$_libo_mingw_found_dlls"; then
$2="$$2 $_libo_mingw_found_dlls"
fi[]dnl
@@ -43,18 +32,51 @@ m4_define([_libo_mingw_get_libtool_var],
# _libo_mingw_find_dll([library],[dlls],[out-var])
m4_define([_libo_mingw_find_dll],
-[if test -f "$1"; then
- _libo_mingw_get_libtool_var([dlname],[$1],[_libo_mingw_dlname])
- _libo_mingw_dlname=`basename $_libo_mingw_dlname`
- _libo_mingw_dll_present=
- for _libo_mingw_dll in $2; do
- if test "$_libo_mingw_dlname" = "$_libo_mingw_dll"; then
- _libo_mingw_dll_present=yes
- break
- fi
- done
- if test -z "$_libo_mingw_dll_present"; then
- $3="$_libo_mingw_dlname"
+[_libo_mingw_get_libtool_var([dlname],[$1],[_libo_mingw_dlname])
+_libo_mingw_dlname=`basename $_libo_mingw_dlname`
+_libo_mingw_dll_present=
+for _libo_mingw_dll in $2; do
+ if test "$_libo_mingw_dlname" = "$_libo_mingw_dll"; then
+ _libo_mingw_dll_present=yes
+ break
fi
+done
+if test -z "$_libo_mingw_dll_present"; then
+ $3="$_libo_mingw_dlname"
fi[]dnl
]) # _libo_mingw_find_dll
+
+# _libo_mingw_find_dlls([libraries],[dlls],[out-var],[libdir])
+m4_define([_libo_mingw_find_dlls],
+[_libo_mingw_new_dlls=
+for _libo_mingw_lib in $1; do
+ _libo_mingw_lib="$4/$_libo_mingw_lib.la"
+ _libo_mingw_new_dll=
+ _libo_mingw_find_dll([$_libo_mingw_lib],[$3 $_libo_mingw_new_dlls],[_libo_mingw_new_dll])
+ if test -n "$_libo_mingw_new_dll"; then
+ _libo_mingw_new_dlls="$_libo_mingw_new_dlls $_libo_mingw_new_dll"
+ fi
+
+ _libo_mingw_get_libtool_var([dependency_libs],[$_libo_mingw_lib],[_libo_mingw_dep_libs])
+ for _libo_mingw_dep_lib in $_libo_mingw_dep_libs; do
+ if test "${_libo_mingw_dep_lib%.la}" != "$_libo_mingw_dep_lib"; then
+ _libo_mingw_new_dll=''
+ _libo_mingw_find_dll([$_libo_mingw_dep_lib],[$3 $_libo_mingw_new_dlls],[_libo_mingw_new_dll])
+ if test -n "$_libo_mingw_new_dll"; then
+ _libo_mingw_new_dlls="$_libo_mingw_new_dlls $_libo_mingw_new_dll"
+ fi
+ fi
+ done
+done
+$2="$_libo_mingw_new_dlls"[]dnl
+]) # _libo_mingw_find_dlls
+
+# _libo_mingw_test_la([libraries],[out-var],[libdir])
+m4_define([_libo_mingw_test_la],
+[for _libo_mingw_lib in $1; do
+ if test -f "$3/$_libo_mingw_lib.la"; then
+ $2=yes
+ break
+ fi
+done[]dnl
+]) # _libo_mingw_test_la