LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / android / Bootstrap / Makefile.shared
blobf40693615f0a098bb4b4e5ce639c44a127866f02
2 # Common Makefile pieces for building Java / Android apps.
6 # BOOTSTRAPDIR needs to be set to this directory before starting this
9 # Probably would be best to just stop fooling around with the possibilities to
10 # set various stuff with the -env command line parameters (and environment
11 # variables?) and in a plethora of rc files, and hardcode construction of
12 # *all* required pathnames based on the app installation location for Android
13 # (and iOS), etc. We don't really win anything by having so many layers of
14 # configurability on platforms like Android and iOS where apps based on LO
15 # code are very much self-contained pre-packaged thingies.
17 JNILIBSDIR=$(BUILDDIR)/android/jniLibs
18 SODEST=$(JNILIBSDIR)/$(ANDROID_APP_ABI)
19 OBJLOCAL=$(BUILDDIR)/android/obj/local/$(ANDROID_APP_ABI)
22 # Helpful rules ...
25 local.properties: $(BUILDDIR)/config_host.mk
26         echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
29 # Build / link the single .so for this app
32 ALL_STATIC_LIBS := $(shell $(SRCDIR)/bin/lo-all-static-libs)
34 LIBS = \
35   -Wl,--start-group \
36   $(ALL_STATIC_LIBS) \
37   -Wl,--end-group
39 NSSLIBS = freebl3 \
40         nspr4 \
41         nss3 \
42         nssckbi \
43         nssdbm3 \
44         nssutil3 \
45         plc4 \
46         plds4 \
47         smime3 \
48         softokn3 \
49         sqlite3 \
50         ssl3 \
52 WHOLELIBS = \
53   -Wl,--whole-archive \
54   $(addprefix -l,$(strip \
55         $(if $(ENABLE_JAVA),juh) \
56   )) \
57   -Wl,--no-whole-archive
60 $(OBJLOCAL)/liblo-native-code.so : native-code.cxx $(ALL_STATIC_LIBS)
61         @echo "Linking $@"
62         mkdir -p $(OBJLOCAL)
63         $(CXX) -fuse-ld=gold -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script=../Bootstrap/version.map -Wl,--no-keep-files-mapped -Wl,--no-undefined -DANDROID -DDISABLE_DYNLOADING -shared -Wl,-soname,liblo-native-code.so -o $(OBJLOCAL)/liblo-native-code.so -I$(BUILDDIR)/config_host -I$(SRCDIR)/include native-code.cxx -L$(INSTDIR)/$(LIBO_LIB_FOLDER) $(WHOLELIBS) $(LIBS) -lc++_static -lc++abi $(if $(filter-out arm64-v8a x86_64,$(ANDROID_APP_ABI)),-landroid_support) $(if $(filter armeabi-v7a,$(ANDROID_APP_ABI)),-lunwind) $(addprefix -l,$(NSSLIBS)) -lGLESv2 -landroid -ljnigraphics -llog -lz
65 $(SODEST)/liblo-native-code.so : $(OBJLOCAL)/liblo-native-code.so
66         mkdir -p $(SODEST)
67         $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so
68         #to keep some symbols, eg.: $(STRIP) -o $(SODEST)/liblo-native-code.so $(OBJLOCAL)/liblo-native-code.so -w -K 'Java*'
70 $(SODEST)/nss-libraries : 
71         mkdir -p $(SODEST)
72         $(foreach lib,$(NSSLIBS),$(STRIP) -o $(SODEST)/lib$(lib).so $(INSTDIR)/$(LIBO_LIB_FOLDER)/lib$(lib).so;)
74 $(SODEST)/libc++_shared.so : $(ANDROID_NDK_HOME)/sources/cxx-stl/llvm-libc++/libs/$(ANDROID_APP_ABI)/libc++_shared.so
75         mkdir -p $(SODEST)
76         cp $< $@
78 link-so: $(SODEST)/liblo-native-code.so $(SODEST)/nss-libraries $(SODEST)/libc++_shared.so
80 # If you reinstall an app several times *on the emulator*, even if you
81 # uninstall it between, disk space seems to leak that won't get recycled until
82 # you stop and start... No idea if this holds for a device, too. (And you
83 # can't "stop" a device anyway.)
85 stop-start-cycle:
86         $(ANDROID_SDK_HOME)/platform-tools/adb shell stop && $(ANDROID_SDK_HOME)/platform-tools/adb shell start && sleep 10
88 # build-host specific stuff (build paths and the like) to keep build.gradle static
89 liboSettings.gradle: $(BUILDDIR)/config_build.mk $(BUILDDIR)/config_host.mk
90         @echo "creating $@"
91         ( \
92                 echo "// created by Makefile.shared - your changes will be overridden" \
93                 && echo "ext {" \
94                 && echo "    liboSrcRoot         = '$(SRC_ROOT)'" \
95                 && echo "    liboJniLibsdir      = '$(JNILIBSDIR)'" \
96                 && echo "    liboWorkdir         = '$(WORKDIR)'" \
97                 && echo "    liboInstdir         = '$(INSTDIR)'" \
98                 && echo "    liboEtcFolder       = '$(LIBO_ETC_FOLDER)'" \
99                 && echo "    liboUreMiscFolder   = '$(LIBO_URE_MISC_FOLDER)'" \
100                 && echo "    liboSharedResFolder = '$(LIBO_SHARE_RESOURCE_FOLDER)'" \
101                 && echo "    liboUREJavaFolder   = '$(LIBO_URE_SHARE_JAVA_FOLDER)'" \
102                 && echo "    liboShareJavaFolder = '$(LIBO_SHARE_JAVA_FOLDER)'" \
103                 && echo "    liboExampleDocument = '$(if $(exampleDocument),$(exampleDocument),$(SRC_ROOT)/android/default-document/example.odt)'" \
104                 && echo "    liboVersionMajor    = '$(LIBO_VERSION_MAJOR)'" \
105                 && echo "    liboVersionMinor    = '$(LIBO_VERSION_MINOR)'" \
106                 && echo "    liboGitFullCommit   = '$(shell cd $(SRCDIR) && git log -1 --format=%H)'" \
107                 && echo "}" \
108                 && echo "android.defaultConfig {" \
109                 && echo "    applicationId '$(ANDROID_PACKAGE_NAME)'" \
110                 && echo "    versionCode project.hasProperty('cmdVersionCode') ? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
111                 && echo "    versionName '$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)/$(shell cd $(SRCDIR) && git log -1 --format=%h)/$(OOO_VENDOR)'" \
112                 && echo "}" \
113         ) > $@