32
32
pushdef([UP], translit([$1], [a-z], [A-Z]))dnl Uppercase
33
33
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl Lowercase
34
pushdef([UPHEADER], translit([$2], [a-z./], [A-Z__]))dnl Uppercase header
36
dnl AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [Enable support for $3.]), [
37
dnl case "${enableval}" in
40
dnl *) AC_MSG_ERROR([bad value ${enableval} for enable-$1 option]) ;;
34
pushdef([DASHDOWN], translit([$1], [A-Z_], [a-z-]))dnl Lowercase
35
pushdef([UPHEADER], translit([$2], [a-z./-], [A-Z___]))dnl Uppercase header
44
38
if test x$4 = x; then
50
44
dnl Look for the header
51
45
if test x"${$1}" = x"yes"; then
52
46
AC_ARG_WITH($1_incl, AC_HELP_STRING([--with-$1-incl], [directory where $2 is]), with_$1_incl=${withval})
53
AC_CACHE_VAL(ac_cv_path_$1_incl, [
54
if test x"${with_$1_incl}" != x ; then
55
if test -f ${with_$1_incl}/$2 ; then
56
ac_cv_path_$1_incl="-I`(cd ${with_$1_incl}; pwd)`"
59
AC_MSG_ERROR([${with_$1_incl} directory doesn't contain $2.])
47
AC_CACHE_VAL(ac_cv_path_$1_incl, [
48
if test x"${with_$1_incl}" != x ; then
49
if test -f ${with_$1_incl}/$2 ; then
50
ac_cv_path_$1_incl="-I`(cd ${with_$1_incl}; pwd)`"
53
AC_MSG_ERROR([${with_$1_incl} directory doesn't contain $2.])
64
58
if test x$cross_compiling = xno; then
65
59
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_incl}" = x; then
66
60
AC_MSG_CHECKING([for $2 header using pkg-config])
67
$PKG_CONFIG --exists DOWN[] && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags DOWN[]`"
61
$PKG_CONFIG --exists DASHDOWN[] && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags DASHDOWN[]`"
68
62
$PKG_CONFIG --exists $name && ac_cv_path_$1_incl="`$PKG_CONFIG --cflags $name`"
69
63
if test x"${ac_cv_path_$1_incl}" != x; then
70
64
AC_MSG_RESULT(${ac_cv_path_$1_incl})
90
dnl If the path hasn't been specified, go look for it.
91
if test x"${ac_cv_path_$1_incl}" = x; then
92
AC_CHECK_HEADER($2, [ac_cv_path_$1_incl=""; found_$1_incl="yes"], [
93
AC_CHECK_HEADER($1/$2, [ac_cv_path_$1_incl="-I/usr/include/$1"; found_$1_incl="yes"], [
94
AC_CHECK_HEADER($name/$2, [ac_cv_path_$1_incl="-I/usr/include/$name"; found_$1_incl="yes"], [
95
AC_CHECK_HEADER($2, [ac_cv_path_$1_incl="-I/usr/include/$2"; found_$1_incl="yes"], [
96
if test x"${ac_cv_path_$1_incl}" = x; then
97
for i in $incllist; do
98
if test -f $i/$name; then
100
if test x"$i" != x"/usr/include"; then
101
ac_cv_path_$1_incl="-I$i"
104
ac_cv_path_$1_incl=""
108
if test -f $i/$name/$2; then
110
ac_cv_path_$1_incl="-I$i/$name"
113
if test -f $i/$2; then
115
ac_cv_path_$1_incl="-I$i"
84
dnl If the path hasn't been specified, go look for it.
85
if test x"${ac_cv_path_$1_incl}" = x; then
86
AC_CHECK_HEADER($2, [ac_cv_path_$1_incl=""; found_$1_incl="yes"], [
87
AC_CHECK_HEADER($1/$2, [ac_cv_path_$1_incl="-I/usr/include/$1"; found_$1_incl="yes"], [
88
AC_CHECK_HEADER($name/$2, [ac_cv_path_$1_incl="-I/usr/include/$name"; found_$1_incl="yes"], [
89
AC_CHECK_HEADER($2, [ac_cv_path_$1_incl="-I/usr/include/$2"; found_$1_incl="yes"], [
90
if test x"${ac_cv_path_$1_incl}" = x; then
91
for i in $incllist; do
92
if test -f $i/$name; then
94
if test x"$i" != x"/usr/include"; then
95
ac_cv_path_$1_incl="-I$i"
102
if test -f $i/$name/$2; then
103
ac_cv_path_$1_incl="-I$i/$name"
105
if test -f $i/$2; then
106
ac_cv_path_$1_incl="-I$i"
128
119
if test x"${found_$1_incl}" = "xyes"; then
151
142
pushdef([UP], translit([$1], [a-z], [A-Z]))dnl Uppercase
152
143
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl Lowercase
144
pushdef([DASHDOWN], translit([$1], [A-Z_], [a-z-]))dnl Lowercase
156
AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], [Enable support for $3.]),
157
[case "${enableval}" in
161
AC_MSG_ERROR([bad value ${enableval} for enable-$1 option]) ;;
164
if test x$4 = x; then
170
148
if test x"${$1}" = x"yes"; then
171
dnl Look for the library
172
AC_ARG_WITH($1_lib, AC_HELP_STRING([--with-$1-lib], [directory where $1 library is]), with_$1_lib=${withval})
173
AC_CACHE_VAL(ac_cv_path_$1_lib,[
174
if test x"${with_$1_lib}" != x ; then
175
AC_MSG_CHECKING([for lib$1 library in specified directory])
176
if test -f ${with_$1_lib}/lib$name.a -o -f ${with_$1_lib}/lib$name.${shlibext}; then
177
tmp="`(cd ${with_$1_lib}; pwd)`"
178
ac_cv_path_$1_lib="-L${tmp} -l$name"
181
AC_MSG_ERROR([${with_$1_lib} directory doesn't contain library $name.])
149
dnl Look for the library
150
AC_ARG_WITH($1_lib, AC_HELP_STRING([--with-$1-lib], [directory where $1 library is]), with_$1_lib=${withval})
151
AC_CACHE_VAL(ac_cv_path_$1_lib,[
152
if test x"${with_$1_lib}" != x ; then
153
AC_MSG_CHECKING([for lib$1 library in specified directory])
154
if test -f ${with_$1_lib}/lib$name.a -o -f ${with_$1_lib}/lib$name.${shlibext}; then
155
tmp="`(cd ${with_$1_lib}; pwd)`"
156
ac_cv_path_$1_lib="-L${tmp} -l$name"
159
AC_MSG_ERROR([${with_$1_lib} directory doesn't contain library $name.])
187
dnl If the header doesn't exist, there is no point looking for the library.
165
dnl If the header doesn't exist, there is no point looking for the library.
188
166
if test x$cross_compiling = xno; then
189
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_lib}" = x; then
190
$PKG_CONFIG --exists libDOWN[] && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l libDOWN[]`"
191
$PKG_CONFIG --exists DOWN[] && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l DOWN[]`"
192
$PKG_CONFIG --exists lib$name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l lib$name`"
193
$PKG_CONFIG --exists $name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l $name`"
194
AC_MSG_CHECKING([for lib$1 library])
195
AC_MSG_RESULT(${ac_cv_path_$1_lib})
167
if test x"$PKG_CONFIG" != x -a x"${ac_cv_path_$1_lib}" = x; then
168
$PKG_CONFIG --exists [lib]DASHDOWN && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l libDOWN[]`"
169
$PKG_CONFIG --exists DASHDOWN && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l DASHDOWN`"
170
$PKG_CONFIG --exists lib$name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l lib$name`"
171
$PKG_CONFIG --exists $name && ac_cv_path_$1_lib="`$PKG_CONFIG --libs-only-l $name`"
172
AC_MSG_CHECKING([for lib$1 library])
173
AC_MSG_RESULT(${ac_cv_path_$1_lib})
197
175
if test x"${ac_cv_path_$1_lib}" = x; then
198
176
AC_PATH_PROG(UP[]_CONFIG, $1-config)
199
177
if test x"${UP[]_CONFIG}" != x; then
207
if test x"${ac_cv_path_$1_lib}" = x; then
210
for i in $libslist; do
211
if test -f $i/lib$1.a -o -f $i/lib$1.${shlibext}; then
212
if test -f "$i/lib$1.a" -o -f "$i/lib$1.${shlibext}"; then
213
if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
214
ac_cv_path_$1_lib="-L$i -l$1 $5"
217
ac_cv_path_$1_lib="-l$1 $5"
222
if test -f "$i/lib$name.a" -o -f "$i/lib$name.${shlibext}"; then
223
if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
224
ac_cv_path_$1_lib="-L$i -l$name $5"
227
ac_cv_path_$1_lib="-l$name $5"
185
if test x"${ac_cv_path_$1_lib}" = x; then
188
for i in $libslist; do
189
if test -f $i/lib$1.a -o -f $i/lib$1.${shlibext}; then
190
if test -f "$i/lib$1.a" -o -f "$i/lib$1.${shlibext}"; then
191
if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
192
ac_cv_path_$1_lib="-L$i -l$1 $5"
194
ac_cv_path_$1_lib="-l$1 $5"
199
if test -f "$i/lib$name.a" -o -f "$i/lib$name.${shlibext}"; then
200
if test ! x"$i" = x"/usr/lib" -a ! x"$i" = x"/usr/lib64"; then
201
ac_cv_path_$1_lib="-L$i -l$name $5"
203
ac_cv_path_$1_lib="-l$name $5"
236
if test x"${ac_cv_path_$1_lib}" = x ; then
212
if test x"${ac_cv_path_$1_lib}" = x ; then
237
213
AC_SEARCH_LIBS($2, $1 $name, [ac_cv_path_$1_lib="$LIBS $5"])
240
if test x"${ac_cv_path_$1_lib}" != x ; then
241
UP[]_LIBS="${ac_cv_path_$1_lib}"
216
if test x"${ac_cv_path_$1_lib}" != x ; then
217
UP[]_LIBS="${ac_cv_path_$1_lib}"