19
19
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
20
20
AC_REQUIRE([AC_LIB_RPATH])
21
define([Name],[translit([$1],[./-], [___])])
22
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
21
pushdef([Name],[translit([$1],[./-], [___])])
22
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
23
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
24
24
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
25
25
AC_LIB_LINKFLAGS_BODY([$1], [$2])
26
26
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
58
58
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
59
59
AC_REQUIRE([AC_LIB_RPATH])
60
define([Name],[translit([$1],[./-], [___])])
61
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
62
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
60
pushdef([Name],[translit([$1],[./-], [___])])
61
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
62
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
64
64
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
66
AC_LIB_LINKFLAGS_BODY([$1], [$2])
66
AC_LIB_LINKFLAGS_BODY([$1], [$2], [$5])
68
68
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
69
69
dnl because if the user has installed lib[]Name and not disabled its use
131
131
acl_hardcode_direct="$acl_cv_hardcode_direct"
132
132
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
133
133
dnl Determine whether the user wants rpath handling at all.
134
AC_ARG_ENABLE([rpath],
135
135
[ --disable-rpath do not hardcode runtime library paths],
136
136
:, enable_rpath=yes)
139
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
140
dnl the libraries corresponding to explicit and implicit dependencies.
139
dnl AC_LIB_FROMPACKAGE(name, package)
140
dnl declares that libname comes from the given package. The configure file
141
dnl will then not have a --with-libname-prefix option but a
142
dnl --with-package-prefix option. Several libraries can come from the same
143
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
144
dnl macro call that searches for libname.
145
AC_DEFUN([AC_LIB_FROMPACKAGE],
147
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
148
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
149
define([acl_frompackage_]NAME, [$2])
152
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
153
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
154
define([acl_libsinpackage_]PACKUP,
155
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
160
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies, system]) searches for
161
dnl libname and the libraries corresponding to explicit and implicit
141
163
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
142
164
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
143
165
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
166
dnl If system==system, -isystem is used instead of -I
144
167
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
146
169
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
147
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
148
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
170
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
171
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
172
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
173
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
174
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
175
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
149
176
dnl Autoconf >= 2.61 supports dots in --with options.
150
define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
177
pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
151
178
dnl By default, look in $includedir and $libdir.
152
179
use_additional=yes
180
if test "x$GCC" = "xyes" -a "x$3" = "xsystem"
153
187
AC_LIB_WITH_FINAL_PREFIX([
154
188
eval additional_includedir=\"$includedir\"
155
189
eval additional_libdir=\"$libdir\"
157
AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
158
[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
159
--without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
191
AC_ARG_WITH(P_A_C_K[-prefix],
192
[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
193
--without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
161
195
if test "X$withval" = "Xno"; then
162
196
use_additional=no
415
455
case "$found_dir" in
416
456
*/$acl_libdirstem | */$acl_libdirstem/)
417
457
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
418
LIB[]NAME[]_PREFIX="$basedir"
458
if test "$name" = '$1'; then
459
LIB[]NAME[]_PREFIX="$basedir"
461
additional_includedir="$basedir/include"
463
*/$acl_libdirstem2 | */$acl_libdirstem2/)
464
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
465
if test "$name" = '$1'; then
466
LIB[]NAME[]_PREFIX="$basedir"
419
468
additional_includedir="$basedir/include"