Commit 7209bedf authored by Simon Morlat's avatar Simon Morlat

fix for osip checks (must never add -L/usr/lib !!!)

parent f7bb65c2
......@@ -5,28 +5,16 @@ AC_ARG_WITH( osip,
[ --with-osip Set prefix where osip can be found (ex:/usr or /usr/local)[default=/usr] ],
[ osip_prefix=${withval}],[ osip_prefix=/usr ])
dnl FC6's compat-osip2 headers live into "/usr/include/osip2-2.2.2",
dnl while libraries are "/usr/lib/libosipparser2-2.2.2.so*".
AC_ARG_WITH( osip-version,dnl
AC_HELP_STRING([--with-osip-version=VERSION],
[Set osip legacy version @<:@empty@:>@]),
[osip_legacy_version="-${withval}"],
[osip_legacy_version=""])
osip_pkgconfig=true
osip_pkgconfig_file=libosip2
if test -n "$osip_legacy_version"; then
osip_pkgconfig_file=libosip2${osip_legacy_version}
fi
PKG_CHECK_MODULES(OSIP, $osip_pkgconfig_file >= 3.0.0, ,osip_pkgconfig=false)
PKG_CHECK_MODULES(OSIP, $osip_pkgconfig_file >= 3.3.0, ,osip_pkgconfig=false)
if test $osip_pkgconfig = false; then
if test -z "$osip_legacy_version"; then
if test "$osip_prefix" != "/usr" ; then
OSIP_CFLAGS="-I${osip_prefix}/include"
else
OSIP_CFLAGS="-I${osip_prefix}/include/osip2${osip_legacy_version}"
fi
dnl check osip2 headers
......@@ -36,7 +24,10 @@ dnl check osip2 headers
CPPFLAGS=$CPPFLAGS_save
dnl check for osip2 libs
OSIP_LIBS="-L$osip_prefix/lib -losipparser2${osip_legacy_version}"
if test "$osip_prefix" != "/usr" ; then
OSIP_LIBS="-L$osip_prefix/lib"
fi
OSIP_LIBS="$OSIP_LIBS -losipparser2"
LDFLAGS_save=$LDFLAGS
LDFLAGS=$OSIP_LIBS
LIBS_save=$LIBS
......@@ -49,8 +40,8 @@ dnl check for osip2 libs
;;
esac
OSIP_LIBS="$OSIP_LIBS $osip_aux_libs"
AC_CHECK_LIB(osip2${osip_legacy_version},osip_init, , AC_MSG_ERROR([Could not find osip2 library !]),[-losipparser2${osip_legacy_version} $osip_aux_libs ])
AC_CHECK_LIB(osipparser2${osip_legacy_version},osip_message_init, , AC_MSG_ERROR([Could not find osipparser2 library !]),[$osip_aux_libs])
AC_CHECK_LIB(osip2,osip_init, , AC_MSG_ERROR([Could not find osip2 library !]),[-losipparser2 $osip_aux_libs ])
AC_CHECK_LIB(osipparser2,osip_message_init, , AC_MSG_ERROR([Could not find osipparser2 library !]),[$osip_aux_libs])
LDFLAGS=$LDFLAGS_save
LIBS=$LIBS_save
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment