| @@ -1,94 +1,77 @@ | | | @@ -1,94 +1,77 @@ |
1 | # $NetBSD: find-libs.mk,v 1.10 2012/04/23 08:44:00 sbd Exp $ | | 1 | # $NetBSD: find-libs.mk,v 1.11 2013/04/28 13:39:09 obache Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2005 The NetBSD Foundation, Inc. | | 3 | # Copyright (c) 2005 The NetBSD Foundation, Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # This code is derived from software contributed to The NetBSD Foundation | | 6 | # This code is derived from software contributed to The NetBSD Foundation |
7 | # by Johnny C. Lam. | | 7 | # by Johnny C. Lam. |
8 | # | | 8 | # |
9 | # Redistribution and use in source and binary forms, with or without | | 9 | # Redistribution and use in source and binary forms, with or without |
10 | # modification, are permitted provided that the following conditions | | 10 | # modification, are permitted provided that the following conditions |
11 | # are met: | | 11 | # are met: |
12 | # 1. Redistributions of source code must retain the above copyright | | 12 | # 1. Redistributions of source code must retain the above copyright |
13 | # notice, this list of conditions and the following disclaimer. | | 13 | # notice, this list of conditions and the following disclaimer. |
14 | # 2. Redistributions in binary form must reproduce the above copyright | | 14 | # 2. Redistributions in binary form must reproduce the above copyright |
15 | # notice, this list of conditions and the following disclaimer in the | | 15 | # notice, this list of conditions and the following disclaimer in the |
16 | # documentation and/or other materials provided with the distribution. | | 16 | # documentation and/or other materials provided with the distribution. |
17 | # 3. All advertising materials mentioning features or use of this software | | 17 | # 3. All advertising materials mentioning features or use of this software |
18 | # must display the following acknowledgement: | | 18 | # must display the following acknowledgement: |
19 | # This product includes software developed by the NetBSD | | 19 | # This product includes software developed by the NetBSD |
20 | # Foundation, Inc. and its contributors. | | 20 | # Foundation, Inc. and its contributors. |
21 | # 4. Neither the name of The NetBSD Foundation nor the names of its | | 21 | # 4. Neither the name of The NetBSD Foundation nor the names of its |
22 | # contributors may be used to endorse or promote products derived | | 22 | # contributors may be used to endorse or promote products derived |
23 | # from this software without specific prior written permission. | | 23 | # from this software without specific prior written permission. |
24 | # | | 24 | # |
25 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 25 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
26 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 26 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
27 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 27 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
28 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 28 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
29 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 29 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
30 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 30 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
31 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 31 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 32 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
33 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 33 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 34 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
35 | # POSSIBILITY OF SUCH DAMAGE. | | 35 | # POSSIBILITY OF SUCH DAMAGE. |
36 | # | | 36 | # |
37 | | | 37 | |
38 | # | | 38 | # |
39 | # This is a "subroutine" that can be included to detect the presence of | | 39 | # This is a "subroutine" that can be included to detect the presence of |
40 | # libraries in the base system. | | 40 | # libraries in the base system. |
41 | # | | 41 | # |
42 | # The input variable is BUILDLINK_FIND_LIBS, which is a list of library | | 42 | # The input variable is BUILDLINK_FIND_LIBS, which is a list of library |
43 | # names, e.g. ncurses, iconv, etc., that will be sought in the base | | 43 | # names, e.g. ncurses, iconv, etc., that will be sought in the base |
44 | # system. BUILTIN_LIB_FOUND.<lib> is set to "yes" or "no" depending | | 44 | # system. BUILTIN_LIB_FOUND.<lib> is set to "yes" or "no" depending |
45 | # on the result of the search. | | 45 | # on the result of the search. |
46 | # | | 46 | # |
47 | # An example use is: | | 47 | # An example use is: |
48 | # | | 48 | # |
49 | # BUILDLINK_FIND_LIBS:= intl iconv | | 49 | # BUILDLINK_FIND_LIBS:= intl iconv |
50 | # .include "../../mk/buildlink3/find-libs.mk" | | 50 | # .include "../../mk/buildlink3/find-libs.mk" |
51 | # # ${BUILTIN_LIB_FOUND.intl} and ${BUILTIN_LIB_FOUND.iconv} are now | | 51 | # # ${BUILTIN_LIB_FOUND.intl} and ${BUILTIN_LIB_FOUND.iconv} are now |
52 | # # either "yes" or "no". | | 52 | # # either "yes" or "no". |
53 | # | | 53 | # |
54 | | | 54 | |
55 | .if empty(USE_TOOLS:Mecho) | | 55 | .if empty(USE_TOOLS:Mecho) |
56 | USE_TOOLS+= echo | | 56 | USE_TOOLS+= echo |
57 | .endif | | 57 | .endif |
58 | .if empty(USE_TOOLS:Mtest) | | 58 | .if empty(USE_TOOLS:Mtest) |
59 | USE_TOOLS+= test | | 59 | USE_TOOLS+= test |
60 | .endif | | 60 | .endif |
61 | | | 61 | |
62 | .for _lib_ in ${BUILTIN_FIND_LIBS} | | 62 | .for _lib_ in ${BUILTIN_FIND_LIBS} |
63 | . if !defined(BUILTIN_LIB_FOUND.${_lib_}) | | 63 | . if !defined(BUILTIN_LIB_FOUND.${_lib_}) |
64 | . if ${OPSYS} == "Haiku" && defined(BELIBRARIES) && !empty(BELIBRARIES) | | | |
65 | BUILTIN_LIB_FOUND.${_lib_}= no | | 64 | BUILTIN_LIB_FOUND.${_lib_}= no |
66 | . for _path_ in ${BELIBRARIES:S/:/ /g} | | 65 | . for _path_ in ${COMPILER_LIB_DIRS} |
67 | . if ${BUILTIN_LIB_FOUND.${_lib_}} == "no" | | 66 | . if ${BUILTIN_LIB_FOUND.${_lib_}} == "no" |
68 | BUILTIN_LIB_FOUND.${_lib_}!= \ | | 67 | BUILTIN_LIB_FOUND.${_lib_}!= \ |
69 | if ${TEST} "`${ECHO} ${_path_}/lib${_lib_}.*`" != "${_path_}/lib${_lib_}.*"; then \ | | 68 | if ${TEST} "`${ECHO} ${_path_}/lib${_lib_}.*`" != "${_path_}/lib${_lib_}.*"; then \ |
70 | ${ECHO} yes; \ | | 69 | ${ECHO} yes; \ |
71 | else \ | | 70 | else \ |
72 | ${ECHO} no; \ | | 71 | ${ECHO} no; \ |
73 | fi | | 72 | fi |
74 | . endif | | 73 | . endif |
75 | . endfor | | 74 | . endfor |
76 | . else | | | |
77 | # XXX: Why are we looking in '/usr/lib${ABI}' and '/lib${ABI}', as we should | | | |
78 | # XXX: only be looking in '/usr/lib${LIBABISUFFIX}' and '/lib${LIBABISUFFIX}' | | | |
79 | BUILTIN_LIB_FOUND.${_lib_}!= \ | | | |
80 | if ${TEST} "`${ECHO} /usr/lib${ABI}/lib${_lib_}.*`" != "/usr/lib${ABI}/lib${_lib_}.*"; then \ | | | |
81 | ${ECHO} yes; \ | | | |
82 | elif ${TEST} "`${ECHO} /lib${ABI}/lib${_lib_}.*`" != "/lib${ABI}/lib${_lib_}.*"; then \ | | | |
83 | ${ECHO} yes; \ | | | |
84 | elif ${TEST} "`${ECHO} /usr/lib${LIBABISUFFIX}/lib${_lib_}.*`" != "/usr/lib${LIBABISUFFIX}/lib${_lib_}.*"; then \ | | | |
85 | ${ECHO} yes; \ | | | |
86 | elif ${TEST} "`${ECHO} /lib${LIBABISUFFIX}/lib${_lib_}.*`" != "/lib${LIBABISUFFIX}/lib${_lib_}.*"; then \ | | | |
87 | ${ECHO} yes; \ | | | |
88 | else \ | | | |
89 | ${ECHO} no; \ | | | |
90 | fi | | | |
91 | . endif | | | |
92 | . endif | | 75 | . endif |
93 | MAKEVARS+= BUILTIN_LIB_FOUND.${_lib_} | | 76 | MAKEVARS+= BUILTIN_LIB_FOUND.${_lib_} |
94 | .endfor | | 77 | .endfor |