configure.ac 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966
  1. # -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.63])
  4. AC_INIT([loolwsd], [master], [libreoffice@lists.freedesktop.org])
  5. LT_INIT([shared, disable-static, dlopen])
  6. AM_INIT_AUTOMAKE([1.10 subdir-objects tar-pax -Wno-portability])
  7. AC_CONFIG_MACRO_DIR([m4])
  8. # We don't want to require pkg-config and PKG_CHECK_MODULES on macOS
  9. m4_if(m4_esyscmd_s([uname -s]),Linux,[],[m4_define([PKG_CHECK_MODULES],[])])
  10. LOOLWSD_VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'`
  11. LOOLWSD_VERSION_MINOR=`echo $VERSION | awk -F. '{print $2}'`
  12. LOOLWSD_VERSION_MICRO=`echo $VERSION | awk -F. '{print $3}'`
  13. LOOLWSD_VERSION="$LOOLWSD_VERSION_MAJOR.$LOOLWSD_VERSION_MINOR.$LOOLWSD_VERSION_MICRO"
  14. AC_SUBST([LOOLWSD_VERSION_MAJOR])
  15. AC_SUBST([LOOLWSD_VERSION_MINOR])
  16. AC_SUBST([LOOLWSD_VERSION_MICRO])
  17. AC_SUBST([LOOLWSD_VERSION])
  18. AC_DEFINE_UNQUOTED([LOOLWSD_VERSION],[["$LOOLWSD_VERSION"]],[LibreOffice Online WebSocket server version])
  19. # try to add a git hash for a version if we're developing
  20. LOOLWSD_VERSION_HASH="$LOOLWSD_VERSION"
  21. git_hash=`cd ${srcdir} && ( cat dist_git_hash 2> /dev/null || git log -1 --format=%h 2> /dev/null )`
  22. if test "z$git_hash" != "z"; then
  23. LOOLWSD_VERSION_HASH=$git_hash
  24. fi
  25. AC_SUBST([LOOLWSD_VERSION_HASH])
  26. AC_DEFINE_UNQUOTED([LOOLWSD_VERSION_HASH],[["$LOOLWSD_VERSION_HASH"]],[LibreOffice Online git hash if present])
  27. AC_CONFIG_SRCDIR([wsd/LOOLWSD.cpp])
  28. AC_CONFIG_HEADERS([config.h])
  29. # Checks for programs.
  30. AC_PROG_CXX
  31. AC_PROG_CC
  32. AC_LANG_PUSH([C++])
  33. AS_IF([test `uname -s` = Linux],
  34. [AC_PATH_PROG([SETCAP], setcap,[],[/bin:/usr/bin:/sbin:/usr/sbin])]
  35. AS_IF([test -z "$SETCAP"],
  36. [AC_MSG_ERROR([The setcap command is needed. It might be in a package called libcap-progs.])]))
  37. # check for python modules
  38. for MODULE in lxml polib; do
  39. AC_MSG_CHECKING([for ${MODULE} for python3])
  40. if /usr/bin/env python3 -c "import ${MODULE}" 2> /dev/null ; then
  41. AC_MSG_RESULT([yes])
  42. else
  43. AC_MSG_RESULT([no])
  44. AS_IF([test `uname -s` = Linux],
  45. [AC_MSG_ERROR([${MODULE} for python3 is needed. It might be in a package called python3-${MODULE}.])],
  46. [AC_MSG_WARN([${MODULE} for python3 is needed. It might be in a package called python3-${MODULE}. But
  47. if you are building the JS bits on another (Linux) machine, that doesn't matter])])
  48. fi
  49. done
  50. # Declare options
  51. AC_ARG_ENABLE([debug],
  52. AS_HELP_STRING([--enable-debug],
  53. [Enable debugging, link with debugging version of Poco libraries]))
  54. AC_ARG_ENABLE([browsersync],
  55. AS_HELP_STRING([--enable-browsersync],
  56. [Don't copy files to the target directory but create the symlink to allow browsersync usage]))
  57. AC_ARG_ENABLE([anonymization],
  58. AS_HELP_STRING([--enable-anonymization],
  59. [Enable anonymization/obfuscation of user-data in logs]))
  60. AC_ARG_ENABLE([iosapp],
  61. AS_HELP_STRING([--enable-iosapp],
  62. [Use in a tree where the only purpose is to build the HTML and CSS stuff
  63. to be copied to a Mac where the iOS app is being built, *or* in a tree where
  64. you will build the iOS app.]))
  65. AC_ARG_WITH([iosapp-appicon],
  66. AS_HELP_STRING([--with-iosapp-appicon=<path>],
  67. [Point to a directory containing an icon set to use instead of the default empty one.]))
  68. AC_ARG_WITH([iosapp-fonts],
  69. AS_HELP_STRING([--with-iosapp-fonts=<path>],
  70. [Point to a directory containing .ttf or .otf files to be bundled in the iOS app (and
  71. thus installed on the device for use of the LO core code).]))
  72. AC_ARG_WITH([app-branding],
  73. AS_HELP_STRING([--with-app-branding=<path>],
  74. [Point to a directory containing a branding.css file and possibly other files it references,
  75. to be bundled and used by the iOS app. The directory structure is copied to
  76. "loleaflet/dist/branding" and that directory ends upp in the app bundle as "branding".]))
  77. AC_ARG_ENABLE([gtkapp],
  78. AS_HELP_STRING([--enable-gtkapp],
  79. [Use in a tree where the only purpose is to build the gtk+ "app" that is supposed
  80. to work similarly to the iOS app, from the JavaScript and the pseudo WebSocket
  81. message plumbing point of view. See gtk/README.]))
  82. AC_ARG_ENABLE([androidapp],
  83. AS_HELP_STRING([--enable-androidapp],
  84. [Use in a tree where the only purpose is to build the Android app that is supposed
  85. to work similarly to the iOS app, from the JavaScript and the pseudo WebSocket
  86. message plumbing point of view.]))
  87. AC_ARG_WITH(android-package-name,
  88. AS_HELP_STRING([--with-android-package-name="org.libreoffice.androidapp"],
  89. [Set Android package name of the build.]),
  90. ,)
  91. AC_ARG_WITH(android-package-versioncode,
  92. AS_HELP_STRING([--with-android-package-versioncode=20],
  93. [Set the versionCode for the Android package.]),
  94. ,)
  95. AC_ARG_WITH([app-name],
  96. AS_HELP_STRING([--with-app-name=<name>],
  97. [Set the user-visible name of the app you build.]))
  98. AC_ARG_WITH([icon-theme],
  99. AS_HELP_STRING([--with-icon-theme=<path>],
  100. [Path to custom icon theme (similiar to loleflet/images).]))
  101. AC_ARG_WITH(vendor,
  102. AS_HELP_STRING([--with-vendor="John the Builder"],
  103. [Set vendor of the build.]),
  104. ,)
  105. AC_ARG_WITH(info-url,
  106. AS_HELP_STRING([--with-info-url="https://john-the-builder.org"],
  107. [Set the info url of the build.]),
  108. ,)
  109. AC_ARG_ENABLE([seccomp],
  110. AS_HELP_STRING([--disable-seccomp],
  111. [Disable use of linux/seccomp.h header when kernel on target system does not support it.
  112. Beware of the security consequences!]))
  113. AC_ARG_WITH([lokit-path],
  114. AS_HELP_STRING([--with-lokit-path=<path>],
  115. [Path to the "include" directory with the LibreOfficeKit headers]))
  116. AC_ARG_WITH([lo-path],
  117. AS_HELP_STRING([--with-lo-path=<path>],
  118. [Path to a working installation directory or instdir of LibreOffice]))
  119. AC_ARG_WITH([lo-builddir],
  120. AS_HELP_STRING([--with-lo-builddir=<path>],
  121. [Mandatory, and relevant, in a tree where building the iOS or Android app.
  122. Path to a the build directory of the LibreOffice core source tree you want to use.
  123. In case of macOS, you MUST manually edit the ios/Mobile.xcodeproj/project.pbxproj
  124. file and change the references to "../ios-device" to refer to the corresponding
  125. LibreOffice core source directory (which typically would be the same as the build
  126. directory you specify with this option).]))
  127. AC_ARG_WITH([logfile],
  128. AS_HELP_STRING([--with-logfile=<path>],
  129. [Path to the location of the logfile.]))
  130. AC_ARG_WITH([poco-includes],
  131. AS_HELP_STRING([--with-poco-includes=<path>],
  132. [Path to the "include" directory with the Poco headers]))
  133. AC_ARG_WITH([poco-libs],
  134. AS_HELP_STRING([--with-poco-libs=<path>],
  135. [Path to the "lib" directory with the Poco libraries]))
  136. AC_ARG_WITH([libpng-includes],
  137. AS_HELP_STRING([--with-libpng-includes=<path>],
  138. [Path to the "include" directory with the libpng headers]))
  139. AC_ARG_WITH([libpng-libs],
  140. AS_HELP_STRING([--with-libpng-libs=<path>],
  141. [Path to the "lib" directory with the libpng libraries]))
  142. AC_ARG_WITH([cppunit-includes],
  143. AS_HELP_STRING([--with-cppunit-includes=<path>],
  144. [Path to the "include" directory with the Cppunit headers]))
  145. AC_ARG_WITH([cppunit-libs],
  146. AS_HELP_STRING([--with-cppunit-libs=<path>],
  147. [Path to the "lib" directory with the Cppunit libraries]))
  148. AC_ARG_ENABLE([ssl],
  149. AS_HELP_STRING([--disable-ssl],
  150. [Compile without SSL support]))
  151. AC_ARG_WITH([support-public-key],
  152. AS_HELP_STRING([--with-support-public-key=<public-key-name.pub>],
  153. [Implements signed key with expiration required for support. Targeted at LibreOffice Online Service Providers.]))
  154. AC_ARG_WITH([max-connections],
  155. AS_HELP_STRING([--with-max-connections],
  156. [Set the limit on the total number of client connections. Def: 20, Min: 3.]))
  157. AC_ARG_WITH([max-documents],
  158. AS_HELP_STRING([--with-max-documents],
  159. [Set the limit on the total number of documents. Def: 10, Min: 2.]))
  160. AC_ARG_WITH([sanitizer],
  161. AS_HELP_STRING([--with-sanitizer],
  162. [Enable one or more compatible sanitizers. E.g. --with-sanitizer=address,undefined,leak]))
  163. AC_ARG_WITH([compiler-plugins],
  164. AS_HELP_STRING([--with-compiler-plugins=<path>],
  165. [Experimental! Unlikely to work for anyone except Noel! Enable compiler plugins that will perform additional checks during
  166. building.]))
  167. AC_ARG_ENABLE([setcap],
  168. AS_HELP_STRING([--disable-setcap],
  169. [Do not set capabilities on files. For packaging builds]))
  170. AC_ARG_ENABLE([werror],
  171. AS_HELP_STRING([--disable-werror],
  172. [Do not turn warnings into errors.]))
  173. AC_ARG_ENABLE([vereign],
  174. AS_HELP_STRING([--enable-vereign],
  175. [Set Vereign document_signing_url configuration key to the default app.vereign.com.]))
  176. # Handle options
  177. AS_IF([test "$enable_debug" = yes -a -n "$with_poco_libs"],
  178. [POCO_DEBUG_SUFFIX=d],
  179. [POCO_DEBUG_SUFFIX=])
  180. ENABLE_DEBUG=
  181. LOOLWSD_LOGLEVEL="warning"
  182. LOOLWSD_LOG_TO_FILE="false"
  183. LOOLWSD_LOGFILE="/var/log/loolwsd.log"
  184. LOOLWSD_ANONYMIZE_USER_DATA=false
  185. LOLEAFLET_LOGGING="false"
  186. debug_msg="secure mode: product build"
  187. anonym_msg=""
  188. if test "$enable_debug" = "yes"; then
  189. AC_DEFINE([ENABLE_DEBUG],1,[Whether to compile in some extra debugging support code and disable some security pieces])
  190. ENABLE_DEBUG=true
  191. LOOLWSD_LOGLEVEL="trace"
  192. LOOLWSD_LOG_TO_FILE="true"
  193. LOOLWSD_LOGFILE="/tmp/loolwsd.log"
  194. LOOLWSD_ANONYMIZE_USER_DATA=false
  195. LOLEAFLET_LOGGING="true"
  196. debug_msg="low security debugging mode"
  197. else
  198. AC_DEFINE([ENABLE_DEBUG],0,[Whether to compile in some extra debugging support code and disable some security pieces])
  199. fi
  200. AC_SUBST(ENABLE_DEBUG)
  201. AC_SUBST(LOOLWSD_LOGLEVEL)
  202. AC_SUBST(LOOLWSD_LOG_TO_FILE)
  203. AC_SUBST(LOLEAFLET_LOGGING)
  204. ENABLE_BROWSERSYNC=
  205. browsersync_msg="disabled: copy files to the target directory"
  206. if test "$enable_browsersync" = "yes"; then
  207. AC_DEFINE([ENABLE_BROWSERSYNC],1,[Whether to create symlinks instead of copying files to the target dorectory to run browsersync])
  208. ENABLE_BROWSERSYNC=true
  209. browsersync_msg="enabled: create symlinks in the target directory"
  210. else
  211. AC_DEFINE([ENABLE_BROWSERSYNC],0,[Whether to create symlinks instead of copying files to the target dorectory to run browsersync])
  212. fi
  213. AC_SUBST(ENABLE_BROWSERSYNC)
  214. if test -n "$with_logfile" ; then
  215. LOOLWSD_LOGFILE="$with_logfile"
  216. fi
  217. AC_SUBST(LOOLWSD_LOGFILE)
  218. if test "$enable_anonymization" = "yes" ; then
  219. LOOLWSD_ANONYMIZE_USER_DATA=true
  220. anonym_msg="anonymization of user-data is enabled"
  221. fi
  222. AC_DEFINE_UNQUOTED([LOOLWSD_ANONYMIZE_USER_DATA],[$LOOLWSD_ANONYMIZE_USER_DATA],[Enable permanent anonymization in logs])
  223. AC_SUBST(LOOLWSD_ANONYMIZE_USER_DATA)
  224. if test -z "$anonym_msg"; then
  225. anonym_msg="anonymization of user-data is disabled"
  226. fi
  227. # macOS: When configuring for building the app itself, on macOS, we need these.
  228. # But not when just configuring for building the JS on Linux, for copying over
  229. # to the Mac.
  230. # Android: We need these to setup the CMakeLists.txt properly.
  231. LOBUILDDIR=
  232. POCOINCLUDE=
  233. POCOLIB=
  234. POCODEBUG=
  235. if test \( "$enable_iosapp" = "yes" -a `uname -s` = "Darwin" \) -o \( "$enable_androidapp" = "yes" \); then
  236. AC_MSG_CHECKING([for LibreOffice build tree to build against])
  237. if test -z "$with_lo_builddir"; then
  238. AC_MSG_ERROR([You MUST use the --with-lo-builddir option when configuring the mobile app build tree.])
  239. fi
  240. LOBUILDDIR="$with_lo_builddir"
  241. # Sanity check, just a random object file in the LibreOffice build tree
  242. if test \( "$enable_iosapp" = "yes" -a -f "$LOBUILDDIR/workdir/CxxObject/vcl/ios/iosinst.o" \) -o \( "$enable_androidapp" = "yes" -a -f "$LOBUILDDIR/workdir/LinkTarget/StaticLibrary/liblibpng.a" \); then
  243. AC_MSG_RESULT([$LOBUILDDIR])
  244. else
  245. AC_MSG_ERROR([This is not a LibreOffice core build directory: $LOBUILDDIR])
  246. fi
  247. AC_MSG_CHECKING([for Poco include directory to build against])
  248. if test -z "$with_poco_includes"; then
  249. AC_MSG_ERROR([You MUST use the --with-poco-includes option when configuring the mobile app build tree.])
  250. fi
  251. POCOINCLUDE="$with_poco_includes"
  252. # Sanity check
  253. if test -f "$POCOINCLUDE/Poco/Poco.h"; then
  254. AC_MSG_RESULT([$POCOINCLUDE])
  255. else
  256. AC_MSG_ERROR([This is not a Poco include directory: $POCOINCLUDE])
  257. fi
  258. AC_MSG_CHECKING([for Poco lib directory to build against])
  259. if test -z "$with_poco_libs"; then
  260. AC_MSG_ERROR([You MUST use the --with-poco-libs option when configuring the mobile app build tree.])
  261. fi
  262. POCOLIB="$with_poco_libs"
  263. # Sanity check
  264. if test -f "$POCOLIB/libPocoFoundation.a"; then
  265. AC_MSG_RESULT([$POCOLIB])
  266. else
  267. AC_MSG_ERROR([This is not a Poco lib directory: $POCOLIB])
  268. fi
  269. if test "$ENABLE_DEBUG" = "true" ; then
  270. POCODEBUG=d
  271. fi
  272. fi
  273. AC_SUBST(LOBUILDDIR)
  274. AC_SUBST(POCOINCLUDE)
  275. AC_SUBST(POCOLIB)
  276. AC_SUBST(POCODEBUG)
  277. LIBPNG_INCLUDES="$with_libpng_includes"
  278. LIBPNG_LIBS="$with_libpng_libs"
  279. LOKIT_PATH=`readlink -f $with_lokit_path`
  280. if test "$enable_androidapp" = "yes"; then
  281. if test -z "$LIBPNG_INCLUDES" ; then
  282. LIBPNG_INCLUDES="$LOBUILDDIR/workdir/UnpackedTarball/libpng"
  283. fi
  284. if test -z "$LIBPNG_LIBS" ; then
  285. LIBPNG_LIBS="$LOBUILDDIR/workdir/LinkTarget/StaticLibrary"
  286. fi
  287. if test -z "$LOKIT_PATH" ; then
  288. LOKIT_PATH=`readlink -f $LOBUILDDIR/include`
  289. fi
  290. fi
  291. AC_SUBST(LIBPNG_INCLUDES)
  292. AC_SUBST(LIBPNG_LIBS)
  293. AC_SUBST(LOKIT_PATH)
  294. ENABLE_ANDROIDAPP=
  295. ANDROID_PACKAGE_NAME=
  296. ANDROID_PACKAGE_VERSIONCODE=
  297. if test "$enable_androidapp" = "yes"; then
  298. ENABLE_ANDROIDAPP=true
  299. AC_MSG_CHECKING([for Android package name])
  300. if test -z "$with_android_package_name" -o "$with_android_package_name" = "no"; then
  301. ANDROID_PACKAGE_NAME="org.libreoffice.androidapp"
  302. AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_NAME])
  303. else
  304. ANDROID_PACKAGE_NAME="$with_android_package_name"
  305. AC_MSG_RESULT([$ANDROID_PACKAGE_NAME])
  306. fi
  307. AC_MSG_CHECKING([for Android package versionCode])
  308. if test -z "$with_android_package_versioncode" -o "$with_android_package_versioncode" = "no"; then
  309. ANDROID_PACKAGE_VERSIONCODE="1"
  310. AC_MSG_RESULT([not set, using $ANDROID_PACKAGE_VERSIONCODE])
  311. else
  312. ANDROID_PACKAGE_VERSIONCODE="$with_android_package_versioncode"
  313. AC_MSG_RESULT([$ANDROID_PACKAGE_VERSIONCODE])
  314. fi
  315. fi
  316. AC_SUBST(ENABLE_ANDROIDAPP)
  317. AM_CONDITIONAL([ENABLE_ANDROIDAPP], [test "$ENABLE_ANDROIDAPP" = "true"])
  318. AC_SUBST(ANDROID_PACKAGE_NAME)
  319. AC_SUBST(ANDROID_PACKAGE_VERSIONCODE)
  320. APP_NAME="LOOL"
  321. if test -n "$with_app_name"; then
  322. APP_NAME="$with_app_name"
  323. fi
  324. AC_DEFINE_UNQUOTED([APP_NAME],["$APP_NAME"],[The user-visible name of the app you build.])
  325. AC_SUBST(APP_NAME)
  326. VENDOR=
  327. AC_MSG_CHECKING([for vendor])
  328. if test -z "$with_vendor" -o "$with_vendor" = "no"; then
  329. VENDOR="$USERNAME"
  330. if test -z "$VENDOR"; then
  331. VENDOR="$USER"
  332. fi
  333. if test -z "$VENDOR"; then
  334. VENDOR="`id -u -n`"
  335. fi
  336. AC_MSG_RESULT([not set, using $VENDOR])
  337. else
  338. VENDOR="$with_vendor"
  339. AC_MSG_RESULT([$VENDOR])
  340. fi
  341. AC_SUBST(VENDOR)
  342. INFO_URL='https://www.libreoffice.org'
  343. if test -n "$with_info_url" -a "$with_info_url" != "no"; then
  344. INFO_URL="$with_info_url"
  345. fi
  346. AC_SUBST(INFO_URL)
  347. ENABLE_IOSAPP=
  348. IOSAPP_BUNDLE_VERSION=
  349. if test "$enable_iosapp" = "yes"; then
  350. ENABLE_IOSAPP=true
  351. if test -f BUNDLE-VERSION; then
  352. IOSAPP_BUNDLE_VERSION=$(cat BUNDLE-VERSION)
  353. else
  354. IOSAPP_BUNDLE_VERSION=1
  355. fi
  356. echo $IOSAPP_BUNDLE_VERSION >BUNDLE-VERSION
  357. fi
  358. AC_SUBST(ENABLE_IOSAPP)
  359. AM_CONDITIONAL([ENABLE_IOSAPP], [test "$ENABLE_IOSAPP" = "true"])
  360. AC_SUBST(IOSAPP_BUNDLE_VERSION)
  361. AC_MSG_CHECKING([for custom icon theme])
  362. CUSTOM_ICONS_DIRECTORY=
  363. if test -d "$with_icon_theme"; then
  364. CUSTOM_ICONS_DIRECTORY=`readlink -f $with_icon_theme`
  365. AC_MSG_RESULT([$CUSTOM_ICONS_DIRECTORY])
  366. else
  367. AC_MSG_RESULT([no])
  368. fi
  369. AC_SUBST(CUSTOM_ICONS_DIRECTORY)
  370. ENABLE_GTKAPP=
  371. if test "$enable_gtkapp" = "yes"; then
  372. ENABLE_GTKAPP=true
  373. fi
  374. AC_SUBST(ENABLE_GTKAPP)
  375. AM_CONDITIONAL([ENABLE_GTKAPP], [test "$ENABLE_GTKAPP" = "true"])
  376. MAX_CONNECTIONS=20
  377. AS_IF([test -n "$with_max_connections" && test "$with_max_connections" -gt "0"],
  378. [MAX_CONNECTIONS="$with_max_connections"])
  379. AS_IF([test "$MAX_CONNECTIONS" -lt "3"],
  380. [MAX_CONNECTIONS="3"])
  381. AC_DEFINE_UNQUOTED([MAX_CONNECTIONS],[$MAX_CONNECTIONS],[Limit the maximum number of open connections])
  382. AC_SUBST(MAX_CONNECTIONS)
  383. MAX_DOCUMENTS=10
  384. AS_IF([test -n "$with_max_documents" && test "$with_max_documents" -gt "0"],
  385. [MAX_DOCUMENTS="$with_max_documents"])
  386. AS_IF([test "$MAX_DOCUMENTS" -gt "$MAX_CONNECTIONS"],
  387. [MAX_DOCUMENTS="$MAX_CONNECTIONS"])
  388. AS_IF([test "$MAX_DOCUMENTS" -lt "2"],
  389. [MAX_DOCUMENTS="2"])
  390. AC_DEFINE_UNQUOTED([MAX_DOCUMENTS],[$MAX_DOCUMENTS],[Limit the maximum number of open documents])
  391. AC_SUBST(MAX_DOCUMENTS)
  392. VEREIGN_URL=
  393. if test "$enable_vereign" = "yes"; then
  394. VEREIGN_URL="https://app.vereign.com"
  395. fi
  396. AC_DEFINE_UNQUOTED([VEREIGN_URL],["$VEREIGN_URL"],[Default value of per_documents.document_signing_url])
  397. AC_SUBST(VEREIGN_URL)
  398. # Test for build environment
  399. AS_IF([test "$ENABLE_GTKAPP" != true],
  400. [CXXFLAGS="$CXXFLAGS -std=c++11"
  401. CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wshadow"])
  402. CFLAGS="$CFLAGS -Wall -Wextra"
  403. AC_MSG_CHECKING([whether to turn warnings to errors])
  404. if test -z "$enable_werror" -o "$enable_werror" = "yes"; then
  405. AC_MSG_RESULT([yes])
  406. CXXFLAGS="$CXXFLAGS -Werror"
  407. CFLAGS="$CFLAGS -Werror"
  408. else
  409. AC_MSG_RESULT([no])
  410. fi
  411. AC_MSG_CHECKING([whether to turn sanitizers on])
  412. if test "x$with_sanitizer" != "x"; then
  413. AC_MSG_RESULT([yes ($with_sanitizer)])
  414. SANITIZER_FLAGS="-O1 -fno-omit-frame-pointer -fsanitize=$with_sanitizer -frtti -static-libasan"
  415. CXXFLAGS="$CXXFLAGS $SANITIZER_FLAGS"
  416. CFLAGS="$CFLAGS $SANITIZER_FLAGS"
  417. else
  418. AC_MSG_RESULT([no])
  419. fi
  420. # check for C++11 support
  421. HAVE_CXX11=
  422. AC_MSG_CHECKING([whether $CXX supports C++17, C++14 or C++11])
  423. for flag in -std=c++17 -std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x ; do
  424. save_CXXFLAGS=$CXXFLAGS
  425. CXXFLAGS="$CXXFLAGS $flag -Werror"
  426. AC_LANG_PUSH([C++])
  427. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  428. #include <algorithm>
  429. #include <functional>
  430. #include <vector>
  431. void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
  432. std::sort(v.begin(), v.end(), fn);
  433. }
  434. ]])],[CXXFLAGS_CXX11=$flag])
  435. AC_LANG_POP([C++])
  436. CXXFLAGS=$save_CXXFLAGS
  437. if test -n "$CXXFLAGS_CXX11"; then
  438. HAVE_CXX11=TRUE
  439. break
  440. fi
  441. done
  442. if test "$HAVE_CXX11" = TRUE; then
  443. AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
  444. else
  445. AC_MSG_ERROR(no)
  446. fi
  447. STD_FILESYSTEM=
  448. if test "$CXXFLAGS_CXX11" = "-std=c++17" -a "$ENABLE_ANDROIDAPP" != "true" ; then
  449. save_CXXFLAGS=$CXXFLAGS
  450. CXXFLAGS="$CXXFLAGS -Werror"
  451. save_LIBS=$LIBS
  452. LIBS="$save_LIBS -lstdc++fs"
  453. AC_LANG_PUSH([C++])
  454. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  455. #include <experimental/filesystem>
  456. int main()
  457. {
  458. if (!std::experimental::filesystem::temp_directory_path().empty())
  459. return 0;
  460. return 1;
  461. }
  462. ]])],[STD_FILESYSTEM=experimental])
  463. AC_LINK_IFELSE([AC_LANG_SOURCE([[
  464. #include <filesystem>
  465. int main()
  466. {
  467. if (!std::filesystem::temp_directory_path().empty())
  468. return 0;
  469. return 1;
  470. }
  471. ]])],[STD_FILESYSTEM=TRUE])
  472. AC_LANG_POP([C++])
  473. CXXFLAGS=$save_CXXFLAGS
  474. LIBS=$save_LIBS
  475. fi
  476. if test -n "$STD_FILESYSTEM" ; then
  477. LIBS="$LIBS -lstdc++fs"
  478. AC_DEFINE([HAVE_STD_FILESYSTEM],1,[Whether the used C++ has support for std::filesystem.])
  479. if test "$STD_FILESYSTEM" = "experimental" ; then
  480. AC_DEFINE([HAVE_STD_FILESYSTEM_EXPERIMENTAL],1,[Whether the std::filesystem is in the experimental header.])
  481. else
  482. AC_DEFINE([HAVE_STD_FILESYSTEM_EXPERIMENTAL],0,[Whether the std::filesystem is in the experimental header.])
  483. fi
  484. else
  485. AC_DEFINE([HAVE_STD_FILESYSTEM],0,[Whether the used C++ has support for std::filesystem.])
  486. AC_DEFINE([HAVE_STD_FILESYSTEM_EXPERIMENTAL],0,[Whether the std::filesystem is in the experimental header.])
  487. fi
  488. AS_IF([test -n "$LOKIT_PATH"],
  489. [CPPFLAGS="$CPPFLAGS -I${LOKIT_PATH}"])
  490. lokit_msg="$LOKIT_PATH"
  491. AS_IF([test "$ENABLE_IOSAPP" != "true" -a "$ENABLE_ANDROIDAPP" != "true"],
  492. [AC_MSG_CHECKING([for LibreOffice path])
  493. if test -n "$with_lo_path"; then
  494. # strip trailing '/' from LO_PATH, 'ln -s' with such path will otherwise fail
  495. LO_PATH="${with_lo_path%/}"
  496. AC_MSG_RESULT([found])
  497. else
  498. AC_MSG_RESULT([not found])
  499. AC_MSG_ERROR([LibreOffice path must be configured: --with-lo-path])
  500. fi
  501. ])
  502. JAIL_PATH=not-set
  503. SYSTEMPLATE_PATH=not-set
  504. have_lo_path=false
  505. AC_MSG_CHECKING([whether to run tests against a LibreOffice])
  506. version_file="$with_lo_path/program/versionrc"
  507. if test -f $version_file; then
  508. JAILS_PATH="\${abs_top_builddir}/jails"
  509. SYSTEMPLATE_PATH="\${abs_top_builddir}/systemplate"
  510. have_lo_path=true
  511. lo_msg="test against $LO_PATH"
  512. AC_MSG_RESULT([yes])
  513. else
  514. lo_msg="no integration tests"
  515. AC_MSG_RESULT([no])
  516. fi
  517. AC_SUBST(LO_PATH)
  518. AC_DEFINE_UNQUOTED([LO_PATH],["$LO_PATH"],[Path to LibreOffice installation])
  519. AC_SUBST(JAILS_PATH)
  520. AC_SUBST(SYSTEMPLATE_PATH)
  521. AM_CONDITIONAL(HAVE_LO_PATH,[test "$have_lo_path" = "true"])
  522. AS_IF([test -n "$with_poco_includes"],
  523. [CPPFLAGS="$CPPFLAGS -isystem ${with_poco_includes}"])
  524. AS_IF([test -n "$with_poco_libs"],
  525. [LDFLAGS="$LDFLAGS -L${with_poco_libs}"])
  526. AS_IF([test -n "$LIBPNG_INCLUDES"],
  527. [CPPFLAGS="$CPPFLAGS -isystem ${LIBPNG_INCLUDES}"])
  528. AS_IF([test -n "$LIBPNG_LIBS"],
  529. [LDFLAGS="$LDFLAGS -L${LIBPNG_LIBS}"])
  530. AS_IF([test -n "$with_cppunit_includes"],
  531. [CPPFLAGS="$CPPFLAGS -isystem ${with_cppunit_includes}"])
  532. AS_IF([test -n "$with_cppunit_libs"],
  533. [LDFLAGS="$LDFLAGS -L${with_cppunit_libs}"])
  534. AS_IF([test `uname -s` = Linux],
  535. [AS_IF([test -n "$with_poco_libs"],
  536. [LDFLAGS="$LDFLAGS -Wl,-rpath,${with_poco_libs}"])])
  537. AS_IF([test `uname -s` = Linux],
  538. [AS_IF([test -n "$with_cppunit_libs"],
  539. [LDFLAGS="$LDFLAGS -Wl,-rpath,${with_cppunit_libs}"])])
  540. AS_IF([test `uname -s` != Darwin],
  541. [AC_SEARCH_LIBS([dlopen],
  542. [dl dld],
  543. [],
  544. [AC_MSG_ERROR([dlopen not found])])])
  545. AS_IF([test "$ENABLE_IOSAPP" != "true" -a "$ENABLE_ANDROIDAPP" != "true"],
  546. [AC_SEARCH_LIBS([png_create_write_struct],
  547. [png],
  548. [],
  549. [AC_MSG_ERROR([libpng not available?])])
  550. PKG_CHECK_MODULES([ZLIB], [zlib])
  551. PKG_CHECK_MODULES([CPPUNIT], [cppunit])
  552. ])
  553. AS_IF([test `uname -s` = Linux -a "$ENABLE_ANDROIDAPP" != "true"],
  554. [AC_SEARCH_LIBS([cap_get_proc],
  555. [cap],
  556. [],
  557. [AC_MSG_ERROR([libcap not available?])])])
  558. AS_IF([test "$ENABLE_GTKAPP" = true],
  559. [PKG_CHECK_MODULES([WEBKIT],[webkit2gtk-4.0])])
  560. AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "true"])
  561. AM_CONDITIONAL([ENABLE_BROWSERSYNC], [test "$ENABLE_BROWSERSYNC" = "true"])
  562. mobile_app=
  563. ENABLE_MOBILEAPP=
  564. MOBILEAPP=0
  565. AC_MSG_CHECKING([Is this a mobile app])
  566. if test "$enable_gtkapp" = "yes" -o "$enable_iosapp" = "yes" -o "$enable_androidapp"; then
  567. AC_MSG_RESULT([Yes])
  568. mobile_app=true;
  569. MOBILEAPP=1
  570. ENABLE_MOBILEAPP=true
  571. else
  572. AC_MSG_RESULT([No])
  573. fi
  574. AC_DEFINE_UNQUOTED([MOBILEAPP],[$MOBILEAPP],[Define to 1 if this is a mobileapp (eg. Android) build.])
  575. AC_SUBST(ENABLE_MOBILEAPP)
  576. AM_CONDITIONAL([ENABLE_MOBILEAPP], [test "$ENABLE_MOBILEAPP" = "true"])
  577. ENABLE_SSL=true
  578. if test "$enable_ssl" != "no" -a "$mobile_app" != "true"; then
  579. ssl_msg="ssl enabled"
  580. ENABLE_SSL=true
  581. AC_DEFINE([ENABLE_SSL],1,[Whether to enable SSL])
  582. else
  583. ssl_msg="insecure: ssl disabled"
  584. ENABLE_SSL=false
  585. AC_DEFINE([ENABLE_SSL],0,[Whether to enable SSL])
  586. fi
  587. AM_CONDITIONAL([ENABLE_SSL], [$ENABLE_SSL])
  588. AC_SUBST(ENABLE_SSL)
  589. AS_IF([test "$ENABLE_ANDROIDAPP" != "true"],
  590. [AC_CHECK_HEADERS([security/pam_appl.h],
  591. [],
  592. [AC_MSG_ERROR([header security/pam_appl.h not found, install PAM development package])])
  593. AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([No. Install PAM development package])])])
  594. AC_MSG_CHECKING([whether to build with support public key])
  595. if test "x$with_support_public_key" != "x"; then
  596. AC_DEFINE([ENABLE_SUPPORT_KEY],1,[Whether to enable support key])
  597. # generate the public key include
  598. echo -e "#ifndef INCLUDED_SUPPORT_PUBLIC_KEY_HPP\n#define INCLUDED_SUPPORT_PUBLIC_KEY_HPP\n#include <string>\nconst static std::string SUPPORT_PUBLIC_KEY(" > "${srcdir}/common/support-public-key.hpp"
  599. sed 's/\(.*\)/"\1\\n"/' "$with_support_public_key" >> "${srcdir}/common/support-public-key.hpp"
  600. echo -e ");\n#endif" >> "${srcdir}/common/support-public-key.hpp"
  601. AC_MSG_RESULT([yes])
  602. else
  603. AC_DEFINE([ENABLE_SUPPORT_KEY],0,[Whether to enable support key])
  604. rm -f "${srcdir}/common/support-public-key.hpp"
  605. AC_MSG_RESULT([no])
  606. fi
  607. AC_SUBST(ENABLE_SUPPORT_KEY)
  608. LIBS="$LIBS -lPocoNet${POCO_DEBUG_SUFFIX} -lPocoNetSSL${POCO_DEBUG_SUFFIX} -lPocoUtil${POCO_DEBUG_SUFFIX} -lPocoJSON${POCO_DEBUG_SUFFIX} -lPocoXML${POCO_DEBUG_SUFFIX} -lPocoFoundation${POCO_DEBUG_SUFFIX} -lPocoCrypto${POCO_DEBUG_SUFFIX}"
  609. AS_IF([test "$ENABLE_SSL" = "true"],
  610. [LIBS="$LIBS -lssl -lcrypto"])
  611. AS_IF([test "$ENABLE_IOSAPP" != "true"],
  612. [AC_CHECK_HEADERS([LibreOfficeKit/LibreOfficeKit.h],
  613. [],
  614. [AC_MSG_ERROR([header LibreOfficeKit/LibreOfficeKit.h not found, perhaps you want to use --with-lokit-path])])
  615. AC_CHECK_HEADERS([Poco/Net/WebSocket.h],
  616. [],
  617. [AC_MSG_ERROR([header Poco/Net/WebSocket.h not found, perhaps you want to use --with-poco-includes])])
  618. DISABLE_SECCOMP=
  619. if test "$enable_seccomp" != "no"; then
  620. AC_CHECK_HEADERS([linux/seccomp.h],
  621. [],
  622. [AC_MSG_ERROR([critical security header linux/seccomp.h not found. If kernel on target system does not support SECCOMP, you can use --disable-seccomp, but mind the security consequences.])])
  623. AC_DEFINE([DISABLE_SECCOMP],0,[Whether to disable SECCOMP])
  624. else
  625. AC_DEFINE([DISABLE_SECCOMP],1,[Whether to disable SECCOMP])
  626. fi
  627. AC_MSG_CHECKING([Whether OpenSSL has PKCS5_PBKDF2_HMAC()])
  628. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  629. #include <openssl/opensslv.h>
  630. #if OPENSSL_VERSION_NUMBER < 0x10001000L
  631. #error PKCS5_PBKDF2_HMAC() is in OpenSSL 1.0.1 or newer
  632. #endif
  633. ])],
  634. [AC_MSG_RESULT([yes])
  635. AC_DEFINE([HAVE_PKCS5_PBKDF2_HMAC],1,[whether OpenSSL has PKCS5_PBKDF2_HMAC()])],
  636. [AC_MSG_RESULT([no])
  637. AC_MSG_WARN([OpenSSL is too old. Secure password storage for Admin Console is not supported.])
  638. AC_DEFINE([HAVE_PKCS5_PBKDF2_HMAC],0,[Whether OpenSSL has PKCS5_PBKDF2_HMAC()])])
  639. AC_MSG_CHECKING([POCO version])
  640. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  641. #include <Poco/Version.h>
  642. #if POCO_VERSION < 0x01070100
  643. #error Require Poco 1.7.1 or newer
  644. #endif
  645. ])],
  646. [AC_MSG_RESULT([OK])],
  647. [AC_MSG_ERROR([The POCO version is too old])])
  648. # If poco is built with --unbundled, it uses the system pcre library
  649. AC_MSG_CHECKING([If we need to link with -lpcre])
  650. AC_LINK_IFELSE([AC_LANG_SOURCE([
  651. #include <Poco/RegularExpression.h>
  652. int main(int argc, char **argv)
  653. {
  654. (void)argc;
  655. Poco::RegularExpression e("abc.[def]");
  656. Poco::RegularExpression::Match m;
  657. return e.match(argv[[1]], m);
  658. }
  659. ])],
  660. [AC_MSG_RESULT([No])],
  661. [AC_MSG_RESULT([Yes])
  662. LIBS="$LIBS -lpcre"])
  663. ])
  664. AS_IF([test `uname -s` = "Linux"],
  665. # We need npm and node only on Linux, both in the normal Online case,
  666. # and when only building JS for the iOS app. When building the iOS app itself on macOS,
  667. # don't do this.
  668. [AC_PATH_PROG(NPM, npm, no)
  669. if test "$NPM" = "no"; then
  670. AC_MSG_ERROR([npm required to build loleaflet, but not installed])
  671. else
  672. NPM_VER=`npm -v | awk -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
  673. if test "$NPM_VER" -lt 50000; then
  674. AC_MSG_ERROR([This npm version is too old, upgrade to >= 5.0.0])
  675. fi
  676. fi
  677. AC_PATH_PROG(NODE, node, no)
  678. if test "$NODE" = "no"; then
  679. AC_MSG_ERROR([node required to build loleaflet, but not installed])
  680. else
  681. NODE_VER=`node --version | sed 's/^v//' | awk -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
  682. if test "$NODE_VER" -lt 60000; then
  683. AC_MSG_ERROR([This node version is old, upgrade to >= 6.0.0])
  684. fi
  685. fi
  686. ])
  687. # need this after the other stuff that uses the compiler because we don't want to run configure-tests with the plugins enabled
  688. AS_IF([test -n "$with_compiler_plugins"],
  689. [CPPFLAGS="$CPPFLAGS -Xclang -load -Xclang ${with_compiler_plugins}/compilerplugins/obj/plugin.so -Xclang -add-plugin -Xclang loplugin -Xclang -plugin-arg-loplugin -Xclang --lool-base-path=\${abs_top_srcdir}"])
  690. LOOLWSD_CONFIGDIR=${sysconfdir}/${PACKAGE}
  691. AC_SUBST(LOOLWSD_CONFIGDIR)
  692. LOOLWSD_DATADIR=${datadir}/${PACKAGE}
  693. AC_SUBST(LOOLWSD_DATADIR)
  694. AS_IF([test "$enable_setcap" != "no"],
  695. [AC_DEFINE([ENABLE_SETCAP],1,[Whether to enable setting of capabilities])],
  696. [AC_DEFINE([ENABLE_SETCAP],0,[Whether to enable setting of capabilities])])
  697. AM_CONDITIONAL([ENABLE_SETCAP], [test "$enable_setcap" != "no"])
  698. ENABLE_SETCAP=
  699. if test "$enable_setcap" != "no"; then
  700. ENABLE_SETCAP=true
  701. setcap_msg="setcap enabled"
  702. else
  703. setcap_msg="setcap disabled"
  704. fi
  705. AC_SUBST(ENABLE_SETCAP)
  706. AC_CONFIG_LINKS([discovery.xml:discovery.xml])
  707. AC_CONFIG_LINKS([loolkitconfig.xcu:loolkitconfig.xcu])
  708. AC_CONFIG_LINKS([loleaflet/package.json:loleaflet/package.json])
  709. AC_LINK_FILES([loleaflet/archived-packages], [loleaflet/archived-packages])
  710. APP_BRANDING_DIR=
  711. if test "$with_app_branding" != no -a -d "$with_app_branding"; then
  712. APP_BRANDING_DIR="$with_app_branding"
  713. fi
  714. AC_SUBST(APP_BRANDING_DIR)
  715. AS_IF([test "$ENABLE_IOSAPP" = "true"],
  716. [
  717. if test `uname -s` = "Darwin"; then
  718. IOSAPP_FONTS=''
  719. mkdir -p ios/Mobile/Fonts
  720. if test "$with_iosapp_fonts" != no -a -d "$with_iosapp_fonts"; then
  721. AC_MSG_NOTICE([copying fonts to be bundled])
  722. IOSAPP_FONTS=`find "$with_iosapp_fonts" -type f |
  723. while read fname; do
  724. cp "$fname" ios/Mobile/Fonts
  725. echo '<string>Fonts/'$(basename $fname)'</string>'
  726. done`
  727. fi
  728. rm -rf ios/Mobile/Branding
  729. mkdir ios/Mobile/Branding
  730. if test -n "$APP_BRANDING_DIR" ; then
  731. AC_MSG_NOTICE([copying branding files])
  732. mkdir -p ios/Mobile/Branding
  733. (cd "$APP_BRANDING_DIR" && tar cf - .) | (cd ios/Mobile/Branding && tar xf -)
  734. else
  735. # A Branding/branding.css file must exist, it is
  736. # referenced unconditionally in loleaflet.html in the
  737. # iOS app.
  738. touch ios/Mobile/Branding/branding.css
  739. fi
  740. fi
  741. ])
  742. AC_SUBST(IOSAPP_FONTS)
  743. AC_CONFIG_FILES([Makefile
  744. android/app/appSettings.gradle
  745. android/lib/libSettings.gradle
  746. android/lib/src/main/cpp/CMakeLists.txt
  747. android/Makefile
  748. gtk/Makefile
  749. ios/config.h
  750. ios/Mobile/Info.plist
  751. test/Makefile
  752. loleaflet/Makefile
  753. loleaflet/npm-shrinkwrap.json
  754. loolwsd.spec
  755. loolwsd.xml
  756. debian/loolwsd.postinst])
  757. AC_CONFIG_FILES([test/run_unit.sh],[chmod +x test/run_unit.sh])
  758. AC_OUTPUT
  759. AC_LANG_POP
  760. AS_IF([test "$ENABLE_IOSAPP" = "true"],
  761. [
  762. if test `uname -s` = "Darwin"; then
  763. # Sadly I can't figure out any better way to avoid having to
  764. # edit the Xcode project file manually. Create symlinks to the
  765. # LibreOffice core source and build trees, and to the Poco
  766. # installation.
  767. AC_MSG_NOTICE([creating symbolic links for the Xcode project to use])
  768. if test -L lobuilddir-symlink; then
  769. rm -f lobuilddir-symlink
  770. elif test -f lobuilddir-symlink; then
  771. AC_MSG_ERROR([lobuilddir-symlink exists and is not a symbolic link])
  772. fi
  773. ln -s "$LOBUILDDIR" lobuilddir-symlink
  774. if test -L pocoinclude-symlink; then
  775. rm -f pocoinclude-symlink
  776. elif test -f pocoinclude-symlink; then
  777. AC_MSG_ERROR([pocoinclude-symlink exists and is not a symbolic link])
  778. fi
  779. ln -s "$POCOINCLUDE" pocoinclude-symlink
  780. if test -L pocolib-symlink; then
  781. rm -f pocolib-symlink
  782. elif test -f pocolib-symlink; then
  783. AC_MSG_ERROR([pocolib-symlink exists and is not a symbolic link])
  784. fi
  785. ln -s "$POCOLIB" pocolib-symlink
  786. eval `grep 'export ICU_MAJOR=' "$LOBUILDDIR/config_host.mk"`
  787. if test -L ICU.dat; then
  788. rm -f ICU.dat
  789. elif test -f ICU.dat; then
  790. AC_MSG_ERROR([ICU.dat exists and is not a symbolic link])
  791. fi
  792. ln -s "$LOBUILDDIR/workdir/CustomTarget/ios/resources/icudt${ICU_MAJOR}l.dat" ICU.dat
  793. # Sadly Xcode doesn't like it if AppIcon.appiconset is a
  794. # symlink, so make it a directory of symlinks to the actual png
  795. # and json files.
  796. rm -rf ios/Mobile/Assets.xcassets/AppIcon.appiconset
  797. mkdir ios/Mobile/Assets.xcassets/AppIcon.appiconset
  798. if test -n "$with_iosapp_appicon"; then
  799. ln -s "$with_iosapp_appicon"/* ios/Mobile/Assets.xcassets/AppIcon.appiconset
  800. else
  801. ln -s ios/Mobile/Assets.xcassets/Empty.appiconset/* ios/Mobile/Assets.xcassets/AppIcon.appiconset
  802. fi
  803. fi
  804. ],
  805. [
  806. echo "
  807. Configuration:
  808. LOKit path ${lokit_msg}
  809. LO path $LO_PATH
  810. LO integration tests ${lo_msg}
  811. SSL support $ssl_msg
  812. Debug & low security $debug_msg
  813. Anonymization $anonym_msg
  814. Set capabilities $setcap_msg
  815. Browsersync $browsersync_msg
  816. \$ make # to compile"
  817. if test -n "$with_lo_path"; then
  818. echo " \$ make run # to start loolwsd
  819. \$ make sync-writer|calc|impress # to start browsersync with specified app
  820. "
  821. fi
  822. ])
  823. dnl vim:set shiftwidth=4 softtabstop=4 expandtab: