Mercurial > libpst
annotate m4/lib-link.m4 @ 219:10ea2d132019 stable-0-6-39
fedora > 10 moved to boost-python-devel
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Sun, 21 Jun 2009 20:13:18 -0700 |
parents | 0b1766da9be8 |
children |
rev | line source |
---|---|
153
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
1 # lib-link.m4 serial 4 (gettext-0.12) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
2 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
3 dnl This file is free software, distributed under the terms of the GNU |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
4 dnl General Public License. As a special exception to the GNU General |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
5 dnl Public License, this file may be distributed as part of a program |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
6 dnl that contains a configuration script generated by Autoconf, under |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
7 dnl the same distribution terms as the rest of that program. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
8 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
9 dnl From Bruno Haible. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
10 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
11 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
12 dnl the libraries corresponding to explicit and implicit dependencies. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
13 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
14 dnl augments the CPPFLAGS variable. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
15 AC_DEFUN([AC_LIB_LINKFLAGS], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
16 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
17 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
18 AC_REQUIRE([AC_LIB_RPATH]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
19 define([Name],[translit([$1],[./-], [___])]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
20 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
21 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
22 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
23 AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
24 ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
25 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
26 ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
27 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
28 LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
29 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
30 INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
31 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
32 AC_SUBST([LIB]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
33 AC_SUBST([LTLIB]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
34 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
35 dnl results of this search when this library appears as a dependency. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
36 HAVE_LIB[]NAME=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
37 undefine([Name]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
38 undefine([NAME]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
39 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
40 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
41 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
42 dnl searches for libname and the libraries corresponding to explicit and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
43 dnl implicit dependencies, together with the specified include files and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
44 dnl the ability to compile and link the specified testcode. If found, it |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
45 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
46 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
47 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
48 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
49 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
50 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
51 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
52 AC_REQUIRE([AC_LIB_RPATH]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
53 define([Name],[translit([$1],[./-], [___])]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
54 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
55 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
56 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
57 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
58 dnl accordingly. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
59 AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
60 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
61 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
62 dnl because if the user has installed lib[]Name and not disabled its use |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
63 dnl via --without-lib[]Name-prefix, he wants to use it. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
64 ac_save_CPPFLAGS="$CPPFLAGS" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
65 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
66 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
67 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
68 ac_save_LIBS="$LIBS" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
69 LIBS="$LIBS $LIB[]NAME" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
70 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
71 LIBS="$ac_save_LIBS" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
72 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
73 if test "$ac_cv_lib[]Name" = yes; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
74 HAVE_LIB[]NAME=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
75 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
76 AC_MSG_CHECKING([how to link with lib[]$1]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
77 AC_MSG_RESULT([$LIB[]NAME]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
78 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
79 HAVE_LIB[]NAME=no |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
80 dnl If $LIB[]NAME didn't lead to a usable library, we don't need |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
81 dnl $INC[]NAME either. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
82 CPPFLAGS="$ac_save_CPPFLAGS" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
83 LIB[]NAME= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
84 LTLIB[]NAME= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
85 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
86 AC_SUBST([HAVE_LIB]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
87 AC_SUBST([LIB]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
88 AC_SUBST([LTLIB]NAME) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
89 undefine([Name]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
90 undefine([NAME]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
91 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
92 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
93 dnl Determine the platform dependent parameters needed to use rpath: |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
94 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
95 dnl hardcode_direct, hardcode_minus_L. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
96 AC_DEFUN([AC_LIB_RPATH], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
97 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
98 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
99 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
100 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
101 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
102 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
103 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
104 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
105 . ./conftest.sh |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
106 rm -f ./conftest.sh |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
107 acl_cv_rpath=done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
108 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
109 wl="$acl_cv_wl" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
110 libext="$acl_cv_libext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
111 shlibext="$acl_cv_shlibext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
112 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
113 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
114 hardcode_direct="$acl_cv_hardcode_direct" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
115 hardcode_minus_L="$acl_cv_hardcode_minus_L" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
116 dnl Determine whether the user wants rpath handling at all. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
117 AC_ARG_ENABLE(rpath, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
118 [ --disable-rpath do not hardcode runtime library paths], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
119 :, enable_rpath=yes) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
120 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
121 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
122 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
123 dnl the libraries corresponding to explicit and implicit dependencies. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
124 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
125 AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
126 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
127 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
128 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
129 dnl By default, look in $includedir and $libdir. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
130 use_additional=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
131 AC_LIB_WITH_FINAL_PREFIX([ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
132 eval additional_includedir=\"$includedir\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
133 eval additional_libdir=\"$libdir\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
134 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
135 AC_LIB_ARG_WITH([lib$1-prefix], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
136 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
137 --without-lib$1-prefix don't search for lib$1 in includedir and libdir], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
138 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
139 if test "X$withval" = "Xno"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
140 use_additional=no |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
141 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
142 if test "X$withval" = "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
143 AC_LIB_WITH_FINAL_PREFIX([ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
144 eval additional_includedir=\"$includedir\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
145 eval additional_libdir=\"$libdir\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
146 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
147 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
148 additional_includedir="$withval/include" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
149 additional_libdir="$withval/lib" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
150 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
151 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
152 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
153 dnl Search the library and its dependencies in $additional_libdir and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
154 dnl $LDFLAGS. Using breadth-first-seach. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
155 LIB[]NAME= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
156 LTLIB[]NAME= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
157 INC[]NAME= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
158 rpathdirs= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
159 ltrpathdirs= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
160 names_already_handled= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
161 names_next_round='$1 $2' |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
162 while test -n "$names_next_round"; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
163 names_this_round="$names_next_round" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
164 names_next_round= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
165 for name in $names_this_round; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
166 already_handled= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
167 for n in $names_already_handled; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
168 if test "$n" = "$name"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
169 already_handled=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
170 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
171 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
172 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
173 if test -z "$already_handled"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
174 names_already_handled="$names_already_handled $name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
175 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
176 dnl or AC_LIB_HAVE_LINKFLAGS call. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
177 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
178 eval value=\"\$HAVE_LIB$uppername\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
179 if test -n "$value"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
180 if test "$value" = yes; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
181 eval value=\"\$LIB$uppername\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
182 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
183 eval value=\"\$LTLIB$uppername\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
184 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
185 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
186 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
187 dnl that this library doesn't exist. So just drop it. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
188 : |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
189 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
190 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
191 dnl Search the library lib$name in $additional_libdir and $LDFLAGS |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
192 dnl and the already constructed $LIBNAME/$LTLIBNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
193 found_dir= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
194 found_la= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
195 found_so= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
196 found_a= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
197 if test $use_additional = yes; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
198 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
199 found_dir="$additional_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
200 found_so="$additional_libdir/lib$name.$shlibext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
201 if test -f "$additional_libdir/lib$name.la"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
202 found_la="$additional_libdir/lib$name.la" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
203 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
204 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
205 if test -f "$additional_libdir/lib$name.$libext"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
206 found_dir="$additional_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
207 found_a="$additional_libdir/lib$name.$libext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
208 if test -f "$additional_libdir/lib$name.la"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
209 found_la="$additional_libdir/lib$name.la" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
210 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
211 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
212 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
213 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
214 if test "X$found_dir" = "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
215 for x in $LDFLAGS $LTLIB[]NAME; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
216 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
217 case "$x" in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
218 -L*) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
219 dir=`echo "X$x" | sed -e 's/^X-L//'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
220 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
221 found_dir="$dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
222 found_so="$dir/lib$name.$shlibext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
223 if test -f "$dir/lib$name.la"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
224 found_la="$dir/lib$name.la" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
225 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
226 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
227 if test -f "$dir/lib$name.$libext"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
228 found_dir="$dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
229 found_a="$dir/lib$name.$libext" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
230 if test -f "$dir/lib$name.la"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
231 found_la="$dir/lib$name.la" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
232 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
233 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
234 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
235 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
236 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
237 if test "X$found_dir" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
238 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
239 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
240 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
241 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
242 if test "X$found_dir" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
243 dnl Found the library. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
244 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
245 if test "X$found_so" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
246 dnl Linking with a shared library. We attempt to hardcode its |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
247 dnl directory into the executable's runpath, unless it's the |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
248 dnl standard /usr/lib. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
249 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
250 dnl No hardcoding is needed. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
251 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
252 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
253 dnl Use an explicit option to hardcode DIR into the resulting |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
254 dnl binary. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
255 dnl Potentially add DIR to ltrpathdirs. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
256 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
257 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
258 for x in $ltrpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
259 if test "X$x" = "X$found_dir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
260 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
261 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
262 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
263 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
264 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
265 ltrpathdirs="$ltrpathdirs $found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
266 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
267 dnl The hardcoding into $LIBNAME is system dependent. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
268 if test "$hardcode_direct" = yes; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
269 dnl Using DIR/libNAME.so during linking hardcodes DIR into the |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
270 dnl resulting binary. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
271 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
272 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
273 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
274 dnl Use an explicit option to hardcode DIR into the resulting |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
275 dnl binary. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
276 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
277 dnl Potentially add DIR to rpathdirs. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
278 dnl The rpathdirs will be appended to $LIBNAME at the end. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
279 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
280 for x in $rpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
281 if test "X$x" = "X$found_dir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
282 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
283 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
284 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
285 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
286 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
287 rpathdirs="$rpathdirs $found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
288 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
289 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
290 dnl Rely on "-L$found_dir". |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
291 dnl But don't add it if it's already contained in the LDFLAGS |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
292 dnl or the already constructed $LIBNAME |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
293 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
294 for x in $LDFLAGS $LIB[]NAME; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
295 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
296 if test "X$x" = "X-L$found_dir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
297 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
298 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
299 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
300 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
301 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
302 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
303 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
304 if test "$hardcode_minus_L" != no; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
305 dnl FIXME: Not sure whether we should use |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
306 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
307 dnl here. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
308 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
309 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
310 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
311 dnl here, because this doesn't fit in flags passed to the |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
312 dnl compiler. So give up. No hardcoding. This affects only |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
313 dnl very old systems. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
314 dnl FIXME: Not sure whether we should use |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
315 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
316 dnl here. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
317 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
318 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
319 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
320 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
321 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
322 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
323 if test "X$found_a" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
324 dnl Linking with a static library. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
325 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
326 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
327 dnl We shouldn't come here, but anyway it's good to have a |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
328 dnl fallback. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
329 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
330 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
331 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
332 dnl Assume the include files are nearby. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
333 additional_includedir= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
334 case "$found_dir" in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
335 */lib | */lib/) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
336 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
337 additional_includedir="$basedir/include" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
338 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
339 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
340 if test "X$additional_includedir" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
341 dnl Potentially add $additional_includedir to $INCNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
342 dnl But don't add it |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
343 dnl 1. if it's the standard /usr/include, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
344 dnl 2. if it's /usr/local/include and we are using GCC on Linux, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
345 dnl 3. if it's already present in $CPPFLAGS or the already |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
346 dnl constructed $INCNAME, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
347 dnl 4. if it doesn't exist as a directory. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
348 if test "X$additional_includedir" != "X/usr/include"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
349 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
350 if test "X$additional_includedir" = "X/usr/local/include"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
351 if test -n "$GCC"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
352 case $host_os in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
353 linux*) haveit=yes;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
354 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
355 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
356 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
357 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
358 for x in $CPPFLAGS $INC[]NAME; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
359 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
360 if test "X$x" = "X-I$additional_includedir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
361 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
362 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
363 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
364 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
365 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
366 if test -d "$additional_includedir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
367 dnl Really add $additional_includedir to $INCNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
368 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
369 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
370 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
371 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
372 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
373 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
374 dnl Look for dependencies. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
375 if test -n "$found_la"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
376 dnl Read the .la file. It defines the variables |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
377 dnl dlname, library_names, old_library, dependency_libs, current, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
378 dnl age, revision, installed, dlopen, dlpreopen, libdir. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
379 save_libdir="$libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
380 case "$found_la" in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
381 */* | *\\*) . "$found_la" ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
382 *) . "./$found_la" ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
383 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
384 libdir="$save_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
385 dnl We use only dependency_libs. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
386 for dep in $dependency_libs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
387 case "$dep" in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
388 -L*) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
389 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
390 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
391 dnl But don't add it |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
392 dnl 1. if it's the standard /usr/lib, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
393 dnl 2. if it's /usr/local/lib and we are using GCC on Linux, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
394 dnl 3. if it's already present in $LDFLAGS or the already |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
395 dnl constructed $LIBNAME, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
396 dnl 4. if it doesn't exist as a directory. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
397 if test "X$additional_libdir" != "X/usr/lib"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
398 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
399 if test "X$additional_libdir" = "X/usr/local/lib"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
400 if test -n "$GCC"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
401 case $host_os in |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
402 linux*) haveit=yes;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
403 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
404 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
405 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
406 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
407 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
408 for x in $LDFLAGS $LIB[]NAME; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
409 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
410 if test "X$x" = "X-L$additional_libdir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
411 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
412 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
413 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
414 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
415 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
416 if test -d "$additional_libdir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
417 dnl Really add $additional_libdir to $LIBNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
418 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
419 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
420 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
421 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
422 for x in $LDFLAGS $LTLIB[]NAME; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
423 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
424 if test "X$x" = "X-L$additional_libdir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
425 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
426 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
427 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
428 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
429 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
430 if test -d "$additional_libdir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
431 dnl Really add $additional_libdir to $LTLIBNAME. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
432 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
433 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
434 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
435 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
436 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
437 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
438 -R*) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
439 dir=`echo "X$dep" | sed -e 's/^X-R//'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
440 if test "$enable_rpath" != no; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
441 dnl Potentially add DIR to rpathdirs. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
442 dnl The rpathdirs will be appended to $LIBNAME at the end. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
443 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
444 for x in $rpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
445 if test "X$x" = "X$dir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
446 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
447 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
448 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
449 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
450 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
451 rpathdirs="$rpathdirs $dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
452 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
453 dnl Potentially add DIR to ltrpathdirs. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
454 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
455 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
456 for x in $ltrpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
457 if test "X$x" = "X$dir"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
458 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
459 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
460 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
461 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
462 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
463 ltrpathdirs="$ltrpathdirs $dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
464 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
465 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
466 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
467 -l*) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
468 dnl Handle this in the next round. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
469 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
470 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
471 *.la) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
472 dnl Handle this in the next round. Throw away the .la's |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
473 dnl directory; it is already contained in a preceding -L |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
474 dnl option. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
475 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
476 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
477 *) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
478 dnl Most likely an immediate library name. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
479 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
480 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
481 ;; |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
482 esac |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
483 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
484 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
485 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
486 dnl Didn't find the library; assume it is in the system directories |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
487 dnl known to the linker and runtime loader. (All the system |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
488 dnl directories known to the linker should also be known to the |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
489 dnl runtime loader, otherwise the system is severely misconfigured.) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
490 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
491 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
492 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
493 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
494 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
495 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
496 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
497 if test "X$rpathdirs" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
498 if test -n "$hardcode_libdir_separator"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
499 dnl Weird platform: only the last -rpath option counts, the user must |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
500 dnl pass all path elements in one option. We can arrange that for a |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
501 dnl single library, but not when more than one $LIBNAMEs are used. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
502 alldirs= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
503 for found_dir in $rpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
504 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
505 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
506 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
507 acl_save_libdir="$libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
508 libdir="$alldirs" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
509 eval flag=\"$hardcode_libdir_flag_spec\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
510 libdir="$acl_save_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
511 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
512 else |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
513 dnl The -rpath options are cumulative. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
514 for found_dir in $rpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
515 acl_save_libdir="$libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
516 libdir="$found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
517 eval flag=\"$hardcode_libdir_flag_spec\" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
518 libdir="$acl_save_libdir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
519 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
520 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
521 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
522 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
523 if test "X$ltrpathdirs" != "X"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
524 dnl When using libtool, the option that works for both libraries and |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
525 dnl executables is -R. The -R options are cumulative. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
526 for found_dir in $ltrpathdirs; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
527 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
528 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
529 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
530 ]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
531 |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
532 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
533 dnl unless already present in VAR. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
534 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
535 dnl contains two or three consecutive elements that belong together. |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
536 AC_DEFUN([AC_LIB_APPENDTOVAR], |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
537 [ |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
538 for element in [$2]; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
539 haveit= |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
540 for x in $[$1]; do |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
541 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
542 if test "X$x" = "X$element"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
543 haveit=yes |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
544 break |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
545 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
546 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
547 if test -z "$haveit"; then |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
548 [$1]="${[$1]}${[$1]:+ }$element" |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
549 fi |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
550 done |
0b1766da9be8
use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
551 ]) |