29
29
dnl then we error if we can't actually find serf.
31
31
dnl If a --with-serf=PREFIX option is passed search for a suitable
32
dnl serf installed on the system under that PREFIX. We will
33
dnl error if we can't find serf.
32
dnl serf installed on the system under that PREFIX. First we will
33
dnl try to find a pc file for serf under the prefix or directly
34
dnl in the prefix (allowing the path that the serf-?.pc file to be
35
dnl passed to configure if the pc file is in a non-standard location)
36
dnl and then use pkg-config to determine the options to use that library.
37
dnl If pkg-confg can't provide us the options to use that library fall
38
dnl back on trying to use the guess the options based on just the prefix.
39
dnl We will error if we can't find serf.
35
41
dnl If a --with-serf=no option is passed then no search will be
58
64
elif test "$withval" = "no" ; then
61
SVN_SERF_PREFIX_CONFIG()
68
serf_prefix="$withval"
65
72
if test "$serf_skip" = "no" ; then
66
if test "$serf_found" = "no" ; then
74
if test -n "$serf_prefix" && test "$serf_found" = "no" ; then
75
SVN_SERF_PREFIX_CONFIG()
70
78
AC_MSG_CHECKING([was serf enabled])
134
141
if test -n "$PKG_CONFIG"; then
135
142
for serf_major in serf-2 serf-1; do
136
143
AC_MSG_CHECKING([for $serf_major library])
137
if $PKG_CONFIG $serf_major --exists; then
144
if test -n "$serf_prefix" ; then
145
dnl User provided a prefix so we try to find the pc file under
146
dnl the prefix. PKG_CONFIG_PATH isn't useful for this because
147
dnl we want to make sure that we get the library in the prefix
148
dnl the user specifies and we want to allow the prefix path to
149
dnl point at the path for the pc file is in (if it's in some
150
dnl other path than $serf_prefx/lib/pkgconfig).
151
if test -e "$serf_prefix/$serf_major.pc" ; then
152
serf_pc_arg="$serf_prefix/$serf_major.pc"
153
elif test -e "$serf_prefix/lib/pkgconfig/$serf_major.pc" ; then
154
serf_pc_arg="$serf_prefix/lib/pkgconfig/$serf_major.pc"
160
serf_pc_arg="$serf_major"
162
if $PKG_CONFIG $serf_pc_arg --exists; then
138
163
AC_MSG_RESULT([yes])
139
164
AC_MSG_CHECKING([serf library version])
140
SERF_VERSION=`$PKG_CONFIG $serf_major --modversion`
165
SERF_VERSION=`$PKG_CONFIG $serf_pc_arg --modversion`
141
166
AC_MSG_RESULT([$SERF_VERSION])
142
167
AC_MSG_CHECKING([serf version is suitable])
143
if $PKG_CONFIG $serf_major --atleast-version=$serf_check_version; then
168
if $PKG_CONFIG $serf_pc_arg --atleast-version=$serf_check_version; then
144
169
AC_MSG_RESULT([yes])
146
SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_major --cflags | $SED -e 's/-D[^ ]*//g'`]
147
SVN_SERF_LIBS=`$PKG_CONFIG $serf_major --libs`
171
SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags | $SED -e 's/-D[^ ]*//g'`]
172
SVN_SERF_LIBS=`$PKG_CONFIG $serf_pc_arg --libs-only-l`
173
dnl don't use --libs-only-L because then we might miss some options
174
LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e 's/-l[^ ]*//g'`"]
150
177
AC_MSG_RESULT([no])