4 # Convert paths to .so/.dylib/.dll into directories that can be used with
5 # -L/path and -Wl,-rpath,/path compiler args. Also strip out -l flags,
6 # as autoconf will add them for us for feature detection.
8 if [ "$i" = "-Wl,-rpath" ]; then continue; fi
9 echo "$i" | perl -p -e "s/'/\\\\'/g;" \
11 -e 's;(.*)[/\\].*\.(so|dylib|dll)$;-L\1 -Wl,-rpath,\1;g;'
16 # autoconf's boost detection seems to require a path to boost libs
17 # if they're not in the system directories
19 echo "$i" | perl -n -e 'print if s,(.*)/libboost_.*\.(so|dylib|dll).*,\1,'
23 # This is an extra linker flag that buck appends on OSX that's not valid
24 # This probably requires a patch to buck
25 LDFLAGS=$(get_ldflags "$@" | uniq | tr '\n' ' ' | perl -pe 's;-Xlinker \@executable_path\S*;;g')
27 boost_libdir=$(get_boost_libdirs "$@"| head -n 1)
28 if [ ! -z "$boost_libdir" ]; then
29 BOOST_FLAG="--with-boost-libdir=$boost_libdir"
33 export BOOST_LDFLAGS="$LDFLAGS"
34 export BOOST_CPPFLAGS="$CPPFLAGS"
36 SRCROOT=$(dirname "$(readlink "$SRCDIR"/configure.ac)")
37 # Temp dir because autoconf doesn't like '#' in the working directory
39 trap 'rm -rf "$conf_dir"' EXIT
41 autoreconf -iv "$SRCROOT" && \
42 "$SRCROOT/configure" "$BOOST_FLAG" && \
43 cp -pvf folly-config.h "$OUT"