[Android] buildsystem: Rely on sqlite's .pc file to find it

Hugo Beauzée-Luyssen git at videolan.org
Tue Feb 23 08:49:28 UTC 2021


vlc-android | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Feb 18 17:01:27 2021 +0100| [11cefbd40cab68c00fdadbe05c1dfd404dea5629] | committer: Nicolas Pomepuy

buildsystem: Rely on sqlite's .pc file to find it

Once we start building the medialibrary with meson, there's no trivial
way of pointing it to a library without a .pc or another dependency
system

> https://code.videolan.org/videolan/vlc-android/commit/11cefbd40cab68c00fdadbe05c1dfd404dea5629
---

 buildsystem/compile-medialibrary.sh              | 12 ++++++---
 buildsystem/patches/sqlite/sqlite-no-shell.patch | 31 ++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/buildsystem/compile-medialibrary.sh b/buildsystem/compile-medialibrary.sh
index d63c4ef25..ef9fcf2ff 100755
--- a/buildsystem/compile-medialibrary.sh
+++ b/buildsystem/compile-medialibrary.sh
@@ -57,6 +57,8 @@ if [ ! -d "${MEDIALIBRARY_MODULE_DIR}/${SQLITE_RELEASE}" ]; then
   fi
   tar -xozf ${SQLITE_RELEASE}.tar.gz
   rm -f ${SQLITE_RELEASE}.tar.gz
+  cd ${SQLITE_RELEASE}
+  patch -1 ${SRC_DIR}/buildsystem/sqlite/sqlite-no-shell.patch
 fi
 cd ${MEDIALIBRARY_MODULE_DIR}/${SQLITE_RELEASE}
 if [ ! -d "build-$ANDROID_ABI" ]; then
@@ -67,6 +69,8 @@ cd "build-$ANDROID_ABI";
 if [ ! -e ./config.status -o "$RELEASE" = "1" ]; then
   ../configure \
     --host=$TARGET_TUPLE \
+    --prefix=${SRC_DIR}/medialibrary/prefix/${TARGET_TUPLE} \
+    --disable-shell \
     --enable-force-attachments-api \
     --disable-shared \
     CFLAGS="${VLC_CFLAGS}" \
@@ -76,9 +80,12 @@ if [ ! -e ./config.status -o "$RELEASE" = "1" ]; then
 fi
 
 make $MAKEFLAGS
+avlc_checkfail "sqlite build failed"
+
+make install
+avlc_checkfail "sqlite installation failed"
 
 cd ${SRC_DIR}
-avlc_checkfail "sqlite build failed"
 
 ##############################
 # FETCH MEDIALIBRARY SOURCES #
@@ -135,10 +142,9 @@ if [ ! -e ./config.h -o "$RELEASE" = "1" ]; then
     STRIP="${CROSS_TOOLS}strip" \
     RANLIB="${CROSS_TOOLS}ranlib" \
     PKG_CONFIG_LIBDIR="$SRC_DIR/vlc/build-android-${TARGET_TUPLE}/install/lib/pkgconfig" \
+    PKG_CONFIG_PATH="$SRC_DIR/medialibrary/prefix/${TARGET_TUPLE}/lib/pkgconfig" \
     LIBJPEG_LIBS="-L$SRC_DIR/vlc/contrib/contrib-android-$TARGET_TUPLE/jpeg/.libs -ljpeg" \
     LIBJPEG_CFLAGS="-I$SRC_DIR/vlc/contrib/$TARGET_TUPLE/include/" \
-    SQLITE_LIBS="-L$MEDIALIBRARY_MODULE_DIR/$SQLITE_RELEASE/build-$ANDROID_ABI/.libs -lsqlite3" \
-    SQLITE_CFLAGS="-I$MEDIALIBRARY_MODULE_DIR/$SQLITE_RELEASE" \
     AR="${CROSS_TOOLS}ar"
   avlc_checkfail "medialibrary: autoconf failed"
 fi
diff --git a/buildsystem/patches/sqlite/sqlite-no-shell.patch b/buildsystem/patches/sqlite/sqlite-no-shell.patch
new file mode 100644
index 000000000..1277061c7
--- /dev/null
+++ b/buildsystem/patches/sqlite/sqlite-no-shell.patch
@@ -0,0 +1,31 @@
+--- sqlite/configure.ac.noshell	2020-04-09 10:07:14.127078500 +0200
++++ sqlite/configure.ac	2020-04-09 10:03:50.435193500 +0200
+@@ -203,6 +203,16 @@ fi
+ AC_SUBST(EXTRA_SHELL_OBJ)
+ #-----------------------------------------------------------------------
+ 
++#-----------------------------------------------------------------------
++#   --disable-shell
++#
++AC_ARG_ENABLE(shell, [AS_HELP_STRING(
++  [--enable-shell], 
++  [build the shell tool [default=yes]])], 
++  [], [enable_shell=yes])
++AM_CONDITIONAL([BUILD_SHELL], [test x"$enable_shell" = "xyes"])
++#-----------------------------------------------------------------------
++
+ AC_CHECK_FUNCS(posix_fallocate)
+ AC_CHECK_HEADERS(zlib.h,[
+   AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"])
+--- sqlite/Makefile.am.noshell	2020-04-09 10:07:10.055569100 +0200
++++ sqlite/Makefile.am	2020-04-09 10:04:00.028577700 +0200
+@@ -4,7 +4,9 @@ lib_LTLIBRARIES = libsqlite3.la
+ libsqlite3_la_SOURCES = sqlite3.c
+ libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
+ 
++if BUILD_SHELL
+ bin_PROGRAMS = sqlite3
++endif
+ sqlite3_SOURCES = shell.c sqlite3.h
+ EXTRA_sqlite3_SOURCES = sqlite3.c
+ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@



More information about the Android mailing list