From: Po Lu Date: Thu, 16 Mar 2023 07:46:39 +0000 (+0800) Subject: Make ANDROID_CC and SDK_BUILD_TOOLS precious variables X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e38758aaf40280b8bda819990af8b0f43c48d5f9;p=emacs.git Make ANDROID_CC and SDK_BUILD_TOOLS precious variables * configure.ac (AUTO_DEPEND, ANDROID_STUBIFY, ANDROID_LDFLAGS): * lib/Makefile.in (ANDROID_CFLAGS, ANDROID_BUILD_CFLAGS) (ALL_CFLAGS): * lib/gnulib.mk.in (AM_DEFAULT_VERBOSITY): * msdos/sed1v2.inp: * msdos/sedlibmk.inp: * src/Makefile.in (ANDROID_OBJ, EMACS_CFLAGS): Make those variables precious. Rename ANDROID_CFLAGS substitution to ANDROID_BUILD_CFLAGS. --- diff --git a/configure.ac b/configure.ac index 0282aa0c201..5a8771bf3d7 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ if test "$XCONFIGURE" = "android"; then with_ndk_path="$android_ndk_path" with_ndk_cxx_shared="$android_ndk_cxx_shared" with_ndk_cxx="$android_ndk_cxx" - ndk_INIT([$android_abi], [$ANDROID_SDK], [cross/ndk-build],\ + ndk_INIT([$android_abi], [$ANDROID_SDK], [cross/ndk-build], [$ANDROID_CFLAGS]) fi @@ -811,6 +811,8 @@ android_makefiles="lib/Makefile lib/gnulib.mk lib-src/Makefile src/Makefile" # This is whether or not to package mailutils into the executable. emacs_use_mailutils= +AC_ARG_VAR([SDK_BUILD_TOOLS], [Name of directory holding Android SDK build-tools.]) +AC_ARG_VAR([ANDROID_CFLAGS], [Flags given to the Android C cross-compiler.]) AC_ARG_VAR([JAVAC], [Java compiler path. Used for Android.]) AC_ARG_VAR([JARSIGNER], [Java package signer path. Used for Android.]) AC_ARG_VAR([APKSIGNER], [Android package signer path. Used for Android.]) @@ -2573,7 +2575,9 @@ window_system=none ANDROID_OBJ= ANDROID_LIBS= -ANDROID_CFLAGS= +# ANDROID_CFLAGS is a precious variable used to pass information to +# the cross-compiler. +ANDROID_BUILD_CFLAGS= REALLY_ANDROID= CM_OBJ="cm.o" @@ -2602,11 +2606,11 @@ for Android, but all API calls need to be stubbed out]) # Emacs will be built as a shared library, and a wrapper around it # will also be built for the benefit of applications. This # requires Emacs be built as a position independent executable. - ANDROID_CFLAGS="-fPIC -fvisibility=hidden" + ANDROID_BUILD_CFLAGS="-fPIC -fvisibility=hidden" # Graphics code in sfntfont-android.c benefits heavily from # vectorization. - ANDROID_CFLAGS="$ANDROID_CFLAGS -ftree-vectorize" + ANDROID_BUILD_CFLAGS="$ANDROID_BUILD_CFLAGS -ftree-vectorize" # Link with libraries required for Android support. # API 9 and later require `-landroid' for the asset manager. @@ -2638,7 +2642,7 @@ AC_SUBST([ANDROID]) AC_SUBST([ANDROID_OBJ]) AC_SUBST([ANDROID_LIBS]) AC_SUBST([ANDROID_LDFLAGS]) -AC_SUBST([ANDROID_CFLAGS]) +AC_SUBST([ANDROID_BUILD_CFLAGS]) AC_SUBST([ANDROID_SHARED_USER_ID]) if test "${with_pgtk}" = "yes"; then diff --git a/lib/Makefile.in b/lib/Makefile.in index b84a1bf9741..6752f68c50e 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -27,7 +27,7 @@ XCONFIGURE = @XCONFIGURE@ # This is required to make sure symbol visibility is correct and # functions like readlinkat do not end up replacing their OS # counterparts. -ANDROID_CFLAGS = @ANDROID_CFLAGS@ +ANDROID_BUILD_CFLAGS = @ANDROID_BUILD_CFLAGS@ # Variables substituted by 'configure', and not autogenerated in gnulib.mk, # or needed before gnulib.mk is included. @@ -46,7 +46,7 @@ ALL_CFLAGS = \ $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) $(DEPFLAGS) \ $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ -I. -I../src -I$(srcdir) -I$(top_srcdir)/src \ - $(if $(patsubst e-%,,$(notdir $<)),,-Demacs) $(ANDROID_CFLAGS) + $(if $(patsubst e-%,,$(notdir $<)),,-Demacs) $(ANDROID_BUILD_CFLAGS) ifeq ($(HAVE_NATIVE_COMP),yes) ALL_CFLAGS += -DGL_COMPILE_CRYPTO_STREAM diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 99286852f8b..94fd1d5bec9 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -184,7 +184,7 @@ ALSA_LIBS = @ALSA_LIBS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ ANDROID = @ANDROID@ ANDROID_ABI = @ANDROID_ABI@ -ANDROID_CFLAGS = @ANDROID_CFLAGS@ +ANDROID_BUILD_CFLAGS = @ANDROID_BUILD_CFLAGS@ ANDROID_DEBUGGABLE = @ANDROID_DEBUGGABLE@ ANDROID_JAR = @ANDROID_JAR@ ANDROID_LDFLAGS = @ANDROID_LDFLAGS@ diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 32f1a249f21..71aa27afce2 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -206,7 +206,7 @@ s/ *@WEBP_LIBS@// /^ANDROID_OBJ *=/s/@ANDROID_OBJ@// /^ANDROID_LIBS *=/s/@ANDROID_LIBS@// /^ANDROID_LDFLAGS *=/s/@ANDROID_LDFLAGS@// -/^ANDROID_CFLAGS *=/s/@ANDROID_CFLAGS@// +/^ANDROID_BUILD_CFLAGS *=/s/@ANDROID_CFLAGS@// /^LIBGMP_CFLAGS *=/s/@LIBGMP_CFLAGS@// /^SQLITE3_CFLAGS *=/s/@SQLITE3_CFLAGS@// /^LIBSELINUX_CFLAGS *=/s/@LIBSELINUX_CFLAGS@// diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 81b2ac44497..cca2b46b018 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -156,7 +156,7 @@ s/@PACKAGE@/emacs/ /^HYBRID_MALLOC *=/s/@HYBRID_MALLOC@// /^WARN_CFLAGS *=/s/@WARN_CFLAGS@// /^WERROR_CFLAGS *=/s/@WERROR_CFLAGS@// -/^ANDROID_CFLAGS *=/s/@ANDROID_CFLAGS@// +/^ANDROID_BUILD_CFLAGS *=/s/@ANDROID_BUILD_CFLAGS@// /^DEFS *=/s/@[^@\n]*@// /^DEPDIR *=/s/@[^@\n]*@/deps/ /^ECHO_N *=/s/@[^@\n]*@/-n/ diff --git a/src/Makefile.in b/src/Makefile.in index 1e364cd7a10..9ac7983943e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -391,7 +391,7 @@ HAIKU_CFLAGS = @HAIKU_CFLAGS@ ANDROID_OBJ = @ANDROID_OBJ@ ANDROID_LIBS = @ANDROID_LIBS@ ANDROID_LDFLAGS = @ANDROID_LDFLAGS@ -ANDROID_CFLAGS = @ANDROID_CFLAGS@ +ANDROID_BUILD_CFLAGS = @ANDROID_BUILD_CFLAGS@ LIBGMP_CFLAGS = @LIBGMP_CFLAGS@ @@ -437,7 +437,7 @@ EMACS_CFLAGS=-Demacs $(MYCPPFLAGS) -I. -I$(srcdir) \ $(LIBSYSTEMD_CFLAGS) $(JSON_CFLAGS) $(XSYNC_CFLAGS) $(TREE_SITTER_CFLAGS) \ $(LIBGNUTLS_CFLAGS) $(NOTIFY_CFLAGS) $(CAIRO_CFLAGS) \ $(WERROR_CFLAGS) $(HAIKU_CFLAGS) $(XCOMPOSITE_CFLAGS) $(XSHAPE_CFLAGS) \ - $(ANDROID_CFLAGS) $(GIF_CFLAGS) $(JPEG_CFLAGS) $(SQLITE3_CFLAGS) \ + $(ANDROID_BUILD_CFLAGS) $(GIF_CFLAGS) $(JPEG_CFLAGS) $(SQLITE3_CFLAGS) \ $(LIBGMP_CFLAGS) $(TIFF_CFLAGS) $(LIBSELINUX_CFLAGS) ALL_CFLAGS = $(EMACS_CFLAGS) $(WARN_CFLAGS) $(CFLAGS) ALL_OBJC_CFLAGS = $(EMACS_CFLAGS) \