2 dnl This file is part of the LibreOffice project.
4 dnl This Source Code Form is subject to the terms of the Mozilla Public
5 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
6 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # libo_MINGW_CHECK_DLL(dll-name-stem,[action-if-found],[action-if-not-found])
11 # Checks for presence of dll dll-name-stem . Appends the dll name to
12 # variable MINGW_DLLS if found, issues an error otherwise.
14 # It recognizes these dll patterns (x, y match any character, but they
15 # are supposed to be numerals):
24 # libo_MINGW_CHECK_DLL([libexpat])
25 # might result in MINGW_DLLS containing libexpat-1.dll .
27 # uses MINGW_SYSROOT, WITH_MINGW
29 # ------------------------------------------------------------------------------------------
30 AC_DEFUN([libo_MINGW_CHECK_DLL],
33 if test -n "$WITH_MINGW"; then
34 _libo_mingw_dlldir="[$MINGW_SYSROOT]"/bin
36 AC_MSG_CHECKING([for $1 dll])
38 dnl try one- or two-numbered version
39 _libo_mingw_try_dll([$1][-?.dll])
40 if test "$_libo_mingw_dllname" = ""; then
41 _libo_mingw_try_dll([$1][-??.dll])
43 dnl maybe the version contains a dot (e.g., libdb)
44 if test "$_libo_mingw_dllname" = ""; then
45 _libo_mingw_try_dll([$1][-?.?.dll])
47 dnl maybe the version contains a dash (e.g., libpixman)
48 if test "$_libo_mingw_dllname" = ""; then
49 _libo_mingw_try_dll([$1][-?-?.dll])
51 dnl maybe it is not versioned
52 if test "$_libo_mingw_dllname" = ""; then
53 _libo_mingw_try_dll([$1][.dll])
56 if test "$_libo_mingw_dllname" = ""; then
58 m4_default([$3],[AC_MSG_ERROR([no dll found for $1])])
60 AC_MSG_RESULT([$_libo_mingw_dllname])
61 MINGW_DLLS="$MINGW_DLLS $_libo_mingw_dllname"
65 ]) # libo_MINGW_CHECK_DLL
67 # libo_MINGW_TRY_DLL(dll-name-stem)
69 # Checks for presence of dll dll-name-stem . Appends the dll name to
70 # variable MINGW_DLLS if found, does nothing otherwise.
72 # See libo_MINGW_CHECK_DLL for further info.
74 # uses MINGW_SYSROOT, WITH_MINGW
76 # ------------------------------------------------
77 AC_DEFUN([libo_MINGW_TRY_DLL],
78 [dnl TODO: ignore already tested for dlls
79 libo_MINGW_CHECK_DLL([$1],[[]],[[]])dnl
80 ]) # libo_MINGW_TRY_DLL
82 # _libo_mingw_try_dll(dll-name,dll-dir)
83 m4_define([_libo_mingw_try_dll],
84 [_libo_mingw_trying_dll=`ls "[$_libo_mingw_dlldir]"/[$1] 2>/dev/null`
85 if test -f "$_libo_mingw_trying_dll"; then
86 _libo_mingw_dllname=`basename "$_libo_mingw_trying_dll"`
88 ]) # _libo_mingw_try_dll
90 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: