Alexandr Miloslavskiy wrote on Wed, Jul 28, 2021 at 00:38:34 +0300: > +++ build/ac-macros/serf.m4 (working copy) > @@ -170,6 +170,14 @@ > serf_found=yes > SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_pc_arg --cflags-only-I`] > SVN_SERF_LIBS=[`$PKG_CONFIG $serf_pc_arg --libs-only-l`] > + if test -n "$serf_prefix" ; then > + dnl User provided a prefix, so the location is non default. > + dnl serf doesn't create .la since 2011, and it just > + dnl gives '-lserf-1'. At the same time, libtool doesn't > + dnl add -rpath for dependencies given as '-l'. > + dnl The workaround dnl is to hack '-L' into '-R'. > + SVN_SERF_LIBS=["$SVN_SERF_LIBS `$PKG_CONFIG $serf_pc_arg > --libs-only-L | $SED -e 's/^-L/-R/g'`"] > + fi
I'm sceptical about the regex. For all I know, there may be multiple -L options and there may be leading spaces before the first one. More importantly, however, shouldn't we be getting the linker flags from pkg-config(1)? It would be interesting to build serf with a non-default prefix and then grep the resulting .pc file for that prefix. Cheers, Daniel > dnl don't use --libs-only-L because then we might miss some options > LDFLAGS=["$LDFLAGS `$PKG_CONFIG $serf_pc_arg --libs | $SED -e > 's/-l[^ ]*//g'`"] > break