$(AM_V_GEN) cp -f -p $(top_builddir)/src/config.h.android \
lib-src/config.h
+# Figure out where build-aux is.
+# Then, replace the build-aux directory with its actual location,
+# in case MKDIR_P points there.
+
+relative_buildaux_dir := $(subst /,\/,$(top_srcdir)/build-aux)
+
lib/gnulib.mk: $(top_builddir)/lib/gnulib.mk.android
$(AM_V_GEN) \
sed -e 's/^srcdir =.*$$/srcdir = $(subst /,\/,$(LIB_SRCDIR))/g' \
+ -e 's/$(relative_buildaux_dir)/$(subst /,\/,../$(top_builddir))\/build-aux/g' \
< $(top_builddir)/lib/gnulib.mk.android > $@
lib/Makefile: $(top_builddir)/lib/Makefile.android
done
}
-# Look for a suitable ar in the same directory as the C compiler.
+# Look for a suitable ar and ranlib in the same directory as the C
+# compiler.
ndk_cc_firstword=`AS_ECHO(["$CC"]) | cut -d' ' -f1`
ndk_where_cc=`which $ndk_cc_firstword`
ndk_ar_search_path=$PATH
+ndk_ranlib_search_path=$RANLIB
# First, try to find $host_alias-ar in PATH.
AC_PATH_PROGS([AR], [$host_alias-ar], [], [$ndk_ar_search_path])
ndk_ar_search_path="`AS_DIRNAME([$ndk_where_cc])`:$ndk_ar_search_path"
AC_PATH_PROGS([AR], [$host_alias-ar llvm-ar], [], [$ndk_ar_search_path])])
+# First, try to find $host_alias-ranlib in PATH.
+AC_PATH_PROGS([RANLIB], [$host_alias-ranlib], [], [$ndk_ranlib_search_path])
+
+AS_IF([test -z "$RANLIB"],[
+ # Next, try finding either that or llvm-ranlib in the directory
+ # holding CC.
+ ndk_ranlib_search_path="`AS_DIRNAME([$ndk_where_cc])`:$ndk_ranlib_search_path"
+ AC_PATH_PROGS([RANLIB], [$host_alias-ranlib llvm-ranlib], [],
+ [$ndk_ranlib_search_path])])
+
NDK_BUILD_NASM=
# Next, try to find nasm on x86. This doesn't ship with the NDK.