PageRenderTime 118ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 2ms

/configure.ac

https://bitbucket.org/markjenkins/libreoffice_ubuntu-debian-fixes
m4 | 12315 lines | 10721 code | 1165 blank | 429 comment | 0 complexity | 9a417b8576e187db20823c6988e69605 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-3-Clause-No-Nuclear-License-2014
  1. dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
  2. dnl configure.ac serves as input for the GNU autoconf package
  3. dnl in order to create a configure script.
  4. AC_INIT([LibreOffice],[4.1],[],[],[http://documentfoundation.org/])
  5. AC_PREREQ([2.59])
  6. save_CC=$CC
  7. save_CXX=$CXX
  8. BUILD_TYPE="LibO"
  9. SCPDEFS=""
  10. GIT_NEEDED_SUBMODULES=""
  11. LO_PATH= # used by path_munge to construct a PATH variable
  12. PathFormat()
  13. {
  14. formatted_path="$1"
  15. if test "$build_os" = "cygwin"; then
  16. pf_part1=
  17. pf_conv_to_dos=
  18. for pf_part in $formatted_path; do
  19. if test -z "$pf_part1"; then
  20. pf_part1="$pf_part"
  21. else
  22. pf_conv_to_dos="yes"
  23. fi
  24. done
  25. if test "$pf_conv_to_dos" = "yes"; then
  26. formatted_path=`cygpath -d "$formatted_path"`
  27. if test $? -ne 0; then
  28. AC_MSG_ERROR([path conversion failed for "$1".])
  29. fi
  30. fi
  31. fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
  32. fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
  33. if test "$fp_count_slash$fp_count_colon" != "00"; then
  34. if test "$fp_count_colon" = "0"; then
  35. formatted_path=`realpath "$formatted_path"`
  36. if test $? -ne 0; then
  37. AC_MSG_ERROR([realpath failed for "$1".])
  38. fi
  39. fi
  40. formatted_path=`cygpath -m "$formatted_path"`
  41. if test $? -ne 0; then
  42. AC_MSG_ERROR([path conversion failed for "$1".])
  43. fi
  44. fi
  45. fi
  46. }
  47. cat /dev/null > warn
  48. have_WARNINGS="no"
  49. add_warning()
  50. {
  51. if test "$have_WARNINGS" = "no"; then
  52. echo "*************************************" >> warn
  53. have_WARNINGS="yes"
  54. if which tput >/dev/null 2>/dev/null && test `tput colors` -ge 8; then
  55. dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
  56. COLORWARN='*@<:@1;33;40m WARNING @<:@0m:'
  57. else
  58. COLORWARN="* WARNING :"
  59. fi
  60. fi
  61. echo "$COLORWARN $@" >> warn
  62. }
  63. if test -n "$SOLARENV"; then
  64. AC_MSG_ERROR([You have sourced config_host.mk in this shell. This may lead to trouble, please run in a fresh (login) shell.])
  65. fi
  66. echo "********************************************************************"
  67. echo "*"
  68. echo "* Running ${PACKAGE_NAME} build configuration."
  69. echo "*"
  70. echo "********************************************************************"
  71. echo ""
  72. dnl ===================================================================
  73. dnl checks build and host OSes
  74. dnl do this before argument processing to allow for platform dependent defaults
  75. dnl ===================================================================
  76. AC_CANONICAL_HOST
  77. AC_PROG_EGREP
  78. # AC_PROG_EGREP doesn't set GREP on all systems as well
  79. AC_PATH_PROG(GREP, grep)
  80. if test "$build_os" = "cygwin"; then
  81. EXEEXT_FOR_BUILD=.exe
  82. SRC_ROOT=`pwd`
  83. PathFormat "$SRC_ROOT"
  84. SRC_ROOT="$formatted_path"
  85. x_Cygwin=
  86. else
  87. EXEEXT_FOR_BUILD=
  88. SRC_ROOT=`pwd`
  89. x_Cygwin=[\#]
  90. fi
  91. AC_SUBST(SRC_ROOT)
  92. AC_SUBST(EXEEXT_FOR_BUILD)
  93. AC_SUBST(x_Cygwin)
  94. if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
  95. AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
  96. fi
  97. # need sed in os checks...
  98. AC_PATH_PROGS(SED, sed)
  99. if test -z "$SED"; then
  100. AC_MSG_ERROR([install sed to run this script])
  101. fi
  102. dnl ===================================================================
  103. dnl When building for Android the --with-android-ndk is mandatory
  104. dnl ===================================================================
  105. AC_ARG_WITH(android-ndk,
  106. AS_HELP_STRING([--with-android-ndk],
  107. [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
  108. ,)
  109. AC_ARG_WITH(android-ndk-toolchain-version,
  110. AS_HELP_STRING([--with-android-ndk-toolchain-version],
  111. [Specify which toolchain version to use, of those present in the
  112. Android NDK you are using. Mandatory if the NDK used has several
  113. toolchain versions for the host architecture you are building for.]), ,)
  114. AC_ARG_WITH(android-sdk,
  115. AS_HELP_STRING([--with-android-sdk],
  116. [Specify location of the Android SDK. Mandatory when building for Android.]),
  117. ,)
  118. ANDROID_NDK_HOME=
  119. if test -n "$with_android_ndk"; then
  120. ANDROID_NDK_HOME=$with_android_ndk
  121. # Set up a lot of pre-canned defaults
  122. if test $host_cpu = arm; then
  123. android_cpu=arm
  124. elif test $host_cpu = mips; then
  125. android_cpu=mips
  126. else
  127. # host_cpu is something like "i386" or "i686" I guess, NDK uses
  128. # "x86" in some contexts
  129. android_cpu=x86
  130. fi
  131. ANDROID_ABI_PREBUILT_BIN=`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*$with_android_ndk_toolchain_version/prebuilt/*/bin`
  132. # Check if there are several toolchain versions
  133. case "$ANDROID_ABI_PREBUILT_BIN" in
  134. */bin\ */bin*)
  135. AC_MSG_ERROR([Several toolchain versions in NDK, you must specify --with-android-ndk-toolchain-version])
  136. esac
  137. # This stays empty if there is just one version of the toolchain in the NDK
  138. ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR=
  139. case "`echo $ANDROID_NDK_HOME/toolchains/$android_cpu*-*/prebuilt/*/bin`" in
  140. */bin\ */bin*)
  141. # Trailing slash intentional and necessary, compare to how this is used
  142. ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR="${with_android_ndk_toolchain_version}/"
  143. ;;
  144. esac
  145. if test $host_cpu = arm; then
  146. android_gcc_prefix=arm-linux-androideabi
  147. elif test $host_cpu = mips; then
  148. android_gcc_prefix=mipsel-linux-android
  149. elif test -f $ANDROID_ABI_PREBUILT_BIN/i686-android-linux-gcc; then
  150. android_gcc_prefix=i686-android-linux
  151. elif test -f $ANDROID_ABI_PREBUILT_BIN/i686-linux-android-gcc; then
  152. android_gcc_prefix=i686-linux-android
  153. else
  154. AC_MSG_ERROR([Can't figure out the toolchain prefix])
  155. fi
  156. test -z "$SYSBASE" && export SYSBASE=$ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu
  157. test -z "$AR" && AR=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ar
  158. test -z "$NM" && NM=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-nm
  159. test -z "$OBJDUMP" && OBJDUMP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-objdump
  160. test -z "$RANLIB" && RANLIB=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-ranlib
  161. test -z "$STRIP" && STRIP=$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-strip
  162. if test $host_cpu = arm; then
  163. ANDROID_APP_ABI=armeabi-v7a
  164. ANDROIDCFLAGS="-march=armv7-a -mfloat-abi=softfp -mthumb -mfpu=neon -Wl,--fix-cortex-a8"
  165. elif test $host_cpu = mips; then
  166. ANDROID_APP_ABI=mips
  167. ANDROIDCFLAGS=""
  168. else # x86
  169. ANDROID_APP_ABI=x86
  170. ANDROIDCFLAGS="-march=atom"
  171. fi
  172. ANDROIDCFLAGS="$ANDROIDCFLAGS -ffunction-sections"
  173. ANDROIDCFLAGS="$ANDROIDCFLAGS -Wno-psabi --sysroot $ANDROID_NDK_HOME/platforms/android-9/arch-$android_cpu -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/$ANDROID_APP_ABI"
  174. # When using the 4.6 or newer toolchain, use the gold linker
  175. case "$with_android_ndk_toolchain_version" in
  176. 4.[[6789]]*|[[56789]].*)
  177. # The NDK doesn't have ld.gold for MIPS for some reason
  178. if test "$host_cpu" != mips; then
  179. ANDROIDCFLAGS="$ANDROIDCFLAGS -fuse-ld=gold"
  180. fi
  181. ;;
  182. esac
  183. # gdbserver can be in different locations
  184. if test -f $ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver; then
  185. ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/gdbserver
  186. elif test -f $ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver; then
  187. ANDROID_NDK_GDBSERVER=$ANDROID_NDK_HOME/prebuilt/android-$android_cpu/gdbserver/gdbserver
  188. else
  189. AC_MSG_ERROR([Can't find gdbserver for your Android target])
  190. fi
  191. if test $host_cpu = arm; then
  192. ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/armeabi-v7a/include"
  193. elif test $host_cpu = mips; then
  194. ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/mips/include"
  195. else # x86
  196. ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I $ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/${ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR}libs/x86/include"
  197. fi
  198. test -z "$CC" && CC="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-gcc $ANDROIDCFLAGS"
  199. test -z "$CXX" && CXX="$ANDROID_ABI_PREBUILT_BIN/$android_gcc_prefix-g++ $ANDROIDCXXFLAGS"
  200. fi
  201. AC_SUBST(ANDROID_NDK_HOME)
  202. AC_SUBST(ANDROID_NDK_TOOLCHAIN_VERSION_SUBDIR)
  203. AC_SUBST(ANDROID_NDK_GDBSERVER)
  204. AC_SUBST(ANDROID_APP_ABI)
  205. dnl ===================================================================
  206. dnl Also --with-android-sdk is mandatory
  207. dnl ===================================================================
  208. ANDROID_SDK_HOME=
  209. if test -n "$with_android_sdk"; then
  210. ANDROID_SDK_HOME=$with_android_sdk
  211. PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
  212. fi
  213. AC_SUBST(ANDROID_SDK_HOME)
  214. dnl ===================================================================
  215. dnl The following is a list of supported systems.
  216. dnl Sequential to keep the logic very simple
  217. dnl These values may be checked and reset later.
  218. dnl ===================================================================
  219. #defaults unless the os test overrides this:
  220. test_randr=yes
  221. test_xrender=yes
  222. test_cups=yes
  223. test_dbus=yes
  224. test_fontconfig=yes
  225. test_cairo=no
  226. # Default values, as such probably valid just for Linux, set
  227. # differently below just for Mac OSX,but at least better than
  228. # hardcoding these as we used to do. Much of this is duplicated also
  229. # in solenv for old build system and for gbuild, ideally we should
  230. # perhaps define stuff like this only here in configure.ac?
  231. LINKFLAGSSHL="-shared"
  232. PICSWITCH="-fpic"
  233. DLLPOST=".so"
  234. LINKFLAGSNOUNDEFS="-Wl,-z,defs"
  235. case "$host_os" in
  236. solaris*)
  237. test_gtk=yes
  238. build_gstreamer=yes
  239. build_gstreamer_0_10=yes
  240. test_tde=yes
  241. test_kde=yes
  242. test_freetype=yes
  243. test_gstreamer=yes
  244. _os=SunOS
  245. dnl ===========================================================
  246. dnl Check whether we're using Solaris 10 - SPARC or Intel.
  247. dnl ===========================================================
  248. AC_MSG_CHECKING([the Solaris operating system release])
  249. _os_release=`echo $host_os | $SED -e s/solaris2\.//`
  250. if test "$_os_release" -lt "10"; then
  251. AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
  252. else
  253. AC_MSG_RESULT([ok ($_os_release)])
  254. fi
  255. dnl Check whether we're using a SPARC or i386 processor
  256. AC_MSG_CHECKING([the processor type])
  257. if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
  258. AC_MSG_RESULT([ok ($host_cpu)])
  259. else
  260. AC_MSG_ERROR([only SPARC and i386 processors are supported])
  261. fi
  262. ;;
  263. linux-gnu*|k*bsd*-gnu*)
  264. test_gtk=yes
  265. build_gstreamer=yes
  266. build_gstreamer_0_10=yes
  267. test_tde=yes
  268. test_kde=yes
  269. test_kde4=yes
  270. test_freetype=yes
  271. test_unix_quickstarter=yes
  272. _os=Linux
  273. ;;
  274. gnu)
  275. test_randr=no
  276. test_xrender=no
  277. _os=GNU
  278. ;;
  279. cygwin*|interix*|mingw32*)
  280. # When building on Windows normally with MSVC under Cygwin,
  281. # configure thinks that the host platform (the platform the
  282. # built code will run on) is Cygwin, even if it obviously is
  283. # Windows, which in Autoconf terminology is called
  284. # "mingw32". (Which is misleading as MinGW is the name of the
  285. # tool-chain, not an operating system.)
  286. # Somewhat confusing, yes. But this configure script doesn't
  287. # look at $host etc that much, it mostly uses its own $_os
  288. # variable, set here in this case statement.
  289. # When cross-compiling to Windows from Unix, the host platform
  290. # is "mingw32" (because in that case it is the MinGW
  291. # tool-chain that is used).
  292. test_cups=no
  293. test_dbus=no
  294. test_randr=no
  295. test_xrender=no
  296. test_freetype=no
  297. test_fontconfig=no
  298. _os=WINNT
  299. use_shl_version="TRUE"
  300. DYNAMIC_CRT="TRUE"
  301. DLLPOST=".dll"
  302. LINKFLAGSNOUNDEFS=
  303. # If the host OS matches "mingw32*", that means we are using the
  304. # MinGW cross-compiler, because we don't see the point in building
  305. # LibreOffice using MinGW on Windows. If you want to build on
  306. # Windows, use MSVC. If you want to use MinGW, surely you want to
  307. # cross-compile (from Linux or some other Unix).
  308. case "$host_os" in
  309. mingw32*)
  310. WITH_MINGW=yes
  311. if test -z "$CC"; then
  312. CC="$host_cpu-$host_vendor-$host_os-gcc"
  313. fi
  314. if test -z "$CXX"; then
  315. CXX="$host_cpu-$host_vendor-$host_os-g++"
  316. fi
  317. ;;
  318. esac
  319. ;;
  320. darwin*) # Mac OS X or iOS
  321. test_gtk=yes
  322. test_randr=no
  323. test_xrender=no
  324. test_freetype=no
  325. test_fontconfig=no
  326. test_dbus=no
  327. if test "$host_cpu" = "arm"; then
  328. _os=iOS
  329. test_gtk=no
  330. test_cups=no
  331. else
  332. _os=Darwin
  333. fi
  334. enable_systray=no
  335. # See comment above the case "$host_os"
  336. LINKFLAGSSHL="-dynamiclib -single_module"
  337. # -fPIC is default
  338. PICSWITCH=""
  339. DLLPOST=".dylib"
  340. # -undefined error is the default
  341. LINKFLAGSNOUNDEFS=""
  342. ;;
  343. freebsd*)
  344. test_gtk=yes
  345. build_gstreamer=yes
  346. build_gstreamer_0_10=yes
  347. test_tde=yes
  348. test_kde=yes
  349. test_kde4=yes
  350. test_freetype=yes
  351. AC_MSG_CHECKING([the FreeBSD operating system release])
  352. if test -n "$with_os_version"; then
  353. OSVERSION="$with_os_version"
  354. else
  355. OSVERSION=`/sbin/sysctl -n kern.osreldate`
  356. fi
  357. AC_MSG_RESULT([found OSVERSION=$OSVERSION])
  358. AC_MSG_CHECKING([which thread library to use])
  359. if test "$OSVERSION" -lt "500016"; then
  360. PTHREAD_CFLAGS="-D_THREAD_SAFE"
  361. PTHREAD_LIBS="-pthread"
  362. elif test "$OSVERSION" -lt "502102"; then
  363. PTHREAD_CFLAGS="-D_THREAD_SAFE"
  364. PTHREAD_LIBS="-lc_r"
  365. else
  366. PTHREAD_CFLAGS=""
  367. PTHREAD_LIBS="-pthread"
  368. fi
  369. AC_MSG_RESULT([$PTHREAD_LIBS])
  370. _os=FreeBSD
  371. ;;
  372. *netbsd*)
  373. test_gtk=yes
  374. build_gstreamer=yes
  375. build_gstreamer_0_10=yes
  376. test_tde=no
  377. test_kde=no
  378. test_kde4=yes
  379. test_freetype=yes
  380. PTHREAD_LIBS="-pthread -lpthread"
  381. _os=NetBSD
  382. ;;
  383. aix*)
  384. test_randr=no
  385. test_freetype=yes
  386. PTHREAD_LIBS=-pthread
  387. _os=AIX
  388. ;;
  389. openbsd*)
  390. test_gtk=yes
  391. test_tde=yes
  392. test_kde=yes
  393. test_freetype=yes
  394. PTHREAD_CFLAGS="-D_THREAD_SAFE"
  395. PTHREAD_LIBS="-pthread"
  396. _os=OpenBSD
  397. ;;
  398. dragonfly*)
  399. test_gtk=yes
  400. build_gstreamer=yes
  401. build_gstreamer_0_10=yes
  402. test_tde=yes
  403. test_kde=yes
  404. test_kde4=yes
  405. test_freetype=yes
  406. PTHREAD_LIBS="-pthread"
  407. _os=DragonFly
  408. ;;
  409. linux-android*)
  410. build_gstreamer=no
  411. build_gstreamer_0_10=no
  412. test_cups=no
  413. test_dbus=no
  414. test_fontconfig=no
  415. test_freetype=no
  416. test_gtk=no
  417. test_tde=no
  418. test_kde=no
  419. test_kde4=no
  420. test_randr=no
  421. test_xrender=no
  422. test_unix_quickstarter=no
  423. _os=Android
  424. if test -z "$with_android_ndk"; then
  425. AC_MSG_ERROR([the --with-android-ndk option is mandatory])
  426. fi
  427. if test -z "$with_android_sdk"; then
  428. AC_MSG_ERROR([the --with-android-sdk option is mandatory])
  429. fi
  430. # Verify that the NDK and SDK options are proper
  431. if test ! -f "$ANDROID_NDK_HOME/platforms/android-9/arch-arm/usr/lib/libc.a"; then
  432. AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
  433. fi
  434. if test ! -d "$ANDROID_SDK_HOME/platforms"; then
  435. AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
  436. fi
  437. BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
  438. ;;
  439. *)
  440. AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
  441. ;;
  442. esac
  443. if test "$_os" = "AIX"; then
  444. AC_PATH_PROG(GAWK, gawk)
  445. if test -z "$GAWK"; then
  446. AC_MSG_ERROR([gawk not found in \$PATH])
  447. fi
  448. fi
  449. AC_SUBST(use_shl_version)
  450. AC_SUBST(DYNAMIC_CRT)
  451. AC_SUBST(WITH_MINGW)
  452. AC_SUBST(OSVERSION)
  453. AC_SUBST(PTHREAD_CFLAGS)
  454. AC_SUBST(PTHREAD_LIBS)
  455. ###############################################################################
  456. # Extensions switches --enable/--disable
  457. ###############################################################################
  458. # By default these should be enabled unless having extra dependencies.
  459. # If there is extra dependency over configure options then the enable should
  460. # be automagic based on whether the requiring feature is enabled or not.
  461. # All this options change anything only with --enable-extension-integration.
  462. # The name of this option and its help string makes it sound as if
  463. # extensions are built anyway, just not integrated in the installer,
  464. # if you use --disable-extension-integration. Is that really the
  465. # case?
  466. AC_ARG_ENABLE(extension-integration,
  467. AS_HELP_STRING([--disable-extension-integration],
  468. [Disable integration of the built extensions in the installer of the
  469. product. Use this switch to disable the integration.])
  470. )
  471. AC_ARG_ENABLE(ext-barcode,
  472. AS_HELP_STRING([--enable-ext-barcode],
  473. [Enable the Barcode extension.])
  474. )
  475. AC_ARG_ENABLE(export,
  476. AS_HELP_STRING([--disable-export],
  477. [Disable (some) code for document export. Useful when building viewer-only apps that lack
  478. save/export functionality, to avoid having an excessive amount of code and data used
  479. only for exporrt linked in. Work in progress, use only if you are hacking on it.])
  480. )
  481. AC_ARG_ENABLE(database-connectivity,
  482. AS_HELP_STRING([--disable-database-connectivity],
  483. [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
  484. )
  485. # This doesn't mean not building (or "integrating") extensions
  486. # (although it probably should; i.e. it should imply
  487. # --disable-extension-integration I guess), it means not supporting
  488. # any extension mechanism at all
  489. AC_ARG_ENABLE(extensions,
  490. AS_HELP_STRING([--disable-extensions],
  491. [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
  492. )
  493. AC_ARG_ENABLE(scripting,
  494. AS_HELP_STRING([--disable-scripting],
  495. [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
  496. )
  497. # This is mainly for Android and iOS, but could potentially be used in some
  498. # special case otherwise, too, so factored out as a separate setting
  499. AC_ARG_ENABLE(dynamic-loading,
  500. AS_HELP_STRING([--disable-dynamic-loading],
  501. [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
  502. )
  503. AC_ARG_ENABLE(ext-diagram,
  504. AS_HELP_STRING([--enable-ext-diagram],
  505. [Enable the SmART Gallery (Diagram) extension.])
  506. )
  507. AC_ARG_ENABLE(ext-google-docs,
  508. AS_HELP_STRING([--enable-ext-google-docs],
  509. [Enable the Google Documents extension.])
  510. )
  511. AC_ARG_ENABLE(ext-hunart,
  512. AS_HELP_STRING([--enable-ext-hunart],
  513. [Enable the Hungarian Cross-reference Toolbar extension.])
  514. )
  515. AC_ARG_ENABLE(ext-languagetool,
  516. AS_HELP_STRING([--enable-ext-languagetool],
  517. [Enable the LanguageTool extension.])
  518. )
  519. AC_ARG_ENABLE(ext-mysql-connector,
  520. AS_HELP_STRING([--enable-ext-mysql-connector],
  521. [Enable the build of the MySQL Connector extension.])
  522. )
  523. AC_ARG_ENABLE(ext-nlpsolver,
  524. AS_HELP_STRING([--enable-ext-nlpsolver],
  525. [Enable the NLPSolver extension.])
  526. )
  527. AC_ARG_ENABLE(ext-ct2n,
  528. AS_HELP_STRING([--enable-ext-ct2n],
  529. [Enable the ConvertTextToNumber extension.])
  530. )
  531. AC_ARG_ENABLE(ext-numbertext,
  532. AS_HELP_STRING([--enable-ext-numbertext],
  533. [Enable the Numbertext extension.])
  534. )
  535. AC_ARG_ENABLE(ext-oooblogger,
  536. AS_HELP_STRING([--enable-ext-oooblogger],
  537. [Enable the OOo Blogger extension.])
  538. )
  539. AC_ARG_ENABLE(ext-presenter-minimizer,
  540. AS_HELP_STRING([--disable-ext-presenter-minimizer],
  541. [Disable the Presentation Minimizer extension.])
  542. )
  543. AC_ARG_ENABLE(ext-report-builder,
  544. AS_HELP_STRING([--disable-ext-report-builder],
  545. [Disable the Report Builder extension.])
  546. )
  547. AC_ARG_ENABLE(ext-typo,
  548. AS_HELP_STRING([--enable-ext-typo],
  549. [Enable the Typography Toolbar extension.])
  550. )
  551. AC_ARG_ENABLE(ext-validator,
  552. AS_HELP_STRING([--enable-ext-validator],
  553. [Enable the Validator extension.])
  554. )
  555. AC_ARG_ENABLE(ext-watch-window,
  556. AS_HELP_STRING([--enable-ext-watch-window],
  557. [Enable the Watch Window extension to Calc.])
  558. )
  559. AC_ARG_ENABLE(ext-wiki-publisher,
  560. AS_HELP_STRING([--enable-ext-wiki-publisher],
  561. [Enable the Wiki Publisher extension.])
  562. )
  563. ###############################################################################
  564. dnl ---------- *** ----------
  565. AC_ARG_ENABLE(mergelibs,
  566. AS_HELP_STRING([--enable-mergelibs],
  567. [Enables linking of big, merged, library. Experimental feature tested
  568. only on Linux and Android.])
  569. )
  570. AC_ARG_ENABLE(graphite,
  571. AS_HELP_STRING([--enable-graphite],
  572. [Enables the compilation of Graphite smart font rendering.])
  573. )
  574. AC_ARG_ENABLE(fetch-external,
  575. AS_HELP_STRING([--disable-fetch-external],
  576. [Disables fetching external tarballs from web sources.])
  577. )
  578. AC_ARG_ENABLE(lockdown,
  579. AS_HELP_STRING([--disable-lockdown],
  580. [Disables the gconf integration work in LibreOffice.]),
  581. )
  582. AC_ARG_ENABLE(vba,
  583. AS_HELP_STRING([--disable-vba],
  584. [Disables the vba compatibility feature.])
  585. )
  586. AC_ARG_ENABLE(pch,
  587. AS_HELP_STRING([--enable-pch],
  588. [DEPRECATED : is ignored])
  589. )
  590. AC_ARG_ENABLE(win-mozab-driver,
  591. AS_HELP_STRING([--enable-win-mozab-driver],
  592. [LibreOffice includes a driver to connect to Mozilla
  593. address books under Windows, to build with this version, use this option.])
  594. )
  595. AC_ARG_ENABLE(epm,
  596. AS_HELP_STRING([--enable-epm],
  597. [LibreOffice includes self-packaging code, that requires epm, however epm is
  598. useless for large scale package building.])
  599. )
  600. AC_ARG_ENABLE(odk,
  601. AS_HELP_STRING([--disable-odk],
  602. [LibreOffice includes an ODK, office development kit which some packagers may
  603. wish to build without.])
  604. )
  605. AC_ARG_ENABLE(mathmldtd,
  606. AS_HELP_STRING([--enable-mathmldtd],
  607. [Enable bundling of (modified) MathML 1.01 DTD.])
  608. )
  609. AC_ARG_ENABLE(evolution2,
  610. AS_HELP_STRING([--enable-evolution2],
  611. [Allows the built-in evolution 2 addressbook connectivity build to be
  612. enabled.])
  613. )
  614. AC_ARG_ENABLE(directx,
  615. AS_HELP_STRING([--disable-directx],
  616. [Remove DirectX implementation for the new XCanvas interface.
  617. The DirectX support requires more stuff installed on Windows to
  618. compile. (DirectX SDK, GDI+ libs)])
  619. )
  620. AC_ARG_ENABLE(activex,
  621. AS_HELP_STRING([--disable-activex],
  622. [Disable the use of ActiveX for a Windows build.
  623. This switch is mandatory when using VC++ 2008 Express.])
  624. )
  625. AC_ARG_ENABLE(atl,
  626. AS_HELP_STRING([--disable-atl],
  627. [Disable the use of ATL for a Windows build.])
  628. [
  629. This switch is mandatory when using VC++ 2008 Express.
  630. ],
  631. ,)
  632. AC_ARG_ENABLE(werror,
  633. AS_HELP_STRING([--enable-werror],
  634. [Turn warnings to errors. (Has no effect in modules where the treating
  635. of warnings as errors is disabled explicitly.)]),
  636. ,)
  637. AC_ARG_ENABLE(assert-always-abort,
  638. AS_HELP_STRING([--enable-assert-always-abort],
  639. [make assert() abort even in release code.]),
  640. ,)
  641. AC_ARG_ENABLE(dbgutil,
  642. AS_HELP_STRING([--enable-dbgutil],
  643. [Provide debugging support from --enable-debug and include additional debugging
  644. utilities such as object counting or more expensive checks.
  645. This is the recommended option for developers.
  646. Note that this makes the build ABI incompatible, it is not possible to mix object
  647. files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
  648. AC_ARG_ENABLE(debug,
  649. AS_HELP_STRING([--enable-debug],
  650. [Include debugging information, disable compiler optimization and inlining plus
  651. extra debugging code like assertions. Extra large build! (enables -g compiler flag
  652. and dmake debug=true).]))
  653. AC_ARG_ENABLE(selective-debuginfo,
  654. AS_HELP_STRING([--enable-selective-debuginfo],
  655. [If --enable-debug or --enable-dbgutil is used, build debugging information
  656. (-g compiler flag) only for the specified gbuild build targets
  657. (where all means everything, - prepended means not to enable, / appended means
  658. everything in the directory; there is no ordering, more specific overrides
  659. more general, and disabling takes precedence).
  660. Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
  661. AC_ARG_ENABLE(symbols,
  662. AS_HELP_STRING([--enable-symbols],
  663. [Include debugging symbols in output while preserve optimization.
  664. This enables -g compiler flag for GCC or equivalent,
  665. without changing anything else compared to productive code.]))
  666. AC_ARG_ENABLE(compiler-plugins,
  667. AS_HELP_STRING([--enable-compiler-plugins],
  668. [Enable compiler plugins that will perform additional checks during
  669. building. Enabled automatically by --enable-dbgutil.]))
  670. AC_ARG_ENABLE(linkoo,
  671. AS_HELP_STRING([--disable-linkoo],
  672. [Disable linkoo for the smoketest installation.]))
  673. AC_ARG_ENABLE(lto,
  674. AS_HELP_STRING([--enable-lto],
  675. [Enable link-time optimization. Suitable for product builds.
  676. Building takes longer but libraries are optimized for speed.
  677. (possible only with gcc-4.5 or later,
  678. better to use gcc-4.6 and 'gold' as linker)]))
  679. AC_ARG_ENABLE(crashdump,
  680. AS_HELP_STRING([--enable-crashdump],
  681. [Enable the crashdump feature.]))
  682. AC_ARG_ENABLE(python,
  683. AS_HELP_STRING([--enable-python=<no/auto/system/internal>],
  684. [Enables or disables Python support at run-time and build-time.
  685. Also specifies what Python to use. 'auto' is the
  686. default. Note that Python can be disabled with
  687. --disable-python or --enable-python=no only if no
  688. translations are required.]))
  689. AC_ARG_ENABLE(gtk,
  690. AS_HELP_STRING([--disable-gtk],
  691. [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
  692. ,enable_gtk=yes)
  693. AC_ARG_ENABLE(gtk3,
  694. AS_HELP_STRING([--enable-gtk3],
  695. [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
  696. ,enable_gtk3=no)
  697. AC_ARG_ENABLE(systray,
  698. AS_HELP_STRING([--disable-systray],
  699. [Determines whether to build the systray quickstarter.]),
  700. ,enable_systray=yes)
  701. AC_ARG_ENABLE(split-app-modules,
  702. AS_HELP_STRING([--enable-split-app-modules],
  703. [Split file lists for app modules, e.g. base, calc.
  704. Has effect only with make distro-pack-install]),
  705. ,)
  706. AC_ARG_ENABLE(split-opt-features,
  707. AS_HELP_STRING([--enable-split-opt-features],
  708. [Split file lists for some optional features, .e.g. pyuno, testtool.
  709. Has effect only with make distro-pack-install]),
  710. ,)
  711. AC_ARG_ENABLE(cairo-canvas,
  712. [ --disable-cairo-canvas Determines whether to build the Cairo canvas on
  713. platforms where Cairo is available.
  714. ])
  715. AC_ARG_ENABLE(opengl,
  716. AS_HELP_STRING([--disable-opengl],
  717. [Determines whether to build the OpenGL 3D slide transitions component.]),
  718. ,enable_opengl=yes)
  719. AC_ARG_ENABLE(dbus,
  720. AS_HELP_STRING([--disable-dbus],
  721. [Determines whether to enable features that depend on dbus.
  722. e.g. Presentation mode screensaver control, bluetooth presentation control]),
  723. ,enable_dbus=yes)
  724. AC_ARG_ENABLE(packagekit,
  725. AS_HELP_STRING([--enable-packagekit],
  726. [Determines whether to enable features using packagekit.
  727. Right now that is auto font install]),
  728. ,)
  729. AC_ARG_ENABLE(sdremote,
  730. AS_HELP_STRING([--disable-sdremote],
  731. [Determines whether to enable Impress remote control.]),
  732. ,enable_sdremote=yes)
  733. AC_ARG_ENABLE(sdremote-bluetooth,
  734. AS_HELP_STRING([--disable-sdremote-bluetooth],
  735. [Determines whether to build sdremote with bluetooth support
  736. Requires: dbus]),
  737. ,enable_sdremote_bluetooth=yes)
  738. AC_ARG_ENABLE(gconf,
  739. AS_HELP_STRING([--disable-gconf],
  740. [Determines whether to use the GConf support.]),
  741. ,enable_gconf=yes)
  742. AC_ARG_ENABLE(gnome-vfs,
  743. AS_HELP_STRING([--disable-gnome-vfs],
  744. [Determines whether to use the Gnome Virtual Filing System on platforms
  745. where that VFS is available.]),
  746. ,enable_gnome_vfs=yes)
  747. AC_ARG_ENABLE(gio,
  748. AS_HELP_STRING([--enable-gio],
  749. [Determines whether to use the GIO support.]),
  750. ,enable_gio=no)
  751. AC_ARG_ENABLE(telepathy,
  752. AS_HELP_STRING([--enable-telepathy],
  753. [Determines whether to enable Telepathy for collaboration.]),
  754. ,enable_telepathy=no)
  755. AC_ARG_ENABLE(build-mozab,
  756. AS_HELP_STRING([--disable-build-mozab],
  757. [Use this option if you do not want to build the Mozilla address book
  758. components from the Mozilla source code but take precompiled zips.
  759. Meaningful only after --enable-win-mozab-driver.]),
  760. ,)
  761. AC_ARG_ENABLE(tde,
  762. AS_HELP_STRING([--enable-tde],
  763. [Determines whether to use TQt/TDE vclplug on platforms where TQt and
  764. TDE are available.]),
  765. ,)
  766. AC_ARG_ENABLE(tdeab,
  767. AS_HELP_STRING([--disable-tdeab],
  768. [Disable the TDE address book support.]),
  769. ,
  770. if test "$enable_tde" = "yes"; then
  771. enable_tdeab=yes
  772. fi
  773. )
  774. AC_ARG_ENABLE(kde,
  775. AS_HELP_STRING([--enable-kde],
  776. [Determines whether to use Qt3/KDE3 vclplug on platforms where Qt3 and
  777. KDE3 are available.]),
  778. ,)
  779. AC_ARG_ENABLE(kdeab,
  780. AS_HELP_STRING([--disable-kdeab],
  781. [Disable the KDE3 address book support.]),
  782. ,
  783. if test "$enable_kde" = "yes"; then
  784. enable_kdeab=yes
  785. fi
  786. )
  787. AC_ARG_ENABLE(kde4,
  788. AS_HELP_STRING([--enable-kde4],
  789. [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
  790. KDE4 are available. May be used with --enable-kde if you want to support
  791. both KDE3 and KDE4.]),
  792. ,)
  793. AC_ARG_ENABLE(headless,
  794. AS_HELP_STRING([--enable-headless],
  795. [Disable building of GUIs to reduce dependencies. Useful for
  796. server usage. Work in progress, use only if you are hacking on
  797. it. Not related to the --headless option.]), ,)
  798. AC_ARG_ENABLE(unix-qstart-libpng,
  799. AS_HELP_STRING([--disable-unix-qstart-libpng],
  800. [On UNIX systems, we have a faster splash app, that can use libpng to
  801. render its splash, if we can safely link to the system libpng then
  802. enabling this is a good idea (ie. for Linux Distro packaging).]),
  803. ,enable_unix_qstart_libpng=yes)
  804. AC_ARG_ENABLE(rpath,
  805. AS_HELP_STRING([--disable-rpath],
  806. [Disable the use of relative paths in shared libraries.]),
  807. ,)
  808. AC_ARG_ENABLE(randr,
  809. AS_HELP_STRING([--disable-randr],
  810. [Disable RandR support in the vcl project.]),
  811. ,enable_randr=yes)
  812. AC_ARG_ENABLE(randr-link,
  813. AS_HELP_STRING([--disable-randr-link],
  814. [Disable linking with libXrandr, instead dynamically open it at runtime.]),
  815. ,enable_randr_link=yes)
  816. AC_ARG_ENABLE(gstreamer,
  817. AS_HELP_STRING([--enable-gstreamer],
  818. [Enable building with the new gstreamer 1.0 avmedia backend.]),
  819. ,enable_gstreamer=no)
  820. AC_ARG_ENABLE(gstreamer-0-10,
  821. AS_HELP_STRING([--disable-gstreamer-0-10],
  822. [Disable building the gstreamer avmedia backend.]),
  823. ,enable_gstreamer_0_10=yes)
  824. AC_ARG_ENABLE(neon,
  825. AS_HELP_STRING([--disable-neon],
  826. [Disable neon and the compilation of webdav binding.]),
  827. ,)
  828. AC_ARG_ENABLE(cve-tests,
  829. AS_HELP_STRING([--disable-cve-tests],
  830. [Prevent CVE tests to be executed]),
  831. ,)
  832. AC_ARG_ENABLE(build-unowinreg,
  833. AS_HELP_STRING([--enable-build-unowinreg],
  834. [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
  835. compiler is needed on Linux.])
  836. [
  837. Usage: --enable-build-unowinreg
  838. ],
  839. ,)
  840. AC_ARG_ENABLE(verbose,
  841. AS_HELP_STRING([--enable-verbose],
  842. [Increase build verbosity.])[
  843. --disable-verbose Decrease build verbosity.],
  844. ,)
  845. AC_ARG_ENABLE(dependency-tracking,
  846. AS_HELP_STRING([--enable-dependency-tracking],
  847. [Do not reject slow dependency extractors.])[
  848. --disable-dependency-tracking
  849. Disables generation of dependency information.
  850. Speed up one-time builds.],
  851. ,)
  852. AC_ARG_ENABLE(icecream,
  853. AS_HELP_STRING([--enable-icecream],
  854. [Use the 'icecream' distributed compiling tool to speedup the compilation.
  855. It defaults to /opt/icecream for the location of the icecream gcc/g++
  856. wrappers, you can override that using --with-gcc-home=/the/path switch.]),
  857. ,)
  858. AC_ARG_ENABLE(zenity,
  859. AS_HELP_STRING([--disable-zenity],
  860. [Do not display a build icon in the notification area (on unix) during build.]),
  861. ,enable_zenity=yes)
  862. AC_ARG_ENABLE(cups,
  863. AS_HELP_STRING([--disable-cups],
  864. [Do not build cups support.])
  865. )
  866. AC_ARG_ENABLE(ccache,
  867. AS_HELP_STRING([--disable-ccache],
  868. [Do not try to use ccache automatically.
  869. By default, we will try to detect if ccache is available; in that case if
  870. CC/CXX are not yet set, and --enable-icecream is not given, we
  871. attempt to use ccache. --disable-ccache disables ccache completely.
  872. ]),
  873. ,)
  874. AC_ARG_ENABLE(64-bit,
  875. AS_HELP_STRING([--enable-64-bit],
  876. [Build a 64-bit LibreOffice on platforms where the normal and only supported build
  877. is 32-bit. In other words, this option is experimental and possibly quite broken,
  878. use only if you are hacking on 64-bit support.]), ,)
  879. AC_ARG_ENABLE(extra-gallery,
  880. AS_HELP_STRING([--enable-extra-gallery],
  881. [Add extra gallery content.]),
  882. ,)
  883. AC_ARG_ENABLE(extra-template,
  884. AS_HELP_STRING([--enable-extra-template],
  885. [Add extra template content.]),
  886. ,)
  887. AC_ARG_ENABLE(extra-sample,
  888. AS_HELP_STRING([--enable-extra-sample],
  889. [Add extra sample content.]),
  890. ,)
  891. AC_ARG_ENABLE(extra-font,
  892. AS_HELP_STRING([--enable-extra-font],
  893. [Add extra font content.]),
  894. ,)
  895. AC_ARG_ENABLE(lomenubar,
  896. AS_HELP_STRING([--enable-lomenubar],
  897. [Enable global menu support.]),
  898. ,)
  899. AC_ARG_ENABLE(online-update,
  900. AS_HELP_STRING([--enable-online-update],
  901. [Enable the online update service that will check for new versions of
  902. LibreOffice. By default, it is on on Windows and Mac, and off on Linux.]),
  903. ,)
  904. AC_ARG_ENABLE(release-build,
  905. AS_HELP_STRING([--enable-release-build],
  906. [Enable release build.
  907. See http://wiki.documentfoundation.org/DevBuild]),
  908. ,)
  909. AC_ARG_ENABLE(silent-msi,
  910. AS_HELP_STRING([--enable-silent-msi],
  911. [Enable MSI with LIMITUI=1 (silent install).]),
  912. ,)
  913. AC_ARG_ENABLE(postgresql-sdbc,
  914. AS_HELP_STRING([--disable-postgresql-sdbc],
  915. [Disable the build of the PostgreSQL-SDBC driver.])
  916. )
  917. AC_ARG_ENABLE(coretext,
  918. AS_HELP_STRING([--enable-coretext],
  919. [Use CoreText framework on Mac (instead of ATSU).
  920. Known to not work properly, use only if you plan to work on that.]),
  921. )
  922. AC_ARG_ENABLE(winegcc,
  923. AS_HELP_STRING([--enable-winegcc],
  924. [Enable use of winegcc during the build, in order to create msi* tools
  925. needed for MinGW cross-compilation.]),
  926. )
  927. AC_ARG_ENABLE(liblangtag,
  928. AS_HELP_STRING([--disable-liblangtag],
  929. [Disable use of liblangtag, and insted use an own simple
  930. implementation.]),
  931. )
  932. AC_ARG_ENABLE(bogus-pkg-config,
  933. AS_HELP_STRING([--enable-bogus-pkg-config],
  934. [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]),
  935. )
  936. dnl ===================================================================
  937. dnl Optional Packages (--with/without-)
  938. dnl ===================================================================
  939. AC_ARG_WITH(gnu-patch,
  940. AS_HELP_STRING([--with-gnu-patch],
  941. [Specify location of GNU patch on Solaris or FreeBSD.]),
  942. ,)
  943. AC_ARG_WITH(build-platform-configure-options,
  944. [Specify options for the configure script run for the *build* platform in a cross-compilation])
  945. AC_ARG_WITH(gnu-cp,
  946. AS_HELP_STRING([--with-gnu-cp],
  947. [Specify location of GNU cp on Solaris or FreeBSD.]),
  948. ,)
  949. AC_ARG_WITH(external-tar,
  950. AS_HELP_STRING([--with-external-tar=<TARFILE PATH>],
  951. [Specify path to tarfiles manually.]),
  952. TARFILE_LOCATION=$withval ,
  953. )
  954. AC_ARG_WITH(solver-and-workdir-root,
  955. AS_HELP_STRING([--with-solver-and-workdir-root=<PATH>],
  956. [Specify path that contains SOLARVER and WORKDIR directories manually.])
  957. )
  958. AC_ARG_WITH(linked-git,
  959. AS_HELP_STRING([--with-linked-git=<OTHER_CLONE_DIR>],
  960. [Specify another checkout's clonedir to re-use. This makes use of
  961. git-new-workdir, and saves a lot of diskspace when having multiple
  962. trees side-by-side.]),
  963. GIT_LINK_SRC=$withval ,
  964. )
  965. AC_ARG_WITH(vba-package-format,
  966. AS_HELP_STRING([--with-vba-package-format],
  967. [Specify package format for vba compatibility api. Specifying "builtin"
  968. means the api component and associated type library are part of the
  969. installation set. Specifying "extn" creates an uno extension that is
  970. part of the installation set (located in the program directory) that
  971. MUST be optionally registered using either the unopkg executeable or the
  972. extension manager gui.])
  973. [
  974. Note: "builtin" is the default, "extn" can cause
  975. problems.
  976. Usage: --with-vba-package-format="builtin" or
  977. --with-vba-package-format="extn"
  978. ],
  979. ,)
  980. AC_ARG_WITH(theme,
  981. AS_HELP_STRING([--with-theme="theme1 theme2..."],
  982. [Choose which themes to include. By default those themes with an '*' are included.
  983. Possible choices: *crystal, *default (galaxy), *hicontrast, human, industrial, *oxygen, *tango, *tango_testing.]),
  984. ,)
  985. AC_ARG_WITH(helppack-integration,
  986. [
  987. --without-helppack-integration It will not integrate the helppacks to the installer
  988. of the product.
  989. Please use this switch to use the online help or separate help packages.],
  990. ,)
  991. AC_ARG_WITH(fonts,
  992. AS_HELP_STRING([--without-fonts],
  993. [LibreOffice includes some third-party fonts to provide a reliable basis for
  994. help content, templates, samples, etc. When these fonts are already
  995. known to be available on the system then you should use this option.]),
  996. ,)
  997. AC_ARG_WITH(ppds,
  998. AS_HELP_STRING([--without-ppds],
  999. [Removes Postscript Printer definition files from LibreOffice
  1000. installation set, for people building for specific distributions where
  1001. PPDs are known to be already available (every recent distro with CUPS backend).]),
  1002. ,)
  1003. AC_ARG_WITH(afms,
  1004. AS_HELP_STRING([--without-afms],
  1005. [Removes bitmap font files from LibreOffice installation set, for people
  1006. building for specific distributions where AFM files or TrueType Fonts
  1007. are known to be available.]),
  1008. ,)
  1009. AC_ARG_WITH(agfa-monotype-fonts,
  1010. AS_HELP_STRING([--with-agfa-monotype-fonts],
  1011. [This switch should only be enabled for those who have the right
  1012. to use or distribute the proprietary Agfa Monotype
  1013. fonts.]),
  1014. ,)
  1015. AC_ARG_WITH(epm,
  1016. AS_HELP_STRING([--with-epm],
  1017. [Decides which epm to use. Default is to use the one from the system if
  1018. one is built. When either this is not there or you say =internal epm
  1019. will be built.]),
  1020. ,)
  1021. AC_ARG_WITH(package-format,
  1022. AS_HELP_STRING([--with-package-format],
  1023. [Specify package format(s) for LibreOffice installsets. Default is the
  1024. "normal" one of the OS/Distribution. Possible values: aix, bsd, deb,
  1025. inst, tardist, osx, pkg, rpm, setld, native, portable, archive, dmg,
  1026. installed, msi. Example: --with-package-format="deb dmg"]),
  1027. ,)
  1028. AC_ARG_WITH(system-libs,
  1029. AS_HELP_STRING([--with-system-libs],
  1030. [Use libraries already on system -- enables all --with-system-* flags except
  1031. mozilla.]),
  1032. ,)
  1033. AC_ARG_WITH(system-headers,
  1034. AS_HELP_STRING([--with-system-headers],
  1035. [Use headers already on system -- enables all --with-system-* flags for
  1036. external packages whose headers are the only entities used i.e.
  1037. boost/vigra/odbc/sane-header(s).]),,
  1038. [with_system_headers="$with_system_libs"])
  1039. AC_ARG_WITH(system-jars,
  1040. AS_HELP_STRING([--without-system-jars],
  1041. [When building with --with-system-libs, also the needed jars are expected
  1042. on the system. Use this to disable that]),,
  1043. [with_system_jars="$with_system_libs"])
  1044. AC_ARG_WITH(system-stdlibs,
  1045. AS_HELP_STRING([--without-system-stdlibs],
  1046. [Bundle the used libstdc++/libgcc_s into the installation set.]),,
  1047. [with_system_stdlibs="$with_system_libs"])
  1048. AC_ARG_WITH(system-cairo,
  1049. AS_HELP_STRING([--with-system-cairo],
  1050. [Use Cairo libraries already on system.]),,
  1051. [with_system_cairo="$with_system_libs"])
  1052. AC_ARG_WITH(system-graphite,
  1053. AS_HELP_STRING([--with-system-graphite],
  1054. [Use graphite library already installed on system.]),,
  1055. [with_system_graphite="$with_system_libs"])
  1056. AC_ARG_WITH(system-nss,
  1057. AS_HELP_STRING([--with-system-nss],
  1058. [Use NSS/nspr libraries already on system.]),,
  1059. [with_system_nss="$with_system_libs"])
  1060. AC_ARG_WITH(mozilla-toolkit,
  1061. AS_HELP_STRING([--with-mozilla-toolkit],
  1062. [DEPRECATED : is ignored]),
  1063. ,)
  1064. AC_ARG_WITH(myspell-dicts,
  1065. AS_HELP_STRING([--without-myspell-dicts],
  1066. [Removes myspell dictionaries from LibreOffice installation set, for
  1067. people building for specific distributions where the myspell dictionaries
  1068. are installed from other sources.]),
  1069. ,)
  1070. AC_ARG_WITH(system-dicts,
  1071. AS_HELP_STRING([--without-system-dicts],
  1072. [Do not use dictionaries from system paths.]),
  1073. ,)
  1074. AC_ARG_WITH(external-dict-dir,
  1075. AS_HELP_STRING([--with-external-dict-dir],
  1076. [Specify external dictionary dir.]),
  1077. ,)
  1078. AC_ARG_WITH(external-hyph-dir,
  1079. AS_HELP_STRING([--with-external-hyph-dir],
  1080. [Specify external hyphenation pattern dir.]),
  1081. ,)
  1082. AC_ARG_WITH(external-thes-dir,
  1083. AS_HELP_STRING([--with-external-thes-dir],
  1084. [Specify external thesaurus dir.]),
  1085. ,)
  1086. AC_ARG_WITH(system-zlib,
  1087. AS_HELP_STRING([--with-system-zlib],
  1088. [Use zlib already on system.]),,
  1089. [with_system_zlib=auto])
  1090. AC_ARG_WITH(system-openssl,
  1091. AS_HELP_STRING([--with-system-openssl],
  1092. [Use OpenSSL already on system.]),,
  1093. [with_system_openssl="$with_system_libs"])
  1094. AC_ARG_WITH(system-jpeg,
  1095. AS_HELP_STRING([--with-system-jpeg],
  1096. [Use jpeg already on system.]),,
  1097. [with_system_jpeg=auto])
  1098. AC_ARG_WITH(system-clucene,
  1099. AS_HELP_STRING([--with-system-clucene],
  1100. [Use clucene already on system.]),,
  1101. [with_system_clucene="$with_system_libs"])
  1102. AC_ARG_WITH(system-expat,
  1103. AS_HELP_STRING([--with-system-expat],
  1104. [Use expat already on system.]),,
  1105. [with_system_expat="$with_system_libs"])
  1106. AC_ARG_WITH(system-libcmis,
  1107. AS_HELP_STRING([--with-system-libcmis],
  1108. [Use libcmis already on system.]),,
  1109. [with_system_libcmis="$with_system_libs"])
  1110. AC_ARG_WITH(system-lcms2,
  1111. AS_HELP_STRING([--with-system-lcms2],
  1112. [Use littlecms v2 already on system.]),,
  1113. [with_system_lcms2="$with_system_libs"])
  1114. AC_ARG_WITH(system-libcdr,
  1115. AS_HELP_STRING([--with-system-libcdr],
  1116. [Use libcdr already on system.]),,
  1117. [with_system_libcdr="$with_system_libs"])
  1118. AC_ARG_WITH(system-libmspub,
  1119. AS_HELP_STRING([--with-system-libmspub],
  1120. [Use libmspub already on system.]),,
  1121. [with_system_libmspub="$with_system_libs"])
  1122. AC_ARG_WITH(system-libvisio,
  1123. AS_HELP_STRING([--with-system-libvisio],
  1124. [Use libvisio already on system.]),,
  1125. [with_system_libvisio="$with_system_libs"])
  1126. AC_ARG_WITH(system-libwpd,
  1127. AS_HELP_STRING([--with-system-libwpd],
  1128. [Use libwpd already on system.]),,
  1129. [with_system_libwpd="$with_system_libs"])
  1130. AC_ARG_WITH(system-libwps,
  1131. AS_HELP_STRING([--with-system-libwps],
  1132. [Use libwps already on system.]),,
  1133. [with_system_libwps="$with_system_libs"])
  1134. AC_ARG_WITH(system-libwpg,
  1135. AS_HELP_STRING([--with-system-libwpg],
  1136. [Use libwpg already on system.]),,
  1137. [with_system_libwpg="$with_system_libs"])
  1138. AC_ARG_WITH(system-libxml,
  1139. AS_HELP_STRING([--with-system-libxml],
  1140. [Use libxml/libxslt already on system.]),,
  1141. [with_system_libxml=auto])
  1142. AC_ARG_WITH(system-icu,
  1143. AS_HELP_STRING([--with-system-icu],
  1144. [Use icu already on system.]),,
  1145. [with_system_icu="$with_system_libs"])
  1146. AC_ARG_WITH(system-ucpp,
  1147. AS_HELP_STRING([--with-system-ucpp],
  1148. [Use ucpp already on system.]),,
  1149. [])
  1150. AC_ARG_WITH(system-openldap,
  1151. AS_HELP_STRING([--with-system-openldap],
  1152. [Use the OpenLDAP LDAP SDK already on system.]),,
  1153. [with_system_openldap="$with_system_libs"])
  1154. AC_ARG_WITH(system-poppler,
  1155. AS_HELP_STRING([--with-system-poppler],
  1156. [Use system poppler (only needed for PDF import).]),,
  1157. [with_system_poppler="$with_system_libs"])
  1158. AC_ARG_WITH(system-apache-commons,
  1159. AS_HELP_STRING([--with-system-apache-commons],
  1160. [Use Apache commons libraries already on system.]),,
  1161. [with_system_apache_commons="$with_system_jars"])
  1162. AC_ARG_WITH(system-mysql,
  1163. AS_HELP_STRING([--with-system-mysql],
  1164. [Use MySQL libraries already on system, for building the MySQL Connector/LibreOffice
  1165. extension. If the the mysql_config executable is not in PATH, use MYSQLCONFIG to
  1166. point to it.]),,
  1167. [with_system_mysql="$with_system_libs"])
  1168. AC_ARG_WITH(libmysql-path,
  1169. AS_HELP_STRING([--with-libmysql-path],
  1170. [Use Connector/C (libmysql) installation for building the MySQL
  1171. Connector/LibreOffice extension.])
  1172. [
  1173. Usage: --with-libmysql-path=<absolute path to
  1174. your Connector/C installation>
  1175. ],
  1176. ,)
  1177. AC_ARG_WITH(system-mysql-cppconn,
  1178. AS_HELP_STRING([--with-system-mysql-cppconn],
  1179. [Use MySQL C++ Connector libraries already on system.]),,
  1180. [with_system_mysql_cppconn="$with_system_libs"])
  1181. AC_ARG_WITH(system-postgresql,
  1182. AS_HELP_STRING([--with-system-postgresql],
  1183. [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
  1184. driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
  1185. [with_system_postgresql="$with_system_libs"])
  1186. AC_ARG_WITH(libpq-path,
  1187. AS_HELP_STRING([--with-libpq-path],
  1188. [Use this PostgreSQL C interface (libpq) installation for building
  1189. the PostgreSQL-SDBC extension.])
  1190. [
  1191. Usage: --with-libpq-path=<absolute path to
  1192. your libq installation>
  1193. ],
  1194. ,)
  1195. AC_ARG_WITH(system-hsqldb,
  1196. AS_HELP_STRING([--with-system-hsqldb],
  1197. [Use hsqldb already on system.]))
  1198. AC_ARG_WITH(hsqldb-jar,
  1199. AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
  1200. [Specify path to jarfile manually.]),
  1201. HSQLDB_JAR=$withval)
  1202. AC_ARG_ENABLE(scripting-beanshell,
  1203. AS_HELP_STRING([--disable-scripting-beanshell],
  1204. [Disable support for scripts in BeanShell.]),
  1205. ,
  1206. )
  1207. AC_ARG_WITH(system-beanshell,
  1208. AS_HELP_STRING([--with-system-beanshell],
  1209. [Use beanshell already on system.]),,
  1210. [with_system_beanshell="$with_system_jars"])
  1211. AC_ARG_WITH(beanshell-jar,
  1212. AS_HELP_STRING([--with-beanshell-jar=JARFILE],
  1213. [Specify path to jarfile manually.]),
  1214. BSH_JAR=$withval)
  1215. AC_ARG_ENABLE(scripting-javascript,
  1216. AS_HELP_STRING([--disable-scripting-javascript],
  1217. [Disable support for scripts in JavaScript.]),
  1218. ,
  1219. )
  1220. AC_ARG_WITH(system-rhino,
  1221. AS_HELP_STRING([--with-system-rhino],
  1222. [Use rhino already on system.]),,)
  1223. # [with_system_rhino="$with_system_jars"])
  1224. # Above is not used as we have different debug interface
  1225. # patched into internal rhino. This code needs to be fixed
  1226. # before we can enable it by default.
  1227. AC_ARG_WITH(rhino-jar,
  1228. AS_HELP_STRING([--with-rhino-jar=JARFILE],
  1229. [Specify path to jarfile manually.]),
  1230. RHINO_JAR=$withval)
  1231. AC_ARG_WITH(commons-codec-jar,
  1232. AS_HELP_STRING([--with-commons-codec-jar=JARFILE],
  1233. [Specify path to jarfile manually.]),
  1234. COMMONS_CODEC_JAR=$withval)
  1235. AC_ARG_WITH(commons-lang-jar,
  1236. AS_HELP_STRING([--with-commons-lang-jar=JARFILE],
  1237. [Specify path to jarfile manually.]),
  1238. COMMONS_LANG_JAR=$withval)
  1239. AC_ARG_WITH(commons-httpclient-jar,
  1240. AS_HELP_STRING([--with-commons-httpclient-jar=JARFILE],
  1241. [Specify path to jarfile manually.]),
  1242. COMMONS_HTTPCLIENT_JAR=$withval)
  1243. AC_ARG_WITH(commons-logging-jar,
  1244. AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
  1245. [Specify path to jarfile manually.]),
  1246. COMMONS_LOGGING_JAR=$withval)
  1247. AC_ARG_WITH(system-servlet-api,
  1248. AS_HELP_STRING([--with-system-servlet-api],
  1249. [Use servlet-api already on system.]),,
  1250. [with_system_servlet_api="$with_system_jars"])
  1251. AC_ARG_WITH(servlet-api-jar,
  1252. AS_HELP_STRING([--with-servlet-api-jar=JARFILE],
  1253. [Specify path to jarfile manually.]),
  1254. SERVLETAPI_JAR=$withval)
  1255. AC_ARG_WITH(system-jfreereport,
  1256. AS_HELP_STRING([--with-system-jfreereport],
  1257. [Use JFreeReport already on system.]),,
  1258. [with_system_jfreereport="$with_system_jars"])
  1259. AC_ARG_WITH(sac-jar,
  1260. AS_HELP_STRING([--with-sac-jar=JARFILE],
  1261. [Specify path to jarfile manually.]),
  1262. SAC_JAR=$withval)
  1263. AC_ARG_WITH(libxml-jar,
  1264. AS_HELP_STRING([--with-libxml-jar=JARFILE],
  1265. [Specify path to jarfile manually.]),
  1266. LIBXML_JAR=$withval)
  1267. AC_ARG_WITH(flute-jar,
  1268. AS_HELP_STRING([--with-flute-jar=JARFILE],
  1269. [Specify path to jarfile manually.]),
  1270. FLUTE_JAR=$withval)
  1271. AC_ARG_WITH(jfreereport-jar,
  1272. AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
  1273. [Specify path to jarfile manually.]),
  1274. JFREEREPORT_JAR=$withval)
  1275. AC_ARG_WITH(liblayout-jar,
  1276. AS_HELP_STRING([--with-liblayout-jar=JARFILE],
  1277. [Specify path to jarfile manually.]),
  1278. LIBLAYOUT_JAR=$withval)
  1279. AC_ARG_WITH(libloader-jar,
  1280. AS_HELP_STRING([--with-libloader-jar=JARFILE],
  1281. [Specify path to jarfile manually.]),
  1282. LIBLOADER_JAR=$withval)
  1283. AC_ARG_WITH(libloader-jar,
  1284. AS_HELP_STRING([--with-libloader-jar=JARFILE],
  1285. [Specify path to jarfile manually.]),
  1286. LIBLOADER_JAR=$withval)
  1287. AC_ARG_WITH(libformula-jar,
  1288. AS_HELP_STRING([--with-libformula-jar=JARFILE],
  1289. [Specify path to jarfile manually.]),
  1290. LIBFORMULA_JAR=$withval)
  1291. AC_ARG_WITH(librepository-jar,
  1292. AS_HELP_STRING([--with-librepository-jar=JARFILE],
  1293. [Specify path to jarfile manually.]),
  1294. LIBREPOSITORY_JAR=$withval)
  1295. AC_ARG_WITH(libfonts-jar,
  1296. AS_HELP_STRING([--with-libfonts-jar=JARFILE],
  1297. [Specify path to jarfile manually.]),
  1298. LIBFONTS_JAR=$withval)
  1299. AC_ARG_WITH(libserializer-jar,
  1300. AS_HELP_STRING([--with-libserializer-jar=JARFILE],
  1301. [Specify path to jarfile manually.]),
  1302. LIBSERIALIZER_JAR=$withval)
  1303. AC_ARG_WITH(libbase-jar,
  1304. AS_HELP_STRING([--with-libbase-jar=JARFILE],
  1305. [Specify path to jarfile manually.]),
  1306. LIBBASE_JAR=$withval)
  1307. AC_ARG_WITH(system-odbc,
  1308. AS_HELP_STRING([--with-system-odbc],
  1309. [Use the odbc headers already on system.]),,
  1310. [with_system_odbc="$with_system_headers"])
  1311. AC_ARG_WITH(system-sane,
  1312. AS_HELP_STRING([--with-system-sane],
  1313. [Use sane.h already on system.]),,
  1314. [with_system_sane="$with_system_headers"])
  1315. AC_ARG_WITH(system-bluez,
  1316. AS_HELP_STRING([--with-system-bluez],
  1317. [Use bluetooth.h already on system.]),,
  1318. [with_system_bluez="$with_system_headers"])
  1319. AC_ARG_WITH(system-xextensions-headers,
  1320. AS_HELP_STRING([--with-system-xextensions-headers],
  1321. [To build without system X11 extensions headers, use
  1322. --without-system-xextensions-headers. This is possibly
  1323. useful on legacy unix systems which ship with the libs
  1324. but without the headers.]))
  1325. AC_ARG_WITH(system-mesa-headers,
  1326. AS_HELP_STRING([--with-system-mesa-headers],
  1327. [Use Mesa headers already on system.]),,
  1328. [with_system_mesa_headers="$with_system_headers"])
  1329. AC_ARG_WITH(system-curl,
  1330. AS_HELP_STRING([--with-system-curl],
  1331. [Use curl already on system.]),,
  1332. [with_system_curl=auto])
  1333. AC_ARG_WITH(system-boost,
  1334. AS_HELP_STRING([--with-system-boost],
  1335. [Use boost already on system.]),,
  1336. [with_system_boost="$with_system_headers"])
  1337. AC_ARG_WITH(system-mdds,
  1338. AS_HELP_STRING([--with-system-mdds],
  1339. [Use mdds already on system.]),,
  1340. [with_system_mdds="$with_system_headers"])
  1341. AC_ARG_WITH(system-vigra,
  1342. AS_HELP_STRING([--with-system-vigra],
  1343. [Use vigra already on system.]),,
  1344. [with_system_vigra="$with_system_headers"])
  1345. AC_ARG_WITH(system-neon,
  1346. AS_HELP_STRING([--with-system-neon],
  1347. [Use neon already on system.]),,
  1348. [with_system_neon="$with_system_libs"])
  1349. AC_ARG_WITH(system-hunspell,
  1350. AS_HELP_STRING([--with-system-hunspell],
  1351. [Use libhunspell already on system.]),,
  1352. [with_system_hunspell="$with_system_libs"])
  1353. AC_ARG_WITH(system-mythes,
  1354. AS_HELP_STRING([--with-system-mythes],
  1355. [Use mythes already on system.]),,
  1356. [with_system_mythes="$with_system_libs"])
  1357. AC_ARG_WITH(system-altlinuxhyph,
  1358. AS_HELP_STRING([--with-system-altlinuxhyph],
  1359. [Use ALTLinuxhyph already on system.]),,
  1360. [with_system_altlinuxhyph="$with_system_libs"])
  1361. AC_ARG_WITH(system-lpsolve,
  1362. AS_HELP_STRING([--with-system-lpsolve],
  1363. [Use lpsolve already on system.]),,
  1364. [with_system_lpsolve="$with_system_libs"])
  1365. AC_ARG_WITH(system-libexttextcat,
  1366. AS_HELP_STRING([--with-system-libexttextcat],
  1367. [Use libexttextcat already on system.]),,
  1368. [with_system_libexttextcat="$with_system_libs"])
  1369. AC_ARG_WITH(system-cppunit,
  1370. AS_HELP_STRING([--with-system-cppunit],
  1371. [Use cppunit already on system.]),,
  1372. [with_system_cppunit="$with_system_libs"])
  1373. AC_ARG_WITH(system-redland,
  1374. AS_HELP_STRING([--with-system-redland],
  1375. [Use redland library already on system.]),,
  1376. [with_system_redland="$with_system_libs"])
  1377. AC_ARG_WITH(system-orcus,
  1378. AS_HELP_STRING([--with-system-orcus],
  1379. [Use orcus library already on system.]),,
  1380. [with_system_orcus="$with_system_libs"])
  1381. AC_ARG_WITH(system-liblangtag,
  1382. AS_HELP_STRING([--with-system-liblangtag],
  1383. [Use liblangtag library already on system.]),,
  1384. [with_system_liblangtag="$with_system_libs"])
  1385. AC_ARG_WITH(system-mozilla,
  1386. AS_HELP_STRING([--with-system-mozilla],
  1387. [DEPRECATED : is ignored]),,
  1388. )
  1389. AC_ARG_WITH(system-npapi-headers,
  1390. AS_HELP_STRING([--with-system-npapi-headers],
  1391. [Use NPAPI headers provided by system instead of bundled ones. Used in
  1392. extensions/source/nsplugin (ENABLE_NPAPI_INTO_BROWSER=YES) and
  1393. extensions/source/plugin (ENABLE_NPAPI_FROM_BROWSER=YES)]),,
  1394. [with_system_npapi_headers="$with_system_headers"]
  1395. )
  1396. AC_ARG_WITH(system-libpng,
  1397. AS_HELP_STRING([--with-system-libpng],
  1398. [Use libpng already on system.]),,
  1399. [with_system_libpng=auto])
  1400. AC_ARG_WITH(linker-hash-style,
  1401. AS_HELP_STRING([--with-linker-hash-style],
  1402. [Use linker with --hash-style=<style> when linking shared objects.
  1403. Possible values: "sysv", "gnu", "both". The default value is "gnu"
  1404. if supported on the build system, and "sysv" otherwise.]))
  1405. AC_ARG_WITH(stlport,
  1406. AS_HELP_STRING([--with-stlport],
  1407. [Build the STLPort library for compatibility with old extensions for
  1408. architectures where STLPort used to be used.]),
  1409. with_stlport=$withval ,
  1410. with_stlport=auto)
  1411. AC_ARG_WITH(jdk-home,
  1412. AS_HELP_STRING([--with-jdk-home],
  1413. [If you have installed JDK 1.3 or later on your system please supply the
  1414. path here. Note that this is not the location of the java command but the
  1415. location of the entire distribution.])
  1416. [
  1417. Usage: --with-jdk-home=<absolute path to JDK home>
  1418. ],
  1419. ,)
  1420. AC_ARG_WITH(gxx_include_path,
  1421. AS_HELP_STRING([--with-gxx-include-path],
  1422. [If you want to override the autodetected g++ include path.])
  1423. [
  1424. Usage: --with-gxx-include-path=<absolute path to
  1425. g++ include dir>
  1426. ],
  1427. ,)
  1428. AC_ARG_WITH(help,
  1429. AS_HELP_STRING([--without-help],
  1430. [Disable the build of help.]))
  1431. AC_ARG_WITH(java,
  1432. AS_HELP_STRING([--with-java],
  1433. [Specify the name of the Java interpreter command. Typically "java"
  1434. which is the default.
  1435. To build without support for Java components, applets, accessibility
  1436. or the XML filters written in Java, use --without-java or --with-java=no.])
  1437. [
  1438. Usage: --with-java==<java command>
  1439. --without-java
  1440. ],
  1441. [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
  1442. [ with_java=java ]
  1443. )
  1444. AC_ARG_WITH(jvm-path,
  1445. AS_HELP_STRING([--with-jvm-path],
  1446. [Use a specific JVM search path at runtime.])
  1447. [
  1448. Usage: --with-jvm-path=<absolute path to parent of jvm home>
  1449. e. g.: --with-jvm-path=/usr/lib/
  1450. to find JRE/JDK in /usr/lib/jvm/
  1451. ],
  1452. ,)
  1453. AC_ARG_WITH(ant-home,
  1454. AS_HELP_STRING([--with-ant-home],
  1455. [If you have installed Jakarta Ant on your system, please supply the path here.
  1456. Note that this is not the location of the Ant binary but the location
  1457. of the entire distribution.])
  1458. [
  1459. Usage: --with-ant-home=<absolute path to Ant home>
  1460. ],
  1461. ,)
  1462. AC_ARG_WITH(junit,
  1463. AS_HELP_STRING([--with-junit],
  1464. [Specifies the JUnit 4 jar file to use for JUnit-based tests.
  1465. --without-junit disables those tests. Not relevant in the --without-java case.])
  1466. [
  1467. Usage: --with-junit=<absolute path to JUnit 4 jar>
  1468. ],
  1469. ,with_junit=yes)
  1470. AC_ARG_WITH(perl-home,
  1471. AS_HELP_STRING([--with-perl-home],
  1472. [If you have installed Perl 5 Distribution, on your system, please
  1473. supply the path here. Note that this is not the location of the Perl
  1474. binary but the location of the entire distribution.])
  1475. [
  1476. Usage: --with-perl-home=<abs. path to Perl 5 home>
  1477. ],
  1478. ,)
  1479. AC_ARG_WITH(
  1480. [doxygen],
  1481. AS_HELP_STRING(
  1482. [--with-doxygen],
  1483. [Specifies the doxygen executable to use when generating ODK C/C++
  1484. documentation. --without-doxygen disables generation of ODK C/C++
  1485. documentation. Not relevant in the --disable-odk case.])
  1486. [
  1487. Usage: --with-doxygen=<absolute path to doxygen executable>
  1488. ],,
  1489. [with_doxygen=yes])
  1490. AC_ARG_WITH(cl-home,
  1491. AS_HELP_STRING([--with-cl-home],
  1492. [For Windows NT users, please supply the path for the Microsoft C/C++
  1493. compiler. Note that this is not the location of the compiler binary but
  1494. the location of the entire distribution.])
  1495. [
  1496. Usage: --with-cl-home=<absolute path to Microsoft
  1497. C/C++ compiler home>
  1498. ],
  1499. ,)
  1500. AC_ARG_WITH(mspdb-path,
  1501. AS_HELP_STRING([--with-mspdb-path],
  1502. [For Microsoft C/C++ compiler users, please supply the path pointing to
  1503. the mspdb80.dll (if using Visual Studio 2008) or mspdb100.dll (if using
  1504. Visual Studio 2010).])
  1505. [
  1506. Usage: --with-mspdb-path=<path to
  1507. mspdb80.dll/mspdb100.dll>
  1508. ],
  1509. ,)
  1510. AC_ARG_WITH(midl-path,
  1511. AS_HELP_STRING([--with-midl-path],
  1512. [For Microsoft compiler users, please supply the path pointing to the midl.exe.])
  1513. [
  1514. Usage: --with-midl-path=<abs. path to midl.exe>
  1515. ],
  1516. ,)
  1517. AC_ARG_WITH(csc-path,
  1518. AS_HELP_STRING([--with-csc-path],
  1519. [For Windows builds, please supply the path pointing to the csc.exe.
  1520. Usually found automatically when building on Windows.])
  1521. [
  1522. Usage: --with-csc-path=<abs. path to csc.exe>
  1523. ],
  1524. ,)
  1525. AC_ARG_WITH(dotnet-framework-home,
  1526. AS_HELP_STRING([--with-dotnet-framework-home],
  1527. [For Microsoft compiler users, please supply the path pointing to
  1528. lib/mscoree.lib, usually something like:
  1529. "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
  1530. [
  1531. Note that in most cases it will be automatically
  1532. found, though.
  1533. Usage: --with-dotnet-framework-home=<absolute path to .NET
  1534. Framework>
  1535. ],
  1536. ,)
  1537. AC_ARG_WITH(windows-sdk-home,
  1538. AS_HELP_STRING([--with-windows-sdk-home],
  1539. [For Windows builds, please supply the path to the Windows SDK.
  1540. Usually found automatically when building on Windows.])
  1541. [
  1542. Usage: --with-windows-sdk-home=<absolute path to Windows SDK>
  1543. ],
  1544. ,)
  1545. AC_ARG_WITH(directx-home,
  1546. AS_HELP_STRING([--with-directx-home],
  1547. [For Windows users, please supply the path to the Microsoft DirectX SDK.])
  1548. [
  1549. Usage: --with-directx-home=<absolute path to
  1550. Microsoft DirectX SDK>
  1551. ],
  1552. ,)
  1553. AC_ARG_WITH(nss-build-tools,
  1554. AS_HELP_STRING([--with-nss-build-tools],
  1555. [For Windows users, please supply the path to the nss build tools.])
  1556. [
  1557. Usage: --with-nss-build-tools=<absolute path to
  1558. nss build tools>
  1559. At the moment of this writing, an installer for the
  1560. mozilla build tools can be obtained from http://ftp.
  1561. mozilla.org/pub/mozilla.org/mozilla/libraries/win32.
  1562. ],
  1563. NSSBUILDTOOLS=$withval ,
  1564. ) # NSSBUILDTOOLS
  1565. AC_ARG_WITH(lang,
  1566. AS_HELP_STRING([--with-lang],
  1567. [Use this option to build LibreOffice with additional language support.
  1568. English (US) is always included by default.
  1569. Separate multiple languages with space.
  1570. For all languages, use --with-lang=ALL.])
  1571. [
  1572. Usage: --with-lang="es sw tu cs sk"
  1573. ],
  1574. ,)
  1575. # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
  1576. AC_ARG_WITH(krb5,
  1577. AS_HELP_STRING([--with-krb5],
  1578. [Enable MIT Kerberos 5 support in modules that support it.
  1579. By default automatically enabled on platforms
  1580. where a good system Kerberos 5 is available.]),
  1581. ,)
  1582. AC_ARG_WITH(gssapi,
  1583. AS_HELP_STRING([--with-gssapi],
  1584. [Enable GSSAPI support in modules that support it.
  1585. By default automatically enabled on platforms
  1586. where a good system GSSAPI is available.]),
  1587. ,)
  1588. dnl ===================================================================
  1589. dnl Branding
  1590. dnl ===================================================================
  1591. AC_ARG_WITH(branding,
  1592. [ --with-branding Use given path to retrieve all branding images.
  1593. Expects /path/intro.png ...
  1594. /path/backing_rtl_right.png to be there. Individual
  1595. images can be overridden via --with-intro-bitmap ...
  1596. --with-startcenter-rtl-left-bitmap switches.
  1597. Usage: --with-branding=/path/to/images
  1598. ],,)
  1599. AC_ARG_WITH(intro-bitmap,
  1600. [ --with-intro-bitmap Prefer the specified intro bitmap over the
  1601. the default one.
  1602. Usage: --with-intro-bitmap=/path/my_ooo_intro.png
  1603. ],,)
  1604. AC_ARG_WITH(intro-progressbar-color,
  1605. [ --with-intro-progressbar-color Set color of progress bar on intro screen.
  1606. Comma separated RGB values in decimal format.
  1607. Usage: --with-intro-progressbar-color=126,170,23
  1608. ],,)
  1609. AC_ARG_WITH(intro-progressbar-size,
  1610. [ --with-intro-progressbar-size Set size of progress bar on intro screen.
  1611. Comma separated values in decimal format.
  1612. Usage: --with-intro-progressbar-size=319,10
  1613. ],,)
  1614. AC_ARG_WITH(intro-progressbar-position,
  1615. [ --with-intro-progressbar-position Set position of progress bar on intro screen.
  1616. Comma separated values in decimal format.
  1617. Usage: --with-intro-progressbar-position=164,225
  1618. ],,)
  1619. AC_ARG_WITH(intro-progressbar-frame-color,
  1620. [ --with-intro-progressbar-frame-color Set color of progress bar frame on intro screen.
  1621. Comma separated RGB values in decimal format.
  1622. Usage: --with-intro-progressbar-frame-color=207,208,211
  1623. ],,)
  1624. AC_ARG_WITH(intro-progressbar-text-color,
  1625. AS_HELP_STRING([--with-intro-progressbar-text-color],
  1626. [Set color of progress bar text on intro screen. Comma separated RGB values in decimal format.])
  1627. [
  1628. Usage: --with-intro-progressbar-text-color=207,208,211
  1629. ],,)
  1630. AC_ARG_WITH(intro-progressbar-text-baseline,
  1631. AS_HELP_STRING([--with-intro-progressbar-text-baseline],
  1632. [Set vertical position of progress bar text on intro screen. Value in decimal format.])
  1633. [
  1634. Usage: --with-intro-progressbar-text-baseline=250
  1635. ],,)
  1636. AC_ARG_WITH(flat-logo-svg,
  1637. [ --with-flat-logo-svg Allows specification of the flat Logo SVG.
  1638. Usage: --with-flat-logo-svg=/path/my_flat_logo.svg
  1639. ],,)
  1640. AC_ARG_WITH(about-background-svg,
  1641. [ --with-about-background-svg Allows specification of the background SVG for the About dialog.
  1642. Usage: --with-about-background-svg=/path/my_libo_about.svg
  1643. ],,)
  1644. AC_ARG_WITH(startcenter-left-bitmap,
  1645. [ --with-startcenter-left-bitmap Similarly to --with-intro-bitmap, this allows
  1646. specification of bitmap for the Start center.
  1647. Usage: --with-startcenter-left-bitmap=/path/my_backing_left.png
  1648. ],,)
  1649. AC_ARG_WITH(startcenter-right-bitmap,
  1650. [ --with-startcenter-right-bitmap Similarly to --with-intro-bitmap, this allows
  1651. specification of bitmap for the Start center.
  1652. Usage: --with-startcenter-right-bitmap=/path/my_backing_right.png
  1653. ],,)
  1654. AC_ARG_WITH(startcenter-rtl-left-bitmap,
  1655. [ --with-startcenter-rtl-left-bitmap Similarly to --with-intro-bitmap, this allows
  1656. specification of bitmap for the Start center.
  1657. Usage: --with-startcenter-rtl-left-bitmap=/path/my_backing_rtl_left.png
  1658. ],,)
  1659. AC_ARG_WITH(startcenter-rtl-right-bitmap,
  1660. [ --with-startcenter-rtl-right-bitmap Similarly to --with-intro-bitmap, this allows
  1661. specification of bitmap for the Start center.
  1662. Usage: --with-startcenter-rtl-right-bitmap=/path/my_backing_rtl_right.png
  1663. ],,)
  1664. AC_ARG_WITH(startcenter-space-bitmap,
  1665. [ --with-startcenter-space-bitmap Similarly to --with-intro-bitmap, this allows
  1666. specification of bitmap for the Start center.
  1667. Usage: --with-startcenter-space-bitmap=/path/my_backing_space.png
  1668. ],,)
  1669. AC_ARG_WITH(extra-buildid,
  1670. AS_HELP_STRING([--with-extra-buildid],
  1671. [Show addition build identification in about dialog.])
  1672. [
  1673. Usage: --with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"
  1674. ],
  1675. ,)
  1676. AC_ARG_WITH(vendor,
  1677. AS_HELP_STRING([--with-vendor],
  1678. [Set vendor of the build.])
  1679. [
  1680. Usage: --with-vendor="John the Builder"
  1681. ],
  1682. ,)
  1683. AC_ARG_WITH(unix-wrapper,
  1684. AS_HELP_STRING([--with-unix-wrapper],
  1685. [Redefines the name of the UNIX wrapper that will be used in the desktop
  1686. files and in the desktop-integration RPMs.])
  1687. [
  1688. Usage: --with-unix-wrapper=ooffice
  1689. ],
  1690. ,)
  1691. AC_ARG_WITH(compat-oowrappers,
  1692. AS_HELP_STRING([--with-compat-oowrappers],
  1693. [Install oo* wrappers in parallel with
  1694. lo* ones to keep backward compatibility.
  1695. Has effect only with make distro-pack-install]),
  1696. ,)
  1697. AC_ARG_WITH(asm-home,
  1698. AS_HELP_STRING([--with-asm-home],
  1699. [For Windows, please supply the path for the ml.exe or ml64.exe assembler.])
  1700. [
  1701. Usage: --with-asm-home=<path to assembler directory>
  1702. ],
  1703. ,)
  1704. AC_ARG_WITH(os-version,
  1705. AS_HELP_STRING([--with-os-version],
  1706. [For FreeBSD users, use this option option to override the detected OSVERSION.])
  1707. [
  1708. Usage: --with-os-version=<OSVERSION>
  1709. ],
  1710. ,)
  1711. AC_ARG_WITH(mingw-cross-compiler,
  1712. AS_HELP_STRING([--with-mingw-cross-compiler],
  1713. [Specify the MinGW cross-compiler to use.])
  1714. [
  1715. Usage: --with-mingw-cross-compiler=<mingw32-g++ command>
  1716. When building on the ODK on Unix and building unowinreg.dll,
  1717. specify the MinGW C++ cross-compiler.
  1718. ],
  1719. ,)
  1720. AC_ARG_WITH(idlc-cpp,
  1721. AS_HELP_STRING([--with-idlc-cpp],
  1722. [Specify the C Preprocessor to use for idlc.])
  1723. [
  1724. Usage: --with-idlc-cpp=cpp
  1725. Default is ucpp.
  1726. ]
  1727. ,)
  1728. AC_ARG_WITH(build-version,
  1729. AS_HELP_STRING([--with-build-version],
  1730. [Allows the builder to add a custom version tag that will appear in the
  1731. Help/About box for QA purposes.])
  1732. [
  1733. Usage: --with-build-version="Built by Jim"
  1734. ],
  1735. with_build_version=$withval ,
  1736. )
  1737. AC_ARG_WITH(alloc,
  1738. AS_HELP_STRING([--with-alloc],
  1739. [Define which allocator to build with (choices are oo, system, tcmalloc, jemalloc).
  1740. Note that on FreeBSD/NetBSD system==jemalloc]),
  1741. ,)
  1742. AC_ARG_WITH(sun-templates,
  1743. AS_HELP_STRING([--with-sun-templates],
  1744. [Integrate Sun template packages.]),
  1745. ,)
  1746. AC_ARG_WITH(parallelism,
  1747. AS_HELP_STRING([--with-parallelism],
  1748. [Number of jobs to run simultaneously during build. Parallel builds can save a lot
  1749. of time on multi-cpu machines. The real number of jobs can get up to parallelism*parallelism
  1750. for a while in the first build phase. That will not happen when dmake is removed.
  1751. Defaults to the number of CPUs on the machine, unless you configure --enable-icecream - then to 10.]),
  1752. ,)
  1753. AC_ARG_WITH(check-jobs,
  1754. AS_HELP_STRING([--with-check-jobs],
  1755. [Maximum number of jobs that will be issued at the same time during 'make subsequenttest'.
  1756. Default value is the same as 'parallelism'. Useful because the subsequent tests are very lightweight.]),
  1757. ,)
  1758. AC_ARG_WITH(all-tarballs,
  1759. AS_HELP_STRING([--with-all-tarballs],
  1760. [Download all external tarballs unconditionally]))
  1761. dnl ===================================================================
  1762. dnl Test whether build target is Release Build
  1763. dnl ===================================================================
  1764. AC_MSG_CHECKING([whether build target is Release Build])
  1765. if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
  1766. AC_MSG_RESULT([no])
  1767. ENABLE_RELEASE_BUILD="FALSE"
  1768. else
  1769. AC_MSG_RESULT([yes])
  1770. ENABLE_RELEASE_BUILD="TRUE"
  1771. fi
  1772. AC_SUBST(ENABLE_RELEASE_BUILD)
  1773. dnl ===================================================================
  1774. dnl MacOSX build and runtime environment options
  1775. dnl ===================================================================
  1776. AC_ARG_WITH(macosx-sdk,
  1777. AS_HELP_STRING([--with-macosx-sdk],
  1778. [Use a specific SDK for building.])
  1779. [
  1780. Usage: --with-macosx-sdk=<version>
  1781. e. g.: --with-macosx-sdk=10.4
  1782. there are 3 options to control the MacOSX build:
  1783. --with-macosx-sdk (refered as 'sdk' below)
  1784. --with-macosx-version-min-required (refered as 'min' below)
  1785. --with-macosx-version-max-allowed (refered as 'max' below)
  1786. the connection between these value and the default they take is as follow:
  1787. ( ? means not specified on the command line, s means the SDK version found,
  1788. constraint: x <= y <= z)
  1789. ==========================================
  1790. command line || config result
  1791. ==========================================
  1792. min | max | sdk || min | max | sdk |
  1793. ? | ? | ? || 10.4 | 10.s | 10.s |
  1794. ? | ? | 10.x || 10.4 | 10.x | 10.x |
  1795. ? | 10.x | ? || 10.4 | 10.s | 10.s |
  1796. ? | 10.x | 10.y || 10.4 | 10.x | 10.y |
  1797. 10.x | ? | ? || 10.x | 10.s | 10.s |
  1798. 10.x | ? | 10.y || 10.x | 10.y | 10.y |
  1799. 10.x | 10.y | ? || 10.x | 10.y | 10.y |
  1800. 10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
  1801. see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
  1802. for a detailled technical explanation of these variables
  1803. Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
  1804. Note that even if in theory using a --with-macosx-version-max-allowed
  1805. (i.e. the MAC_OS_X_VERSION_MAX_ALLOWED macro) less than the SDK version
  1806. should work, in practice Apple doesn't seem to test that, and at least
  1807. compiling with -DMAC_OS_X_VERSION_MAX_ALLOWED=1060 against the 10.7 SDK
  1808. fails in a couple of places. Just because of oversights in ifdefs in the SDK
  1809. headers, but still.
  1810. ],
  1811. ,)
  1812. AC_ARG_WITH(macosx-version-min-required,
  1813. AS_HELP_STRING([--with-macosx-version-min-required],
  1814. [set the minimum OS version needed to run the built LibreOffice])
  1815. [
  1816. Usage: --with-macosx-version-min-required=<version>
  1817. e. g.: --with-macos-version-min-required=10.4
  1818. see --with-macosx-sdk for more info
  1819. ],
  1820. ,)
  1821. AC_ARG_WITH(macosx-version-max-allowed,
  1822. AS_HELP_STRING([--with-macosx-version-max-allowed],
  1823. [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
  1824. [
  1825. Usage: --with-macosx-version-max-allowed=<version>
  1826. e. g.: --with-macos-version-max-allowed=10.6
  1827. see --with-macosx-sdk for more info
  1828. ],
  1829. ,)
  1830. dnl ===================================================================
  1831. dnl options for stuff used during cross-compilation build
  1832. dnl These are superseded by --with-build-platform-configure-options
  1833. dnl ===================================================================
  1834. AC_ARG_WITH(system-boost-for-build,
  1835. AS_HELP_STRING([--with-system-boost-for-build],
  1836. [Use boost already on system for build tools (cross-compilation only).]))
  1837. AC_ARG_WITH(system-cppunit-for-build,
  1838. AS_HELP_STRING([--with-system-cppunit-for-build],
  1839. [Use cppunit already on system for build tools (cross-compilation only).]))
  1840. AC_ARG_WITH(system-expat-for-build,
  1841. AS_HELP_STRING([--with-system-expat-for-build],
  1842. [Use expat already on system for build tools (cross-compilation only).]))
  1843. AC_ARG_WITH(system-icu-for-build,
  1844. AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
  1845. [Use icu already on system for build tools (cross-compilation only).]))
  1846. AC_ARG_WITH(system-libxml-for-build,
  1847. AS_HELP_STRING([--with-system-libxml-for-build],
  1848. [Use libxml/libxslt already on system for build tools (cross-compilation only).]))
  1849. dnl ===================================================================
  1850. dnl check for required programs (grep, awk, sed, bash)
  1851. dnl ===================================================================
  1852. pathmunge ()
  1853. {
  1854. if test -n "$1"; then
  1855. if test "$build_os" = "cygwin"; then
  1856. PathFormat "$1"
  1857. new_path=`cygpath -u "$formatted_path"`
  1858. else
  1859. new_path="$1"
  1860. fi
  1861. if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
  1862. if test "$2" = "after"; then
  1863. LO_PATH="$LO_PATH:$new_path"
  1864. else
  1865. LO_PATH="$new_path:$LO_PATH"
  1866. fi
  1867. fi
  1868. unset new_path
  1869. fi
  1870. }
  1871. AC_PROG_AWK
  1872. AC_PATH_PROG( AWK, $AWK)
  1873. if test -z "$AWK"; then
  1874. AC_MSG_ERROR([install awk to run this script])
  1875. fi
  1876. AC_PATH_PROG(BASH, bash)
  1877. if test -z "$BASH"; then
  1878. AC_MSG_ERROR([bash not found in \$PATH])
  1879. fi
  1880. AC_SUBST(BASH)
  1881. AC_MSG_CHECKING([for GNU or BSD tar])
  1882. for a in $GNUTAR gtar gnutar tar /usr/sfw/bin/gtar; do
  1883. $a --version 2> /dev/null | egrep "GNU|bsdtar" 2>&1 > /dev/null
  1884. if test $? -eq 0; then
  1885. GNUTAR=$a
  1886. break
  1887. fi
  1888. done
  1889. AC_MSG_RESULT($GNUTAR)
  1890. if test -z "$GNUTAR"; then
  1891. AC_MSG_ERROR([not found. install GNU or BSD tar.])
  1892. fi
  1893. AC_SUBST(GNUTAR)
  1894. AC_MSG_CHECKING([for tar's option to strip components])
  1895. $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
  1896. if test $? -eq 0; then
  1897. STRIP_COMPONENTS="--strip-components"
  1898. else
  1899. $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
  1900. if test $? -eq 0; then
  1901. STRIP_COMPONENTS="--strip-path"
  1902. else
  1903. STRIP_COMPONENTS="unsupported"
  1904. fi
  1905. fi
  1906. AC_MSG_RESULT($STRIP_COMPONENTS)
  1907. if test x$STRIP_COMPONENTS == xunsupported; then
  1908. AC_MSG_ERROR([you need a tar that is able to strip components.])
  1909. fi
  1910. AC_SUBST(STRIP_COMPONENTS)
  1911. dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
  1912. dnl desktop OSes from "mobile" ones.
  1913. dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
  1914. dnl In other words, that when building for an OS that is not a
  1915. dnl "desktop" one but a "mobile" one, we are always cross-compiling.
  1916. dnl Note the direction of the implication; there is no assumption that
  1917. dnl cross-compiling would imply a non-desktop OS.
  1918. if test $_os != iOS -a $_os != Android; then
  1919. BUILD_TYPE="$BUILD_TYPE DESKTOP"
  1920. fi
  1921. # Currently we build only viewer apps for Android (and for iOS not even that yet), so to avoid getting
  1922. # some pathological export-related code and data linked in, we will add some judicious #ifndef
  1923. # DISABLE_EXPORT in the code in places where the linker map shows it has a big impact. Places that
  1924. # generate large amounts of code or data related to export only but still gets linked in. At least
  1925. # that is the theory, let's see...
  1926. if test -z "$enable_export"; then
  1927. if test $_os != Android -a $_os != iOS; then
  1928. enable_export=yes
  1929. fi
  1930. fi
  1931. DISABLE_EXPORT=''
  1932. if test "$enable_export" = yes; then
  1933. BUILD_TYPE="$BUILD_TYPE EXPORT"
  1934. else
  1935. DISABLE_EXPORT='TRUE'
  1936. SCPDEFS="$SCPDES -DDISABLE_EXPORT"
  1937. fi
  1938. AC_SUBST(DISABLE_EXPORT)
  1939. dnl Decide whether to build database connectivity stuff (including
  1940. dnl Base) or not. We probably don't want to on non-desktop OSes.
  1941. if test -z "$enable_database_connectivity"; then
  1942. # Do enable database connectivity for Android for now as otherwise
  1943. # we presumably will get linking errors... We are not as far in
  1944. # the work for iOS, so we might as well disable it for iOS already.
  1945. # And actually, do enable it for iOS, too. Let's get back to
  1946. # figuring out what to do with this later, if ever.
  1947. # (Note that with "enable", I mean "enable building the related
  1948. # code". Very likely little of it will make any sense at run-time
  1949. # on Android or iOS and won't even be shipped with/linked into any
  1950. # app.)
  1951. #if test $_os != iOS; then
  1952. enable_database_connectivity=yes
  1953. #fi
  1954. fi
  1955. DISABLE_DBCONNECTIVITY=''
  1956. if test "$enable_database_connectivity" = yes; then
  1957. BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
  1958. else
  1959. DISABLE_DBCONNECTIVITY='TRUE'
  1960. SCPDEFS="$SCPDEFS -DDISABLE_DBCONNECTIVITY"
  1961. fi
  1962. AC_SUBST(DISABLE_DBCONNECTIVITY)
  1963. if test -z "$enable_extensions"; then
  1964. # For iOS disable extensions unless specifically overridden with
  1965. # --enable-extensions.
  1966. if test $_os != iOS; then
  1967. enable_extensions=yes
  1968. fi
  1969. fi
  1970. DISABLE_EXTENSIONS=''
  1971. if test "$enable_extensions" = yes; then
  1972. BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
  1973. else
  1974. DISABLE_EXTENSIONS='TRUE'
  1975. fi
  1976. AC_SUBST(DISABLE_EXTENSIONS)
  1977. if test -z "$enable_scripting"; then
  1978. # Disable scripting for iOS unless specifically overridden
  1979. # with --enable-scripting.
  1980. if test $_os != iOS; then
  1981. enable_scripting=yes
  1982. fi
  1983. fi
  1984. DISABLE_SCRIPTING=''
  1985. if test "$enable_scripting" = yes; then
  1986. BUILD_TYPE="$BUILD_TYPE SCRIPTING"
  1987. else
  1988. DISABLE_SCRIPTING='TRUE'
  1989. SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
  1990. fi
  1991. AC_SUBST(DISABLE_SCRIPTING)
  1992. if test $_os = iOS -o $_os = Android; then
  1993. # Disable dynamic_loading always for iOS and Android
  1994. enable_dynamic_loading=no
  1995. elif test -z "$enable_dynamic_loading"; then
  1996. # Otherwise enable it unless speficically disabled
  1997. enable_dynamic_loading=yes
  1998. fi
  1999. DISABLE_DYNLOADING=''
  2000. if test "$enable_dynamic_loading" = yes; then
  2001. BUILD_TYPE="$BUILD_TYPE DYNLOADING"
  2002. else
  2003. DISABLE_DYNLOADING='TRUE'
  2004. SCPDEFS="$SCPDEFS -DDISABLE_DYNLOADING"
  2005. fi
  2006. AC_SUBST(DISABLE_DYNLOADING)
  2007. if test -n "${with_solver_and_workdir_root}"; then
  2008. if ! test -d ${with_solver_and_workdir_root}; then
  2009. AC_MSG_ERROR([directory does not exist: ${with_solver_and_workdir_root}])
  2010. fi
  2011. PathFormat "${with_solver_and_workdir_root}"
  2012. # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
  2013. if echo ${formatted_path} | $GREP -q '/$'; then
  2014. SOLARVER=${formatted_path}solver
  2015. else
  2016. SOLARVER=${formatted_path}/solver
  2017. fi
  2018. else
  2019. SOLARVER=${SRC_ROOT}/solver
  2020. fi
  2021. dnl ===================================================================
  2022. dnl Extra check for Windows. Cygwin builds need gcc to build dmake
  2023. dnl although MSVC is used to build other build-time tools and
  2024. dnl LibreOffice itself.
  2025. dnl ===================================================================
  2026. if test "$build_os" = "cygwin"; then
  2027. AC_MSG_CHECKING([for Cygwin gcc/g++])
  2028. if which gcc > /dev/null && which g++ > /dev/null; then
  2029. AC_MSG_RESULT([found])
  2030. else
  2031. AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
  2032. fi
  2033. fi
  2034. # remenber SYSBASE value
  2035. AC_SUBST(SYSBASE)
  2036. dnl ===================================================================
  2037. dnl Checks if ccache is available
  2038. dnl ===================================================================
  2039. if test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
  2040. case "%$CC%$CXX%" in
  2041. # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some verison number etc),
  2042. # assume that's good then
  2043. *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
  2044. AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
  2045. ;;
  2046. *)
  2047. AC_PATH_PROG([CCACHE],[ccache],[not found])
  2048. if test "$CCACHE" = "not found"; then
  2049. CCACHE=""
  2050. else
  2051. # Need to check for ccache version: otherwise prevents
  2052. # caching of the results (like "-x objective-c++" for Mac)
  2053. if test $_os = Darwin -o $_os = iOS; then
  2054. # Check ccache version
  2055. AC_MSG_CHECKING([whether version of ccache is suitable])
  2056. CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
  2057. CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  2058. if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
  2059. AC_MSG_RESULT([yes, $CCACHE_VERSION])
  2060. else
  2061. AC_MSG_RESULT([no, $CCACHE_VERSION])
  2062. CCACHE=""
  2063. fi
  2064. fi
  2065. fi
  2066. ;;
  2067. esac
  2068. else
  2069. CCACHE=""
  2070. fi
  2071. if test "$CCACHE" != ""; then
  2072. ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
  2073. ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
  2074. if test "$ccache_size" = ""; then
  2075. ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
  2076. if test "$ccache_size" = ""; then
  2077. ccache_size=0
  2078. fi
  2079. # we could not determine the size or it was less than 1GB -> disable auto-ccache
  2080. if test $ccache_size -lt 1024; then
  2081. CCACHE=""
  2082. AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-producive: Disabling auto-ccache detection])
  2083. add_warning "ccache's cache size is less than 1GB using it is counter-producive: auto-ccache detection disabled"
  2084. else
  2085. # warn that ccache may be too small for debug build
  2086. AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
  2087. add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
  2088. fi
  2089. else
  2090. if test $ccache_size -lt 5; then
  2091. #warn that ccache may be too small for debug build
  2092. AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build])
  2093. add_warning "ccache's cache size is less than 5GB using it may be counter-producive for debug or symbol-enabled build"
  2094. fi
  2095. fi
  2096. fi
  2097. dnl ===================================================================
  2098. dnl Checks for C compiler,
  2099. dnl The check for the C++ compiler is later on.
  2100. dnl ===================================================================
  2101. GCC_HOME_SET="true"
  2102. AC_MSG_CHECKING([gcc home])
  2103. if test -z "$with_gcc_home"; then
  2104. if test "$enable_icecream" = "yes"; then
  2105. if test -d "/usr/lib/icecc/bin"; then
  2106. GCC_HOME="/usr/lib/icecc/"
  2107. else
  2108. GCC_HOME="/opt/icecream/"
  2109. fi
  2110. else
  2111. GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
  2112. GCC_HOME_SET="false"
  2113. fi
  2114. else
  2115. GCC_HOME="$with_gcc_home"
  2116. fi
  2117. AC_MSG_RESULT($GCC_HOME)
  2118. AC_SUBST(GCC_HOME)
  2119. if test "$GCC_HOME_SET" = "true"; then
  2120. if test -z "$CC"; then
  2121. CC="$GCC_HOME/bin/gcc"
  2122. fi
  2123. if test -z "$CXX"; then
  2124. CXX="$GCC_HOME/bin/g++"
  2125. fi
  2126. fi
  2127. dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
  2128. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  2129. # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
  2130. save_CFLAGS=$CFLAGS
  2131. AC_PROG_CC
  2132. CFLAGS=$save_CFLAGS
  2133. fi
  2134. COMPATH=`dirname "$CC"`
  2135. if test "$COMPATH" = "."; then
  2136. AC_PATH_PROGS(COMPATH, $CC)
  2137. dnl double square bracket to get single because of M4 quote...
  2138. COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
  2139. fi
  2140. COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
  2141. dnl ===================================================================
  2142. dnl Test the Solaris compiler version
  2143. dnl ===================================================================
  2144. if test "$_os" = "SunOS"; then
  2145. if test "$CC" = "cc"; then
  2146. AC_PATH_PROGS(_cc, cc)
  2147. COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"`
  2148. AC_MSG_CHECKING([the SunStudio C/C++ compiler version])
  2149. dnl cc -V outputs to standard error!!!!
  2150. _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | $SED -e 's/.* C //'`
  2151. _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'`
  2152. _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'`
  2153. if test "$_sunstudio_major" != "5"; then
  2154. AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
  2155. else
  2156. _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'`
  2157. if test "$_sunstudio_minor" = "false"; then
  2158. AC_MSG_ERROR([found version "$_sunstudio_version", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler])
  2159. else
  2160. dnl compiler will do
  2161. AC_MSG_RESULT([checked])
  2162. fi
  2163. fi
  2164. fi
  2165. fi
  2166. dnl ===================================================================
  2167. dnl Check / find MacOSX SDK and compiler, version checks
  2168. dnl ===================================================================
  2169. if test "$_os" = "Darwin"; then
  2170. if test "$build_cpu" = i386 -a "$host_cpu" = powerpc; then
  2171. # Cross-compiling for PPC from Intel
  2172. arch='-arch ppc'
  2173. elif test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
  2174. bitness=-m32
  2175. else
  2176. bitness=-m64
  2177. BITNESS_OVERRIDE=64
  2178. fi
  2179. # If no --with-macosx-sdk option is given, first look for the 10.4u
  2180. # SDK (which is distributed with the obsolete Xcode 3), then the
  2181. # 10.6, 10.7 and 10.8 SDKs, in that order. (Don't bother looking
  2182. # for the 10.5 SDK, unlikely somebody would have that but not
  2183. # 10.6, I think.) If not found in some (old) default locations,
  2184. # try the xcode-select tool.
  2185. # The intent is that for "most" Mac-based developers, a suitable
  2186. # SDK will be found automatically without any configure options.
  2187. # For developers still using Xcode 2 or 3, in /Developer, either
  2188. # because it is the only Xcode they have, or they have that in
  2189. # addition to Xcode 4 in /Applications/Xcode.app, the 10.4 SDK
  2190. # should be found.
  2191. # For developers with a current Xcode 4 installed from the Mac App
  2192. # Store, the 10.6, 10.7 or 10.8 SDK should be found.
  2193. AC_MSG_CHECKING([what Mac OS X SDK to use])
  2194. if test -z "$with_macosx_sdk"; then
  2195. if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
  2196. with_macosx_sdk=10.4
  2197. elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
  2198. with_macosx_sdk=10.4
  2199. elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
  2200. with_macosx_sdk=10.4
  2201. elif test -d /Developer/SDKs/MacOSX10.6.sdk; then
  2202. with_macosx_sdk=10.6
  2203. elif test -d /Developer/SDKs/MacOSX10.7.sdk; then
  2204. with_macosx_sdk=10.7
  2205. elif test -x /usr/bin/xcode-select; then
  2206. xcodepath="`xcode-select -print-path`"
  2207. if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"; then
  2208. with_macosx_sdk=10.6
  2209. elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"; then
  2210. with_macosx_sdk=10.7
  2211. elif test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"; then
  2212. with_macosx_sdk=10.8
  2213. fi
  2214. fi
  2215. if test -z "$with_macosx_sdk"; then
  2216. AC_MSG_ERROR([Could not figure out the location of a Mac OS X SDK and its version])
  2217. fi
  2218. fi
  2219. case $with_macosx_sdk in
  2220. 10.4)
  2221. MACOSX_SDK_VERSION=1040
  2222. ;;
  2223. 10.5)
  2224. MACOSX_SDK_VERSION=1050
  2225. ;;
  2226. 10.6)
  2227. MACOSX_SDK_VERSION=1060
  2228. ;;
  2229. 10.7)
  2230. MACOSX_SDK_VERSION=1070
  2231. ;;
  2232. 10.8)
  2233. MACOSX_SDK_VERSION=1080
  2234. ;;
  2235. *)
  2236. AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported value are 10.4--8])
  2237. ;;
  2238. esac
  2239. # Next find it (again, if we deduced its version above by finding
  2240. # it... but we need to look for it once more in case
  2241. # --with-macosx-sdk was given so that the aboce search did not
  2242. # happen).
  2243. if test -z "$MACOSX_SDK_PATH"; then
  2244. case $with_macosx_sdk in
  2245. 10.4)
  2246. if test -d /Developer/SDKs/MacOSX10.4u.sdk; then
  2247. MACOSX_SDK_PATH=/Developer/SDKs/MacOSX10.4u.sdk
  2248. elif test -d /Developer-old/SDKs/MacOSX10.4u.sdk; then
  2249. MACOSX_SDK_PATH=/Developer-old/SDKs/MacOSX10.4u.sdk
  2250. elif test -d /Xcode3/SDKs/MacOSX10.4u.sdk; then
  2251. MACOSX_SDK_PATH=/Xcode3/SDKs/MacOSX10.4u.sdk
  2252. fi
  2253. ;;
  2254. 10.6|10.7|10.8)
  2255. if test -d /Developer/SDKs/MacOSX$with_macosx_sdk.sdk; then
  2256. MACOSX_SDK_PATH=/Developer/SDKs/MacOSX$with_macosx_sdk.sdk
  2257. elif test -x /usr/bin/xcode-select; then
  2258. xcodepath="`xcode-select -print-path`"
  2259. if test -d "$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"; then
  2260. MACOSX_SDK_PATH="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$with_macosx_sdk.sdk"
  2261. fi
  2262. fi
  2263. ;;
  2264. esac
  2265. if test -z "$MACOSX_SDK_PATH"; then
  2266. AC_MSG_ERROR([Could not figure out the location of Mac OS X $with_macosx_sdk SDK])
  2267. fi
  2268. fi
  2269. AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
  2270. if test "$with_macosx_version_min_required" = ""; then
  2271. case $with_macosx_sdk in
  2272. 10.4|10.5)
  2273. with_macosx_version_min_required="10.4";;
  2274. *)
  2275. with_macosx_version_min_required="10.6";;
  2276. esac
  2277. fi
  2278. if test "$with_macosx_version_max_allowed" = ""; then
  2279. with_macosx_version_max_allowed="$with_macosx_sdk"
  2280. fi
  2281. FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
  2282. MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
  2283. case "$with_macosx_version_min_required" in
  2284. 10.4)
  2285. MAC_OS_X_VERSION_MIN_REQUIRED="1040"
  2286. ;;
  2287. 10.5)
  2288. MAC_OS_X_VERSION_MIN_REQUIRED="1050"
  2289. ;;
  2290. 10.6)
  2291. MAC_OS_X_VERSION_MIN_REQUIRED="1060"
  2292. ;;
  2293. 10.7)
  2294. MAC_OS_X_VERSION_MIN_REQUIRED="1070"
  2295. ;;
  2296. 10.8)
  2297. MAC_OS_X_VERSION_MIN_REQUIRED="1080"
  2298. ;;
  2299. *)
  2300. AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported value are 10.4--8])
  2301. ;;
  2302. esac
  2303. if test "$BITNESS_OVERRIDE" = 64; then
  2304. case $with_macosx_version_min_required in
  2305. 10.4|10.5)
  2306. AC_MSG_ERROR([Can't build 64-bit code for with-macosx-version-min-required=$with_macosx_version_min_required])
  2307. ;;
  2308. esac
  2309. fi
  2310. if test "$BITNESS_OVERRIDE" = ""; then
  2311. case "$with_macosx_version_min_required" in
  2312. 10.4)
  2313. case "$with_macosx_sdk" in
  2314. 10.4)
  2315. ;;
  2316. *)
  2317. AC_MSG_WARN([Building with a SDK > 10.4 possibly breaks 10.4 compatibility. Do not use for deliverable build until verified that it really works])
  2318. add_warning "Building with a SDK > 10.4 possibly breaks 10.4 compatibility. Do not use for deliverable build until verified that it really works"
  2319. ;;
  2320. esac
  2321. ;;
  2322. *)
  2323. AC_MSG_WARN([Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build])
  2324. add_warning "Building with a minimum version requirement > 10.4 breaks 10.4 compatibility. Do not use for deliverable build"
  2325. ;;
  2326. esac
  2327. fi
  2328. # If no CC and CXX environment vars, try to guess where the compiler is
  2329. if test -z "$save_CC"; then
  2330. AC_MSG_CHECKING([what compiler to use])
  2331. case $with_macosx_sdk in
  2332. 10.4)
  2333. case "$MACOSX_SDK_PATH" in
  2334. /Developer/*)
  2335. gccprefix=""
  2336. ;;
  2337. /Developer-old/*)
  2338. gccprefix=/Developer-old/usr/bin/
  2339. ;;
  2340. /Xcode3/*)
  2341. gccprefix=/Xcode3/usr/bin/
  2342. ;;
  2343. *)
  2344. AC_MSG_ERROR([Cannot guess gcc location for this SDK])
  2345. ;;
  2346. esac
  2347. CC="${gccprefix}gcc-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2348. CXX="${gccprefix}g++-4.0 $arch -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2349. ;;
  2350. 10.6)
  2351. # Is similar logic as above needed? Is it likely somebody
  2352. # has both an older Xcode with the 10.6 SDK and a current
  2353. # Xcode?
  2354. CC="gcc-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2355. CXX="g++-4.2 $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2356. ;;
  2357. 10.7|10.8)
  2358. CC="`xcrun -find clang` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2359. CXX="`xcrun -find clang++` $bitness -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
  2360. XCRUN=xcrun
  2361. ;;
  2362. esac
  2363. AC_MSG_RESULT([$CC and $CXX])
  2364. fi
  2365. case "$with_macosx_version_max_allowed" in
  2366. 10.4)
  2367. MAC_OS_X_VERSION_MAX_ALLOWED="1040"
  2368. ;;
  2369. 10.5)
  2370. MAC_OS_X_VERSION_MAX_ALLOWED="1050"
  2371. ;;
  2372. 10.6)
  2373. MAC_OS_X_VERSION_MAX_ALLOWED="1060"
  2374. ;;
  2375. 10.7)
  2376. MAC_OS_X_VERSION_MAX_ALLOWED="1070"
  2377. ;;
  2378. 10.8)
  2379. MAC_OS_X_VERSION_MAX_ALLOWED="1080"
  2380. ;;
  2381. *)
  2382. AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported value are 10.4--8])
  2383. ;;
  2384. esac
  2385. AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
  2386. if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
  2387. AC_MSG_ERROR([the version minimumn required must be inferior or equal to the version maximum allowed])
  2388. else
  2389. AC_MSG_RESULT([ok])
  2390. fi
  2391. AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
  2392. if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
  2393. AC_MSG_ERROR([the version maximum allowed cannot be greater thatn the sdk level])
  2394. else
  2395. AC_MSG_RESULT([ok])
  2396. fi
  2397. AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
  2398. AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
  2399. fi
  2400. AC_SUBST(FRAMEWORKSHOME)
  2401. AC_SUBST(MACOSX_SDK_PATH)
  2402. AC_SUBST(MACOSX_SDK_VERSION)
  2403. AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
  2404. AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
  2405. AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
  2406. AC_SUBST(XCRUN)
  2407. dnl ===================================================================
  2408. dnl Windows specific tests and stuff
  2409. dnl ===================================================================
  2410. if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
  2411. AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
  2412. if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
  2413. AC_MSG_RESULT([no])
  2414. SDK_ARCH="x86"
  2415. else
  2416. AC_MSG_RESULT([yes])
  2417. SDK_ARCH="x64"
  2418. BITNESS_OVERRIDE=64
  2419. fi
  2420. AC_MSG_CHECKING([whether to use DirectX])
  2421. if test "$enable_directx" = "yes" -o "$enable_directx" = ""; then
  2422. ENABLE_DIRECTX="TRUE"
  2423. AC_MSG_RESULT([yes])
  2424. else
  2425. ENABLE_DIRECTX=""
  2426. AC_MSG_RESULT([no])
  2427. fi
  2428. AC_MSG_CHECKING([whether to use ActiveX])
  2429. if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then
  2430. DISABLE_ACTIVEX=""
  2431. SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
  2432. AC_MSG_RESULT([yes])
  2433. else
  2434. DISABLE_ACTIVEX="TRUE"
  2435. AC_MSG_RESULT([no])
  2436. fi
  2437. AC_MSG_CHECKING([whether to use ATL])
  2438. if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then
  2439. DISABLE_ATL=""
  2440. AC_MSG_RESULT([yes])
  2441. else
  2442. DISABLE_ATL="TRUE"
  2443. AC_MSG_RESULT([no])
  2444. fi
  2445. else
  2446. ENABLE_DIRECTX=""
  2447. DISABLE_ACTIVEX="TRUE"
  2448. DISABLE_ATL="TRUE"
  2449. fi
  2450. AC_SUBST(ENABLE_DIRECTX)
  2451. AC_SUBST(DISABLE_ACTIVEX)
  2452. AC_SUBST(DISABLE_ATL)
  2453. if test "$cross_compiling" = "yes"; then
  2454. CROSS_COMPILING=YES
  2455. SCPDEFS="$SCPDEFS -DCROSS_COMPILING"
  2456. else
  2457. CROSS_COMPILING=
  2458. BUILD_TYPE="$BUILD_TYPE NATIVE"
  2459. fi
  2460. AC_SUBST(CROSS_COMPILING)
  2461. dnl ===================================================================
  2462. dnl Test the gcc version
  2463. dnl ===================================================================
  2464. if test "$GCC" = "yes"; then
  2465. AC_MSG_CHECKING([the GCC version])
  2466. _gcc_version=`$CC -dumpversion`
  2467. _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'`
  2468. GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  2469. if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$GCCVER" -ge "040100"; then
  2470. if test -z "$save_CC" -a -x "$GCC_HOME/bin/gcc-4.0"; then
  2471. export CC="$GCC_HOME/bin/gcc-4.0"
  2472. # export CC to make it finally available to config.guess
  2473. GCCVER2=`$CC -dumpversion | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  2474. if test "$GCCVER2" -ge "040000" -a "$GCCVER2" -lt "040100"; then
  2475. GCCVER=$GCCVER2
  2476. fi
  2477. fi
  2478. if test "$GCCVER" -ge "040100"; then
  2479. AC_MSG_ERROR([You need to use the gcc-4.0 compiler (gcc $_gcc_version won't work with the MacOSX10.4u.sdk) - set CC accordingly])
  2480. else
  2481. AC_MSG_RESULT([implicitly using CC=$CC])
  2482. fi
  2483. else
  2484. AC_MSG_RESULT([gcc $_gcc_version])
  2485. fi
  2486. if test "$GCCVER" -lt 040000; then
  2487. AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.0.0])
  2488. fi
  2489. fi
  2490. dnl ===================================================================
  2491. dnl Is GCC actually Clang?
  2492. dnl ===================================================================
  2493. COM_GCC_IS_CLANG=
  2494. if test "$GCC" = "yes"; then
  2495. AC_MSG_CHECKING([whether GCC is actually Clang])
  2496. AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
  2497. #ifndef __clang__
  2498. you lose
  2499. #endif
  2500. int foo=42;
  2501. ]])],
  2502. [AC_MSG_RESULT([yes])
  2503. COM_GCC_IS_CLANG=TRUE],
  2504. [AC_MSG_RESULT([no])])
  2505. if test "$COM_GCC_IS_CLANG" = TRUE; then
  2506. AC_MSG_CHECKING([the Clang version])
  2507. clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC -E -P -`
  2508. CLANG_FULL_VERSION=`echo __clang_version__ | $CC -E -P -`
  2509. CLANGVER=`echo $clang_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  2510. AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
  2511. fi
  2512. fi
  2513. AC_SUBST(COM_GCC_IS_CLANG)
  2514. # ===================================================================
  2515. # check various GCC options that Clang does not support now but maybe
  2516. # will somewhen in the future, check them even for GCC, so that the
  2517. # flags are set
  2518. # ===================================================================
  2519. HAVE_GCC_GGDB2=
  2520. HAVE_GCC_FINLINE_LIMIT=
  2521. HAVE_GCC_FNO_INLINE=
  2522. if test "$GCC" = "yes"; then
  2523. AC_MSG_CHECKING([whether $CC supports -ggdb2])
  2524. if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
  2525. # Option just ignored and silly warning that isn't a real
  2526. # warning printed
  2527. :
  2528. else
  2529. save_CFLAGS=$CFLAGS
  2530. CFLAGS="$CFLAGS -Werror -ggdb2"
  2531. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
  2532. CFLAGS=$save_CFLAGS
  2533. fi
  2534. if test "$HAVE_GCC_GGDB2" = "TRUE"; then
  2535. AC_MSG_RESULT([yes])
  2536. else
  2537. AC_MSG_RESULT([no])
  2538. fi
  2539. AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
  2540. if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
  2541. # As above
  2542. :
  2543. else
  2544. save_CFLAGS=$CFLAGS
  2545. CFLAGS="$CFLAGS -Werror -finline-limit=0"
  2546. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
  2547. CFLAGS=$save_CFLAGS
  2548. fi
  2549. if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
  2550. AC_MSG_RESULT([yes])
  2551. else
  2552. AC_MSG_RESULT([no])
  2553. fi
  2554. AC_MSG_CHECKING([whether $CC supports -fno-inline])
  2555. if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
  2556. # Ditto
  2557. :
  2558. else
  2559. save_CFLAGS=$CFLAGS
  2560. CFLAGS="$CFLAGS -Werror -fno-inline"
  2561. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
  2562. CFLAGS=$save_CFLAGS
  2563. fi
  2564. if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
  2565. AC_MSG_RESULT([yes])
  2566. else
  2567. AC_MSG_RESULT([no])
  2568. fi
  2569. fi
  2570. AC_SUBST(HAVE_GCC_GGDB2)
  2571. AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
  2572. AC_SUBST(HAVE_GCC_FNO_INLINE)
  2573. HAVE_LD_BSYMBOLIC_FUNCTIONS=
  2574. if test "$GCC" = "yes"; then
  2575. AC_MSG_CHECKING( for -Bsymbolic-functions linker support )
  2576. bsymbolic_functions_ldflags_save=$LDFLAGS
  2577. LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo"
  2578. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  2579. #include <stdio.h>
  2580. ],[
  2581. printf ("hello world\n");
  2582. ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
  2583. if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
  2584. AC_MSG_RESULT( found )
  2585. else
  2586. AC_MSG_RESULT( not found )
  2587. fi
  2588. LDFLAGS=$bsymbolic_functions_ldflags_save
  2589. fi
  2590. AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
  2591. dnl ===================================================================
  2592. dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT
  2593. dnl ===================================================================
  2594. SHOWINCLUDES_PREFIX=
  2595. if test "$_os" = "WINNT"; then
  2596. if test "$WITH_MINGW" != "yes"; then
  2597. AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
  2598. if test -z "$with_cl_home"; then
  2599. vctest=`./oowintool --msvc-productdir`
  2600. if test "$BITNESS_OVERRIDE" = ""; then
  2601. if test -x "$vctest/bin/cl.exe"; then
  2602. with_cl_home=$vctest
  2603. fi
  2604. else
  2605. if test -x "$vctest/bin/amd64/cl.exe"; then
  2606. with_cl_home=$vctest
  2607. fi
  2608. fi
  2609. else
  2610. with_cl_home=`cygpath -u "$with_cl_home"`
  2611. fi
  2612. with_cl_home=`cygpath -d "$with_cl_home"`
  2613. with_cl_home=`cygpath -u "$with_cl_home"`
  2614. AC_MSG_RESULT([$with_cl_home])
  2615. dnl ===========================================================
  2616. dnl Check for mspdb80.dll/mspdb100.dll/mspdb110.dll
  2617. dnl ===========================================================
  2618. dnl MSVS 2008/10/12 Compiler
  2619. if test -n "$with_mspdb_path"; then
  2620. with_mspdb_path=`cygpath -u "$with_mspdb_path"`
  2621. fi
  2622. if test -e "$with_mspdb_path/mspdb80.dll" -o -e "$with_mspdb_path/mspdb100.dll" -o -e "$with_mspdb_path/mspdb110.dll"; then
  2623. MSPDB_PATH="$with_mspdb_path"
  2624. fi
  2625. dnl MSVS 2008 case
  2626. if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb80.dll"; then
  2627. MSPDB_PATH="$with_cl_home/../Common7/IDE"
  2628. fi
  2629. dnl Windows SDK 6.0 case
  2630. if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
  2631. MSPDB_PATH="$with_cl_home/bin"
  2632. fi
  2633. dnl MSVS 2010 case
  2634. if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb100.dll"; then
  2635. MSPDB_PATH="$with_cl_home/../Common7/IDE"
  2636. fi
  2637. dnl MSVS 2012 case
  2638. if test -z "$MSPDB_PATH" -a -e "$with_cl_home/../Common7/IDE/mspdb110.dll"; then
  2639. MSPDB_PATH="$with_cl_home/../Common7/IDE"
  2640. fi
  2641. if test -z "$MSPDB_PATH"; then
  2642. dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
  2643. AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
  2644. AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
  2645. AC_PATH_PROG(MSPDB_PATH, mspdb110.dll)
  2646. MSPDB_PATH=`dirname "$MSPDB_PATH"`
  2647. fi
  2648. if test -z "$MSPDB_PATH"; then
  2649. AC_MSG_ERROR([You need a mspdb80.dll or mspdb100.dll or mspdb110.dll, make sure it is in the path or use --with-mspdb-path])
  2650. fi
  2651. MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
  2652. MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
  2653. dnl The path needs to be added before cl is called
  2654. PATH="$MSPDB_PATH:$PATH"
  2655. AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
  2656. if test -z "$CC"; then
  2657. if test "$BITNESS_OVERRIDE" = ""; then
  2658. if test -x "$with_cl_home/bin/cl.exe"; then
  2659. CC="$with_cl_home/bin/cl.exe"
  2660. fi
  2661. else
  2662. if test -x "$with_cl_home/bin/amd64/cl.exe"; then
  2663. CC="$with_cl_home/bin/amd64/cl.exe"
  2664. fi
  2665. fi
  2666. if test -z "$CC"; then
  2667. AC_PATH_PROG(CC, cl.exe)
  2668. fi
  2669. # This gives us a posix path with 8.3 filename restrictions
  2670. CC=`cygpath -d "$CC"`
  2671. CC=`cygpath -u "$CC"`
  2672. fi
  2673. if test -n "$CC"; then
  2674. # Remove /cl.exe from CC case insensitive
  2675. AC_MSG_RESULT([found ($CC)])
  2676. if test "$BITNESS_OVERRIDE" = ""; then
  2677. COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
  2678. else
  2679. if test -n "$with_cl_home"; then
  2680. COMPATH=`echo $with_cl_home`
  2681. fi
  2682. fi
  2683. export INCLUDE=`cygpath -d "$COMPATH/Include"`
  2684. dnl Check which Microsoft C/C++ compiler is found
  2685. AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
  2686. # The following finds Microsoft, matches nn.nn.nnnn then pulls numbers out.
  2687. CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
  2688. x = match( \\\$0, /..\\...\\...../ )
  2689. CCversion = substr( \\\$0, RSTART, RLENGTH)
  2690. tokencount = split (CCversion,vertoken,\".\")
  2691. for ( i = 1 ; i <= tokencount ; i++ ) {
  2692. printf (\"%04d\",vertoken[[i]] )
  2693. }
  2694. }"`
  2695. if test "$CCNUMVER" -ge "001700000000"; then
  2696. COMEX=14
  2697. MSVSVER=2012
  2698. VCVER=110
  2699. elif test "$CCNUMVER" -ge "001600000000"; then
  2700. COMEX=13
  2701. MSVSVER=2010
  2702. VCVER=100
  2703. elif test "$CCNUMVER" -ge "001500000000"; then
  2704. COMEX=12
  2705. MSVSVER=2008
  2706. VCVER=90
  2707. else
  2708. AC_MSG_ERROR([Compiler too old. Use Microsoft Visual Studio 2008 or 2010.])
  2709. fi
  2710. PathFormat "$COMPATH"
  2711. COMPATH="$formatted_path"
  2712. AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
  2713. else
  2714. AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
  2715. fi
  2716. dnl We need to guess the prefix of the -showIncludes output, it can be
  2717. dnl localized
  2718. AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
  2719. echo "#include <stdlib.h>" > conftest.c
  2720. SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
  2721. grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
  2722. rm -f conftest.c conftest.obj
  2723. if test -z "$SHOWINCLUDES_PREFIX"; then
  2724. AC_MSG_ERROR([cannot determine the -showIncludes prefix])
  2725. else
  2726. AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
  2727. fi
  2728. # Check for 64-bit (cross-)compiler to use to build the 64-bit
  2729. # version of the Explorer extension (and maybe other small
  2730. # bits, too) needed when installing a 32-bit LibreOffice on a
  2731. # 64-bit OS. The 64-bit Explorer extension is a feature that
  2732. # has been present since long in OOo. Don't confuse it with
  2733. # building LibreOffice itself as 64-bit code, which is
  2734. # unfished work and highly experimental.
  2735. BUILD_X64=
  2736. CXX_X64_BINARY=
  2737. LINK_X64_BINARY=
  2738. LIBMGR_X64_BINARY=
  2739. if test "$BITNESS_OVERRIDE" = ""; then
  2740. AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
  2741. if test -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
  2742. # Prefer native x64 compiler to cross-compiler, in case we are running
  2743. # the build on a 64-bit OS.
  2744. if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
  2745. BUILD_X64=TRUE
  2746. CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
  2747. LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
  2748. LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
  2749. elif "$with_cl_home/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
  2750. BUILD_X64=TRUE
  2751. CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
  2752. LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
  2753. LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
  2754. fi
  2755. fi
  2756. if test "$BUILD_X64" = TRUE; then
  2757. AC_MSG_RESULT([found])
  2758. else
  2759. AC_MSG_RESULT([not found])
  2760. AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
  2761. fi
  2762. fi
  2763. AC_SUBST(BUILD_X64)
  2764. # These are passed to the environment and then used in set_wntx64.mk
  2765. AC_SUBST(CXX_X64_BINARY)
  2766. AC_SUBST(LINK_X64_BINARY)
  2767. AC_SUBST(LIBMGR_X64_BINARY)
  2768. else
  2769. AC_MSG_CHECKING([the compiler is MinGW])
  2770. MACHINE_PREFIX=`$CC -dumpmachine`
  2771. if echo $MACHINE_PREFIX | $GREP -q mingw32; then
  2772. COMPATH=`echo "$COMPATH" | sed -e 's,/bin$,,'`
  2773. AC_MSG_RESULT([yes])
  2774. else
  2775. AC_MSG_ERROR([Compiler is not MinGW.])
  2776. fi
  2777. fi
  2778. fi
  2779. AC_SUBST(COMEX)
  2780. AC_SUBST(VCVER)
  2781. PathFormat "$MSPDB_PATH"
  2782. MSPDB_PATH="$formatted_path"
  2783. AC_SUBST(SHOWINCLUDES_PREFIX)
  2784. #
  2785. # dbghelp.dll
  2786. #
  2787. if test "$_os" == "WINNT"; then
  2788. DBGHELP_DLL="13fbc2e8b37ddf28181dd6d8081c2b8e-dbghelp.dll"
  2789. fi
  2790. AC_SUBST(DBGHELP_DLL)
  2791. #
  2792. # unowinreg.dll
  2793. #
  2794. UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
  2795. AC_SUBST(UNOWINREG_DLL)
  2796. #
  2797. # prefix C with ccache if needed
  2798. #
  2799. if test "$CCACHE" != ""; then
  2800. AC_MSG_CHECKING([whether $CC is already ccached])
  2801. AC_LANG_PUSH([C])
  2802. save_CFLAGS=$CFLAGS
  2803. CFLAGS="$CFLAGS --ccache-skip -O2"
  2804. dnl an empty program will do, we're checking the compiler flags
  2805. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
  2806. [use_ccache=yes], [use_ccache=no])
  2807. if test $use_ccache = yes; then
  2808. AC_MSG_RESULT([yes])
  2809. else
  2810. CC="$CCACHE $CC"
  2811. AC_MSG_RESULT([no])
  2812. fi
  2813. CFLAGS=$save_CFLAGS
  2814. AC_LANG_POP([C])
  2815. fi
  2816. dnl Set the ENABLE_DBGUTIL variable
  2817. dnl ===================================================================
  2818. AC_MSG_CHECKING([whether to build with additional debug utilities])
  2819. if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
  2820. ENABLE_DBGUTIL="TRUE"
  2821. PROEXT=""
  2822. PRODUCT=""
  2823. AC_MSG_RESULT([yes])
  2824. # cppunit and graphite expose STL in public headers
  2825. if test "$with_system_cppunit" = "yes"; then
  2826. AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
  2827. else
  2828. with_system_cppunit=no
  2829. fi
  2830. if test "$with_system_graphite" = "yes"; then
  2831. AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
  2832. else
  2833. with_system_graphite=no
  2834. fi
  2835. if test "$with_system_mysql_cppconn" = "yes"; then
  2836. AC_MSG_ERROR([--with-system-mysql-cppconn conflicts with --enable-dbgutil])
  2837. else
  2838. with_system_mysql_cppconn=no
  2839. fi
  2840. if test "$with_system_orcus" = "yes"; then
  2841. AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
  2842. else
  2843. with_system_orcus=no
  2844. fi
  2845. else
  2846. ENABLE_DBGUTIL=""
  2847. # PRODUCT is old concept, still used by build.pl .
  2848. PRODUCT="full"
  2849. PROEXT=".pro"
  2850. AC_MSG_RESULT([no])
  2851. fi
  2852. AC_SUBST(ENABLE_DBGUTIL)
  2853. AC_SUBST(PRODUCT)
  2854. AC_SUBST(PROEXT)
  2855. dnl Set the ENABLE_DEBUG variable.
  2856. dnl ===================================================================
  2857. AC_MSG_CHECKING([whether to do a debug build])
  2858. if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
  2859. AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
  2860. fi
  2861. if test -n "$ENABLE_DBGUTIL"; then
  2862. if test "$enable_debug" = "no"; then
  2863. AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
  2864. fi
  2865. ENABLE_DEBUG="TRUE"
  2866. AC_MSG_RESULT([yes (dbgutil)])
  2867. elif test -n "$enable_debug" && test "$enable_debug" != "no"; then
  2868. ENABLE_DEBUG="TRUE"
  2869. AC_MSG_RESULT([yes])
  2870. else
  2871. ENABLE_DEBUG=""
  2872. AC_MSG_RESULT([no])
  2873. fi
  2874. AC_SUBST(ENABLE_DEBUG)
  2875. dnl Selective debuginfo
  2876. ENABLE_DEBUGINFO_FOR=
  2877. if test -n "$ENABLE_DEBUG"; then
  2878. AC_MSG_CHECKING([whether to use selective debuginfo])
  2879. if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
  2880. ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
  2881. AC_MSG_RESULT([for "$enable_selective_debuginfo"])
  2882. else
  2883. ENABLE_DEBUGINFO_FOR=all
  2884. AC_MSG_RESULT([no, for all])
  2885. fi
  2886. fi
  2887. AC_SUBST(ENABLE_DEBUGINFO_FOR)
  2888. dnl Check for enable symbols option
  2889. dnl ===================================================================
  2890. AC_MSG_CHECKING([whether to include symbols while preserve optimization])
  2891. if test -n "$enable_symbols" -a "$enable_symbols" != "no"; then
  2892. ENABLE_SYMBOLS="TRUE"
  2893. if test -n "$ENABLE_DBGUTIL"; then
  2894. AC_MSG_ERROR([--enable-dbgutil cannot be used with --enable-symbols])
  2895. elif test -n "$ENABLE_DEBUG"; then
  2896. AC_MSG_ERROR([--enable-debug cannot be used with --enable-symbols])
  2897. fi
  2898. AC_MSG_RESULT([yes])
  2899. else
  2900. if test -n "$enable_symbols" -a "$enable_symbols" = "no"; then
  2901. ENABLE_SYMBOLS="FALSE"
  2902. else
  2903. ENABLE_SYMBOLS=
  2904. fi
  2905. AC_MSG_RESULT([no])
  2906. fi
  2907. AC_SUBST(ENABLE_SYMBOLS)
  2908. dnl Check for explicit C/CXX/OBJC/OBJCXX/LDFLAGS. We by default use the ones specified
  2909. dnl by our build system, but explicit override is possible.
  2910. AC_MSG_CHECKING(for explicit CFLAGS)
  2911. if test -n "$CFLAGS"; then
  2912. AC_MSG_RESULT([$CFLAGS])
  2913. x_CFLAGS=
  2914. else
  2915. AC_MSG_RESULT(no)
  2916. x_CFLAGS=[\#]
  2917. fi
  2918. AC_MSG_CHECKING(for explicit CXXFLAGS)
  2919. if test -n "$CXXFLAGS"; then
  2920. AC_MSG_RESULT([$CXXFLAGS])
  2921. x_CXXFLAGS=
  2922. else
  2923. AC_MSG_RESULT(no)
  2924. x_CXXFLAGS=[\#]
  2925. fi
  2926. AC_MSG_CHECKING(for explicit OBJCFLAGS)
  2927. if test -n "$OBJCFLAGS"; then
  2928. AC_MSG_RESULT([$OBJCFLAGS])
  2929. x_OBJCFLAGS=
  2930. else
  2931. AC_MSG_RESULT(no)
  2932. x_OBJCFLAGS=[\#]
  2933. fi
  2934. AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
  2935. if test -n "$OBJCXXFLAGS"; then
  2936. AC_MSG_RESULT([$OBJCXXFLAGS])
  2937. x_OBJCXXFLAGS=
  2938. else
  2939. AC_MSG_RESULT(no)
  2940. x_OBJCXXFLAGS=[\#]
  2941. fi
  2942. AC_MSG_CHECKING(for explicit LDFLAGS)
  2943. if test -n "$LDFLAGS"; then
  2944. AC_MSG_RESULT([$LDFLAGS])
  2945. x_LDFLAGS=
  2946. else
  2947. AC_MSG_RESULT(no)
  2948. x_LDFLAGS=[\#]
  2949. fi
  2950. AC_SUBST(CFLAGS)
  2951. AC_SUBST(CXXFLAGS)
  2952. AC_SUBST(OBJCFLAGS)
  2953. AC_SUBST(OBJCXXFLAGS)
  2954. AC_SUBST(LDFLAGS)
  2955. AC_SUBST(x_CFLAGS)
  2956. AC_SUBST(x_CXXFLAGS)
  2957. AC_SUBST(x_OBJCFLAGS)
  2958. AC_SUBST(x_OBJCXXFLAGS)
  2959. AC_SUBST(x_LDFLAGS)
  2960. #
  2961. # determine CPU, CPUNAME, GUI, GUIBASE, ...
  2962. #
  2963. LIB64="lib"
  2964. SOLARINC=
  2965. case "$host_os" in
  2966. aix*)
  2967. COM=GCC
  2968. CPU=P
  2969. CPUNAME=POWERPC
  2970. GUI=UNX
  2971. GUIBASE=unx
  2972. OS=AIX
  2973. RTL_OS=AIX
  2974. RTL_ARCH=PowerPC
  2975. PLATFORMID=aix_powerpc
  2976. OUTPATH=unxaigppc
  2977. P_SEP=:
  2978. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  2979. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  2980. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  2981. ;;
  2982. cygwin*)
  2983. COM=MSC
  2984. GUI=WNT
  2985. GUIBASE=WIN
  2986. OS=WNT
  2987. RTL_OS=Windows
  2988. P_SEP=";"
  2989. case "$host_cpu" in
  2990. i*86|x86_64)
  2991. if test "$BITNESS_OVERRIDE" = 64; then
  2992. CPU=X
  2993. CPUNAME=X86_64
  2994. RTL_ARCH=X86_64
  2995. LIB64="lib/x64"
  2996. PLATFORMID=windows_x86_64
  2997. OUTPATH=wntmscx$COMEX
  2998. else
  2999. CPU=I
  3000. CPUNAME=INTEL
  3001. RTL_ARCH=x86
  3002. PLATFORMID=windows_x86
  3003. OUTPATH=wntmsci$COMEX
  3004. fi
  3005. ;;
  3006. *)
  3007. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3008. ;;
  3009. esac
  3010. SCPDEFS="$SCPDEFS -D_MSC_VER"
  3011. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3012. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3013. ;;
  3014. darwin*)
  3015. COM=GCC
  3016. GUI=UNX
  3017. # Not sure if "Aqua" is the right term to use?
  3018. GUIBASE="aqua"
  3019. OS=MACOSX
  3020. RTL_OS=MacOSX
  3021. P_SEP=:
  3022. case "$host_cpu" in
  3023. arm*)
  3024. CPU=R
  3025. CPUNAME=ARM
  3026. RTL_ARCH=ARM_EABI
  3027. GUIBASE=cocoatouch
  3028. PLATFORMID=macosx_arm_eabi
  3029. OUTPATH=unxiosr
  3030. OS=IOS
  3031. ;;
  3032. powerpc*)
  3033. CPU=P
  3034. CPUNAME=POWERPC
  3035. RTL_ARCH=PowerPC
  3036. PLATFORMID=macosx_powerpc
  3037. OUTPATH=unxmacxp
  3038. ;;
  3039. i*86)
  3040. if test "$BITNESS_OVERRIDE" = 64; then
  3041. AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
  3042. fi
  3043. CPU=I
  3044. CPUNAME=INTEL
  3045. RTL_ARCH=x86
  3046. PLATFORMID=macosx_x86
  3047. OUTPATH=unxmacxi
  3048. ;;
  3049. x86_64)
  3050. if test "$BITNESS_OVERRIDE" = 64; then
  3051. CPU=X
  3052. CPUNAME=X86_64
  3053. RTL_ARCH=X86_64
  3054. PLATFORMID=macosx_x86_64
  3055. OUTPATH=unxmacxx
  3056. else
  3057. CPU=I
  3058. CPUNAME=INTEL
  3059. RTL_ARCH=x86
  3060. PLATFORMID=macosx_x86
  3061. OUTPATH=unxmacxi
  3062. fi
  3063. ;;
  3064. *)
  3065. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3066. ;;
  3067. esac
  3068. SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3069. ;;
  3070. dragonfly*)
  3071. COM=GCC
  3072. GUI=UNX
  3073. GUIBASE=unx
  3074. OS=DRAGONFLY
  3075. RTL_OS=DragonFly
  3076. OUTPATH=unxdfly
  3077. P_SEP=:
  3078. case "$host_cpu" in
  3079. i*86)
  3080. CPU=I
  3081. CPUNAME=INTEL
  3082. RTL_ARCH=x86
  3083. PLATFORMID=dragonfly_x86
  3084. ;;
  3085. x86_64)
  3086. CPU=X
  3087. CPUNAME=X86_64
  3088. RTL_ARCH=X86_64
  3089. PLATFORMID=dragonfly_x86_64
  3090. ;;
  3091. *)
  3092. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3093. ;;
  3094. esac
  3095. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3096. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3097. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3098. ;;
  3099. freebsd*)
  3100. COM=GCC
  3101. GUI=UNX
  3102. GUIBASE=unx
  3103. RTL_OS=FreeBSD
  3104. OS=FREEBSD
  3105. OUTPATH=unxfbsd
  3106. P_SEP=:
  3107. case "$host_cpu" in
  3108. i*86)
  3109. CPU=I
  3110. CPUNAME=INTEL
  3111. RTL_ARCH=x86
  3112. PLATFORMID=freebsd_x86
  3113. OUTPATH=unxfbsdi
  3114. ;;
  3115. x86_64)
  3116. CPU=X
  3117. CPUNAME=X86_64
  3118. RTL_ARCH=X86_64
  3119. PLATFORMID=freebsd_x86_64
  3120. ;;
  3121. *)
  3122. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3123. ;;
  3124. esac
  3125. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3126. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3127. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3128. ;;
  3129. kfreebsd*)
  3130. COM=GCC
  3131. GUI=UNX
  3132. GUIBASE=unx
  3133. OS=LINUX
  3134. RTL_OS=kFreeBSD
  3135. P_SEP=:
  3136. case "$host_cpu" in
  3137. i*86)
  3138. CPU=I
  3139. CPUNAME=INTEL
  3140. RTL_ARCH=x86
  3141. PLATFORMID=kfreebsd_x86
  3142. OUTPATH=unxkfgi6
  3143. ;;
  3144. x86_64)
  3145. CPU=X
  3146. CPUNAME=X86_64
  3147. RTL_ARCH=X86_64
  3148. LIB64="lib64"
  3149. PLATFORMID=kfreebsd_x86_64
  3150. OUTPATH=unxkfgx6
  3151. ;;
  3152. *)
  3153. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3154. ;;
  3155. esac
  3156. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3157. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3158. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3159. ;;
  3160. linux-gnu*)
  3161. COM=GCC
  3162. GUI=UNX
  3163. GUIBASE=unx
  3164. OS=LINUX
  3165. RTL_OS=Linux
  3166. P_SEP=:
  3167. case "$host_cpu" in
  3168. alpha)
  3169. CPU=L
  3170. CPUNAME=AXP
  3171. RTL_ARCH=ALPHA
  3172. PLATFORMID=linux_alpha
  3173. OUTPATH=unxlngaxp
  3174. ;;
  3175. arm*)
  3176. CPU=R
  3177. CPUNAME=ARM
  3178. EPM_FLAGS="-a arm"
  3179. OUTPATH=unxlngr
  3180. RTL_ARCH=ARM_EABI
  3181. PLATFORMID=linux_arm_eabi
  3182. case "$host_cpu" in
  3183. arm*-linux)
  3184. RTL_ARCH=ARM_OABI
  3185. PLATFORMID=linux_arm_oabi
  3186. ;;
  3187. esac
  3188. ;;
  3189. hppa)
  3190. CPU=H
  3191. CPUNAME=HPPA
  3192. RTL_ARCH=HPPA
  3193. EPM_FLAGS="-a hppa"
  3194. PLATFORMID=linux_hppa
  3195. OUTPATH=unxlnghppa
  3196. ;;
  3197. i*86)
  3198. CPU=I
  3199. CPUNAME=INTEL
  3200. RTL_ARCH=x86
  3201. PLATFORMID=linux_x86
  3202. OUTPATH=unxlngi6
  3203. ;;
  3204. ia64)
  3205. CPU=A
  3206. CPUNAME=IA64
  3207. RTL_ARCH=IA64
  3208. PLATFORMID=linux_ia64
  3209. OUTPATH=unxlnga
  3210. ;;
  3211. mips)
  3212. CPU=M
  3213. CPUNAME=GODSON
  3214. RTL_ARCH=MIPS_EB
  3215. EPM_FLAGS="-a mips"
  3216. PLATFORMID=linux_mips_eb
  3217. OUTPATH=unxlngmips
  3218. ;;
  3219. mips64)
  3220. CPU=M
  3221. CPUNAME=GODSON
  3222. RTL_ARCH=MIPS_EB
  3223. EPM_FLAGS="-a mips64"
  3224. PLATFORMID=linux_mips_eb
  3225. OUTPATH=unxlngmips
  3226. ;;
  3227. mips64el)
  3228. CPU=M
  3229. CPUNAME=GODSON
  3230. RTL_ARCH=MIPS_EL
  3231. EPM_FLAGS="-a mips64el"
  3232. PLATFORMID=linux_mips_el
  3233. OUTPATH=unxlngmips
  3234. ;;
  3235. mipsel)
  3236. CPU=M
  3237. CPUNAME=GODSON
  3238. RTL_ARCH=MIPS_EL
  3239. EPM_FLAGS="-a mipsel"
  3240. PLATFORMID=linux_mips_el
  3241. OUTPATH=unxlngmips
  3242. ;;
  3243. m68k)
  3244. CPU=6
  3245. CPUNAME=M68K
  3246. RTL_ARCH=M68K
  3247. PLATFORMID=linux_m68k
  3248. OUTPATH=unxlngm68k
  3249. ;;
  3250. powerpc)
  3251. CPU=P
  3252. CPUNAME=POWERPC
  3253. RTL_ARCH=PowerPC
  3254. PLATFORMID=linux_powerpc
  3255. OUTPATH=unxlngppc
  3256. ;;
  3257. powerpc64)
  3258. CPU=P
  3259. CPUNAME=POWERPC64
  3260. RTL_ARCH=PowerPC_64
  3261. LIB64="lib64"
  3262. PLATFORMID=linux_powerpc_64
  3263. OUTPATH=unxlngppc64
  3264. ;;
  3265. sparc)
  3266. CPU=S
  3267. CPUNAME=SPARC
  3268. RTL_ARCH=SPARC
  3269. PLATFORMID=linux_sparc
  3270. OUTPATH=unxlngs
  3271. ;;
  3272. s390)
  3273. CPU=3
  3274. CPUNAME=S390
  3275. RTL_ARCH=S390
  3276. PLATFORMID=linux_s390
  3277. OUTPATH=unxlngs390
  3278. ;;
  3279. s390x)
  3280. CPU=3
  3281. CPUNAME=S390X
  3282. RTL_ARCH=S390x
  3283. LIB64="lib64"
  3284. PLATFORMID=linux_s390x
  3285. OUTPATH=unxlngs390x
  3286. ;;
  3287. x86_64)
  3288. CPU=X
  3289. CPUNAME=X86_64
  3290. RTL_ARCH=X86_64
  3291. LIB64="lib64"
  3292. PLATFORMID=linux_x86_64
  3293. OUTPATH=unxlngx6
  3294. ;;
  3295. *)
  3296. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3297. ;;
  3298. esac
  3299. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3300. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3301. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3302. ;;
  3303. linux-android*)
  3304. COM=GCC
  3305. GUI=UNX
  3306. GUIBASE=android
  3307. OS=ANDROID
  3308. RTL_OS=Android
  3309. P_SEP=:
  3310. case "$host_cpu" in
  3311. arm|armel)
  3312. CPU=R
  3313. CPUNAME=ARM
  3314. RTL_ARCH=ARM_EABI
  3315. PLATFORMID=android_arm_eabi
  3316. OUTPATH=unxandr
  3317. ;;
  3318. mips|mipsel)
  3319. CPU=M
  3320. CPUNAME=GODSON # Weird, but maybe that's the LO convention?
  3321. RTL_ARCH=MIPS_EL
  3322. PLATFORMID=android_mips_el
  3323. OUTPATH=unxandm
  3324. ;;
  3325. i*86)
  3326. CPU=I
  3327. CPUNAME=INTEL
  3328. RTL_ARCH=x86
  3329. PLATFORMID=android_x86
  3330. OUTPATH=unxandi
  3331. ;;
  3332. *)
  3333. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3334. ;;
  3335. esac
  3336. SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/$OUTPATH"
  3337. SOLARLIB="-L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3338. ;;
  3339. mingw*)
  3340. COM=GCC
  3341. GUI=WNT
  3342. GUIBASE=WIN
  3343. OS=WNT
  3344. RTL_OS=Windows
  3345. P_SEP=:
  3346. case "$host_cpu" in
  3347. i*86|x86_64)
  3348. if test "$BITNESS_OVERRIDE" = 64; then
  3349. CPU=X
  3350. CPUNAME=X86_64
  3351. RTL_ARCH=X86_84
  3352. PLATFORMID=windows_x86_64
  3353. OUTPATH=wntgccx$COMEX
  3354. else
  3355. CPU=I
  3356. CPUNAME=INTEL
  3357. RTL_ARCH=x86
  3358. PLATFORMID=windows_x86
  3359. OUTPATH=wntgcci$COMEX
  3360. fi
  3361. ;;
  3362. *)
  3363. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3364. ;;
  3365. esac
  3366. SOLARINC="$SOLARINC -I$SRC_ROOT/solenv/inc/win32 -I$SRC_ROOT/solenv/inc/$OUTPATH"
  3367. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3368. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3369. ;;
  3370. *netbsd*)
  3371. COM=GCC
  3372. GUI=UNX
  3373. GUIBASE=unx
  3374. OS=NETBSD
  3375. RTL_OS=NetBSD
  3376. OUTPATH=unxnbsd
  3377. P_SEP=:
  3378. case "$host_cpu" in
  3379. i*86)
  3380. CPU=I
  3381. CPUNAME=INTEL
  3382. RTL_ARCH=x86
  3383. PLATFORMID=netbsd_x86
  3384. ;;
  3385. powerpc)
  3386. CPU=P
  3387. CPUNAME=POWERPC
  3388. RTL_ARCH=PowerPC
  3389. PLATFORMID=netbsd_powerpc
  3390. ;;
  3391. sparc)
  3392. CPU=S
  3393. CPUNAME=SPARC
  3394. RTL_ARCH=SPARC
  3395. PLATFORMID=netbsd_sparc
  3396. ;;
  3397. x86_64)
  3398. CPU=X
  3399. CPUNAME=X86_64
  3400. RTL_ARCH=X86_64
  3401. PLATFORMID=netbsd_x86_64
  3402. ;;
  3403. *)
  3404. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3405. ;;
  3406. esac
  3407. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3408. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3409. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3410. ;;
  3411. openbsd*)
  3412. COM=GCC
  3413. GUI=UNX
  3414. GUIBASE=unx
  3415. OS=OPENBSD
  3416. RTL_OS=OpenBSD
  3417. OUTPATH=unxobsd
  3418. P_SEP=:
  3419. case "$host_cpu" in
  3420. i*86)
  3421. CPU=I
  3422. CPUNAME=INTEL
  3423. RTL_ARCH=x86
  3424. PLATFORMID=openbsd_x86
  3425. ;;
  3426. x86_64)
  3427. CPU=X
  3428. CPUNAME=X86_64
  3429. RTL_ARCH=X86_64
  3430. PLATFORMID=openbsd_x86_64
  3431. ;;
  3432. *)
  3433. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3434. ;;
  3435. esac
  3436. SOLARINC="$SOLARINC -I/usr/local/include"
  3437. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3438. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3439. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3440. SOLARLIB="$SOLARLIB -L/usr/local/lib"
  3441. ;;
  3442. solaris*)
  3443. COM=GCC
  3444. GUI=UNX
  3445. GUIBASE=unx
  3446. OS=SOLARIS
  3447. RTL_OS=Solaris
  3448. P_SEP=:
  3449. case "$host_cpu" in
  3450. i*86)
  3451. CPU=I
  3452. CPUNAME=INTEL
  3453. RTL_ARCH=x86
  3454. PLATFORMID=solaris_x86
  3455. OUTPATH=unxsogi
  3456. ;;
  3457. sparc)
  3458. CPU=S
  3459. CPUNAME=SPARC
  3460. RTL_ARCH=SPARC
  3461. PLATFORMID=solaris_sparc
  3462. OUTPATH=unxsogs
  3463. ;;
  3464. *)
  3465. AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
  3466. ;;
  3467. esac
  3468. SOLARINC="$SOLARINC -I/usr/local/include"
  3469. SOLARLIB="-L../lib -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3470. SOLARLIB="$SOLARLIB -L${SOLARVER}/${OUTPATH}${PROEXT}/lib"
  3471. SOLARLIB="$SOLARLIB -L$SRC_ROOT/solenv/$OUTPATH/lib"
  3472. SOLARLIB="$SOLARLIB -L$COMPATH/lib"
  3473. SOLARLIB="$SOLARLIB -L/usr/local/bin -L/usr/dt/lib -L/usr/openwin/lib"
  3474. ;;
  3475. *)
  3476. AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
  3477. ;;
  3478. esac
  3479. if test "$enable_headless" = "yes"; then
  3480. if test "$GUIBASE" != "unx"; then
  3481. AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --enable-headless])
  3482. fi
  3483. GUIBASE=headless
  3484. fi
  3485. INPATH="${OUTPATH}${PROEXT}"
  3486. if test -n "${with_solver_and_workdir_root}"; then
  3487. PathFormat "${with_solver_and_workdir_root}"
  3488. # IsValidFilePath in /sal/osl/w32/file_url.cxx rejects "X:\\" breaking idlc
  3489. if echo ${formatted_path} | $GREP -q '/$'; then
  3490. WORKDIR=${formatted_path}workdir/${INPATH}
  3491. else
  3492. WORKDIR=${formatted_path}/workdir/${INPATH}
  3493. fi
  3494. else
  3495. WORKDIR=${SRC_ROOT}/workdir/${INPATH}
  3496. fi
  3497. OUTDIR="${SOLARVER}/${INPATH}"
  3498. SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC"
  3499. AC_SUBST(COM)
  3500. AC_SUBST(CPU)
  3501. AC_SUBST(CPUNAME)
  3502. AC_SUBST(RTL_OS)
  3503. AC_SUBST(RTL_ARCH)
  3504. AC_SUBST(EPM_FLAGS)
  3505. AC_SUBST(GUI)
  3506. AC_SUBST(GUIBASE)
  3507. AC_SUBST(INPATH)
  3508. AC_SUBST(OS)
  3509. AC_SUBST(OUTDIR)
  3510. AC_SUBST(OUTPATH)
  3511. AC_SUBST(P_SEP)
  3512. AC_SUBST(SOLARVER)
  3513. AC_SUBST(WORKDIR)
  3514. AC_SUBST(PLATFORMID)
  3515. dnl ===================================================================
  3516. dnl Test which package format to use
  3517. dnl ===================================================================
  3518. AC_MSG_CHECKING([which package format to use])
  3519. if test -n "$with_package_format"; then
  3520. for i in $with_package_format; do
  3521. case "$i" in
  3522. aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable | archive | dmg | installed | msi)
  3523. ;;
  3524. *)
  3525. AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
  3526. aix - AIX software distribution
  3527. bsd - FreeBSD, NetBSD, or OpenBSD software distribution
  3528. deb - Debian software distribution
  3529. inst or tardist - IRIX software distribution
  3530. osx - MacOS X software distribution
  3531. pkg - Solaris software distribution
  3532. rpm - RedHat software distribution
  3533. setld - Tru64 (setld) software distribution
  3534. native - "Native" software distribution for the platform
  3535. portable - Portable software distribution
  3536. LibreOffice additionally supports:
  3537. archive - .tar.gz or .zip
  3538. dmg - Mac OS X .dmg
  3539. installed - installation tree
  3540. msi - Windows .msi
  3541. ])
  3542. ;;
  3543. esac
  3544. done
  3545. PKGFORMAT="$with_package_format"
  3546. elif test "$enable_epm" = "yes"; then
  3547. # defaults
  3548. case "$_os" in
  3549. Darwin)
  3550. PKGFORMAT=dmg
  3551. ;;
  3552. SunOS)
  3553. PKGFORMAT=pkg
  3554. ;;
  3555. Linux)
  3556. # if building on Debian, default should be deb...
  3557. if test -e /etc/debian_version; then
  3558. PKGFORMAT=deb
  3559. else
  3560. PKGFORMAT=rpm
  3561. fi
  3562. ;;
  3563. AIX)
  3564. PKGFORMAT=rpm
  3565. ;;
  3566. OpenBSD|DragonFly)
  3567. PKGFORMAT=portable
  3568. ;;
  3569. *BSD)
  3570. PKGFORMAT=bsd
  3571. ;;
  3572. WINNT)
  3573. PKGFORMAT=msi
  3574. ;;
  3575. # we never should get here since we check the arciecture/os at the beginning,
  3576. # but go sure...
  3577. *)
  3578. AC_MSG_ERROR([unknown system])
  3579. esac
  3580. else
  3581. if test "$WITH_MINGW" = "yes"; then
  3582. # when tested, we should default this to 'msi', instead of 'archive'
  3583. PKGFORMAT=archive
  3584. else
  3585. PKGFORMAT=native
  3586. fi
  3587. fi
  3588. AC_MSG_RESULT([$PKGFORMAT])
  3589. AC_SUBST(PKGFORMAT)
  3590. dnl ===================================================================
  3591. dnl Set up a different compiler to produce tools to run on the build
  3592. dnl machine when doing cross-compilation
  3593. dnl ===================================================================
  3594. m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
  3595. if test "$cross_compiling" = "yes"; then
  3596. AC_MSG_CHECKING([for BUILD platform configuration])
  3597. echo
  3598. rm -rf CONF-FOR-BUILD config_build.mk
  3599. mkdir CONF-FOR-BUILD
  3600. tar cf - \
  3601. config.guess \
  3602. config_host.mk.in \
  3603. configure \
  3604. oowintool \
  3605. bin/get_config_variables \
  3606. solenv/bin/getcompver.awk \
  3607. solenv/inc/langlist.mk \
  3608. solenv/inc/postset.mk \
  3609. | (cd CONF-FOR-BUILD && tar xf -)
  3610. (
  3611. unset COM GUI GUIBASE OS CPU CPUNAME
  3612. unset CC CXX SYSBASE CFLAGS
  3613. unset PYTHON_CFLAGS PYTHON_LIBS
  3614. unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
  3615. unset CPPUNIT_CFLAGS CPPUNIT_LIBS
  3616. unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC
  3617. test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
  3618. test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
  3619. test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
  3620. cd CONF-FOR-BUILD
  3621. sub_conf_opts=""
  3622. test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
  3623. test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
  3624. test $with_java = no && sub_conf_opts="$sub_conf_opts --without-java"
  3625. test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
  3626. test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
  3627. test -n "${with_solver_and_workdir_root}" && sub_conf_opts="$sub_conf_opts --with-solver-and-workdir-root=${with_solver_and_workdir_root}"
  3628. test -n "$with_system_boost_for_build" && sub_conf_opts="$sub_conf_opts --with-system-boost"
  3629. test -n "$with_system_cppunit_for_build" && sub_conf_opts="$sub_conf_opts --with-system-cppunit"
  3630. test -n "$with_system_expat_for_build" && sub_conf_opts="$sub_conf_opts --with-system-expat"
  3631. test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
  3632. test -n "$with_system_libxml_for_build" && sub_conf_opts="$sub_conf_opts --with-system-libxml"
  3633. # we need the msi build tools on mingw if we are creating the
  3634. # installation set
  3635. if test "$WITH_MINGW" = "yes"; then
  3636. enable_winegcc_for_build=
  3637. for pkgformat in $PKGFORMAT; do
  3638. case "$pkgformat" in
  3639. msi|native) enable_winegcc_for_build=yes ;;
  3640. esac
  3641. done
  3642. test -n "$enable_winegcc_for_build" && sub_conf_opts="$sub_conf_opts --enable-winegcc"
  3643. fi
  3644. sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
  3645. # Don't bother having configure look for stuff not needed for the build platform anyway
  3646. ./configure \
  3647. --disable-graphite \
  3648. --disable-build-mozilla \
  3649. --disable-postgresql-sdbc \
  3650. --disable-zenity \
  3651. --with-parallelism="$with_parallelism" \
  3652. --without-doxygen \
  3653. ENABLE_PDFIMPORT=FALSE \
  3654. $sub_conf_opts \
  3655. 2>&1 | sed -e 's/^/ /'
  3656. test -f ./config_host.mk 2>/dev/null || exit
  3657. cp config_host.mk ../config_build.mk
  3658. cp config.log ../config.Build.log
  3659. . ./bin/get_config_variables COM GUI GUIBASE OS PATH CPU CPUNAME CC CXX DISABLE_PYTHON GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH PYTHON SYSTEM_LIBXSLT OUTDIR SOLARINC SOLARLIB WORKDIR
  3660. for V in COM GUI GUIBASE OS CPU CPUNAME CC CXX DISABLE_PYTHON GXX_INCLUDE_PATH MACOSX_DEPLOYMENT_TARGET INPATH OUTPATH \
  3661. PYTHON SYSTEM_LIBXSLT; do
  3662. VV='$'$V
  3663. VV=`eval "echo $VV"`
  3664. if test -n "$VV"; then
  3665. line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
  3666. echo "$line" >>build-config
  3667. fi
  3668. done
  3669. for V in OUTDIR SOLARINC SOLARLIB WORKDIR; do
  3670. VV='$'$V
  3671. VV=`eval "echo $VV"`
  3672. VV=`echo $VV | sed -e 's,/CONF-FOR-BUILD,,g'`
  3673. if test -n "$VV"; then
  3674. line="${V}_FOR_BUILD='$VV'"
  3675. echo "$line" >>build-config
  3676. fi
  3677. done
  3678. line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
  3679. echo "$line" >>build-config
  3680. )
  3681. test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
  3682. test -f config_build.mk || AC_MSG_ERROR([A file called config_build.mk was supposed to have been copied here, but it isn't found])
  3683. perl -pi -e 's,/CONF-FOR-BUILD,,g' config_build.mk
  3684. eval `cat CONF-FOR-BUILD/build-config`
  3685. AC_MSG_RESULT([checking for BUILD platform configuration... done])
  3686. rm -rf CONF-FOR-BUILD
  3687. else
  3688. CC_FOR_BUILD="$CC"
  3689. CXX_FOR_BUILD="$CXX"
  3690. CC_FOR_BUILD="$CC"
  3691. COM_FOR_BUILD="$COM"
  3692. CPUNAME_FOR_BUILD="$CPUNAME"
  3693. CPU_FOR_BUILD="$CPU"
  3694. CXX_FOR_BUILD="$CXX"
  3695. DISABLE_PYTHON_FOR_BUILD="$DISABLE_PYTHON"
  3696. GUIBASE_FOR_BUILD="$GUIBASE"
  3697. GUI_FOR_BUILD="$GUI"
  3698. INPATH_FOR_BUILD="$INPATH"
  3699. MACOSX_DEPLOYMENT_TARGET_FOR_BUILD="$MACOSX_DEPLOYMENT_TARGET"
  3700. OS_FOR_BUILD="$OS"
  3701. OUTDIR_FOR_BUILD="$OUTDIR"
  3702. OUTPATH_FOR_BUILD="$OUTPATH"
  3703. PYTHON_FOR_BUILD="$PYTHON"
  3704. WORKDIR_FOR_BUILD="$WORKDIR"
  3705. fi
  3706. AC_SUBST(COM_FOR_BUILD)
  3707. AC_SUBST(GUI_FOR_BUILD)
  3708. AC_SUBST(GUIBASE_FOR_BUILD)
  3709. AC_SUBST(OS_FOR_BUILD)
  3710. AC_SUBST(CPU_FOR_BUILD)
  3711. AC_SUBST(CPUNAME_FOR_BUILD)
  3712. AC_SUBST(CC_FOR_BUILD)
  3713. AC_SUBST(CXX_FOR_BUILD)
  3714. AC_SUBST(INPATH_FOR_BUILD)
  3715. AC_SUBST(OUTPATH_FOR_BUILD)
  3716. AC_SUBST(MACOSX_DEPLOYMENT_TARGET_FOR_BUILD)
  3717. AC_SUBST([PYTHON_FOR_BUILD])
  3718. AC_SUBST(OUTDIR_FOR_BUILD)
  3719. AC_SUBST(WORKDIR_FOR_BUILD)
  3720. UPD="`echo AC_PACKAGE_VERSION | sed "s/\.//"`0"
  3721. SOURCEVERSION="OOO$UPD"
  3722. AC_SUBST(UPD)
  3723. AC_SUBST(SOURCEVERSION)
  3724. dnl ===================================================================
  3725. dnl Set the ENABLE_CRASHDUMP variable.
  3726. dnl ===================================================================
  3727. AC_MSG_CHECKING([whether to enable crashdump feature])
  3728. if test "$enable_crashdump" = "yes"; then
  3729. ENABLE_CRASHDUMP="TRUE"
  3730. BUILD_TYPE="$BUILD_TYPE CRASHREP"
  3731. AC_MSG_RESULT([yes])
  3732. else
  3733. ENABLE_CRASHDUMP=""
  3734. AC_MSG_RESULT([no])
  3735. fi
  3736. AC_SUBST(ENABLE_CRASHDUMP)
  3737. dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
  3738. dnl ===================================================================
  3739. AC_MSG_CHECKING([whether to turn warnings to errors])
  3740. if test -n "$enable_werror" -a "$enable_werror" != "no"; then
  3741. EXTERNAL_WARNINGS_NOT_ERRORS="FALSE"
  3742. AC_MSG_RESULT([yes])
  3743. else
  3744. EXTERNAL_WARNINGS_NOT_ERRORS="TRUE"
  3745. AC_MSG_RESULT([no])
  3746. fi
  3747. AC_SUBST(EXTERNAL_WARNINGS_NOT_ERRORS)
  3748. dnl Set the ASSERT_ALWAYS_ABORT variable. (Activate --enable-assert-always-abort)
  3749. dnl ===================================================================
  3750. AC_MSG_CHECKING([whether to have assert to abort in release code])
  3751. if test -n "$enable_assert_always_abort" -a "$enable_assert_always_abort" = "yes"; then
  3752. ASSERT_ALWAYS_ABORT="TRUE"
  3753. AC_MSG_RESULT([yes])
  3754. else
  3755. ASSERT_ALWAYS_ABORT="FALSE"
  3756. AC_MSG_RESULT([no])
  3757. fi
  3758. AC_SUBST(ASSERT_ALWAYS_ABORT)
  3759. dnl Determine whether to use linkoo for the smoketest installation
  3760. dnl ===================================================================
  3761. AC_MSG_CHECKING([whether to use linkoo for the smoketest installation])
  3762. if test "$enable_linkoo" = "no"; then
  3763. DISABLE_LINKOO="TRUE"
  3764. AC_MSG_RESULT([no])
  3765. else
  3766. DISABLE_LINKOO=
  3767. AC_MSG_RESULT([yes])
  3768. fi
  3769. AC_SUBST(DISABLE_LINKOO)
  3770. # Set the ENABLE_LTO variable
  3771. # ===================================================================
  3772. AC_MSG_CHECKING([whether to use link-time optimization])
  3773. if test -n "$enable_lto" -a "$enable_lto" != "no"; then
  3774. ENABLE_LTO="TRUE"
  3775. AC_MSG_RESULT([yes])
  3776. else
  3777. ENABLE_LTO=""
  3778. AC_MSG_RESULT([no])
  3779. fi
  3780. AC_SUBST(ENABLE_LTO)
  3781. if test "$enable_headless" = "yes"; then
  3782. # be sure to do not mess with uneeded stuff
  3783. test_randr=no
  3784. test_xrender=no
  3785. test_cups=no
  3786. test_dbus=no
  3787. test_fontconfig=yes
  3788. test_gtk=no
  3789. build_gstreamer=no
  3790. build_gstreamer_0_10=no
  3791. test_tde=no
  3792. test_kde=no
  3793. test_kde4=no
  3794. test_unix_quickstarter=no
  3795. enable_cairo_canvas=no
  3796. enable_gnome_vfs=no
  3797. fi
  3798. dnl ===================================================================
  3799. dnl check for cups support
  3800. dnl ===================================================================
  3801. ENABLE_CUPS=""
  3802. if test "$enable_cups" = "no"; then
  3803. test_cups=no
  3804. fi
  3805. AC_MSG_CHECKING([whether to enable CUPS support])
  3806. if test "$test_cups" = "yes"; then
  3807. ENABLE_CUPS="TRUE"
  3808. AC_MSG_RESULT([yes])
  3809. AC_MSG_CHECKING([whether cups support is present])
  3810. AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
  3811. AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
  3812. if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -a "$ac_cv_header_cups_cups_h" != "yes"; then
  3813. AC_MSG_ERROR([Could not find CUPS. Install libcupsys2-dev or cups-devel.])
  3814. fi
  3815. else
  3816. AC_MSG_RESULT([no])
  3817. fi
  3818. AC_SUBST(ENABLE_CUPS)
  3819. # fontconfig checks
  3820. if test "$test_fontconfig" = "yes"; then
  3821. PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0])
  3822. else
  3823. case "$BUILD_TYPE" in
  3824. *FONTCONFIG*)
  3825. FONTCONFIG_LIBS="-lfontconfig"
  3826. ;;
  3827. esac
  3828. fi
  3829. AC_SUBST(FONTCONFIG_CFLAGS)
  3830. AC_SUBST(FONTCONFIG_LIBS)
  3831. dnl whether to find & fetch external tarballs?
  3832. dnl ===================================================================
  3833. if test -z "$TARFILE_LOCATION"; then
  3834. TARFILE_LOCATION="$SRC_ROOT/src"
  3835. fi
  3836. AC_SUBST(TARFILE_LOCATION)
  3837. AC_MSG_CHECKING([whether we want to fetch tarballs])
  3838. if test "$enable_fetch_external" != "no"; then
  3839. if test "$with_all_tarballs" = "yes"; then
  3840. AC_MSG_RESULT(["yes, all of them"])
  3841. DO_FETCH_TARBALLS="ALL"
  3842. else
  3843. AC_MSG_RESULT(["yes, if we use them"])
  3844. DO_FETCH_TARBALLS="YES"
  3845. fi
  3846. else
  3847. AC_MSG_RESULT([no])
  3848. DO_FETCH_TARBALLS="NO"
  3849. fi
  3850. AC_SUBST(DO_FETCH_TARBALLS)
  3851. AC_MSG_CHECKING([whether to build help])
  3852. if test "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
  3853. AC_MSG_RESULT([yes])
  3854. BUILD_TYPE="$BUILD_TYPE HELP"
  3855. SCPDEFS="$SCPDEFS -DWITH_HELP"
  3856. GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
  3857. else
  3858. AC_MSG_RESULT([no])
  3859. fi
  3860. dnl Test whether to include MySpell dictionaries
  3861. dnl ===================================================================
  3862. AC_MSG_CHECKING([whether to include MySpell dictionaries])
  3863. if test -z "$with_myspell_dicts" -o "$with_myspell_dicts" = "yes"; then
  3864. AC_MSG_RESULT([yes])
  3865. WITH_MYSPELL_DICTS=YES
  3866. BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
  3867. GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
  3868. else
  3869. AC_MSG_RESULT([no])
  3870. WITH_MYSPELL_DICTS=NO
  3871. fi
  3872. AC_SUBST(WITH_MYSPELL_DICTS)
  3873. AC_MSG_CHECKING([whether to use dicts from external paths])
  3874. if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
  3875. AC_MSG_RESULT([yes])
  3876. SYSTEM_DICTS=YES
  3877. AC_MSG_CHECKING([for spelling dictionary directory])
  3878. if test -n "$with_external_dict_dir"; then
  3879. DICT_SYSTEM_DIR=file://$with_external_dict_dir
  3880. else
  3881. DICT_SYSTEM_DIR=file:///usr/share/hunspell
  3882. if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
  3883. DICT_SYSTEM_DIR=file:///usr/share/myspell
  3884. fi
  3885. fi
  3886. AC_MSG_RESULT([$DICT_SYSTEM_DIR])
  3887. AC_MSG_CHECKING([for hyphenation patterns directory])
  3888. if test -n "$with_external_hyph_dir"; then
  3889. HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
  3890. else
  3891. HYPH_SYSTEM_DIR=file:///usr/share/hyphen
  3892. fi
  3893. AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
  3894. AC_MSG_CHECKING([for thesaurus directory])
  3895. if test -n "$with_external_thes_dir"; then
  3896. THES_SYSTEM_DIR=file://$with_external_thes_dir
  3897. else
  3898. THES_SYSTEM_DIR=file:///usr/share/mythes
  3899. fi
  3900. AC_MSG_RESULT([$THES_SYSTEM_DIR])
  3901. else
  3902. AC_MSG_RESULT([no])
  3903. SYSTEM_DICTS=NO
  3904. fi
  3905. AC_SUBST(SYSTEM_DICTS)
  3906. AC_SUBST(DICT_SYSTEM_DIR)
  3907. AC_SUBST(HYPH_SYSTEM_DIR)
  3908. AC_SUBST(THES_SYSTEM_DIR)
  3909. dnl ===================================================================
  3910. dnl ENABLE_PCH i now a no-op
  3911. dnl ===================================================================
  3912. AC_MSG_CHECKING([whether to enable pch feature])
  3913. AC_MSG_RESULT([no, obsolete])
  3914. dnl ===================================================================
  3915. dnl Search all the common names for GNU make
  3916. dnl ===================================================================
  3917. AC_MSG_CHECKING([for GNU make])
  3918. # try to use our own make if it is available and GNUMAKE was not already defined
  3919. if test -z "$GNUMAKE"; then
  3920. if test -x "/opt/lo/bin/make"; then
  3921. GNUMAKE="/opt/lo/bin/make"
  3922. fi
  3923. fi
  3924. for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
  3925. if test -n "$a"; then
  3926. $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null
  3927. if test $? -eq 0; then
  3928. GNUMAKE=$a
  3929. break
  3930. fi
  3931. fi
  3932. done
  3933. AC_MSG_RESULT($GNUMAKE)
  3934. if test -z "$GNUMAKE"; then
  3935. AC_MSG_ERROR([not found. install GNU make.])
  3936. fi
  3937. AC_MSG_CHECKING([the GNU make version])
  3938. _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
  3939. _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  3940. if test "$_make_longver" -ge "038200"; then
  3941. AC_MSG_RESULT([$GNUMAKE $_make_version])
  3942. elif test "$_make_longver" -ge "038100"; then
  3943. if test "$build_os" = "cygwin"; then
  3944. AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
  3945. fi
  3946. AC_MSG_RESULT([$GNUMAKE $_make_version])
  3947. dnl ===================================================================
  3948. dnl Search all the common names for sha1sum
  3949. dnl ===================================================================
  3950. AC_PATH_PROGS(SHA1SUM, sha1sum sha1 shasum)
  3951. if test -z "$SHA1SUM"; then
  3952. AC_MSG_ERROR([install the approproate SHA-1 checksumming program for this OS])
  3953. fi
  3954. AC_MSG_CHECKING([for GNU make bug 20033])
  3955. TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
  3956. cat > $TESTGMAKEBUG20033/Makefile << EOF
  3957. A := \$(wildcard *.a)
  3958. .PHONY: all
  3959. all: \$(A:.a=.b)
  3960. @echo survived bug20033. #dont kill these tabs, you will break the Makefile!!!!
  3961. .PHONY: setup
  3962. setup:
  3963. @touch 1.a 2.a 3.a 4.a 5.a 6.a
  3964. define d1
  3965. @echo lala \$(1)
  3966. @sleep 1
  3967. endef
  3968. define d2
  3969. @echo tyty \$(1)
  3970. @sleep 1
  3971. endef
  3972. %.b : %.a
  3973. \$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
  3974. \$(call d1,\$(CHECKSUM)),\
  3975. \$(call d2,\$(CHECKSUM)))
  3976. EOF
  3977. if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
  3978. no_parallelism_make="YES"
  3979. AC_MSG_RESULT([yes, disable parallelism])
  3980. else
  3981. AC_MSG_RESULT([no, keep parallelism enabled])
  3982. fi
  3983. rm -rf $TESTGMAKEBUG20033
  3984. else
  3985. AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
  3986. fi
  3987. # find if gnumake support file function
  3988. AC_MSG_CHECKING([whether GNU make supports the 'file' function])
  3989. TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
  3990. cat > $TESTGMAKEFILEFUNC/Makefile << EOF
  3991. \$(file >test.txt,Success )
  3992. .PHONY: all
  3993. all:
  3994. @cat test.txt
  3995. EOF
  3996. $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
  3997. if test -f $TESTGMAKEFILEFUNC/test.txt; then
  3998. HAVE_GNUMAKE_FILE_FUNC="YES"
  3999. AC_MSG_RESULT([yes])
  4000. else
  4001. AC_MSG_RESULT([no])
  4002. fi
  4003. rm -rf $TESTGMAKEFILEFUNC
  4004. AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
  4005. AC_SUBST(GNUMAKE)
  4006. _make_ver_check=`$GNUMAKE --version | grep LibreOffice`
  4007. STALE_MAKE=
  4008. make_warning=
  4009. if test "$_make_ver_check" = ""; then
  4010. STALE_MAKE=TRUE
  4011. fi
  4012. HAVE_LD_HASH_STYLE=FALSE
  4013. WITH_LINKER_HASH_STYLE=
  4014. AC_MSG_CHECKING( for --hash-style gcc linker support )
  4015. if test "$GCC" = "yes"; then
  4016. if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
  4017. hash_styles="gnu sysv"
  4018. elif test "$with_linker_hash_style" = "no"; then
  4019. hash_styles=
  4020. else
  4021. hash_styles="$with_linker_hash_style"
  4022. fi
  4023. for hash_style in $hash_styles; do
  4024. test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
  4025. hash_style_ldflags_save=$LDFLAGS
  4026. LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
  4027. AC_LINK_IFELSE([AC_LANG_PROGRAM(
  4028. [
  4029. #include <stdio.h>
  4030. ],[
  4031. printf ("");
  4032. ])],
  4033. [ if ./conftest$EXEEXT; then
  4034. HAVE_LD_HASH_STYLE=TRUE
  4035. WITH_LINKER_HASH_STYLE=$hash_style
  4036. fi],
  4037. [HAVE_LD_HASH_STYLE=FALSE])
  4038. LDFLAGS=$hash_style_ldflags_save
  4039. done
  4040. if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
  4041. AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
  4042. else
  4043. AC_MSG_RESULT( no )
  4044. fi
  4045. LDFLAGS=$hash_style_ldflags_save
  4046. else
  4047. AC_MSG_RESULT( no )
  4048. fi
  4049. AC_SUBST(HAVE_LD_HASH_STYLE)
  4050. AC_SUBST(WITH_LINKER_HASH_STYLE)
  4051. dnl ===================================================================
  4052. dnl Check whether there's a Perl version available.
  4053. dnl ===================================================================
  4054. if test -z "$with_perl_home"; then
  4055. AC_PATH_PROG(PERL, perl)
  4056. else
  4057. test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
  4058. _perl_path="$with_perl_home/bin/perl"
  4059. if test -x "$_perl_path"; then
  4060. PERL=$_perl_path
  4061. else
  4062. AC_MSG_ERROR([$_perl_path not found])
  4063. fi
  4064. fi
  4065. dnl ===================================================================
  4066. dnl Testing for Perl version 5 or greater.
  4067. dnl $] is the Perl version variable, it is returned as an integer
  4068. dnl ===================================================================
  4069. if test "$PERL"; then
  4070. AC_MSG_CHECKING([the Perl version])
  4071. ${PERL} -e "exit($]);"
  4072. _perl_version=$?
  4073. if test "$_perl_version" -lt 5; then
  4074. AC_MSG_ERROR([found Perl version "$_perl_version", use version 5 of Perl])
  4075. fi
  4076. AC_MSG_RESULT([checked (perl $_perl_version)])
  4077. else
  4078. AC_MSG_ERROR([Perl not found, install version 5 of Perl])
  4079. fi
  4080. dnl ===================================================================
  4081. dnl Testing for required Perl modules
  4082. dnl ===================================================================
  4083. AC_MSG_CHECKING([for required Perl modules])
  4084. if `$PERL -e 'use Archive::Zip; use Cwd; use Digest::MD5'`; then
  4085. AC_MSG_RESULT([all modules found])
  4086. else
  4087. AC_MSG_ERROR([Failed to find some modules])
  4088. fi
  4089. dnl ===================================================================
  4090. dnl Check for pkg-config
  4091. dnl ===================================================================
  4092. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4093. PKG_PROG_PKG_CONFIG
  4094. fi
  4095. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4096. # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
  4097. # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
  4098. # explicitly. Or put /path/to/compiler in PATH yourself.
  4099. AC_CHECK_TOOL(AR,ar)
  4100. AC_CHECK_TOOL(NM,nm)
  4101. AC_CHECK_TOOL(OBJDUMP,objdump)
  4102. AC_CHECK_TOOL(RANLIB,ranlib)
  4103. AC_CHECK_TOOL(STRIP,strip)
  4104. if test "$_os" = "WINNT"; then
  4105. AC_CHECK_TOOL(DLLTOOL,dlltool)
  4106. AC_CHECK_TOOL(WINDRES,windres)
  4107. fi
  4108. fi
  4109. AC_SUBST(AR)
  4110. AC_SUBST(DLLTOOL)
  4111. AC_SUBST(NM)
  4112. AC_SUBST(OBJDUMP)
  4113. AC_SUBST(PKG_CONFIG)
  4114. AC_SUBST(RANLIB)
  4115. AC_SUBST(STRIP)
  4116. AC_SUBST(WINDRES)
  4117. dnl ===================================================================
  4118. dnl pkg-config checks on Mac OS X
  4119. dnl ===================================================================
  4120. if test $_os = Darwin; then
  4121. AC_MSG_CHECKING([for bogus pkg-config])
  4122. if test -n "$PKG_CONFIG"; then
  4123. if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
  4124. AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
  4125. else
  4126. if test "$enable_bogus_pkg_config" = "yes"; then
  4127. AC_MSG_RESULT([yes, user-approved from unknown origin.])
  4128. else
  4129. AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please remove or hide $PKG_CONFIG])
  4130. fi
  4131. fi
  4132. else
  4133. AC_MSG_RESULT([no, good])
  4134. fi
  4135. fi
  4136. dnl ===================================================================
  4137. dnl .NET needs special treatment
  4138. dnl (does the above comment really mean .NET, or is it misusing
  4139. dnl that to mean Visual Studio .NET 2003 ? And does this also
  4140. dnl in fact apply equally to what we actually support, i.e.
  4141. dnl Visual Studio 2008 and 2010?)
  4142. dnl ===================================================================
  4143. if test "$build_os" = "cygwin"; then
  4144. dnl Check midl.exe
  4145. AC_PATH_PROG(MIDL_PATH, midl.exe)
  4146. if test -n "$MIDL_PATH"; then
  4147. MIDL_PATH=`dirname "$MIDL_PATH"`
  4148. else
  4149. AC_MSG_CHECKING([for midl.exe more thoroughly])
  4150. fi
  4151. if test -n "$with_midl_path"; then
  4152. with_midl_path=`cygpath -u "$with_midl_path"`
  4153. fi
  4154. if test -x "$with_midl_path/midl.exe"; then
  4155. MIDL_PATH="$with_midl_path"
  4156. fi
  4157. if test -z "$MIDL_PATH" -a -e "$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
  4158. MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
  4159. fi
  4160. if test -z "$MIDL_PATH"; then
  4161. vstest=`./oowintool --msvs-productdir`
  4162. if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
  4163. MIDL_PATH="$vstest/Common7/Tools/Bin"
  4164. fi
  4165. fi
  4166. if test -z "$MIDL_PATH"; then
  4167. winsdktest=`./oowintool --windows-sdk-home`
  4168. if test -x "$winsdktest/Bin/midl.exe"; then
  4169. MIDL_PATH="$winsdktest/Bin"
  4170. elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then
  4171. MIDL_PATH="$winsdktest/Bin/$SDK_ARCH"
  4172. fi
  4173. fi
  4174. if test ! -x "$MIDL_PATH/midl.exe"; then
  4175. AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or use --with-midl-path])
  4176. else
  4177. AC_MSG_RESULT([$MIDL_PATH/midl.exe])
  4178. fi
  4179. # Convert to posix path with 8.3 filename restrictions ( No spaces )
  4180. MIDL_PATH=`cygpath -d "$MIDL_PATH"`
  4181. MIDL_PATH=`cygpath -u "$MIDL_PATH"`
  4182. dnl Check csc.exe
  4183. AC_PATH_PROG(CSC_PATH, csc.exe)
  4184. if test -n "$CSC_PATH"; then
  4185. CSC_PATH=`dirname "$CSC_PATH"`
  4186. fi
  4187. if test -n "$with_csc_path"; then
  4188. with_csc_path=`cygpath -u "$with_csc_path"`
  4189. else
  4190. AC_MSG_CHECKING([for csc.exe more thoroughly])
  4191. fi
  4192. if test -x "$with_csc_path/csc.exe"; then
  4193. CSC_PATH="$with_csc_path"
  4194. else
  4195. csctest=`./oowintool --csc-compilerdir`
  4196. if test -x "$csctest/csc.exe"; then
  4197. CSC_PATH="$csctest"
  4198. fi
  4199. fi
  4200. if test ! -x "$CSC_PATH/csc.exe"; then
  4201. AC_MSG_ERROR([csc.exe not found. Make sure it's in the path or use --with-csc-path])
  4202. else
  4203. AC_MSG_RESULT([$CSC_PATH/csc.exe])
  4204. fi
  4205. # Convert to posix path with 8.3 filename restrictions ( No spaces )
  4206. CSC_PATH=`cygpath -d "$CSC_PATH"`
  4207. CSC_PATH=`cygpath -u "$CSC_PATH"`
  4208. dnl Check al.exe
  4209. AC_PATH_PROG(AL_PATH, al.exe)
  4210. if test -n "$AL_PATH"; then
  4211. AL_PATH=`dirname "$AL_PATH"`
  4212. else
  4213. AC_MSG_CHECKING([for al.exe more thoroughly])
  4214. fi
  4215. if test -n "$with_al_path"; then
  4216. with_al_path=`cygpath -u "$with_al_path"`
  4217. fi
  4218. if test -x "$with_al_path/al.exe"; then
  4219. AL_PATH="$with_al_path"
  4220. fi
  4221. if test -z "$AL_PATH"; then
  4222. winsdktest=`./oowintool --windows-sdk-home`
  4223. if test -x "$winsdktest/Bin/al.exe"; then
  4224. AL_PATH="$winsdktest/Bin"
  4225. elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then
  4226. AL_PATH="$winsdktest/Bin/$SDK_ARCH"
  4227. fi
  4228. fi
  4229. if test -z "$AL_PATH"; then
  4230. altest=`./oowintool --al-home`
  4231. if test -x "$altest/bin/al.exe"; then
  4232. AL_PATH="$altest/bin"
  4233. elif test -x "$altest/al.exe"; then
  4234. AL_PATH="$altest"
  4235. fi
  4236. fi
  4237. if test ! -x "$AL_PATH/al.exe"; then
  4238. AC_MSG_ERROR([al.exe not found. Make sure it's in PATH or use --with-al-path])
  4239. else
  4240. AC_MSG_RESULT([$AL_PATH/al.exe])
  4241. fi
  4242. # Convert to posix path with 8.3 filename restrictions ( No spaces )
  4243. AL_PATH=`cygpath -d "$AL_PATH"`
  4244. AL_PATH=`cygpath -u "$AL_PATH"`
  4245. dnl Check mscoree.lib / .NET Framework dir
  4246. AC_MSG_CHECKING(.NET Framework)
  4247. if test -n "$with_dotnet_framework_home"; then
  4248. with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
  4249. fi
  4250. if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
  4251. DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
  4252. fi
  4253. if test -z "$DOTNET_FRAMEWORK_HOME"; then
  4254. frametest=`./oowintool --dotnetsdk-dir`
  4255. if test -f "$frametest/lib/mscoree.lib"; then
  4256. DOTNET_FRAMEWORK_HOME="$frametest"
  4257. else
  4258. frametest=`./oowintool --windows-sdk-home`
  4259. if test -f "$frametest/lib/mscoree.lib" -o -f "$frametest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
  4260. DOTNET_FRAMEWORK_HOME="$frametest"
  4261. fi
  4262. fi
  4263. fi
  4264. if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
  4265. AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make sure you use --with-dotnet-framework-home])
  4266. fi
  4267. AC_MSG_RESULT(found)
  4268. PathFormat "$MIDL_PATH"
  4269. MIDL_PATH="$formatted_path"
  4270. PathFormat "$AL_PATH"
  4271. AL_PATH="$formatted_path"
  4272. PathFormat "$DOTNET_FRAMEWORK_HOME"
  4273. DOTNET_FRAMEWORK_HOME="$formatted_path"
  4274. PathFormat "$CSC_PATH"
  4275. CSC_PATH="$formatted_path"
  4276. fi
  4277. dnl ===================================================================
  4278. dnl Check if stdc headers are available excluding MSVC.
  4279. dnl ===================================================================
  4280. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4281. AC_HEADER_STDC
  4282. fi
  4283. dnl ===================================================================
  4284. dnl Testing for C++ compiler and version...
  4285. dnl ===================================================================
  4286. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4287. # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
  4288. save_CXXFLAGS=$CXXFLAGS
  4289. AC_PROG_CXX
  4290. CXXFLAGS=$save_CXXFLAGS
  4291. else
  4292. if test -n "$CC" -a -z "$CXX"; then
  4293. CXX="$CC"
  4294. fi
  4295. fi
  4296. dnl check if we are using a buggy version of g++ (currently 3.4.0, 3.4.1 and trunk)
  4297. if test "$GXX" = "yes"; then
  4298. AC_MSG_CHECKING([the GNU C++ compiler version])
  4299. _gpp_version=`$CXX -dumpversion`
  4300. _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
  4301. if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.4" -a "$_gpp_majmin" -ge "401"; then
  4302. if test -z "$save_CXX" -a -x "$GCC_HOME/bin/g++-4.0"; then
  4303. export CXX="$GCC_HOME/bin/g++-4.0"
  4304. _gpp_majmin_2=`$CXX -dumpversion | $AWK -F. '{ print \$1*100+\$2 }'`
  4305. if test "$_gpp_majmin_2" -ge "400" -a "$_gpp_majmin_2" -lt "401"; then
  4306. _gpp_majmin=$_gpp_majmin_2
  4307. fi
  4308. fi
  4309. if test "$_gpp_majmin" -ge "401"; then
  4310. AC_MSG_ERROR([You need to use the g++-4.0 compiler (g++ $_gpp_version won't work with the MacOSX10.4u.sdk) - set CXX accordingly])
  4311. else
  4312. AC_MSG_RESULT([implicitly using CXX=$CXX])
  4313. fi
  4314. else
  4315. AC_MSG_RESULT([checked (g++ $_gpp_version)])
  4316. fi
  4317. if test "$_gpp_majmin" = "304"; then
  4318. AC_MSG_CHECKING([whether $CXX has the enum bug])
  4319. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  4320. extern "C" void abort (void);
  4321. extern "C" void exit (int status);
  4322. enum E { E0, E1, E2, E3, E4, E5 };
  4323. void test (enum E e)
  4324. {
  4325. if (e == E2 || e == E3 || e == E1)
  4326. exit (1);
  4327. }
  4328. int main (void)
  4329. {
  4330. test (E4);
  4331. test (E5);
  4332. test (E0);
  4333. return 0;
  4334. }
  4335. ]])],[AC_MSG_ERROR([your version of the GNU C++ compile has a bug which prevents LibreOffice from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details.])],[AC_MSG_RESULT([no])],[])
  4336. fi
  4337. fi
  4338. #
  4339. # prefx CXX with ccache if needed
  4340. #
  4341. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4342. if test "$CCACHE" != ""; then
  4343. AC_MSG_CHECKING([whether $CXX is already ccached])
  4344. AC_LANG_PUSH([C++])
  4345. save_CXXFLAGS=$CXXFLAGS
  4346. CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
  4347. dnl an empty program will do, we're checking the compiler flags
  4348. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
  4349. [use_ccache=yes], [use_ccache=no])
  4350. if test $use_ccache = yes; then
  4351. AC_MSG_RESULT([yes])
  4352. else
  4353. CXX="$CCACHE $CXX"
  4354. AC_MSG_RESULT([no])
  4355. fi
  4356. CXXFLAGS=$save_CXXFLAGS
  4357. AC_LANG_POP([C++])
  4358. fi
  4359. fi
  4360. dnl ===================================================================
  4361. dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
  4362. dnl ===================================================================
  4363. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4364. AC_PROG_CXXCPP
  4365. dnl Check whether there's a C pre-processor.
  4366. dnl ===================================================================
  4367. dnl When using SunStudio compiler, there is a bug with the cc
  4368. dnl preprocessor, so use CC preprocessor as the cc preprocessor
  4369. dnl See Issuezilla #445.
  4370. dnl ===================================================================
  4371. if test "$_os" = "SunOS"; then
  4372. CPP=$CXXCPP
  4373. else
  4374. AC_PROG_CPP
  4375. fi
  4376. fi
  4377. dnl ===================================================================
  4378. dnl Find integral type sizes and alignments
  4379. dnl ===================================================================
  4380. if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
  4381. AC_CHECK_SIZEOF(long)
  4382. AC_CHECK_SIZEOF(short)
  4383. AC_CHECK_SIZEOF(int)
  4384. AC_CHECK_SIZEOF(long long)
  4385. AC_CHECK_SIZEOF(double)
  4386. AC_CHECK_SIZEOF(void*)
  4387. SIZEOF_SHORT=$ac_cv_sizeof_short
  4388. SIZEOF_INT=$ac_cv_sizeof_int
  4389. SIZEOF_LONG=$ac_cv_sizeof_long
  4390. SIZEOF_LONGLONG=$ac_cv_sizeof_long_long
  4391. SIZEOF_DOUBLE=$ac_cv_sizeof_double
  4392. SIZEOF_POINTER=$ac_cv_sizeof_voidp
  4393. dnl Allow build without AC_CHECK_ALIGNOF, grrr
  4394. m4_pattern_allow([AC_CHECK_ALIGNOF])
  4395. m4_ifdef([AC_CHECK_ALIGNOF],
  4396. [
  4397. AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
  4398. AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
  4399. AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
  4400. AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
  4401. ],
  4402. [
  4403. case "$_os-$host_cpu" in
  4404. Darwin-powerpc)
  4405. test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=1
  4406. test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=1
  4407. test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=1
  4408. test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=1
  4409. ;;
  4410. Linux-i686)
  4411. test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
  4412. test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
  4413. test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
  4414. test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
  4415. ;;
  4416. Linux-x86_64)
  4417. test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
  4418. test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
  4419. test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
  4420. test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
  4421. ;;
  4422. *)
  4423. if test -z "$ac_cv_alignof_short" -o \
  4424. -z "$ac_cv_alignof_int" -o \
  4425. -z "$ac_cv_alignof_long" -o \
  4426. -z "$ac_cv_alignof_double"; then
  4427. AC_MSG_ERROR([Your Autoconf doesn't have [AC_][CHECK_ALIGNOF]. You need to set the environment variables ac_cv_alignof_short, ac_cv_alignof_int, ac_cv_alignof_long and ac_cv_alignof_double.])
  4428. fi
  4429. ;;
  4430. esac
  4431. ])
  4432. ALIGNOF_SHORT=$ac_cv_alignof_short
  4433. ALIGNOF_INT=$ac_cv_alignof_int
  4434. ALIGNOF_LONG=$ac_cv_alignof_long
  4435. ALIGNOF_DOUBLE=$ac_cv_alignof_double
  4436. AC_C_BIGENDIAN
  4437. WORDS_BIGENDIAN=$ac_cv_c_bigendian
  4438. dnl Check for large file support
  4439. AC_SYS_LARGEFILE
  4440. if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
  4441. LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  4442. fi
  4443. if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
  4444. LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
  4445. fi
  4446. else
  4447. # Hardcode for MSVC
  4448. SIZEOF_SHORT=2
  4449. SIZEOF_INT=4
  4450. SIZEOF_LONG=4
  4451. SIZEOF_LONGLONG=8
  4452. if test "$BITNESS_OVERRIDE" = ""; then
  4453. SIZEOF_POINTER=4
  4454. else
  4455. SIZEOF_POINTER=8
  4456. fi
  4457. ALIGNOF_SHORT=2
  4458. ALIGNOF_INT=4
  4459. ALIGNOF_LONG=4
  4460. ALIGNOF_DOUBLE=8
  4461. WORDS_BIGENDIAN=no
  4462. LFS_CFLAGS=''
  4463. fi
  4464. AC_SUBST(WORDS_BIGENDIAN)
  4465. AC_SUBST(LFS_CFLAGS)
  4466. AC_SUBST(SIZEOF_SHORT)
  4467. AC_SUBST(SIZEOF_INT)
  4468. AC_SUBST(SIZEOF_LONG)
  4469. AC_SUBST(SIZEOF_LONGLONG)
  4470. AC_SUBST(SIZEOF_DOUBLE)
  4471. AC_SUBST(SIZEOF_POINTER)
  4472. AC_SUBST(ALIGNOF_SHORT)
  4473. AC_SUBST(ALIGNOF_INT)
  4474. AC_SUBST(ALIGNOF_LONG)
  4475. AC_SUBST(ALIGNOF_DOUBLE)
  4476. dnl ===================================================================
  4477. dnl Check if valgrind headers are available
  4478. dnl ===================================================================
  4479. if test "$cross_compiling" = yes -o "$ENABLE_DBGUTIL" != TRUE; then
  4480. ENABLE_VALGRIND=FALSE
  4481. else
  4482. prev_cppflags=$CPPFLAGS
  4483. CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
  4484. AC_CHECK_HEADER([valgrind/valgrind.h],
  4485. [ENABLE_VALGRIND=TRUE],[ENABLE_VALGRIND=FALSE])
  4486. CPPFLAGS=$prev_cppflags
  4487. fi
  4488. AC_SUBST([ENABLE_VALGRIND])
  4489. if test "$ENABLE_VALGRIND" = FALSE; then
  4490. VALGRIND_CFLAGS=
  4491. fi
  4492. AC_SUBST([VALGRIND_CFLAGS])
  4493. dnl ===================================================================
  4494. dnl Compiler plugins
  4495. dnl ===================================================================
  4496. COMPILER_PLUGINS=
  4497. # currently only Clang
  4498. if test "$COM_GCC_IS_CLANG" = "TRUE"; then
  4499. if test -n "$enable_compiler_plugins"; then
  4500. compiler_plugins="$enable_compiler_plugins"
  4501. elif test -n "$ENABLE_DBGUTIL"; then
  4502. compiler_plugins=test
  4503. else
  4504. compiler_plugins=no
  4505. fi
  4506. if test "$compiler_plugins" != "no"; then
  4507. AC_LANG_PUSH([C++])
  4508. save_CPPFLAGS=$CPPFLAGS
  4509. CPPFLAGS="$CPPFLAGS $CLANGPLUGIN_CPPFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
  4510. AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
  4511. [COMPILER_PLUGINS=TRUE],
  4512. [
  4513. if test "$compiler_plugins" = "yes"; then
  4514. AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
  4515. else
  4516. AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
  4517. add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
  4518. fi
  4519. ])
  4520. CPPFLAGS=$save_CPPFLAGS
  4521. AC_LANG_POP([C++])
  4522. fi
  4523. else
  4524. if test "$enable_compiler_plugins" = "yes"; then
  4525. AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
  4526. fi
  4527. fi
  4528. AC_SUBST(COMPILER_PLUGINS)
  4529. AC_SUBST(CLANGPLUGIN_CPPFLAGS)
  4530. dnl ===================================================================
  4531. dnl Set the MinGW sys-root
  4532. dnl ===================================================================
  4533. if test "$WITH_MINGW" = "yes"; then
  4534. for sysroot in /usr/i686-w64-mingw32/sys-root/mingw; do
  4535. if test -d "$sysroot"; then
  4536. MINGW_SYSROOT="$sysroot"
  4537. break
  4538. fi
  4539. done
  4540. fi
  4541. AC_SUBST([MINGW_SYSROOT])
  4542. dnl ===================================================================
  4543. dnl Set the MinGW include directories
  4544. dnl ===================================================================
  4545. if test "$WITH_MINGW" = "yes"; then
  4546. AC_MSG_CHECKING([for MinGW include path])
  4547. cat >conftest.$ac_ext <<_ACEOF
  4548. #include <stddef.h>
  4549. #include <bits/c++config.h>
  4550. _ACEOF
  4551. _mingw_lib_include_path=`$CXX -E -xc++ conftest.$ac_ext | $SED -n -e '/.*1*"\(.*\)\/stddef.h".*/s//\1/p' -e '/.*1*"\(.*\)\/bits\/c++config.h".*/s//\1/p' | sort -u | xargs echo`
  4552. rm conftest.$ac_ext
  4553. if test -z "$_mingw_lib_include_path"; then
  4554. _mingw_lib_include_path="NO_LIB_INCLUDE"
  4555. AC_MSG_RESULT([no MinGW include path])
  4556. else
  4557. AC_MSG_RESULT([$_mingw_lib_include_path])
  4558. fi
  4559. MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path"
  4560. AC_SUBST(MINGW_LIB_INCLUDE_PATH)
  4561. mingw_crtbegin=`$CC -print-file-name=crtbegin.o`
  4562. MINGW_CLIB_DIR=`dirname $mingw_crtbegin`
  4563. AC_LANG_PUSH([C++])
  4564. AC_MSG_CHECKING([for dynamic libgcc])
  4565. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  4566. #include <iostream>
  4567. using namespace std;
  4568. ]], [[ try { throw 42; } catch (int e) { cout << "Yep, " << e << endl; } ]])],[
  4569. MINGW_GCCDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libgcc' | $SED -e 's@.*DLL Name: @@'`
  4570. if test -n "$MINGW_GCCDLL"; then
  4571. MINGW_SHARED_GCCLIB=YES
  4572. AC_MSG_RESULT([ $MINGW_GCCDLL])
  4573. else
  4574. MINGW_SHARED_GCCLIB=NO
  4575. AC_MSG_RESULT([no])
  4576. fi
  4577. ],[ AC_MSG_RESULT([no])
  4578. ])
  4579. AC_MSG_CHECKING([for dynamic libstdc++])
  4580. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  4581. #include <iostream>
  4582. using namespace std;
  4583. ]], [[ cout << "Hello there." << endl; ]])],[
  4584. MINGW_GXXDLL=`$OBJDUMP -p conftest.exe | grep 'DLL Name: libstdc++' | $SED -e 's@.*DLL Name: @@'`
  4585. if test -n "$MINGW_GXXDLL"; then
  4586. mingw_gxxdll_root=${MINGW_GXXDLL%.dll}
  4587. mingw_gxxdll_root=${mingw_gxxdll_root#lib}
  4588. if test "$CROSS_COMPILING" = "YES"; then
  4589. dnl m4 escaping!
  4590. mingw_gxxdll_root=${mingw_gxxdll_root%-[[0-9]]}
  4591. fi
  4592. MINGW_SHARED_LIBSTDCPP=-l$mingw_gxxdll_root
  4593. MINGW_SHARED_GXXLIB=YES
  4594. AC_MSG_RESULT([$MINGW_GXXDLL])
  4595. else
  4596. MINGW_SHARED_GXXLIB=NO
  4597. AC_MSG_RESULT([no])
  4598. fi
  4599. ],[ AC_MSG_RESULT([no])
  4600. ])
  4601. AC_LANG_POP([C++])
  4602. AC_SUBST(MINGW_CLIB_DIR)
  4603. AC_SUBST(MINGW_SHARED_GCCLIB)
  4604. AC_SUBST(MINGW_SHARED_GXXLIB)
  4605. AC_SUBST(MINGW_SHARED_LIBSTDCPP)
  4606. AC_SUBST(MINGW_GCCDLL)
  4607. AC_SUBST(MINGW_GXXDLL)
  4608. fi
  4609. dnl ===================================================================
  4610. dnl Extra checking for the SunOS compiler
  4611. dnl ===================================================================
  4612. if test "$_os" = "SunOS"; then
  4613. dnl SunStudio C++ compiler packaged with SunStudio C compiler
  4614. if test "$CC" = "cc"; then
  4615. AC_MSG_CHECKING([SunStudio C++ Compiler])
  4616. if test "$CXX" != "CC"; then
  4617. AC_MSG_WARN([SunStudio C++ was not found])
  4618. add_warning "SunStudio C++ was not found"
  4619. else
  4620. AC_MSG_RESULT([checked])
  4621. fi
  4622. fi
  4623. fi
  4624. dnl *************************************************************
  4625. dnl Testing for exception handling - dwarf2 or sjlj exceptions...
  4626. dnl *************************************************************
  4627. if test "$WITH_MINGW" = "yes"; then
  4628. AC_MSG_CHECKING([exception type])
  4629. AC_LANG_PUSH([C++])
  4630. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iostream>
  4631. extern "C" void _Unwind_SjLj_RaiseException(void) __attribute__ ((__noreturn__));
  4632. ]], [[_Unwind_SjLj_RaiseException() ]])],[exceptions_type="sjlj"],[exceptions_type="dwarf2"
  4633. ])
  4634. AC_MSG_RESULT($exceptions_type)
  4635. AC_LANG_POP([C++])
  4636. fi
  4637. EXCEPTIONS="$exceptions_type"
  4638. AC_SUBST(EXCEPTIONS)
  4639. dnl ===================================================================
  4640. dnl Checks for what the default STL should be
  4641. dnl ===================================================================
  4642. AC_MSG_CHECKING([Whether building STLPort library makes sense])
  4643. BUILD_STLPORT="no"
  4644. if test "$_os" = "Linux"; then
  4645. case "$host_cpu" in
  4646. i?86)
  4647. case "$host_os" in
  4648. k*bsd*-gnu*)
  4649. BUILD_STLPORT="no"
  4650. ;;
  4651. *)
  4652. BUILD_STLPORT="yes"
  4653. ;;
  4654. esac
  4655. ;;
  4656. *)
  4657. BUILD_STLPORT="no"
  4658. ;;
  4659. esac
  4660. elif test "$_os" = "SunOS" -a "$COM" = "C52"; then
  4661. BUILD_STLPORT="yes"
  4662. elif test "$_os" = "WINNT" -a "$CPUNAME" != X86_64 -a "$WITH_MINGW" != "yes"; then
  4663. BUILD_STLPORT="yes"
  4664. elif test "$_os" = "FreeBSD"; then
  4665. BUILD_STLPORT="yes"
  4666. fi
  4667. if test "$BUILD_STLPORT" = "yes"; then
  4668. AC_MSG_RESULT([yes])
  4669. else
  4670. AC_MSG_RESULT([no])
  4671. fi
  4672. AC_MSG_CHECKING([Whether STLPort library will be actually built])
  4673. if test "$with_stlport" = "auto" -o "$BUILD_STLPORT" = "no"; then
  4674. with_stlport=$BUILD_STLPORT
  4675. fi
  4676. if test "$with_stlport" = "yes"; then
  4677. AC_MSG_RESULT([yes])
  4678. WITH_STLPORT=YES
  4679. SCPDEFS="$SCPDEFS -DWITH_STLPORT"
  4680. BUILD_TYPE="$BUILD_TYPE STLPORT"
  4681. else
  4682. WITH_STLPORT=NO
  4683. AC_MSG_RESULT([no])
  4684. fi
  4685. AC_SUBST(WITH_STLPORT)
  4686. dnl ===================================================================
  4687. dnl gxx include directories needed by STLPort
  4688. dnl ===================================================================
  4689. # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path
  4690. # often contains an i386 which is expanded as a macro.
  4691. if test "$GXX" = "yes"; then
  4692. AC_MSG_CHECKING([for g++ include path])
  4693. if test -z "$with_gxx_include_path"; then
  4694. with_gxx_include_path=`echo "#include <cstring>" | $CXX -E -xc++ - 2>/dev/null | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
  4695. if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then
  4696. with_gxx_include_path="/usr/include"
  4697. fi
  4698. if echo $with_gxx_include_path | $GREP -q linux; then
  4699. # workaround for Mandriva - issue 100049
  4700. with_gxx_include_path=`cd -P $with_gxx_include_path && pwd`
  4701. fi
  4702. fi
  4703. dnl This is the original code...
  4704. dnl with_gxx_include_path=`$CXX -print-search-dirs | grep instal |$AWK '{ print \$2 }'`/include
  4705. if test -z "$with_gxx_include_path"; then
  4706. with_gxx_include_path="NO_GXX_INCLUDE"
  4707. AC_MSG_RESULT([none])
  4708. else
  4709. PathFormat "$with_gxx_include_path"
  4710. with_gxx_include_path="$formatted_path"
  4711. AC_MSG_RESULT([$with_gxx_include_path])
  4712. fi
  4713. else
  4714. with_gxx_include_path="NO_GXX_INCLUDE"
  4715. fi
  4716. GXX_INCLUDE_PATH="$with_gxx_include_path"
  4717. AC_SUBST(GXX_INCLUDE_PATH)
  4718. dnl ===================================================================
  4719. dnl thread-safe statics
  4720. dnl ===================================================================
  4721. AC_MSG_CHECKING([whether $CXX supports thread safe statics])
  4722. unset HAVE_THREADSAFE_STATICS
  4723. if test "$GCC" = "yes"; then
  4724. dnl -fthreadsafe-statics is available since GCC 4, so always available for
  4725. dnl us. However, some C++ runtimes use a single lock for all static
  4726. dnl variables, which can cause deadlock in multi-threaded applications.
  4727. dnl This is not easily tested here; for POSIX-based systems, if executing
  4728. dnl the following C++ program does not terminate then the tool chain
  4729. dnl apparently has this problem:
  4730. dnl
  4731. dnl #include <pthread.h>
  4732. dnl int h() { return 0; }
  4733. dnl void * g(void * unused) {
  4734. dnl static int n = h();
  4735. dnl return &n;
  4736. dnl }
  4737. dnl int f() {
  4738. dnl pthread_t t;
  4739. dnl pthread_create(&t, 0, g, 0);
  4740. dnl pthread_join(t, 0);
  4741. dnl return 0;
  4742. dnl }
  4743. dnl int main() {
  4744. dnl static int n = f();
  4745. dnl return n;
  4746. dnl }
  4747. dnl
  4748. dnl Mac OS X up to at least 10.7.1 is known to have this problem, as is at
  4749. dnl least one instance of GCC 4.2.4 (used on a "Linux ooobuild1.osuosl.org
  4750. dnl 2.6.9-101.plus.c4smp #1 SMP Thu Jul 21 19:08:15 EDT 2011 i686 i686 i386
  4751. dnl GNU/Linux" machine); see the definition of __cxa_guard_acquire in GCC's
  4752. dnl libstdc++-v3/libsupc++/guard.cc for what #ifdefs actually make a
  4753. dnl difference there. Conservative advice from Jakub Jelinek is to assume
  4754. dnl it working in GCC >= 4.3:
  4755. if test "$_os" = "Darwin" -o $_os = Android -o "${GCCVER?}" -lt 040300; then
  4756. AC_MSG_RESULT([broken (i.e., no)])
  4757. else
  4758. HAVE_THREADSAFE_STATICS=TRUE
  4759. AC_MSG_RESULT([yes])
  4760. fi
  4761. else
  4762. AC_MSG_RESULT([unknown (assuming no)])
  4763. fi
  4764. AC_SUBST(HAVE_THREADSAFE_STATICS)
  4765. dnl ===================================================================
  4766. dnl visibility and c++0x features
  4767. dnl ===================================================================
  4768. if test "$GCC" = "yes"; then
  4769. AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
  4770. save_CFLAGS=$CFLAGS
  4771. CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
  4772. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_VISIBILITY_FEATURE=TRUE ],[])
  4773. CFLAGS=$save_CFLAGS
  4774. if test "$COM_GCC_IS_CLANG" = TRUE -a $_os = Darwin; then
  4775. # It seems that with Apple's Clang, visibility doesn't work as
  4776. # we would want at least in the connectivity and dbaccess
  4777. # modules. This might be because of something peculiar in
  4778. # those modules? Whatever.
  4779. HAVE_GCC_VISIBILITY_FEATURE=
  4780. fi
  4781. if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
  4782. AC_MSG_RESULT([yes])
  4783. else
  4784. AC_MSG_RESULT([no])
  4785. fi
  4786. AC_MSG_CHECKING([whether $CC supports -Wno-long-double])
  4787. save_CFLAGS=$CFLAGS
  4788. CFLAGS="$CFLAGS -Werror -Wno-long-double"
  4789. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_NO_LONG_DOUBLE=TRUE ],[])
  4790. CFLAGS=$save_CFLAGS
  4791. if test "$HAVE_GCC_NO_LONG_DOUBLE" = "TRUE"; then
  4792. AC_MSG_RESULT([yes])
  4793. else
  4794. AC_MSG_RESULT([no])
  4795. fi
  4796. AC_MSG_CHECKING([whether $CC supports -mno-avx])
  4797. save_CFLAGS=$CFLAGS
  4798. CFLAGS="$CFLAGS -Werror -mno-avx"
  4799. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
  4800. CFLAGS=$save_CFLAGS
  4801. if test "$HAVE_GCC_AVX" = "TRUE"; then
  4802. AC_MSG_RESULT([yes])
  4803. else
  4804. AC_MSG_RESULT([no])
  4805. fi
  4806. AC_MSG_CHECKING([whether $CC supports atomic functions])
  4807. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  4808. int v = 0;
  4809. if (__sync_add_and_fetch(&v, 1) != 1 ||
  4810. __sync_sub_and_fetch(&v, 1) != 0)
  4811. return 1;
  4812. __sync_synchronize();
  4813. if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
  4814. v != 1)
  4815. return 1;
  4816. return 0;
  4817. ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
  4818. if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
  4819. AC_MSG_RESULT([yes])
  4820. else
  4821. AC_MSG_RESULT([no])
  4822. fi
  4823. AC_MSG_CHECKING([whether $CXX supports -std=gnu++0x without Language Defect 757])
  4824. if test "$GCCVER" -ge 040700 -a "$GCCVER" -lt 040702; then
  4825. AC_MSG_NOTICE([Not using -std=gnu++0x on $CXX version 4.7.0/4.7.1 due to libstdc++ ABI breakage.])
  4826. else
  4827. save_CXXFLAGS=$CXXFLAGS
  4828. CXXFLAGS="$CXXFLAGS -std=gnu++0x"
  4829. AC_LANG_PUSH([C++])
  4830. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  4831. #include <stddef.h>
  4832. #include <vector>
  4833. // some Clang fail when compiling against GCC 4.7 headers with --std=gnu++0x
  4834. template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
  4835. namespace
  4836. {
  4837. struct b
  4838. {
  4839. int i;
  4840. int j;
  4841. };
  4842. }
  4843. ]], [[
  4844. struct a
  4845. {
  4846. int i;
  4847. int j;
  4848. };
  4849. a thinga[]={{0,0}, {1,1}};
  4850. b thingb[]={{0,0}, {1,1}};
  4851. size_t i = sizeof(sal_n_array_size(thinga));
  4852. size_t j = sizeof(sal_n_array_size(thingb));
  4853. return !(i != 0 && j != 0);
  4854. ]])],[HAVE_CXX0X=TRUE],[])
  4855. AC_LANG_POP([C++])
  4856. CXXFLAGS=$save_CXXFLAGS
  4857. fi
  4858. if test "$HAVE_CXX0X" = "TRUE"; then
  4859. AC_MSG_RESULT([yes])
  4860. else
  4861. AC_MSG_RESULT([no])
  4862. fi
  4863. fi
  4864. AC_SUBST(HAVE_CXX0X)
  4865. AC_SUBST(HAVE_GCC_NO_LONG_DOUBLE)
  4866. AC_SUBST(HAVE_GCC_AVX)
  4867. AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
  4868. dnl ===================================================================
  4869. dnl system stl sanity tests
  4870. dnl ===================================================================
  4871. HAVE_GCC_VISIBILITY_BROKEN=
  4872. if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
  4873. AC_LANG_PUSH([C++])
  4874. save_CPPFLAGS="$CPPFLAGS"
  4875. if test -n "$MACOSX_SDK_PATH"; then
  4876. CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
  4877. fi
  4878. if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
  4879. dnl gcc#19664, gcc#22482, rhbz#162935
  4880. AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
  4881. AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
  4882. AC_MSG_RESULT([$stlvisok])
  4883. if test "$stlvisok" = "no"; then
  4884. AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
  4885. add_warning "Your gcc STL headers are not visibility safe. Disabling visibility"
  4886. unset HAVE_GCC_VISIBILITY_FEATURE
  4887. fi
  4888. fi
  4889. if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
  4890. sharedlink_ldflags_save=$LDFLAGS
  4891. LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden $PICSWITCH $LINKFLAGSSHL"
  4892. AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe with STL headers])
  4893. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  4894. #include <sstream>
  4895. using namespace std;
  4896. ]], [[
  4897. istringstream strm( "test" ); return 0;
  4898. ]])],
  4899. # Ugh, surely bad to assume an error message will contain
  4900. # the word "unresolvable", a problem with
  4901. # -fvisibility-inlines-hidden and STL headers might cause
  4902. # some more obscure message on some platform, and anway,
  4903. # the error message could be localised.
  4904. [$EGREP -q unresolvable conftest.err;
  4905. if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi],[gccvisok=no
  4906. ])
  4907. AC_MSG_RESULT([$gccvisok])
  4908. if test "$gccvisok" = "no"; then
  4909. AC_MSG_WARN([Your gcc is not -fvisibility-inlines-hidden safe, disabling that.])
  4910. add_warning "Your gcc is not -fvisibility-inlines-hidden safe, disabling that."
  4911. HAVE_GCC_VISIBILITY_BROKEN="TRUE"
  4912. fi
  4913. LDFLAGS=$sharedlink_ldflags_save
  4914. fi
  4915. if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a "$HAVE_GCC_VISIBILITY_BROKEN" != "TRUE"; then
  4916. AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
  4917. cat > conftestlib1.cc <<_ACEOF
  4918. template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
  4919. struct S2: S1<int> { virtual ~S2(); };
  4920. S2::~S2() {}
  4921. _ACEOF
  4922. cat > conftestlib2.cc <<_ACEOF
  4923. template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
  4924. struct S2: S1<int> { virtual ~S2(); };
  4925. struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
  4926. _ACEOF
  4927. gccvisinlineshiddenok=yes
  4928. if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
  4929. gccvisinlineshiddenok=no
  4930. else
  4931. if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $LINKFLAGSNOUNDEFS -o libconftest2$DLLPOST >/dev/null 2>&5; then
  4932. gccvisinlineshiddenok=no
  4933. fi
  4934. fi
  4935. rm -fr libconftest*
  4936. AC_MSG_RESULT([$gccvisinlineshiddenok])
  4937. if test "$gccvisinlineshiddenok" = "no"; then
  4938. AC_MSG_WARN([Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that.])
  4939. add_warning "Your gcc/clang is not -fvisibility-inlines-hidden safe, disabling that."
  4940. HAVE_GCC_VISIBILITY_BROKEN="TRUE"
  4941. fi
  4942. fi
  4943. if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
  4944. AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
  4945. cat >visibility.cxx <<_ACEOF
  4946. #pragma GCC visibility push(hidden)
  4947. struct __attribute__ ((visibility ("default"))) TestStruct {
  4948. static void Init();
  4949. };
  4950. __attribute__ ((visibility ("default"))) void TestFunc() {
  4951. TestStruct::Init();
  4952. }
  4953. _ACEOF
  4954. if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx 2>/dev/null > /dev/null; then
  4955. gccvisbroken=yes
  4956. else
  4957. case "$host_cpu" in
  4958. i?86|x86_64)
  4959. if test "$_os" = "Darwin" -o "$WITH_MINGW" = "yes"; then
  4960. gccvisbroken=no
  4961. else
  4962. if $EGREP -q '@PLT|@GOT' visibility.s; then
  4963. gccvisbroken=no
  4964. else
  4965. gccvisbroken=yes
  4966. fi
  4967. fi
  4968. ;;
  4969. *)
  4970. gccvisbroken=no
  4971. ;;
  4972. esac
  4973. fi
  4974. rm -f visibility.s visibility.cxx
  4975. AC_MSG_RESULT([$gccvisbroken])
  4976. if test "$gccvisbroken" = "yes"; then
  4977. AC_MSG_WARN([Your gcc is not -fvisibility=hidden safe. Disabling visibility])
  4978. add_warning "Your gcc is not -fvisibility=hidden safe. Disabling visibility"
  4979. unset HAVE_GCC_VISIBILITY_FEATURE
  4980. fi
  4981. fi
  4982. CPPFLAGS="$save_CPPFLAGS"
  4983. AC_LANG_POP([C++])
  4984. fi
  4985. AC_SUBST(HAVE_GCC_VISIBILITY_FEATURE)
  4986. AC_SUBST(HAVE_GCC_VISIBILITY_BROKEN)
  4987. dnl ===================================================================
  4988. dnl SFINAE test
  4989. dnl Pre-C++11 does not allow types without linkage as template arguments.
  4990. dnl Substitution Failure Is Not An Error is an idiom that disables
  4991. dnl template instances that would cause an error, without actually
  4992. dnl causing an error. Old gcc (pre-4.0.2) however causes a real error.
  4993. dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21514
  4994. dnl ===================================================================
  4995. HAVE_SFINAE_ANONYMOUS_BROKEN=
  4996. if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
  4997. AC_LANG_PUSH([C++])
  4998. AC_MSG_CHECKING([if SFINAE is broken with anonymous types])
  4999. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  5000. enum { AnonymousEnumValue };
  5001. template< typename T > class TestPredicate {};
  5002. template<> class TestPredicate< int > { public: typedef bool Type; };
  5003. template< typename T >
  5004. bool test( const T&, typename TestPredicate< T >::Type = false )
  5005. { return true; };
  5006. void test( ... );
  5007. ]], [[
  5008. test( 10 );
  5009. test( AnonymousEnumValue );
  5010. ]])],[sfinae_anonymous_broken=no],[sfinae_anonymous_broken=yes
  5011. ])
  5012. AC_MSG_RESULT([$sfinae_anonymous_broken])
  5013. if test "$sfinae_anonymous_broken" = "yes"; then
  5014. HAVE_SFINAE_ANONYMOUS_BROKEN="TRUE"
  5015. fi
  5016. AC_LANG_POP([C++])
  5017. fi
  5018. AC_SUBST(HAVE_SFINAE_ANONYMOUS_BROKEN)
  5019. dnl ===================================================================
  5020. dnl Clang++ tests
  5021. dnl ===================================================================
  5022. HAVE_GCC_FNO_DEFAULT_INLINE=
  5023. HAVE_GCC_FNO_ENFORCE_EH_SPECS=
  5024. if test "$GCC" = "yes"; then
  5025. AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
  5026. if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
  5027. # Option just ignored and silly warning that isn't a real
  5028. # warning printed
  5029. :
  5030. else
  5031. AC_LANG_PUSH([C++])
  5032. save_CXXFLAGS=$CXXFLAGS
  5033. CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
  5034. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
  5035. CXXFLAGS=$save_CXXFLAGS
  5036. AC_LANG_POP([C++])
  5037. fi
  5038. if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
  5039. AC_MSG_RESULT([yes])
  5040. else
  5041. AC_MSG_RESULT([no])
  5042. fi
  5043. AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
  5044. if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
  5045. # As above
  5046. :
  5047. else
  5048. AC_LANG_PUSH([C++])
  5049. save_CXXFLAGS=$CXXFLAGS
  5050. CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
  5051. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
  5052. CXXFLAGS=$save_CXXFLAGS
  5053. AC_LANG_POP([C++])
  5054. fi
  5055. if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
  5056. AC_MSG_RESULT([yes])
  5057. else
  5058. AC_MSG_RESULT([no])
  5059. fi
  5060. fi
  5061. AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
  5062. AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
  5063. dnl ===================================================================
  5064. dnl allocator
  5065. dnl ===================================================================
  5066. AC_MSG_CHECKING([which memory allocator to use])
  5067. if test "$with_alloc" = "system"; then
  5068. AC_MSG_RESULT([system])
  5069. ALLOC="SYS_ALLOC"
  5070. AC_CHECK_FUNCS([malloc realloc calloc free])
  5071. fi
  5072. if test "$with_alloc" = "tcmalloc"; then
  5073. AC_MSG_RESULT(tcmalloc)
  5074. if ! echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
  5075. AC_MSG_ERROR([tcmalloc only available/usable on ix86])
  5076. fi
  5077. AC_CHECK_LIB([tcmalloc], [malloc], [:],
  5078. [AC_MSG_ERROR(tcmalloc not found or functional. Install the Google Profiling Tools)], [])
  5079. ALLOC="TCMALLOC"
  5080. fi
  5081. if test "$with_alloc" = "jemalloc"; then
  5082. if test "$_os" != "FreeBSD" -o "$_os" != "NetBSD"; then
  5083. AC_MSG_RESULT(jemalloc)
  5084. save_CFLAGS=$CFLAGS
  5085. CFLAGS="$CFLAGS -pthread"
  5086. AC_CHECK_LIB([jemalloc], [malloc], [:],
  5087. [AC_MSG_ERROR(jemalloc not found or functional. Install the jemalloc allocator.)], [])
  5088. ALLOC="JEMALLOC"
  5089. CFLAGS=$save_CFLAGS
  5090. else
  5091. AC_MSG_RESULT([system])
  5092. ALLOC="SYS_ALLOC"
  5093. AC_CHECK_FUNCS([malloc realloc calloc free])
  5094. fi
  5095. fi
  5096. if test "$with_alloc" = "internal" -o -z "$with_alloc"; then
  5097. AC_MSG_RESULT([internal])
  5098. fi
  5099. AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
  5100. AC_SUBST(HAVE_POSIX_FALLOCATE)
  5101. AC_SUBST(ALLOC)
  5102. dnl ===================================================================
  5103. dnl Custom build version
  5104. dnl ===================================================================
  5105. AC_MSG_CHECKING([whether to add custom build version])
  5106. if test "$with_build_version" != ""; then
  5107. BUILD_VER_STRING=$with_build_version
  5108. AC_MSG_RESULT([yes, $BUILD_VER_STRING])
  5109. else
  5110. BUILD_VER_STRING=
  5111. AC_MSG_RESULT([no])
  5112. fi
  5113. AC_SUBST(BUILD_VER_STRING)
  5114. dnl ===================================================================
  5115. dnl Java support enable
  5116. dnl ===================================================================
  5117. AC_MSG_CHECKING([whether to build with Java support])
  5118. if test "$with_java" != "no"; then
  5119. if test "$DISABLE_SCRIPTING" = TRUE; then
  5120. AC_MSG_RESULT([no, overridden by --disable-scripting])
  5121. SOLAR_JAVA=""
  5122. with_java=no
  5123. else
  5124. AC_MSG_RESULT([yes])
  5125. SOLAR_JAVA="TRUE"
  5126. fi
  5127. else
  5128. AC_MSG_RESULT([no])
  5129. SOLAR_JAVA=""
  5130. fi
  5131. AC_SUBST(SOLAR_JAVA)
  5132. dnl SOLAR_JAVA="YES" (yes, silly name, should rename) indicates whether we
  5133. dnl want there to be *run-time* (and build-time) support for Java extensions in the
  5134. dnl built LibreOffice.
  5135. dnl SOLAR_JAVA="BUILD" is claimed to indicate build-time only support
  5136. dnl (no runtime support). It doesn't seem to ever be set to this
  5137. dnl value, though, and everywhere SOLAR_JAVA is only checked for being
  5138. dnl empty or non-empty.
  5139. dnl SOLAR_JAVA="" indicate no java support at all
  5140. JITC_PROCESSOR_TYPE=""
  5141. if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
  5142. # IBMs JDK needs this...
  5143. JITC_PROCESSOR_TYPE=6
  5144. export JITC_PROCESSOR_TYPE
  5145. fi
  5146. AC_SUBST([JITC_PROCESSOR_TYPE])
  5147. if test $_os = "WINNT"; then
  5148. AC_MSG_CHECKING([for Microsoft_VC${VCVER}_CRT_x86.msm])
  5149. if ./oowintool --msvc-find-msms; then
  5150. AC_MSG_RESULT([yes])
  5151. SCPDEFS="$SCPDEFS -DWITH_VC"$VCVER"_REDIST"
  5152. else
  5153. AC_MSG_RESULT([no])
  5154. fi
  5155. fi
  5156. dnl ===================================================================
  5157. dnl Checks for Java
  5158. dnl ===================================================================
  5159. if test "$SOLAR_JAVA" != ""; then
  5160. # Windows-specific tests
  5161. if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
  5162. if test "$BITNESS_OVERRIDE" = 64; then
  5163. bitness="64-bit"
  5164. otherbitness="32-bit"
  5165. else
  5166. bitness="32-bit"
  5167. otherbitness="64-bit"
  5168. fi
  5169. if test -z "$with_jdk_home"; then
  5170. # Unfortunately apparently no way to find, if needed, the 64-bit
  5171. # JDK in the Registry from the 32-bit Perl oowintool
  5172. _jdk_home=`./oowintool --jdk-home`
  5173. if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
  5174. with_jdk_home="$_jdk_home"
  5175. howfound="found by oowintool"
  5176. else
  5177. AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK])
  5178. fi
  5179. else
  5180. test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"`
  5181. howfound="you passed"
  5182. fi
  5183. fi
  5184. JAVA_HOME=; export JAVA_HOME
  5185. if test -z "$with_jdk_home"; then
  5186. AC_PATH_PROG(JAVAINTERPRETER, $with_java)
  5187. else
  5188. _java_path="$with_jdk_home/bin/$with_java"
  5189. dnl Check if there is a Java interpreter at all.
  5190. if test -x "$_java_path"; then
  5191. JAVAINTERPRETER=$_java_path
  5192. else
  5193. AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
  5194. fi
  5195. fi
  5196. if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
  5197. # Check that the JDK found is correct architecture
  5198. # Why is this necessary, we don't link with any library from the JDK I think,
  5199. shortjdkhome=`cygpath -d "$with_jdk_home"`
  5200. if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
  5201. AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
  5202. AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
  5203. elif test "$BITNESS_OVERRIDE" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
  5204. AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
  5205. AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
  5206. fi
  5207. if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
  5208. JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
  5209. fi
  5210. JAVAINTERPRETER=`cygpath -d "$JAVAINTERPRETER"`
  5211. JAVAINTERPRETER=`cygpath -u "$JAVAINTERPRETER"`
  5212. elif test "$_os" = "Darwin"; then
  5213. dnl HACK: There currently is only a 32 bit version of LibreOffice for Mac OS X,
  5214. dnl and Tiger Java complains about -d32 while Snow Leopard Java needs it
  5215. dnl to run in 32 bit mode and be able to load LibreOffice jnilibs:
  5216. AC_MSG_CHECKING([whether to pass -d32 to Java interpreter])
  5217. if "$JAVAINTERPRETER" -d32 >&5 2>&5; then
  5218. AC_MSG_RESULT([yes])
  5219. JAVAIFLAGS=-d32
  5220. else
  5221. AC_MSG_RESULT([no])
  5222. fi
  5223. fi
  5224. fi
  5225. dnl ===================================================================
  5226. dnl Checks for JDK.
  5227. dnl ===================================================================
  5228. # Note that JAVA_HOME as for now always means the *build* platform's
  5229. # JAVA_HOME. Whether all the complexity here actually is needed any
  5230. # more or not, no idea.
  5231. if test "$SOLAR_JAVA" != ""; then
  5232. _gij_longver=0
  5233. AC_MSG_CHECKING([the installed JDK])
  5234. if test -n "$JAVAINTERPRETER"; then
  5235. dnl java -version sends output to stderr!
  5236. if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
  5237. AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
  5238. elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
  5239. JDK=gcj
  5240. AC_MSG_RESULT([checked (gcj)])
  5241. _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
  5242. _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
  5243. elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
  5244. AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
  5245. elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
  5246. JDK=ibm
  5247. dnl IBM JDK specific tests
  5248. _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
  5249. _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
  5250. if test "$_jdk_ver" -lt 10500; then
  5251. AC_MSG_ERROR([IBM JDK is too old, you need at least 1.5])
  5252. fi
  5253. AC_MSG_RESULT([checked (IBM JDK $_jdk)])
  5254. if test "$with_jdk_home" = ""; then
  5255. AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
  5256. you must use the "--with-jdk-home" configure option explicitly])
  5257. fi
  5258. JAVA_HOME=$with_jdk_home
  5259. else
  5260. JDK=sun
  5261. dnl Sun JDK specific tests
  5262. _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
  5263. _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
  5264. if test "$_jdk_ver" -lt 10500; then
  5265. AC_MSG_ERROR([JDK is too old, you need at least 1.5])
  5266. fi
  5267. AC_MSG_RESULT([checked (JDK $_jdk)])
  5268. JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
  5269. if test "$_os" = "WINNT"; then
  5270. JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
  5271. fi
  5272. fi
  5273. else
  5274. AC_MSG_ERROR([Java not found. You need at least jdk-1.5, or gcj-4])
  5275. fi
  5276. else
  5277. dnl Java disabled
  5278. JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME
  5279. fi
  5280. dnl ===================================================================
  5281. dnl Set target Java bytecode version
  5282. dnl ===================================================================
  5283. if test "$SOLAR_JAVA" != ""; then
  5284. _java_target_ver="1.5"
  5285. JAVA_SOURCE_VER="$_java_target_ver"
  5286. JAVA_TARGET_VER="$_java_target_ver"
  5287. fi
  5288. dnl ===================================================================
  5289. dnl Checks for javac
  5290. dnl ===================================================================
  5291. if test "$SOLAR_JAVA" != ""; then
  5292. if test "$JDK" = "gcj"; then
  5293. javacompiler=`echo $with_java | $SED -e "s/gij/gcj/g" | $SED -e "s/java/javac/g"`
  5294. else
  5295. javacompiler="javac"
  5296. fi
  5297. if test -z "$with_jdk_home"; then
  5298. AC_PATH_PROG(JAVACOMPILER, $javacompiler)
  5299. else
  5300. _javac_path="$with_jdk_home/bin/$javacompiler"
  5301. dnl Check if there is a Java compiler at all.
  5302. if test -x "$_javac_path"; then
  5303. JAVACOMPILER=$_javac_path
  5304. fi
  5305. fi
  5306. if test -z "$JAVACOMPILER"; then
  5307. AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
  5308. fi
  5309. if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
  5310. if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
  5311. JAVACOMPILER="${JAVACOMPILER}.exe"
  5312. fi
  5313. JAVACOMPILER=`cygpath -d "$JAVACOMPILER"`
  5314. JAVACOMPILER=`cygpath -u "$JAVACOMPILER"`
  5315. fi
  5316. if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Eclipse Java Compiler"` -gt 0; then
  5317. AC_MSG_CHECKING([re-checking JDK])
  5318. JDK=gcj
  5319. AC_MSG_RESULT([checked (ecj)])
  5320. _gij_longver="40200"
  5321. fi
  5322. fi
  5323. JAVACISGCJ=""
  5324. dnl ===================================================================
  5325. dnl Checks that javac is gcj
  5326. dnl ===================================================================
  5327. if test "$SOLAR_JAVA" != ""; then
  5328. if test `$JAVACOMPILER --version 2>&1 | $GREP -c "GCC"` -gt 0; then
  5329. JAVACISGCJ="yes"
  5330. fi
  5331. fi
  5332. AC_SUBST(JAVACISGCJ)
  5333. JAVACISKAFFE=""
  5334. dnl ===================================================================
  5335. dnl Checks that javac is kaffe
  5336. dnl ===================================================================
  5337. if test "$SOLAR_JAVA" != ""; then
  5338. if test `$JAVACOMPILER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
  5339. JAVACISKAFFE="yes"
  5340. fi
  5341. fi
  5342. AC_SUBST(JAVACISKAFFE)
  5343. dnl ===================================================================
  5344. dnl Checks for javadoc
  5345. dnl ===================================================================
  5346. if test "$SOLAR_JAVA" != ""; then
  5347. if test -z "$with_jdk_home"; then
  5348. AC_PATH_PROG(JAVADOC, javadoc)
  5349. else
  5350. _javadoc_path="$with_jdk_home/bin/javadoc"
  5351. dnl Check if there is a javadoc at all.
  5352. if test -x "$_javadoc_path"; then
  5353. JAVADOC=$_javadoc_path
  5354. else
  5355. AC_PATH_PROG(JAVADOC, javadoc)
  5356. fi
  5357. fi
  5358. if test -z "$JAVADOC"; then
  5359. AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
  5360. fi
  5361. if test "$build_os" = "cygwin" -a "$_os" = "WINNT"; then
  5362. if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
  5363. JAVADOC="${JAVADOC}.exe"
  5364. fi
  5365. JAVADOC=`cygpath -d "$JAVADOC"`
  5366. JAVADOC=`cygpath -u "$JAVADOC"`
  5367. fi
  5368. fi
  5369. if test "$SOLAR_JAVA" != ""; then
  5370. # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
  5371. if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
  5372. if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
  5373. # try to recover first by looking whether we have a alternatives
  5374. # system as in Debian or newer SuSEs where following /usr/bin/javac
  5375. # over /etc/alternatives/javac leads to the right bindir where we
  5376. # just need to strip a bit away to get a valid JAVA_HOME
  5377. JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
  5378. elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
  5379. # maybe only one level of symlink (e.g. on Mac)
  5380. JAVA_HOME=$(readlink $JAVACOMPILER)
  5381. if test "$(dirname $JAVA_HOME)" = "."; then
  5382. # we've got no path to trim back
  5383. JAVA_HOME=""
  5384. fi
  5385. else
  5386. # else warn
  5387. AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
  5388. AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
  5389. add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
  5390. add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
  5391. fi
  5392. dnl now that we have the path to the real javac, make a JAVA_HOME out of it..
  5393. if test "$JAVA_HOME" != "/usr"; then
  5394. if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
  5395. dnl Leopard returns a non-suitable path with readlink - points to "Current" only
  5396. JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
  5397. dnl Tiger already returns a JDK path..
  5398. JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
  5399. else
  5400. JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
  5401. fi
  5402. fi
  5403. fi
  5404. # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
  5405. dnl now if JAVA_HOME has been set to empty, then call findhome to find it
  5406. if test -z "$JAVA_HOME"; then
  5407. if test "x$with_jdk_home" = "x"; then
  5408. cat > findhome.java <<_ACEOF
  5409. [import java.io.File;
  5410. class findhome
  5411. {
  5412. public static void main(String args[])
  5413. {
  5414. String jrelocation = System.getProperty("java.home");
  5415. File jre = new File(jrelocation);
  5416. System.out.println(jre.getParent());
  5417. }
  5418. }]
  5419. _ACEOF
  5420. AC_MSG_CHECKING([if javac works])
  5421. javac_cmd="$JAVACOMPILER findhome.java 1>&2"
  5422. AC_TRY_EVAL(javac_cmd)
  5423. if test $? = 0 -a -f ./findhome.class; then
  5424. AC_MSG_RESULT([javac works])
  5425. else
  5426. echo "configure: javac test failed" >&5
  5427. cat findhome.java >&5
  5428. AC_MSG_ERROR([javac does not work - java projects will not build!])
  5429. fi
  5430. AC_MSG_CHECKING([if gij knows its java.home])
  5431. JAVA_HOME=`$JAVAINTERPRETER findhome`
  5432. if test $? = 0 -a "$JAVA_HOME" != ""; then
  5433. AC_MSG_RESULT([$JAVA_HOME])
  5434. else
  5435. echo "configure: java test failed" >&5
  5436. cat findhome.java >&5
  5437. AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
  5438. fi
  5439. # clean-up after ourselves
  5440. rm -f ./findhome.java ./findhome.class
  5441. else
  5442. JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
  5443. fi
  5444. fi
  5445. dnl second sanity check JAVA_HOME if possible
  5446. if test "$JDK" != "gcj" -o "$_gij_longver" -ge "40200"; then
  5447. # now check if $JAVA_HOME is really valid
  5448. if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
  5449. if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
  5450. JAVA_HOME_OK="NO"
  5451. fi
  5452. elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
  5453. JAVA_HOME_OK="NO"
  5454. fi
  5455. if test "$JAVA_HOME_OK" = "NO"; then
  5456. AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
  5457. AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
  5458. AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects with not be built correctly])
  5459. add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
  5460. add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
  5461. add_warning "in case JAVA_HOME is incorrectly set, some projects with not be built correctly"
  5462. fi
  5463. fi
  5464. PathFormat "$JAVA_HOME"
  5465. JAVA_HOME="$formatted_path"
  5466. fi
  5467. AWTLIB=
  5468. if test "$SOLAR_JAVA" != ""; then
  5469. AC_MSG_CHECKING([for jawt lib name])
  5470. if test "$JDK" = "gcj"; then
  5471. save_CFLAGS=$CFLAGS
  5472. save_LDFLAGS=$LDFLAGS
  5473. CFLAGS="$CFLAGS -I$JAVA_HOME/include"
  5474. LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj"
  5475. exec 6>/dev/null # no output
  5476. AC_CHECK_HEADER(jni.h, [],
  5477. [AC_MSG_ERROR([jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?])], [])
  5478. AC_CHECK_LIB(gcjawt, JAWT_GetAWT, [ AWTLIB="-lgcjawt -lgcj"] )
  5479. exec 6>&1 # output on again
  5480. CFLAGS=$save_CFLAGS
  5481. LDFLAGS=$save_LDFLAGS
  5482. fi
  5483. # IBM SDK 1.5.0-sr5 includes libjawt.so with unresolved symbols.
  5484. # A workaround is to link also against libpmawt.so
  5485. if test "$JDK" = "ibm"; then
  5486. save_CFLAGS=$CFLAGS
  5487. save_LDFLAGS=$LDFLAGS
  5488. save_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
  5489. CFLAGS="$CFLAGS -I$JAVA_HOME/include"
  5490. LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin"
  5491. LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH
  5492. export LD_LIBRARY_PATH
  5493. exec 6>/dev/null # no output
  5494. AC_CHECK_HEADER(jni.h, [],
  5495. [AC_MSG_ERROR([jni.h could not be found.])], [])
  5496. AC_CHECK_LIB(jawt, JAWT_GetAWT, [ AWTLIB="-ljawt"] )
  5497. if test -z "$AWTLIB"; then
  5498. LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt"
  5499. AC_CHECK_LIB(mawt, JAWT_GetAWT, [ AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt"])
  5500. fi
  5501. exec 6>&1 # output on again
  5502. CFLAGS=$save_CFLAGS
  5503. LDFLAGS=$save_LDFLAGS
  5504. LD_LIBRARY_PATH=$save_LD_LIBRARY_PATH
  5505. fi
  5506. if test -z "$AWTLIB"; then
  5507. if test $_os = WINNT -a "$WITH_MINGW" != yes; then
  5508. AWTLIB=jawt.lib
  5509. else
  5510. AWTLIB=-ljawt
  5511. fi
  5512. fi
  5513. AC_MSG_RESULT([$AWTLIB])
  5514. AC_SUBST(AWTLIB)
  5515. fi
  5516. if test "$SOLAR_JAVA" != ""; then
  5517. #
  5518. # Determine JAVALIB
  5519. # If your platform follow the common pattern
  5520. # just define JAVA_ARCH and JAVA_TOOLKIT for it
  5521. # if not, leave JAVA_ARCH empty and define JAVALIB manually
  5522. # if you don't want JAVALIB to be exported at all
  5523. # define x_JAVALIB=[\#]
  5524. #
  5525. JAVA_ARCH=
  5526. JAVA_TOOLKIT=
  5527. x_JAVALIB=
  5528. x_JDKLIB=[\#]
  5529. case "$host_os" in
  5530. aix*)
  5531. JAVA_ARCH="ppc"
  5532. JAVA_TOOLKIT="classic"
  5533. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5534. SOLARINC="$SOLARINC -I$JAVA_HOME/include/aix"
  5535. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5536. ;;
  5537. cygwin*)
  5538. x_JDKLIB=
  5539. JDKLIB="$JAVA_HOME/lib"
  5540. SOLARINC="$SOLARINC -I$JAVA_HOME/include/win32"
  5541. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5542. ;;
  5543. darwin*)
  5544. x_JAVALIB=[\#]
  5545. SOLARINC="$SOLARINC -I$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers -I$FRAMEWORKSHOME/JavaVM/Headers"
  5546. ;;
  5547. dragonfly*)
  5548. case "$host_cpu" in
  5549. i*86)
  5550. JAVA_ARCH="i386"
  5551. JAVA_TOOLKIT="client"
  5552. ;;
  5553. x86_64)
  5554. JAVA_ARCH="amd64"
  5555. JAVA_TOOLKIT="server"
  5556. ;;
  5557. esac
  5558. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5559. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5560. ;;
  5561. freebsd*)
  5562. case "$host_cpu" in
  5563. i*86)
  5564. JAVA_ARCH="i386"
  5565. JAVA_TOOLKIT="client"
  5566. ;;
  5567. x86_64)
  5568. if test "`echo $JAVA_HOME | sed -e 's,.*/,,'`" = "linux"; then
  5569. JAVA_ARCH="i386"
  5570. JAVA_TOOLKIT="client"
  5571. else
  5572. JAVA_ARCH="amd64"
  5573. JAVA_TOOLKIT="server"
  5574. fi
  5575. ;;
  5576. esac
  5577. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5578. SOLARINC="$SOLARINC -I$JAVA_HOME/include/freebsd"
  5579. SOLARINC="$SOLARINC -I$JAVA_HOME/include/bsd"
  5580. SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
  5581. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5582. ;;
  5583. k*bsd*-gnu*)
  5584. case "$host_cpu" in
  5585. i*86)
  5586. JAVA_ARCH="i386"
  5587. JAVA_TOOLKIT="client"
  5588. ;;
  5589. x86_64)
  5590. JAVA_ARCH="amd64"
  5591. JAVA_TOOLKIT="server"
  5592. ;;
  5593. esac
  5594. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5595. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5596. ;;
  5597. linux-gnu*)
  5598. case "$host_cpu" in
  5599. alpha)
  5600. JAVA_ARCH="alpha"
  5601. JAVA_TOOLKIT="server"
  5602. ;;
  5603. arm*)
  5604. JAVA_ARCH="arm"
  5605. JAVA_TOOLKIT="server"
  5606. ;;
  5607. hppa)
  5608. JAVA_ARCH="hppa"
  5609. JAVA_TOOLKIT="server"
  5610. ;;
  5611. i*86)
  5612. JAVA_ARCH="i386"
  5613. case "$JDK" in
  5614. [Ii][Bb][Mm]*)
  5615. JAVA_ARCH=
  5616. JRE_BASE_DIR="$JAVA_HOME/jre/bin"
  5617. JAVALIB="-L$JAVA_HOME/$LIB64 -L$JRE_BASE_DIR -L$JRE_BASE_DIR/classic -L$JRE_BASE_DIR/native_thread"
  5618. ;;
  5619. [Bb][Ee][Aa]*)
  5620. JAVA_TOOLKIT="jrockit"
  5621. ;;
  5622. *)
  5623. JAVA_TOOLKIT="client"
  5624. ;;
  5625. esac
  5626. ;;
  5627. ia64)
  5628. JAVA_ARCH="ia64"
  5629. JAVA_TOOLKIT="server"
  5630. ;;
  5631. m68k)
  5632. JAVA_ARCH="mk68"
  5633. JAVA_TOOLKIT="server"
  5634. ;;
  5635. mips|mips64|mipsel|mips64el)
  5636. JAVA_ARCH="$host_cpu"
  5637. JAVA_TOOLKIT="server"
  5638. ;;
  5639. mips32)
  5640. JAVA_ARCH="$host_cpu"
  5641. JAVA_TOOLKIT="client"
  5642. ;;
  5643. powerpc)
  5644. JAVA_ARCH="ppc"
  5645. case "$JDK" in
  5646. [Ii][Bb][Mm]*)
  5647. JAVA_TOOLKIT="classic"
  5648. ;;
  5649. gcj)
  5650. JAVA_TOOLKIT="client"
  5651. ;;
  5652. *)
  5653. JAVA_TOOLKIT="server"
  5654. ;;
  5655. esac
  5656. ;;
  5657. powerpc64)
  5658. JAVA_ARCH="ppc64"
  5659. if test "$JDK" = "gcj"; then
  5660. JAVA_TOOLKIT="client"
  5661. else
  5662. JAVA_TOOLKIT="server"
  5663. fi
  5664. ;;
  5665. sparc)
  5666. JAVA_ARCH="sparc"
  5667. JAVA_TOOLKIT="server"
  5668. ;;
  5669. s390)
  5670. JAVA_ARCH="s390"
  5671. JAVA_TOOLKIT="server"
  5672. ;;
  5673. s390x)
  5674. JAVA_ARCH="s390x"
  5675. JAVA_TOOLKIT="server"
  5676. ;;
  5677. x86_64)
  5678. JAVA_ARCH="amd64"
  5679. JAVA_TOOLKIT="server"
  5680. ;;
  5681. *)
  5682. AC_MSG_ERROR([No JAVALIB definition host_cpu $host_cpu for host_os $host_os])
  5683. ;;
  5684. esac
  5685. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5686. SOLARINC="$SOLARINC -I$JAVA_HOME/include/linux"
  5687. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5688. ;;
  5689. linux-androideabi*)
  5690. case "$host_cpu" in
  5691. arm|armel)
  5692. JAVA_ARCH="arm"
  5693. JAVA_TOOLKIT="server"
  5694. ;;
  5695. esac
  5696. ;;
  5697. mingw*)
  5698. x_JAVALIB=[\#]
  5699. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5700. ;;
  5701. *netbsd*)
  5702. case "$host_cpu" in
  5703. i*86)
  5704. JAVA_ARCH="i386"
  5705. JAVA_TOOLKIT="client"
  5706. ;;
  5707. powerpc)
  5708. JAVA_ARCH="pcc"
  5709. JAVA_TOOLKIT="classic"
  5710. ;;
  5711. sparc)
  5712. JAVA_ARCH="sparc"
  5713. JAVA_TOOLKIT="client"
  5714. ;;
  5715. x86_64)
  5716. JAVA_ARCH="amd64"
  5717. JAVA_TOOLKIT="client"
  5718. ;;
  5719. esac
  5720. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5721. SOLARINC="$SOLARINC -I$JAVA_HOME/include/netbsd"
  5722. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5723. ;;
  5724. openbsd*)
  5725. case "$host_cpu" in
  5726. i*86)
  5727. JAVA_ARCH="i386"
  5728. JAVA_TOOLKIT="client"
  5729. ;;
  5730. x86_64)
  5731. JAVA_ARCH="amd64"
  5732. JAVA_TOOLKIT="server"
  5733. ;;
  5734. esac
  5735. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5736. SOLARINC="$SOLARINC -I$JAVA_HOME/include/openbsd"
  5737. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5738. ;;
  5739. solaris*)
  5740. JAVA_TOOLKIT="xawt"
  5741. case "$host_cpu" in
  5742. i*86)
  5743. JAVA_ARCH="i386"
  5744. ;;
  5745. sparc)
  5746. JAVA_ARCH="sparc"
  5747. ;;
  5748. esac
  5749. SOLARINC="$SOLARINC -I$JAVA_HOME/include"
  5750. SOLARINC="$SOLARINC -I$JAVA_HOME/include/solaris"
  5751. SOLARINC="$SOLARINC -I$JAVA_HOME/include/native_threads/include"
  5752. ;;
  5753. esac
  5754. if test -n "$JAVA_ARCH"; then
  5755. JRE_BASE_DIR="$JAVA_HOME/jre/lib/$JAVA_ARCH"
  5756. JAVALIB="-L$JAVA_HOME/$LIB64"
  5757. test -d "$JRE_BASE_DIR" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR"
  5758. test -d "$JRE_BASE_DIR/$JAVA_TOOLKIT" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/$JAVA_TOOLKIT"
  5759. test -d "$JRE_BASE_DIR/native_thread" && JAVALIB="$JAVALIB -L$JRE_BASE_DIR/native_thread"
  5760. fi
  5761. else
  5762. x_JAVALIB=[\#]
  5763. x_JDKLIB=[\#]
  5764. fi
  5765. AC_SUBST(JAVALIB)
  5766. AC_SUBST(JAVACOMPILER)
  5767. AC_SUBST(JAVADOC)
  5768. AC_SUBST(JAVAINTERPRETER)
  5769. AC_SUBST(JAVAIFLAGS)
  5770. AC_SUBST(JAVA_HOME)
  5771. AC_SUBST(JAVA_SOURCE_VER)
  5772. AC_SUBST(JAVA_TARGET_VER)
  5773. AC_SUBST(JDK)
  5774. AC_SUBST(JDKLIB)
  5775. AC_SUBST(x_JAVALIB)
  5776. AC_SUBST(x_JDKLIB)
  5777. dnl ===================================================================
  5778. dnl Checks for specific files.
  5779. dnl ===================================================================
  5780. dnl ===================================================================
  5781. dnl Checks for programs.
  5782. dnl ===================================================================
  5783. dnl ===================================================================
  5784. dnl Check whether we already have dmake
  5785. dnl ===================================================================
  5786. AC_PATH_PROG(DMAKE, dmake, no)
  5787. if test "$DMAKE" = "no"; then
  5788. BUILD_DMAKE=YES
  5789. echo "dmake will be built on ./bootstrap"
  5790. else
  5791. AC_MSG_CHECKING([whether the found dmake is the right dmake])
  5792. # we need to find out whether that dmake we found is "our" dmake
  5793. # or the dmake from Sun's SunStudio Compiler which is something
  5794. # different
  5795. # This test _should_ work because the one accepts -V (ours) and one
  5796. # (the other) not...
  5797. $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null
  5798. if test $? -eq 0; then
  5799. BUILD_DMAKE=NO
  5800. AC_MSG_RESULT([yes])
  5801. AC_MSG_CHECKING([the dmake version])
  5802. DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'`
  5803. if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then
  5804. AC_MSG_RESULT([OK, >= 4.11])
  5805. elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \
  5806. test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then
  5807. AC_MSG_RESULT([OK, >= 4.11])
  5808. else
  5809. AC_MSG_RESULT([too old. >= 4.11 is needed])
  5810. echo "A newer dmake will be built on ./bootstrap"
  5811. BUILD_DMAKE=YES
  5812. fi
  5813. else
  5814. AC_MSG_RESULT([no])
  5815. echo "dmake will be built on ./bootstrap"
  5816. BUILD_DMAKE=YES
  5817. fi
  5818. fi
  5819. AC_SUBST(BUILD_DMAKE)
  5820. AC_MSG_CHECKING([which C preprocessor to use in idlc])
  5821. if test -n "$with_idlc_cpp"; then
  5822. AC_MSG_RESULT([$with_idlc_cpp])
  5823. AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
  5824. else
  5825. AC_MSG_RESULT([ucpp])
  5826. AC_MSG_CHECKING([which ucpp tp use])
  5827. if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
  5828. AC_MSG_RESULT([external])
  5829. AC_PATH_PROG(SYSTEM_UCPP, ucpp)
  5830. else
  5831. AC_MSG_RESULT([internal])
  5832. BUILD_TYPE="$BUILD_TYPE UCPP"
  5833. fi
  5834. fi
  5835. AC_SUBST(SYSTEM_UCPP)
  5836. dnl ===================================================================
  5837. dnl Check for epm (not needed for Windows)
  5838. dnl ===================================================================
  5839. AC_MSG_CHECKING([whether to enable EPM for packing])
  5840. if test "$enable_epm" = "yes"; then
  5841. AC_MSG_RESULT([yes])
  5842. if test "$_os" != "WINNT"; then
  5843. if test -n "$with_epm"; then
  5844. EPM=$with_epm
  5845. else
  5846. AC_PATH_PROG(EPM, epm, no)
  5847. fi
  5848. if test "$EPM" = "no" -o "$EPM" = "internal"; then
  5849. echo "EPM will be built."
  5850. BUILD_TYPE="$BUILD_TYPE EPM"
  5851. else
  5852. # Gentoo has some epm which is something different...
  5853. AC_MSG_CHECKING([whether the found epm is the right epm])
  5854. if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
  5855. AC_MSG_RESULT([yes])
  5856. else
  5857. AC_MSG_ERROR([no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm])
  5858. fi
  5859. AC_MSG_CHECKING([epm version])
  5860. EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
  5861. if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
  5862. test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
  5863. AC_MSG_RESULT([OK, >= 3.7])
  5864. if test "$_os" = "Darwin"; then
  5865. AC_MSG_CHECKING([which PackageMaker EPM thinks to use])
  5866. _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1`
  5867. if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then
  5868. AC_MSG_ERROR([$_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)])
  5869. elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then
  5870. AC_MSG_RESULT([$_pm, ok])
  5871. else # we never should get here, but go safe
  5872. AC_MSG_ERROR([$_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)])
  5873. fi
  5874. fi
  5875. else
  5876. AC_MSG_RESULT([too old. epm >= 3.7 is required.])
  5877. echo "EPM will be built."
  5878. BUILD_TYPE="$BUILD_TYPE EPM"
  5879. fi
  5880. fi
  5881. fi
  5882. if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
  5883. AC_MSG_CHECKING([for rpm])
  5884. for a in "$RPM" rpmbuild rpm; do
  5885. $a --usage >/dev/null 2> /dev/null
  5886. if test $? -eq 0; then
  5887. RPM=$a
  5888. break
  5889. else
  5890. $a --version >/dev/null 2> /dev/null
  5891. if test $? -eq 0; then
  5892. RPM=$a
  5893. break
  5894. fi
  5895. fi
  5896. done
  5897. if test -z "$RPM"; then
  5898. AC_MSG_ERROR([not found])
  5899. elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
  5900. RPM_PATH=`which $RPM`
  5901. AC_MSG_RESULT([$RPM_PATH])
  5902. else
  5903. AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
  5904. fi
  5905. fi
  5906. if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
  5907. AC_PATH_PROG(DPKG, dpkg, no)
  5908. if test "$DPKG" = "no"; then
  5909. AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
  5910. fi
  5911. fi
  5912. if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then
  5913. if test "$_os" = "Darwin"; then
  5914. AC_MSG_CHECKING([for PackageMaker availability])
  5915. if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then
  5916. AC_MSG_ERROR([not installed. Please install Apples Dev Tools])
  5917. else
  5918. AC_MSG_RESULT([ok])
  5919. fi
  5920. else
  5921. AC_MSG_ERROR([PackageMaker needed to build OSX packages and you are not on OSX...])
  5922. fi
  5923. fi
  5924. if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
  5925. echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
  5926. if test "$EPM" != "no" -a "$EPM" != "internal"; then
  5927. if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
  5928. AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
  5929. if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
  5930. AC_MSG_RESULT([yes])
  5931. else
  5932. AC_MSG_RESULT([no])
  5933. if echo "$PKGFORMAT" | $GREP -q rpm; then
  5934. _pt="rpm"
  5935. AC_MSG_WARN([the rpms will need to be installed with --nodeps])
  5936. add_warning "the rpms will need to be installed with --nodeps"
  5937. else
  5938. _pt="pkg"
  5939. fi
  5940. AC_MSG_WARN([the ${_pt}s will not be relocateable])
  5941. add_warning "the ${_pt}s will not be relocateable"
  5942. AC_MSG_WARN([if you want to make sure installation without --nodeps and
  5943. relocation will work, you need to patch your epm with the
  5944. patch in epm/epm-3.7.patch or build with
  5945. --with-epm=internal which will build a suitable epm])
  5946. fi
  5947. fi
  5948. fi
  5949. fi
  5950. if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
  5951. AC_PATH_PROG(PKGMK, pkgmk, no)
  5952. if test "$PKGMK" = "no"; then
  5953. AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
  5954. fi
  5955. fi
  5956. AC_SUBST(RPM)
  5957. AC_SUBST(DPKG)
  5958. AC_SUBST(PKGMK)
  5959. else
  5960. AC_MSG_RESULT([no])
  5961. EPM=NO
  5962. fi
  5963. AC_SUBST(EPM)
  5964. dnl ===================================================================
  5965. dnl We need winegcc when building MinGW build to be able to cross-build msi tools
  5966. dnl ===================================================================
  5967. WINEGCC=
  5968. if test "$enable_winegcc" = "yes"; then
  5969. AC_PATH_PROG(WINEGCC, winegcc)
  5970. if test "$WINEGCC" = ""; then
  5971. AC_MSG_ERROR([winegcc was not found, please install wine-devel, or wine-devel-32bit])
  5972. fi
  5973. CC_save="$CC"
  5974. ac_exeext_save="$ac_exeext"
  5975. CC="$WINEGCC -m32"
  5976. ac_exeext=".exe"
  5977. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  5978. #include <stdio.h>
  5979. ],[
  5980. printf ("hello world\n");
  5981. ])],,
  5982. [AC_MSG_ERROR([winegcc cannot build 32bit binaries, please install glibc-devel-32bit and gcc-32bit])]
  5983. )
  5984. CC="$CC_save"
  5985. ac_exeext="$ac_exeext_save"
  5986. fi
  5987. AC_SUBST(WINEGCC)
  5988. dnl ===================================================================
  5989. dnl Check for gperf
  5990. dnl ===================================================================
  5991. AC_PATH_PROG(GPERF, gperf)
  5992. if test -z "$GPERF"; then
  5993. AC_MSG_ERROR([gperf not found but needed. Install it.])
  5994. fi
  5995. AC_MSG_CHECKING([gperf version])
  5996. if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
  5997. AC_MSG_RESULT([OK])
  5998. else
  5999. AC_MSG_ERROR([too old, you need at least 3.0.0])
  6000. fi
  6001. AC_SUBST(GPERF)
  6002. dnl ===================================================================
  6003. dnl Check for building ODK
  6004. dnl ===================================================================
  6005. AC_MSG_CHECKING([whether to build the ODK])
  6006. if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
  6007. AC_MSG_RESULT([yes])
  6008. if test "$with_java" != "no"; then
  6009. AC_MSG_CHECKING([whether to build unowinreg.dll])
  6010. if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
  6011. # build on Win by default
  6012. enable_build_unowinreg=yes
  6013. fi
  6014. if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
  6015. AC_MSG_RESULT([no])
  6016. BUILD_UNOWINREG=NO
  6017. else
  6018. AC_MSG_RESULT([yes])
  6019. BUILD_UNOWINREG=YES
  6020. fi
  6021. if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "YES"; then
  6022. if test -z "$with_mingw_cross_compiler"; then
  6023. dnl Guess...
  6024. AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
  6025. elif test -x "$with_mingw_cross_compiler"; then
  6026. MINGWCXX="$with_mingw_cross_compiler"
  6027. else
  6028. AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
  6029. fi
  6030. if test "$MINGWCXX" = "false"; then
  6031. AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
  6032. fi
  6033. mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
  6034. if test -x "$mingwstrip_test"; then
  6035. MINGWSTRIP="$mingwstrip_test"
  6036. else
  6037. AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
  6038. fi
  6039. if test "$MINGWSTRIP" = "false"; then
  6040. AC_MSG_ERROR(MinGW32 binutils not found.)
  6041. fi
  6042. fi
  6043. fi
  6044. BUILD_TYPE="$BUILD_TYPE ODK"
  6045. else
  6046. AC_MSG_RESULT([no])
  6047. BUILD_UNOWINREG=NO
  6048. fi
  6049. AC_SUBST(BUILD_UNOWINREG)
  6050. AC_SUBST(MINGWCXX)
  6051. AC_SUBST(MINGWSTRIP)
  6052. dnl ===================================================================
  6053. dnl Check for system stdlibs
  6054. dnl ===================================================================
  6055. AC_MSG_CHECKING([whether to provide libstdc++/libgcc_s in the installset])
  6056. if test "$with_system_stdlibs" != "no"; then
  6057. AC_MSG_RESULT([no])
  6058. SYSTEM_STDLIBS=YES
  6059. else
  6060. AC_MSG_RESULT([yes])
  6061. SYSTEM_STDLIBS=NO
  6062. fi
  6063. AC_SUBST(SYSTEM_STDLIBS)
  6064. dnl ===================================================================
  6065. dnl Check for system zlib
  6066. dnl ===================================================================
  6067. if test "$with_system_zlib" = "auto"; then
  6068. case "$_os" in
  6069. WINNT)
  6070. with_system_zlib="$with_system_libs"
  6071. ;;
  6072. *)
  6073. with_system_zlib=yes
  6074. ;;
  6075. esac
  6076. fi
  6077. AC_MSG_CHECKING([which zlib to use])
  6078. if test "$with_system_zlib" = "yes"; then
  6079. AC_MSG_RESULT([external])
  6080. SYSTEM_ZLIB=YES
  6081. AC_CHECK_HEADER(zlib.h, [],
  6082. [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
  6083. AC_CHECK_LIB(z, deflate, [ ZLIB=-lz ],
  6084. [AC_MSG_ERROR(zlib not found or functional)], [])
  6085. else
  6086. AC_MSG_RESULT([internal])
  6087. SYSTEM_ZLIB=NO
  6088. BUILD_TYPE="$BUILD_TYPE ZLIB"
  6089. ZLIB_CFLAGS="-I${OUTDIR}/inc/external/zlib"
  6090. ZLIB_LIBS="-L${OUTDIR}/lib -lz"
  6091. fi
  6092. AC_SUBST(ZLIB_CFLAGS)
  6093. AC_SUBST(ZLIB_LIBS)
  6094. AC_SUBST(SYSTEM_ZLIB)
  6095. dnl ===================================================================
  6096. dnl Check for system jpeg
  6097. dnl ===================================================================
  6098. AC_MSG_CHECKING([which jpeg to use])
  6099. if test "$with_system_jpeg" = "auto"; then
  6100. case "$_os" in
  6101. WINNT|Darwin|iOS|Android)
  6102. with_system_jpeg="$with_system_libs"
  6103. ;;
  6104. *)
  6105. with_system_jpeg=yes
  6106. ;;
  6107. esac
  6108. fi
  6109. if test "$with_system_jpeg" = "yes"; then
  6110. AC_MSG_RESULT([external])
  6111. SYSTEM_JPEG=YES
  6112. AC_CHECK_HEADER(jpeglib.h, [],
  6113. [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
  6114. AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ JPEG3RDLIB=-ljpeg ],
  6115. [AC_MSG_CHECKING(jpeg library not found or fuctional)], [])
  6116. libo_MINGW_CHECK_DLL([JPEG], [libjpeg])
  6117. else
  6118. AC_MSG_RESULT([internal])
  6119. SYSTEM_JPEG=NO
  6120. BUILD_TYPE="$BUILD_TYPE JPEG"
  6121. fi
  6122. AC_SUBST(SYSTEM_JPEG)
  6123. AC_SUBST([MINGW_JPEG_DLL])
  6124. dnl ===================================================================
  6125. dnl Check for system clucene
  6126. dnl ===================================================================
  6127. AC_MSG_CHECKING([which clucene to use])
  6128. if test "$with_system_clucene" = "yes"; then
  6129. AC_MSG_RESULT([external])
  6130. SYSTEM_CLUCENE=YES
  6131. PKG_CHECK_MODULES(CLUCENE, libclucene-core)
  6132. AC_LANG_PUSH([C++])
  6133. save_CXXFLAGS=$CXXFLAGS
  6134. save_CPPFLAGS=$CPPFLAGS
  6135. CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
  6136. CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
  6137. dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
  6138. dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
  6139. AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
  6140. [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
  6141. CXXFLAGS=$save_CXXFLAGS
  6142. CPPFLAGS=$save_CPPFLAGS
  6143. AC_LANG_POP([C++])
  6144. CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
  6145. else
  6146. AC_MSG_RESULT([internal])
  6147. SYSTEM_CLUCENE=NO
  6148. BUILD_TYPE="$BUILD_TYPE CLUCENE"
  6149. fi
  6150. AC_SUBST(SYSTEM_CLUCENE)
  6151. AC_SUBST(CLUCENE_CFLAGS)
  6152. AC_SUBST(CLUCENE_LIBS)
  6153. dnl ===================================================================
  6154. dnl Check for system expat
  6155. dnl ===================================================================
  6156. AC_MSG_CHECKING([which expat to use])
  6157. if test "$with_system_expat" = "yes"; then
  6158. AC_MSG_RESULT([external])
  6159. SYSTEM_EXPAT=YES
  6160. AC_CHECK_HEADER(expat.h, [],
  6161. [AC_MSG_ERROR(expat.h not found. install expat)], [])
  6162. AC_CHECK_LIB([expat], [XML_ParserCreate], [:],
  6163. [AC_MSG_RESULT(expat library not found or functional.)], [])
  6164. libo_MINGW_CHECK_DLL([EXPAT], [libexpat])
  6165. else
  6166. AC_MSG_RESULT([internal])
  6167. SYSTEM_EXPAT=NO
  6168. BUILD_TYPE="$BUILD_TYPE EXPAT"
  6169. fi
  6170. AC_SUBST(SYSTEM_EXPAT)
  6171. AC_SUBST([MINGW_EXPAT_DLL])
  6172. dnl ===================================================================
  6173. dnl Check for system libcdr
  6174. dnl ===================================================================
  6175. AC_MSG_CHECKING([which libcdr to use])
  6176. if test "$with_system_libcdr" = "yes"; then
  6177. AC_MSG_RESULT([external])
  6178. SYSTEM_LIBCDR=YES
  6179. PKG_CHECK_MODULES( CDR, libcdr-0.0 >= 0.0.5 )
  6180. elif test $_os = iOS; then
  6181. # libcdr depends on libwpd and libwpg and those are LGPL
  6182. AC_MSG_RESULT([none])
  6183. else
  6184. AC_MSG_RESULT([internal])
  6185. SYSTEM_LIBCDR=NO
  6186. BUILD_TYPE="$BUILD_TYPE CDR"
  6187. fi
  6188. AC_SUBST(SYSTEM_LIBCDR)
  6189. AC_SUBST(CDR_CFLAGS)
  6190. AC_SUBST(CDR_LIBS)
  6191. dnl ===================================================================
  6192. dnl Check for system libmspub
  6193. dnl ===================================================================
  6194. AC_MSG_CHECKING([which libmspub to use])
  6195. if test "$with_system_libmspub" = "yes"; then
  6196. AC_MSG_RESULT([external])
  6197. SYSTEM_LIBMSPUB=YES
  6198. PKG_CHECK_MODULES( MSPUB, libmspub-0.0 )
  6199. elif test $_os = iOS; then
  6200. # libmspub depends on libwpd and libwpg and those are LGPL
  6201. AC_MSG_RESULT([none])
  6202. else
  6203. AC_MSG_RESULT([internal])
  6204. SYSTEM_LIBMSPUB=NO
  6205. BUILD_TYPE="$BUILD_TYPE MSPUB"
  6206. fi
  6207. AC_SUBST(SYSTEM_LIBMSPUB)
  6208. AC_SUBST(MSPUB_CFLAGS)
  6209. AC_SUBST(MSPUB_LIBS)
  6210. dnl ===================================================================
  6211. dnl Check for system libvisio
  6212. dnl ===================================================================
  6213. AC_MSG_CHECKING([which libvisio to use])
  6214. if test "$with_system_libvisio" = "yes"; then
  6215. AC_MSG_RESULT([external])
  6216. SYSTEM_LIBVISIO=YES
  6217. PKG_CHECK_MODULES( VISIO, libvisio-0.0 )
  6218. elif test $_os = iOS; then
  6219. # libvisio depends on libwpd and libwpg and those are LGPL
  6220. AC_MSG_RESULT([none])
  6221. else
  6222. AC_MSG_RESULT([internal])
  6223. SYSTEM_LIBVISIO=NO
  6224. BUILD_TYPE="$BUILD_TYPE VISIO"
  6225. fi
  6226. AC_SUBST(SYSTEM_LIBVISIO)
  6227. AC_SUBST(VISIO_CFLAGS)
  6228. AC_SUBST(VISIO_LIBS)
  6229. dnl ===================================================================
  6230. dnl Check for system libcmis
  6231. dnl ===================================================================
  6232. AC_MSG_CHECKING([which libcmis to use])
  6233. if test "$with_system_libcmis" = "yes"; then
  6234. AC_MSG_RESULT([external])
  6235. SYSTEM_LIBCMIS=YES
  6236. PKG_CHECK_MODULES( CMIS, libcmis-0.3 >= 0.3.0 )
  6237. else
  6238. AC_MSG_RESULT([internal])
  6239. SYSTEM_LIBCMIS=NO
  6240. BUILD_TYPE="$BUILD_TYPE CMIS"
  6241. fi
  6242. AC_SUBST(SYSTEM_LIBCMIS)
  6243. AC_SUBST(CMIS_CFLAGS)
  6244. AC_SUBST(CMIS_LIBS)
  6245. dnl ===================================================================
  6246. dnl Check for system libwpd
  6247. dnl ===================================================================
  6248. AC_MSG_CHECKING([which libwpd to use])
  6249. if test "$with_system_libwpd" = "yes"; then
  6250. AC_MSG_RESULT([external])
  6251. SYSTEM_LIBWPD=YES
  6252. PKG_CHECK_MODULES( WPD, libwpd-0.9 libwpd-stream-0.9 )
  6253. elif test $_os = iOS; then
  6254. AC_MSG_RESULT([none])
  6255. else
  6256. AC_MSG_RESULT([internal])
  6257. SYSTEM_LIBWPD=NO
  6258. WPD_CFLAGS="-I${OUTDIR}/inc/external"
  6259. WPD_LIBS="-L${OUTDIR}/lib -lwpdlib"
  6260. BUILD_TYPE="$BUILD_TYPE WPD"
  6261. fi
  6262. AC_SUBST(SYSTEM_LIBWPD)
  6263. AC_SUBST(WPD_CFLAGS)
  6264. AC_SUBST(WPD_LIBS)
  6265. dnl ===================================================================
  6266. dnl Check for system lcms2
  6267. dnl ===================================================================
  6268. AC_MSG_CHECKING([which littlecms v2 to use])
  6269. if test "$with_system_lcms2" = "yes"; then
  6270. AC_MSG_RESULT([external])
  6271. SYSTEM_LCMS2=YES
  6272. PKG_CHECK_MODULES( LCMS2, lcms2 )
  6273. libo_MINGW_CHECK_DLL([LCMS2], [liblcms2])
  6274. else
  6275. AC_MSG_RESULT([internal])
  6276. SYSTEM_LCMS2=NO
  6277. LCMS2_LIBS="-L${OUTDIR}/lib -llcms2"
  6278. LCMS2_CFLAGS="-I${WORKDIR}/UnpackedTarball/lcms2/include"
  6279. if test "$GCC" = "yes"; then
  6280. LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
  6281. fi
  6282. BUILD_TYPE="$BUILD_TYPE LCMS2"
  6283. fi
  6284. AC_SUBST(SYSTEM_LCMS2)
  6285. AC_SUBST(LCMS2_CFLAGS)
  6286. AC_SUBST(LCMS2_LIBS)
  6287. AC_SUBST([MINGW_LCMS2_DLL])
  6288. dnl ===================================================================
  6289. dnl Check for system cppunit
  6290. dnl ===================================================================
  6291. AC_MSG_CHECKING([which cppunit to use])
  6292. if test "$with_system_cppunit" = "yes"; then
  6293. AC_MSG_RESULT([external])
  6294. SYSTEM_CPPUNIT=YES
  6295. # might work for earlier, too but go sure:
  6296. PKG_CHECK_MODULES( CPPUNIT, cppunit >= 1.12.0 )
  6297. else
  6298. AC_MSG_RESULT([internal])
  6299. SYSTEM_CPPUNIT=NO
  6300. BUILD_TYPE="$BUILD_TYPE CPPUNIT"
  6301. fi
  6302. AC_SUBST(SYSTEM_CPPUNIT)
  6303. AC_SUBST(CPPUNIT_CFLAGS)
  6304. AC_SUBST(CPPUNIT_LIBS)
  6305. dnl ===================================================================
  6306. dnl Check whether freetype is available
  6307. dnl ===================================================================
  6308. if test "$test_freetype" = "yes"; then
  6309. AC_MSG_CHECKING([whether freetype is available])
  6310. PKG_CHECK_MODULES( FREETYPE, freetype2 >= 2.0 )
  6311. else
  6312. case "$BUILD_TYPE" in
  6313. *FREETYPE*)
  6314. FREETYPE_LIBS="-lfreetype"
  6315. ;;
  6316. esac
  6317. fi
  6318. AC_SUBST(FREETYPE_CFLAGS)
  6319. AC_SUBST(FREETYPE_LIBS)
  6320. dnl ===================================================================
  6321. dnl Check for system libwps
  6322. dnl ===================================================================
  6323. AC_MSG_CHECKING([which libwps to use])
  6324. if test "$with_system_libwps" = "yes"; then
  6325. AC_MSG_RESULT([external])
  6326. SYSTEM_LIBWPS=YES
  6327. PKG_CHECK_MODULES( WPS, libwps-0.2 )
  6328. elif test $_os = iOS; then
  6329. AC_MSG_RESULT([none])
  6330. else
  6331. AC_MSG_RESULT([internal])
  6332. SYSTEM_LIBWPS=NO
  6333. WPS_CFLAGS="-I${OUTDIR}/inc/external"
  6334. WPS_LIBS="-L${OUTDIR}/lib -lwpslib"
  6335. BUILD_TYPE="$BUILD_TYPE WPS"
  6336. fi
  6337. AC_SUBST(SYSTEM_LIBWPS)
  6338. AC_SUBST(WPS_CFLAGS)
  6339. AC_SUBST(WPS_LIBS)
  6340. dnl ===================================================================
  6341. dnl Check for system libwpg
  6342. dnl ===================================================================
  6343. AC_MSG_CHECKING([which libwpg to use])
  6344. if test "$with_system_libwpg" = "yes"; then
  6345. AC_MSG_RESULT([external])
  6346. SYSTEM_LIBWPG=YES
  6347. PKG_CHECK_MODULES( WPG, libwpg-0.2 )
  6348. elif test $_os = iOS; then
  6349. AC_MSG_RESULT([none])
  6350. else
  6351. AC_MSG_RESULT([internal])
  6352. SYSTEM_LIBWPG=NO
  6353. WPG_CFLAGS="-I${OUTDIR}/inc/external"
  6354. WPG_LIBS="-L${OUTDIR}/lib -lwpglib"
  6355. BUILD_TYPE="$BUILD_TYPE WPG"
  6356. fi
  6357. AC_SUBST(SYSTEM_LIBWPG)
  6358. AC_SUBST(WPG_CFLAGS)
  6359. AC_SUBST(WPG_LIBS)
  6360. dnl ===================================================================
  6361. dnl Check whether freetype2 supports emboldening
  6362. dnl ===================================================================
  6363. if test "$test_freetype" = "yes"; then
  6364. save_CPPFLAGS="$CPPFLAGS"
  6365. save_LDFLAGS="$LDFLAGS"
  6366. save_LIBS="$LIBS"
  6367. CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
  6368. LDFLAGS="$LDFLAGS $FREETYPE_LIBS"
  6369. AC_CHECK_LIB(freetype, FT_GlyphSlot_Embolden,
  6370. [USE_FT_EMBOLDEN="YES"], [USE_FT_EMBOLDEN="NO"], [])
  6371. LDFLAGS="$save_LDFLAGS"
  6372. CPPFLAGS="$save_CPPFLAGS"
  6373. LIBS="$save_LIBS"
  6374. fi
  6375. AC_SUBST(USE_FT_EMBOLDEN)
  6376. # ===================================================================
  6377. # Check for system libxslt
  6378. # to prevent incompatibilities between internal libxml2 and external libxslt,
  6379. # or vice versa, use with_system_libxml here
  6380. # ===================================================================
  6381. if test "$with_system_libxml" = "auto"; then
  6382. case "$_os" in
  6383. WINNT|iOS|Android)
  6384. with_system_libxml="$with_system_libs"
  6385. ;;
  6386. *)
  6387. with_system_libxml=yes
  6388. ;;
  6389. esac
  6390. fi
  6391. AC_MSG_CHECKING([which libxslt to use])
  6392. if test "$with_system_libxml" = "yes"; then
  6393. AC_MSG_RESULT([external])
  6394. SYSTEM_LIBXSLT=YES
  6395. if test "$_os" = "Darwin"; then
  6396. dnl make sure to use SDK path
  6397. LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
  6398. LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
  6399. dnl omit -L/usr/lib
  6400. LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
  6401. LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
  6402. else
  6403. PKG_CHECK_MODULES(LIBXSLT, libxslt)
  6404. PKG_CHECK_MODULES(LIBEXSLT, libexslt)
  6405. fi
  6406. dnl Check for xsltproc
  6407. AC_PATH_PROG(XSLTPROC, xsltproc, no)
  6408. if test "$XSLTPROC" = "no"; then
  6409. AC_MSG_ERROR([xsltproc is required])
  6410. fi
  6411. libo_MINGW_CHECK_DLL([LIBXSLT], [libxslt])
  6412. libo_MINGW_CHECK_DLL([LIBEXSLT], [libexslt])
  6413. libo_MINGW_TRY_DLL([ICONV], [iconv])
  6414. else
  6415. AC_MSG_RESULT([internal])
  6416. SYSTEM_LIBXSLT=NO
  6417. BUILD_TYPE="$BUILD_TYPE LIBXSLT"
  6418. if test "$cross_compiling" = "yes"; then
  6419. AC_PATH_PROG(XSLTPROC, xsltproc, no)
  6420. if test "$XSLTPROC" = "no"; then
  6421. AC_MSG_ERROR([xsltproc is required])
  6422. fi
  6423. fi
  6424. fi
  6425. AC_SUBST(SYSTEM_LIBXSLT)
  6426. if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
  6427. SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
  6428. fi
  6429. AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
  6430. AC_SUBST(LIBEXSLT_CFLAGS)
  6431. AC_SUBST(LIBEXSLT_LIBS)
  6432. AC_SUBST(LIBXSLT_CFLAGS)
  6433. AC_SUBST(LIBXSLT_LIBS)
  6434. AC_SUBST(XSLTPROC)
  6435. AC_SUBST([MINGW_LIBEXSLT_DLL])
  6436. AC_SUBST([MINGW_LIBXSLT_DLL])
  6437. AC_SUBST([MINGW_ICONV_DLL])
  6438. # ===================================================================
  6439. # Check for system libxml
  6440. # ===================================================================
  6441. AC_MSG_CHECKING([which libxml to use])
  6442. if test "$with_system_libxml" = "yes"; then
  6443. AC_MSG_RESULT([external])
  6444. SYSTEM_LIBXML=YES
  6445. if test "$_os" = "Darwin"; then
  6446. dnl make sure to use SDK path
  6447. LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
  6448. dnl omit -L/usr/lib
  6449. LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
  6450. elif test $_os = iOS; then
  6451. dnl make sure to use SDK path
  6452. usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
  6453. LIBXML_CFLAGS="-I$usr/include/libxml2"
  6454. LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
  6455. else
  6456. PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
  6457. fi
  6458. dnl Check for xmllint
  6459. AC_PATH_PROG(XMLLINT, xmllint, no)
  6460. if test "$XMLLINT" = "no"; then
  6461. AC_MSG_ERROR([xmllint is required])
  6462. fi
  6463. libo_MINGW_CHECK_DLL([LIBXML],[libxml2])
  6464. libo_MINGW_TRY_DLL([ZLIB],[zlib1])
  6465. else
  6466. AC_MSG_RESULT([internal])
  6467. SYSTEM_LIBXML=NO
  6468. BUILD_TYPE="$BUILD_TYPE LIBXML2"
  6469. fi
  6470. AC_SUBST(SYSTEM_LIBXML)
  6471. AC_SUBST(LIBXML_CFLAGS)
  6472. AC_SUBST(LIBXML_LIBS)
  6473. AC_SUBST(XMLLINT)
  6474. AC_SUBST([MINGW_LIBXML_DLL])
  6475. AC_SUBST([MINGW_ZLIB_DLL])
  6476. dnl ===================================================================
  6477. dnl Checks for Python
  6478. dnl ===================================================================
  6479. AC_MSG_CHECKING([which Python to use])
  6480. case "$enable_python" in
  6481. no|disable)
  6482. enable_python=no
  6483. AC_MSG_RESULT([none])
  6484. DISABLE_PYTHON=TRUE
  6485. ;;
  6486. ""|yes|auto)
  6487. if test "$DISABLE_SCRIPTING" = TRUE; then
  6488. AC_MSG_RESULT([no, overridden by --disable-scripting])
  6489. enable_python=no
  6490. DISABLE_PYTHON=TRUE
  6491. elif test $build_os = cygwin; then
  6492. dnl When building on Windows we don't attempt to use any installed
  6493. dnl "system" Python.
  6494. dnl
  6495. dnl (When cross-compiling to Windows from Linux using the mingw32-cross
  6496. dnl compiler from OBS, use mingw32-python from OBS, and ditto for other
  6497. dnl MinGW cross-compilation setups.)
  6498. AC_MSG_RESULT([internal])
  6499. enable_python=internal
  6500. elif test $_os = Darwin -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \) \
  6501. -a \( "$with_macosx_sdk" = 10.4 -o "$with_macosx_sdk" = 10.5 \); then
  6502. # When building against a more recent SDK the ionternal Python can't be compiled, I can't be bothered to fix that for now,
  6503. # building against a recent SDK is only for developer's own builds anyway.
  6504. AC_MSG_RESULT([internal, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
  6505. enable_python=internal
  6506. else
  6507. AC_MSG_RESULT([checking below])
  6508. enable_python=auto
  6509. fi
  6510. ;;
  6511. internal)
  6512. AC_MSG_RESULT([internal])
  6513. ;;
  6514. system)
  6515. if test $_os = Darwin -a -z "$PYTHON" -a \( "$with_macosx_version_min_required" = 10.4 -o "$with_macosx_version_min_required" = 10.5 \); then
  6516. AC_MSG_ERROR([Cannot use "system" Python, the Python in Mac OS X $with_macosx_version_min_required is incompatible with Python3-ified pyuno])
  6517. fi
  6518. AC_MSG_RESULT([system])
  6519. ;;
  6520. *)
  6521. AC_MSG_ERROR([Incorrect --enable-python option])
  6522. ;;
  6523. esac
  6524. AC_SUBST(DISABLE_PYTHON)
  6525. if test $_os = WINNT -a "$WITH_MINGW" != yes -a $enable_python = system; then
  6526. AC_MSG_ERROR([Must use internal Python when building with MSVC])
  6527. fi
  6528. if test $enable_python != no; then
  6529. BUILD_TYPE="$BUILD_TYPE PYUNO"
  6530. fi
  6531. if test "$cross_compiling" = yes; then
  6532. if test $enable_python = auto; then
  6533. enable_python=system
  6534. fi
  6535. else
  6536. if test $enable_python = system -a -z "$PYTHON"; then
  6537. if test $_os = Darwin; then
  6538. # We already have logic above to make sure the system Python
  6539. # is used only when building against SDK 10.6 or newer.
  6540. # Make sure we use the 2.6 Python when building against the
  6541. # 10.6 SDK.
  6542. case $with_macosx_sdk in
  6543. 10.6)
  6544. python_version=2.6;;
  6545. 10.7|10.8)
  6546. python_version=2.7;;
  6547. *)
  6548. # ???
  6549. python_version=2.7;;
  6550. esac
  6551. PYTHON=python$python_version
  6552. PYTHON_CFLAGS="-I/Developer/SDKs/MacOSX${with_macosx_sdk}.sdk/System/Library/Frameworks/Python.framework/Versions/${python_version}/include/python${python_version}"
  6553. PYTHON_LIBS="-framework Python"
  6554. else
  6555. # This causes an error if no python command is found
  6556. AM_PATH_PYTHON([3.3])
  6557. fi
  6558. elif test $enable_python = auto; then
  6559. # We should not come here in a MSVC build, I think?
  6560. if test $build_os = cygwin; then
  6561. AC_MSG_ERROR([Assertion failed - should not be here in a MSVC build])
  6562. fi
  6563. # This allows a lack of system Python 3.3 with no error, we check below for a system Python of
  6564. # earlier version.
  6565. AM_PATH_PYTHON([3.3],, [:])
  6566. if test "$PYTHON" = :; then
  6567. enable_python=internal
  6568. if test $_os = Darwin; then
  6569. # See the fixme in gbuild.mk
  6570. # There must be a system Python, 2.6 should be fine (?), to run build-time Python scripts
  6571. # like filter/source/svg/js2hxx.py. (Is that the only build-time Python script?) If we
  6572. # don't do this, PYTHON will stay with the value ":" which of course makes runing
  6573. # build-time Python scripts rather ineffective.
  6574. # Unset variables set by the above AM_PATH_PYTHON so that we acutally do check anew
  6575. # Finding an (old) system Python should not confuse our already decided intent to build an
  6576. # internal Python 3.3, that is directed by enable_python = internal.
  6577. unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON
  6578. AM_PATH_PYTHON([2.6])
  6579. else
  6580. # For Linux it works to use the internally built Python, see gbuild.mk
  6581. :
  6582. fi
  6583. else
  6584. enable_python=system
  6585. fi
  6586. fi
  6587. fi
  6588. if test $enable_python = system; then
  6589. if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
  6590. # Fallback: Accept these in the environment, or as set above
  6591. # for MacOSX.
  6592. :
  6593. elif test "$cross_compiling" != yes; then
  6594. python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
  6595. python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
  6596. python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
  6597. python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
  6598. if test -z "$PKG_CONFIG"; then
  6599. PYTHON_CFLAGS="-I$python_include"
  6600. PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
  6601. elif $PKG_CONFIG --exists python-$python_version; then
  6602. PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
  6603. PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
  6604. else
  6605. PYTHON_CFLAGS="-I$python_include"
  6606. PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
  6607. fi
  6608. else
  6609. dnl How to find out the cross-compilation Python installation path?
  6610. dnl Let's hardocode what we know for different distributions for now...
  6611. for python_version in 2.6; do
  6612. if test -f ${MINGW_SYSROOT}/include/python${python_version}/Python.h; then
  6613. PYTHON_CFLAGS="-I${MINGW_SYSROOT}/include/python$python_version"
  6614. PYTHON_LIBS="-L${MINGW_SYSROOT}lib -lpython$python_version $python_libs"
  6615. MINGW_PYTHON_EXE=python.exe
  6616. libo_MINGW_CHECK_DLL([PYTHON], [libpython$python_version])
  6617. libo_MINGW_CHECK_DLL([READLINE], [libreadline6])
  6618. libo_MINGW_CHECK_DLL([TERMCAP], [libtermcap])
  6619. # could we somehow extract the really mingw python version from
  6620. # actual distro package?
  6621. # 2.6.2 currently on OpenSUSE 12.1?
  6622. # rpm -q mingw32-python => mingw32-python-2.6.2-17.17.noarch
  6623. PYTHON_VERSION=$python_version.2
  6624. PYTHON_VERSION_MAJOR=${python_version%.*}
  6625. PYTHON_VERSION_MINOR=${python_version#*.}
  6626. break
  6627. fi
  6628. done
  6629. test -n "$PYTHON_CFLAGS" && break
  6630. fi
  6631. fi
  6632. dnl By now enable_python should be "system", "internal" or "no"
  6633. case $enable_python in
  6634. system)
  6635. SYSTEM_PYTHON=YES
  6636. if test "$CROSS_COMPILING" != YES; then
  6637. dnl Check if the headers really work
  6638. save_CPPFLAGS="$CPPFLAGS"
  6639. CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
  6640. AC_CHECK_HEADER(Python.h, [],
  6641. [AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])],
  6642. [])
  6643. CPPFLAGS="$save_CPPFLAGS"
  6644. AC_LANG_PUSH(C)
  6645. CFLAGS="$CFLAGS $PYTHON_CFLAGS"
  6646. AC_MSG_CHECKING([for correct python library version])
  6647. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  6648. #include <Python.h>
  6649. int main(int argc, char **argv) {
  6650. if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 6) ||
  6651. (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
  6652. else return 1;
  6653. }
  6654. ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.6 when building with Python 2])],[])
  6655. CFLAGS=$save_CFLAGS
  6656. AC_LANG_POP(C)
  6657. dnl FIXME Check if the Python library can be linked with, too?
  6658. fi
  6659. ;;
  6660. internal)
  6661. SYSTEM_PYTHON=NO
  6662. PYTHON_VERSION_MAJOR=3
  6663. PYTHON_VERSION_MINOR=3
  6664. PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.0
  6665. BUILD_TYPE="$BUILD_TYPE PYTHON"
  6666. # Embedded Python dies without Home set
  6667. if test "$HOME" = ""; then
  6668. export HOME=""
  6669. fi
  6670. # bz2 tarball and bzip2 is not standard
  6671. if test -z "$BZIP2"; then
  6672. AC_PATH_PROG( BZIP2, bzip2)
  6673. if test -z "$BZIP2"; then
  6674. AC_MSG_ERROR([the internal Python module has a .tar.bz2. You need bzip2])
  6675. fi
  6676. fi
  6677. ;;
  6678. no)
  6679. SYSTEM_PYTHON=NO
  6680. ;;
  6681. *)
  6682. AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
  6683. ;;
  6684. esac
  6685. dnl Cross-build of python requires python that is runnable on the build
  6686. dnl platform, because it is used in the build process
  6687. if test "$cross_compiling" = yes; then
  6688. if test "$DISABLE_PYTHON" = no -a "$SYSTEM_PYTHON" = no -a "$DISABLE_PYTHON_FOR_BUILD" = yes; then
  6689. AC_MSG_ERROR([Cross-build of python requires python that is runnable on the build platform. You must not use --disable-python for the 'build' config.])
  6690. fi
  6691. fi
  6692. AC_SUBST(SYSTEM_PYTHON)
  6693. AC_SUBST(PYTHON_CFLAGS)
  6694. AC_SUBST(PYTHON_LIBS)
  6695. AC_SUBST(PYTHON_VERSION)
  6696. AC_SUBST(PYTHON_VERSION_MAJOR)
  6697. AC_SUBST(PYTHON_VERSION_MINOR)
  6698. AC_SUBST([MINGW_PYTHON_EXE])
  6699. AC_SUBST([MINGW_PYTHON_DLL])
  6700. AC_SUBST([MINGW_READLINE_DLL])
  6701. AC_SUBST([MINGW_TERMCAP_DLL])
  6702. AC_MSG_CHECKING([whether to build the MySQL Connector extension])
  6703. if test "x$enable_ext_mysql_connector" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  6704. AC_MSG_RESULT([yes])
  6705. ENABLE_MYSQLC=YES
  6706. BUILD_TYPE="$BUILD_TYPE MYSQLC"
  6707. else
  6708. AC_MSG_RESULT([no])
  6709. ENABLE_MYSQLC=NO
  6710. fi
  6711. AC_SUBST(ENABLE_MYSQLC)
  6712. if test "$ENABLE_MYSQLC" = "YES"; then
  6713. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_MYSQLC"
  6714. dnl ===================================================================
  6715. dnl Check for system MySQL
  6716. dnl ===================================================================
  6717. AC_MSG_CHECKING([for MySQL prerequisites])
  6718. if test "$with_system_mysql" = "yes"; then
  6719. AC_MSG_RESULT([external MySQL])
  6720. SYSTEM_MYSQL=YES
  6721. AC_PATH_PROG( MYSQLCONFIG, mysql_config)
  6722. AC_MSG_CHECKING([MySQL version])
  6723. MYSQL_VERSION=`$MYSQLCONFIG --version`
  6724. MYSQL_MAJOR=`$MYSQLCONFIG --version | cut -d"." -f1`
  6725. if test "$MYSQL_MAJOR" -ge "5"; then
  6726. AC_MSG_RESULT([OK])
  6727. else
  6728. AC_MSG_ERROR([too old, use 5.0.x or 5.1.x])
  6729. fi
  6730. AC_MSG_CHECKING([for MySQL Client library])
  6731. MYSQL_INC=`$MYSQLCONFIG --include`
  6732. MYSQL_LIB=`$MYSQLCONFIG --libs`
  6733. MYSQL_DEFINES=`$MYSQLCONFIG --cflags | $SED -e s,$MYSQL_INC,,`
  6734. AC_MSG_RESULT([includes $MYSQL_INC, libraries $MYSQL_LIB])
  6735. else
  6736. SYSTEM_MYSQL=NO
  6737. if test -n "$with_libmysql_path"; then
  6738. AC_MSG_RESULT([external Connector/C (libmysql)])
  6739. LIBMYSQL=libmysql.so
  6740. if test "$_os" = "Darwin"; then
  6741. LIBMYSQL=libmysql.dylib
  6742. elif test "$_os" = "WINNT"; then
  6743. LIBMYSQL=libmysql.dll
  6744. fi
  6745. AC_MSG_CHECKING([for $LIBMYSQL])
  6746. if test -e "$with_libmysql_path/lib/$LIBMYSQL"; then
  6747. AC_MSG_RESULT([found.])
  6748. LIBMYSQL_PATH=$with_libmysql_path
  6749. else
  6750. AC_MSG_ERROR([not found. Please specify proper path in --with-libmysql-path.])
  6751. fi
  6752. else
  6753. AC_MSG_ERROR([not given. Please specify either --with-system-mysql or --with-libmysql-path])
  6754. fi
  6755. fi
  6756. AC_SUBST(SYSTEM_MYSQL)
  6757. AC_SUBST(MYSQL_INC)
  6758. AC_SUBST(MYSQL_LIB)
  6759. AC_SUBST(MYSQL_DEFINES)
  6760. AC_SUBST(LIBMYSQL_PATH)
  6761. AC_LANG_PUSH([C++])
  6762. dnl ===================================================================
  6763. dnl Check for system MySQL C++ Connector
  6764. dnl ===================================================================
  6765. # FIXME!
  6766. # who thought this too-generic cppconn dir was a good idea?
  6767. AC_MSG_CHECKING([MySQL Connector/C++])
  6768. if test "$with_system_mysql_cppconn" = "yes"; then
  6769. AC_MSG_RESULT([external])
  6770. SYSTEM_MYSQL_CPPCONN=YES
  6771. AC_LANG_PUSH([C++])
  6772. AC_CHECK_HEADER(mysql_driver.h, [],
  6773. [AC_MSG_ERROR(mysql_driver.h not found. install MySQL C++ Connectivity)], [])
  6774. AC_CHECK_LIB([mysqlcppconn], [main], [:],
  6775. [AC_MSG_ERROR(MySQL C++ Connectivity lib not found or functional)], [])
  6776. save_LIBS=$LIBS
  6777. LIBS="$LIBS -lmysqlcppconn"
  6778. AC_MSG_CHECKING([version])
  6779. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  6780. #include <mysql_driver.h>
  6781. int main(int argc, char **argv) {
  6782. sql::Driver *driver;
  6783. driver = get_driver_instance();
  6784. if (driver->getMajorVersion() > 1 || \
  6785. (driver->getMajorVersion() == 1 && driver->getMinorVersion() > 0) || \
  6786. (driver->getMajorVersion() == 1 && driver->getMinorVersion() == 0 && driver->getPatchVersion() >= 6))
  6787. return 0;
  6788. else
  6789. return 1;
  6790. }
  6791. ]])],[AC_MSG_RESULT(OK)],[AC_MSG_ERROR([not suitable, we need >= 1.0.6])],[])
  6792. AC_LANG_POP([C++])
  6793. LIBS=$save_LIBS
  6794. else
  6795. AC_MSG_RESULT([internal])
  6796. AC_MSG_CHECKING([for mysqlcppconn module])
  6797. if test -d mysqlcppconn; then
  6798. AC_MSG_RESULT([OK])
  6799. else
  6800. AC_MSG_ERROR([not existing. get it (did you get the -extensions tarball?)])
  6801. fi
  6802. BUILD_TYPE="$BUILD_TYPE MYSQLCPPCONN"
  6803. SYSTEM_MYSQL_CPPCONN=NO
  6804. fi
  6805. AC_LANG_POP([C++])
  6806. fi
  6807. AC_SUBST(SYSTEM_MYSQL_CPPCONN)
  6808. dnl ===================================================================
  6809. dnl Check for system hsqldb
  6810. dnl ===================================================================
  6811. if test "$with_java" != "no"; then
  6812. HSQLDB_USE_JDBC_4_1=
  6813. AC_MSG_CHECKING([which hsqldb to use])
  6814. if test "$with_system_hsqldb" = "yes"; then
  6815. AC_MSG_RESULT([external])
  6816. SYSTEM_HSQLDB=YES
  6817. if test -z $HSQLDB_JAR; then
  6818. HSQLDB_JAR=/usr/share/java/hsqldb.jar
  6819. fi
  6820. AC_CHECK_FILE($HSQLDB_JAR, [],
  6821. [AC_MSG_ERROR(hsqldb.jar not found.)], [])
  6822. AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
  6823. export HSQLDB_JAR
  6824. if $PERL -e 'use Archive::Zip;
  6825. my $file = "$ENV{'HSQLDB_JAR'}";
  6826. my $zip = Archive::Zip->new( $file );
  6827. my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
  6828. if ( $mf =~ m/Specification-Version: 1.8.*/ ) {
  6829. push @l, split(/\n/, $mf);
  6830. foreach my $line (@l) {
  6831. if ($line =~ m/Specification-Version:/) {
  6832. ($t, $version) = split (/:/,$line);
  6833. $version =~ s/^\s//;
  6834. ($a, $b, $c, $d) = split (/\./,$version);
  6835. if ($c == "0" && $d > "8") {
  6836. exit 0;
  6837. } else {
  6838. exit 1;
  6839. }
  6840. }
  6841. }
  6842. } else {
  6843. exit 1;
  6844. }'; then
  6845. AC_MSG_RESULT([yes])
  6846. else
  6847. AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
  6848. fi
  6849. else
  6850. AC_MSG_RESULT([internal])
  6851. SYSTEM_HSQLDB=NO
  6852. BUILD_TYPE="$BUILD_TYPE HSQLDB"
  6853. AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
  6854. javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
  6855. if expr "$javanumver" '>=' 000100060000 > /dev/null; then
  6856. AC_MSG_RESULT([yes])
  6857. HSQLDB_USE_JDBC_4_1=YES
  6858. else
  6859. AC_MSG_RESULT([no])
  6860. fi
  6861. fi
  6862. AC_SUBST(SYSTEM_HSQLDB)
  6863. AC_SUBST(HSQLDB_JAR)
  6864. AC_SUBST([HSQLDB_USE_JDBC_4_1])
  6865. fi
  6866. dnl ===================================================================
  6867. dnl Check for PostgreSQL stuff
  6868. dnl ===================================================================
  6869. if test "x$enable_postgresql_sdbc" != "xno"; then
  6870. SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
  6871. # if/when anything else than PostgreSQL uses Kerberos,
  6872. # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
  6873. WITH_KRB5=NO
  6874. WITH_GSSAPI=no
  6875. case "$_os" in
  6876. Darwin)
  6877. # MacOS X has system MIT Kerberos 5 since 10.4
  6878. if test "$with_krb5" != "no"; then
  6879. WITH_KRB5=YES
  6880. save_LIBS=$LIBS
  6881. AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6882. [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5, try installing libcom_err devel package])])
  6883. LIBS=$save_LIBS
  6884. AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6885. [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5, try installing krb5 devel package])])
  6886. LIBS=$save_LIBS
  6887. fi
  6888. if test "$with_gssapi" != "no"; then
  6889. WITH_GSSAPI=YES
  6890. save_LIBS=$LIBS
  6891. AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
  6892. [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
  6893. LIBS=$save_LIBS
  6894. fi
  6895. ;;
  6896. WINNT)
  6897. if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
  6898. AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
  6899. fi
  6900. ;;
  6901. Linux|GNU|*BSD|DragonFly)
  6902. if test "$with_krb5" != "no"; then
  6903. WITH_KRB5=YES
  6904. save_LIBS=$LIBS
  6905. AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6906. [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
  6907. LIBS=$save_LIBS
  6908. AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6909. [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
  6910. LIBS=$save_LIBS
  6911. fi
  6912. if test "$with_gssapi" != "no"; then
  6913. WITH_GSSAPI=YES
  6914. save_LIBS=$LIBS
  6915. AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
  6916. [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
  6917. LIBS=$save_LIBS
  6918. fi
  6919. ;;
  6920. *)
  6921. if test "$with_krb5" = "yes"; then
  6922. WITH_KRB5=YES
  6923. save_LIBS=$LIBS
  6924. AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6925. [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
  6926. LIBS=$save_LIBS
  6927. AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
  6928. [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
  6929. LIBS=$save_LIBS
  6930. fi
  6931. if test "$with_gssapi" = "yes"; then
  6932. WITH_GSSAPI=YES
  6933. save_LIBS=$LIBS
  6934. AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
  6935. [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
  6936. LIBS=$save_LIBS
  6937. fi
  6938. esac
  6939. AC_MSG_CHECKING([PostgreSQL C interface])
  6940. if test "$with_system_postgresql" = "yes"; then
  6941. AC_MSG_RESULT([external PostgreSQL])
  6942. SYSTEM_POSTGRESQL=YES
  6943. if test "$_os" = Darwin; then
  6944. supp_path=''
  6945. for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
  6946. pg_supp_path="$P_SEP$d$pg_supp_path"
  6947. done
  6948. fi
  6949. AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
  6950. if test -z "$PGCONFIG"; then
  6951. AC_MSG_ERROR([pg_config needed; set PGCONFIG if not in PATH])
  6952. fi
  6953. POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
  6954. POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
  6955. else
  6956. if test -n "$with_libpq_path"; then
  6957. SYSTEM_POSTGRESQL=YES
  6958. AC_MSG_RESULT([external libpq])
  6959. POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
  6960. POSTGRESQL_INC=-I"${with_libpq_path}/include/"
  6961. else
  6962. SYSTEM_POSTGRESQL=NO
  6963. AC_MSG_RESULT([internal])
  6964. POSTGRESQL_LIB=""
  6965. POSTGRESQL_INC="%OVERRIDE_ME%"
  6966. BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
  6967. fi
  6968. fi
  6969. if test "${SYSTEM_POSTGRESQL}" = "YES"; then
  6970. AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
  6971. save_CFLAGS=$CFLAGS
  6972. save_CPPFLAGS=$CPPFLAGS
  6973. save_LIBS=$LIBS
  6974. CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
  6975. LIBS="${LIBS} ${POSTGRESQL_LIB}"
  6976. AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
  6977. AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
  6978. [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
  6979. CFLAGS=$save_CFLAGS
  6980. CPPFLAGS=$save_CPPFLAGS
  6981. LIBS=$save_LIBS
  6982. fi
  6983. BUILD_POSTGRESQL_SDBC=YES
  6984. fi
  6985. AC_SUBST(WITH_KRB5)
  6986. AC_SUBST(WITH_GSSAPI)
  6987. AC_SUBST(BUILD_POSTGRESQL_SDBC)
  6988. AC_SUBST(SYSTEM_POSTGRESQL)
  6989. AC_SUBST(POSTGRESQL_INC)
  6990. AC_SUBST(POSTGRESQL_LIB)
  6991. dnl ===================================================================
  6992. dnl Check for system curl
  6993. dnl ===================================================================
  6994. AC_MSG_CHECKING([which libcurl to use])
  6995. if test "$with_system_curl" = "auto"; then
  6996. case "$_os" in
  6997. Darwin)
  6998. with_system_curl=yes
  6999. ;;
  7000. *)
  7001. with_system_curl="$with_system_libs"
  7002. ;;
  7003. esac
  7004. fi
  7005. if test "$with_system_curl" = "yes"; then
  7006. AC_MSG_RESULT([external])
  7007. SYSTEM_CURL=YES
  7008. curl_version=""
  7009. if test "$cross_compiling" = "yes"; then
  7010. dnl At least the OBS mingw32-libcurl-devel package
  7011. dnl comes with a proper .pc file
  7012. PKG_CHECK_MODULES(CURL, libcurl,, [:])
  7013. if test -n "$CURL_PKG_ERRORS"; then
  7014. AC_MSG_RESULT([no])
  7015. else
  7016. curl_version=`$PKG_CONFIG --modversion libcurl`
  7017. fi
  7018. fi
  7019. if test -z "$curl_version"; then
  7020. AC_PATH_PROG(CURLCONFIG, curl-config)
  7021. if test -z "$CURLCONFIG"; then
  7022. AC_MSG_ERROR([install the libcurl development package])
  7023. fi
  7024. CURL_LIBS=`$CURLCONFIG --libs`
  7025. CURL_CFLAGS=`$CURLCONFIG --cflags`
  7026. curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
  7027. fi
  7028. AC_MSG_CHECKING([whether libcurl is >= 7.13.1])
  7029. case $curl_version in
  7030. dnl brackets doubled below because Autoconf uses them as m4 quote characters,
  7031. dnl so they need to be doubled to end up in the configure script
  7032. 7.13.1|7.1[[4-9]].*|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
  7033. AC_MSG_RESULT([yes, you have $curl_version])
  7034. ;;
  7035. *)
  7036. AC_MSG_ERROR([no, you have $curl_version])
  7037. ;;
  7038. esac
  7039. libo_MINGW_CHECK_DLL([CURL], [libcurl])
  7040. libo_MINGW_TRY_DLL([INTL], [libintl])
  7041. libo_MINGW_TRY_DLL([IDN], [libidn])
  7042. libo_MINGW_TRY_DLL([NSPR4], [libnspr4])
  7043. libo_MINGW_TRY_DLL([NSSUTIL3], [nssutil3])
  7044. libo_MINGW_TRY_DLL([PLC4], [libplc4])
  7045. libo_MINGW_TRY_DLL([PLDS4], [libplds4])
  7046. libo_MINGW_TRY_DLL([NSS3], [nss3])
  7047. libo_MINGW_TRY_DLL([SSL3], [ssl3])
  7048. libo_MINGW_TRY_DLL([GPG_ERROR], [libgpg-error])
  7049. libo_MINGW_TRY_DLL([GCRYPT], [libgcrypt])
  7050. libo_MINGW_TRY_DLL([SSH2], [libssh2])
  7051. else
  7052. AC_MSG_RESULT([internal])
  7053. SYSTEM_CURL=NO
  7054. BUILD_TYPE="$BUILD_TYPE CURL"
  7055. fi
  7056. AC_SUBST(SYSTEM_CURL)
  7057. AC_SUBST(CURL_CFLAGS)
  7058. AC_SUBST(CURL_LIBS)
  7059. AC_SUBST([MINGW_CURL_DLL])
  7060. AC_SUBST([MINGW_GCRYPT_DLL])
  7061. AC_SUBST([MINGW_GPG_ERROR_DLL])
  7062. AC_SUBST([MINGW_IDN_DLL])
  7063. AC_SUBST([MINGW_INTL_DLL])
  7064. AC_SUBST([MINGW_NSPR4_DLL])
  7065. AC_SUBST([MINGW_NSS3_DLL])
  7066. AC_SUBST([MINGW_NSSUTIL3_DLL])
  7067. AC_SUBST([MINGW_PLC4_DLL])
  7068. AC_SUBST([MINGW_PLDS4_DLL])
  7069. AC_SUBST([MINGW_SSH2_DLL])
  7070. AC_SUBST([MINGW_SSL3_DLL])
  7071. dnl ===================================================================
  7072. dnl Check for system boost
  7073. dnl ===================================================================
  7074. AC_MSG_CHECKING([which boost to use])
  7075. if test "$with_system_boost" = "yes"; then
  7076. AC_MSG_RESULT([external])
  7077. SYSTEM_BOOST=YES
  7078. AC_LANG_PUSH([C++])
  7079. AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
  7080. [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
  7081. AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
  7082. [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
  7083. AC_CHECK_HEADER(boost/function.hpp, [],
  7084. [AC_MSG_ERROR(boost/function.hpp not found. install boost)], [])
  7085. save_CXXFLAGS=$CXXFLAGS
  7086. CXXFLAGS="$CXXFLAGS -fno-exceptions"
  7087. AC_MSG_CHECKING([whether boost/function.hpp compiles with -fno-exceptions])
  7088. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/function.hpp>
  7089. ]], [[]])],[ac_cv_cxx_boost_no_exceptions_broken=no],[ac_cv_cxx_boost_no_exceptions_broken=yes])
  7090. if test "$ac_cv_cxx_boost_no_exceptions_broken" = "yes"; then
  7091. AC_MSG_ERROR([no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131])
  7092. else
  7093. AC_MSG_RESULT([yes])
  7094. fi
  7095. CXXFLAGS=$save_CXXFLAGS
  7096. AC_LANG_POP([C++])
  7097. AX_BOOST_BASE
  7098. AX_BOOST_DATE_TIME
  7099. mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
  7100. libo_MINGW_TRY_DLL([BOOST_DATE_TIME], [$mingw_boost_date_time_dll])
  7101. if test -z "$MINGW_BOOST_DATE_TIME_DLL"; then
  7102. # if not found, try again with 'lib' prefix
  7103. libo_MINGW_CHECK_DLL([BOOST_DATE_TIME],
  7104. [lib$mingw_boost_date_time_dll])
  7105. fi
  7106. else
  7107. AC_MSG_RESULT([internal])
  7108. BUILD_TYPE="$BUILD_TYPE BOOST"
  7109. SYSTEM_BOOST=NO
  7110. fi
  7111. AC_SUBST([MINGW_BOOST_DATE_TIME_DLL])
  7112. AC_SUBST(SYSTEM_BOOST)
  7113. dnl ===================================================================
  7114. dnl Check for system mdds
  7115. dnl ===================================================================
  7116. AC_MSG_CHECKING([which mdds to use])
  7117. if test "$with_system_mdds" = "yes"; then
  7118. AC_MSG_RESULT([external])
  7119. SYSTEM_MDDS=YES
  7120. dnl ===================================================================
  7121. dnl Determine which hash container mdds shall use
  7122. dnl ===================================================================
  7123. AC_MSG_CHECKING([which hash container mdds shall use])
  7124. if test "x$HAVE_CXX0X" = "xTRUE"; then
  7125. MDDS_CPPFLAGS="-std=gnu++0x"
  7126. AC_MSG_RESULT([std::unordered_map])
  7127. else
  7128. MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
  7129. AC_MSG_RESULT([boost::unordered_map])
  7130. fi
  7131. AC_LANG_PUSH([C++])
  7132. save_CPPFLAGS="$CPPFLAGS"
  7133. CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
  7134. AC_CHECK_HEADER(mdds/flat_segment_tree.hpp, [],
  7135. [AC_MSG_ERROR(mdds/flat_segment_tree.hpp not found. install mdds)], [])
  7136. AC_CHECK_HEADER(mdds/multi_type_matrix.hpp, [],
  7137. [AC_MSG_ERROR(mdds/multi_type_matrix.hpp not found. install mdds >= 0.6.0)], [])
  7138. CPPFLAGS="$save_CPPFLAGS"
  7139. AC_LANG_POP([C++])
  7140. else
  7141. AC_MSG_RESULT([internal])
  7142. BUILD_TYPE="$BUILD_TYPE MDDS"
  7143. SYSTEM_MDDS=NO
  7144. dnl ===================================================================
  7145. dnl Determine which hash container mdds shall use
  7146. dnl ===================================================================
  7147. AC_MSG_CHECKING([which hash container mdds shall use])
  7148. MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
  7149. AC_MSG_RESULT([boost::unordered_map])
  7150. fi
  7151. AC_SUBST(SYSTEM_MDDS)
  7152. AC_SUBST([MDDS_CPPFLAGS])
  7153. dnl ===================================================================
  7154. dnl Check for system vigra
  7155. dnl ===================================================================
  7156. AC_MSG_CHECKING([which vigra to use])
  7157. if test "$with_system_vigra" = "yes"; then
  7158. AC_MSG_RESULT([external])
  7159. SYSTEM_VIGRA=YES
  7160. AC_LANG_PUSH([C++])
  7161. AC_CHECK_HEADER(vigra/copyimage.hxx, [],
  7162. [AC_MSG_ERROR(vigra/copyimage.hxx not found. install vigra)], [])
  7163. AC_LANG_POP([C++])
  7164. else
  7165. AC_MSG_RESULT([internal])
  7166. BUILD_TYPE="$BUILD_TYPE VIGRA"
  7167. SYSTEM_VIGRA=NO
  7168. fi
  7169. AC_SUBST(SYSTEM_VIGRA)
  7170. dnl ===================================================================
  7171. dnl Check for system odbc
  7172. dnl ===================================================================
  7173. AC_MSG_CHECKING([which odbc headers to use])
  7174. if test "$with_system_odbc" = "yes"; then
  7175. AC_MSG_RESULT([external])
  7176. SYSTEM_ODBC_HEADERS=YES
  7177. AC_CHECK_HEADER(sqlext.h, [],
  7178. [AC_MSG_ERROR(odbc not found. install odbc)], [])
  7179. elif test "$enable_database_connectivity" != yes; then
  7180. AC_MSG_RESULT([none])
  7181. else
  7182. AC_MSG_RESULT([internal])
  7183. SYSTEM_ODBC_HEADERS=NO
  7184. fi
  7185. AC_SUBST(SYSTEM_ODBC_HEADERS)
  7186. dnl ===================================================================
  7187. dnl Check for system openldap
  7188. dnl ===================================================================
  7189. if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
  7190. AC_MSG_CHECKING([which openldap library to use])
  7191. if test "$with_system_openldap" = "yes"; then
  7192. AC_MSG_RESULT([external])
  7193. SYSTEM_OPENLDAP=YES
  7194. AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
  7195. AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
  7196. AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
  7197. else
  7198. AC_MSG_RESULT([internal])
  7199. SYSTEM_OPENLDAP=NO
  7200. BUILD_TYPE="$BUILD_TYPE OPENLDAP"
  7201. fi
  7202. fi
  7203. AC_SUBST(SYSTEM_OPENLDAP)
  7204. dnl ===================================================================
  7205. dnl Check for mozilla ab connectivity for windows
  7206. dnl ===================================================================
  7207. AC_MSG_CHECKING([whether to enable build of Mozilla addressbook connectivity driver for Windows])
  7208. if test "$enable_win_mozab_driver" = "yes" -a "$_os" = "WINNT" -a "$WITH_MINGW" != "YES" ; then
  7209. AC_MSG_RESULT([yes])
  7210. WITH_MOZAB4WIN=YES
  7211. BUILD_MOZAB=YES
  7212. if test "$enable_build_mozab" = "no" ; then
  7213. BUILD_MOZAB=NO
  7214. fi
  7215. else
  7216. AC_MSG_RESULT([no])
  7217. WITH_MOZAB4WIN=NO
  7218. fi
  7219. AC_SUBST(WITH_MOZAB4WIN)
  7220. AC_SUBST(BUILD_MOZAB)
  7221. if test "$_os" != "WINNT"; then
  7222. # on all other platforms Mozilla addressbook connectivity
  7223. # is unconditionally built
  7224. # new and shiny mork driver
  7225. AC_MSG_RESULT([yes (new mork driver)])
  7226. else
  7227. if test "$WITH_MOZAB4WIN" = "NO"; then
  7228. AC_MSG_RESULT([no])
  7229. else
  7230. AC_MSG_RESULT([yes, internal (old windows mozab driver)])
  7231. BUILD_TYPE="$BUILD_TYPE MOZ"
  7232. EXTMSV80=`cygpath -u "$SRC_ROOT/external/msvcp80"`
  7233. AC_MSG_CHECKING([for MSVC 2005 runtime needed for prebuilt Mozilla])
  7234. if test -e "$EXTMSV80/Microsoft.VC80.CRT.manifest" -a \
  7235. -e "$EXTMSV80/msvcp80.dll" -a \
  7236. -e "$EXTMSV80/msvcr80.dll"; then
  7237. AC_MSG_RESULT([Found])
  7238. EXTMSV80=
  7239. else
  7240. #uwin-prefixed paths are with no quotes to allow for mask, and uwin to not have spaces, btw
  7241. uwin=`cygpath -d "$WINDIR"`
  7242. uwin=`cygpath -u "$uwin"`
  7243. #if we have one we have all
  7244. if test -e $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053* ; then
  7245. MSVC80_DLL_DIR=`ls -d $uwin/winsxs/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053*`
  7246. MSVC80_MNFST=`ls $uwin/winsxs/Manifests/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4053_*.manifest`
  7247. AC_MSG_RESULT([Found])
  7248. else
  7249. EXTMSV80=
  7250. AC_MSG_RESULT([Not Found])
  7251. AC_MSG_ERROR([For the pre-built Mozilla libraries, you need MSVC 2005 runtime files
  7252. Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll
  7253. in external/msvcp80.
  7254. You can get them by installing:
  7255. <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>
  7256. and relaunch ./autogen.sh])
  7257. fi
  7258. fi
  7259. fi
  7260. fi
  7261. AC_SUBST(MSVC80_DLL_DIR)
  7262. AC_SUBST(MSVC80_MNFST)
  7263. AC_SUBST(EXTMSV80)
  7264. AC_SUBST(EXTMSV80)
  7265. dnl ===================================================================
  7266. dnl Check for system NSS
  7267. dnl ===================================================================
  7268. AC_MSG_CHECKING([which NSS to use])
  7269. if test "$with_system_nss" = "yes"; then
  7270. AC_MSG_RESULT([external])
  7271. SYSTEM_NSS="YES"
  7272. PKG_CHECK_MODULES(NSS, nss >= 3.9.3 nspr >= 4.8)
  7273. libo_MINGW_CHECK_DLL([NSPR4], [libnspr4])
  7274. libo_MINGW_CHECK_DLL([PLC4], [libplc4])
  7275. libo_MINGW_CHECK_DLL([PLDS4], [libplds4])
  7276. libo_MINGW_CHECK_DLL([NSS3], [nss3])
  7277. libo_MINGW_CHECK_DLL([NSSUTIL3], [nssutil3])
  7278. libo_MINGW_CHECK_DLL([SMIME3], [smime3])
  7279. libo_MINGW_CHECK_DLL([SSL3], [ssl3])
  7280. else
  7281. SYSTEM_NSS="NO"
  7282. BUILD_TYPE="$BUILD_TYPE NSS"
  7283. AC_MSG_RESULT([internal])
  7284. if test "$build_os" = "cygwin"; then
  7285. AC_MSG_CHECKING([for nss build tooling]) # coming from mozilla
  7286. if test -z "$NSSBUILDTOOLS"; then
  7287. AC_MSG_ERROR([nss build tooling not provided
  7288. Use the --with-nss-build-tools option after installing the tools obtained
  7289. from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
  7290. else
  7291. if test \( "$WITH_MINGW" = "yes" -a ! -d "$NSSBUILDTOOLS" \) \
  7292. -o ! -d "$NSSBUILDTOOLS/moztools" \
  7293. -o ! -d "$NSSBUILDTOOLS/msys" ; then
  7294. AC_MSG_ERROR([nss build tooling incomplete!])
  7295. else
  7296. AC_MSG_RESULT([ok])
  7297. fi
  7298. fi
  7299. fi
  7300. fi # system nss
  7301. AC_SUBST(SYSTEM_NSS)
  7302. AC_SUBST(NSS_CFLAGS)
  7303. AC_SUBST(NSS_LIBS)
  7304. AC_SUBST(NSSBUILDTOOLS)
  7305. AC_SUBST(MINGW_SMIME3_DLL)
  7306. dnl ===================================================================
  7307. dnl Check for system mozilla headers
  7308. dnl ===================================================================
  7309. HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=
  7310. AC_MSG_CHECKING([which NPAPI headers to use])
  7311. if test "$with_system_npapi_headers" = "yes"; then
  7312. AC_MSG_RESULT([external])
  7313. SYSTEM_NPAPI_HEADERS=YES
  7314. # First try npapi-sdk:
  7315. PKG_CHECK_MODULES(NPAPI_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=no])
  7316. # Then go with libxul:
  7317. if test "x$LOCATED" != "xyes"; then
  7318. PKG_CHECK_MODULES(NPAPI_HEADERS, libxul, [LOCATED=yes], [LOCATED=no])
  7319. fi
  7320. if test "x$LOCATED" != "xyes"; then
  7321. PKG_CHECK_MODULES(NPAPI_HEADERS, mozilla-plugin, [LOCATED=yes], [LOCATED=no])
  7322. fi
  7323. # if still not found bail out
  7324. if test "x$LOCATED" != "xyes"; then
  7325. AC_MSG_ERROR([npapi.h header file not found])
  7326. fi
  7327. AC_LANG_PUSH([C])
  7328. save_CFLAGS=$CFLAGS
  7329. CFLAGS="$CFLAGS $NPAPI_HEADERS_CFLAGS"
  7330. AC_MSG_CHECKING([for NPP_GetMIMEDescription return type])
  7331. AC_COMPILE_IFELSE(
  7332. [AC_LANG_SOURCE([[
  7333. #define XP_UNIX
  7334. #include <npapi.h>
  7335. const char* NPP_GetMIMEDescription(void) { return "foo"; }
  7336. ]])],
  7337. [AC_MSG_RESULT([const char*])],
  7338. [
  7339. AC_MSG_RESULT([char*])
  7340. HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=TRUE
  7341. ])
  7342. CFLAGS=$save_CFLAGS
  7343. AC_LANG_POP([C])
  7344. else
  7345. AC_MSG_RESULT([internal])
  7346. dnl ...but will not be built/used unless ENABLE_NPAPI_FROM_BROWSER or
  7347. dnl ENABLE_NPAPI_INTO_BROWSER is YES
  7348. SYSTEM_NPAPI_HEADERS=NO
  7349. fi
  7350. AC_SUBST(NPAPI_HEADERS_CFLAGS)
  7351. AC_SUBST(SYSTEM_NPAPI_HEADERS)
  7352. AC_SUBST(HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION)
  7353. dnl ===================================================================
  7354. dnl Check for system sane
  7355. dnl ===================================================================
  7356. AC_MSG_CHECKING([which sane header to use])
  7357. if test "$with_system_sane" = "yes"; then
  7358. AC_MSG_RESULT([external])
  7359. AC_CHECK_HEADER(sane/sane.h, [],
  7360. [AC_MSG_ERROR(sane not found. install sane)], [])
  7361. else
  7362. AC_MSG_RESULT([internal])
  7363. BUILD_TYPE="$BUILD_TYPE SANE"
  7364. fi
  7365. dnl ===================================================================
  7366. dnl Check for system icu
  7367. dnl ===================================================================
  7368. SYSTEM_GENBRK=
  7369. SYSTEM_GENCCODE=
  7370. SYSTEM_GENCMN=
  7371. ICU_MAJOR=49
  7372. ICU_MINOR=1
  7373. ICU_MICRO=1
  7374. ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
  7375. ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
  7376. ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="YES"
  7377. ICU_RECLASSIFIED_HEBREW_LETTER="YES"
  7378. AC_MSG_CHECKING([which icu to use])
  7379. if test "$with_system_icu" = "yes"; then
  7380. AC_MSG_RESULT([external])
  7381. SYSTEM_ICU=YES
  7382. AC_LANG_PUSH([C++])
  7383. AC_MSG_CHECKING([for unicode/rbbi.h])
  7384. AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
  7385. AC_LANG_POP([C++])
  7386. ICUPATH="$PATH"
  7387. if test "$WITH_MINGW" = "yes"; then
  7388. ICUPATH=`$CC -print-sysroot`/mingw/bin:"$ICUPATH"
  7389. fi
  7390. AC_PATH_PROG(ICUCONFIG,icu-config,,[$ICUPATH])
  7391. AC_MSG_CHECKING([ICU version])
  7392. ICU_VERSION=`$ICUCONFIG --noverify --version 2>/dev/null || $ICUCONFIG --version`
  7393. ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
  7394. ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
  7395. ICU_MICRO=`echo $ICU_VERSION | cut -d"." -f3`
  7396. if test "$ICU_MAJOR" -ge "4"; then
  7397. AC_MSG_RESULT([OK, $ICU_VERSION])
  7398. else
  7399. AC_MSG_ERROR([not suitable, only >= 4.0 supported currently])
  7400. fi
  7401. if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
  7402. AC_PATH_PROG([ICUCONFIG_FOR_BUILD], [icu-config], [], [$PATH:/usr/sbin:/sbin])
  7403. ICU_VERSION_FOR_BUILD=`$ICUCONFIG_FOR_BUILD --noverify --version 2>/dev/null || $ICUCONFIG_FOR_BUILD --version`
  7404. ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
  7405. ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
  7406. AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
  7407. if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
  7408. AC_MSG_RESULT([yes])
  7409. else
  7410. AC_MSG_RESULT([no])
  7411. if test "$with_system_icu_for_build" != "force"; then
  7412. AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
  7413. You can use --with-system-icu-for-build=force to use it anyway.])
  7414. fi
  7415. fi
  7416. fi
  7417. if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
  7418. # using the system icu tools can lead to version confusion, use the
  7419. # ones from the build environment when cross-compiling
  7420. AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
  7421. if test -z "$SYSTEM_GENBRK"; then
  7422. AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
  7423. fi
  7424. AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
  7425. if test -z "$SYSTEM_GENCCODE"; then
  7426. AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
  7427. fi
  7428. AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
  7429. if test -z "$SYSTEM_GENCMN"; then
  7430. AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
  7431. fi
  7432. if test "$ICU_MAJOR" -ge "49" -o \( "$ICU_MAJOR" = "4" -a "$ICU_MINOR" -ge "4" \); then
  7433. ICU_RECLASSIFIED_CLOSE_PARENTHESIS="YES"
  7434. else
  7435. ICU_RECLASSIFIED_CLOSE_PARENTHESIS="NO"
  7436. fi
  7437. if test "$ICU_MAJOR" -ge "49"; then
  7438. ICU_RECLASSIFIED_PREPEND_SET_EMPTY="YES"
  7439. else
  7440. ICU_RECLASSIFIED_PREPEND_SET_EMPTY="NO"
  7441. fi
  7442. if test "$ICU_MAJOR" -le 4; then
  7443. ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="NO"
  7444. ICU_RECLASSIFIED_HEBREW_LETTER="NO"
  7445. fi
  7446. fi
  7447. libo_MINGW_CHECK_DLL([ICUDATA], [icudata][$ICU_MAJOR][$ICU_MINOR])
  7448. libo_MINGW_CHECK_DLL([ICUI18N], [icui18n][$ICU_MAJOR][$ICU_MINOR])
  7449. libo_MINGW_CHECK_DLL([ICUUC], [icuuc][$ICU_MAJOR][$ICU_MINOR])
  7450. else
  7451. AC_MSG_RESULT([internal])
  7452. SYSTEM_ICU="NO"
  7453. BUILD_TYPE="$BUILD_TYPE ICU"
  7454. fi
  7455. AC_SUBST(SYSTEM_ICU)
  7456. AC_SUBST(SYSTEM_GENBRK)
  7457. AC_SUBST(SYSTEM_GENCCODE)
  7458. AC_SUBST(SYSTEM_GENCMN)
  7459. AC_SUBST(ICU_MAJOR)
  7460. AC_SUBST(ICU_MINOR)
  7461. AC_SUBST(ICU_MICRO)
  7462. AC_SUBST(ICU_RECLASSIFIED_CLOSE_PARENTHESIS)
  7463. AC_SUBST([ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER])
  7464. AC_SUBST([ICU_RECLASSIFIED_HEBREW_LETTER])
  7465. AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
  7466. AC_SUBST([MINGW_ICUDATA_DLL])
  7467. AC_SUBST([MINGW_ICUI18N_DLL])
  7468. AC_SUBST([MINGW_ICUUC_DLL])
  7469. dnl ===================================================================
  7470. dnl Graphite
  7471. dnl ===================================================================
  7472. AC_MSG_CHECKING([whether to enable graphite support])
  7473. if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "$enable_graphite" = "" -o "$enable_graphite" != "no"; then
  7474. AC_MSG_RESULT([yes])
  7475. ENABLE_GRAPHITE="TRUE"
  7476. AC_MSG_CHECKING([which graphite to use])
  7477. if test "$with_system_graphite" = "yes"; then
  7478. AC_MSG_RESULT([external])
  7479. SYSTEM_GRAPHITE=YES
  7480. PKG_CHECK_MODULES( GRAPHITE, graphite2 >= 0.9.3 )
  7481. libo_MINGW_CHECK_DLL([GRAPHITE2], [libgraphite2])
  7482. else
  7483. AC_MSG_RESULT([internal])
  7484. SYSTEM_GRAPHITE=NO
  7485. BUILD_TYPE="$BUILD_TYPE GRAPHITE"
  7486. fi
  7487. else
  7488. AC_MSG_RESULT([no])
  7489. fi
  7490. AC_SUBST(ENABLE_GRAPHITE)
  7491. AC_SUBST(SYSTEM_GRAPHITE)
  7492. AC_SUBST(GRAPHITE_CFLAGS)
  7493. AC_SUBST(GRAPHITE_LIBS)
  7494. AC_SUBST([MINGW_GRAPHITE2_DLL])
  7495. dnl ===================================================================
  7496. dnl Check for NPAPI interface to plug browser plugins into LibreOffice documents
  7497. dnl ===================================================================
  7498. AC_MSG_CHECKING([whether to plug browser plugins into LibreOffice documents])
  7499. if test "$_os" != Android -a "$_os" != iOS
  7500. then
  7501. AC_MSG_RESULT([yes])
  7502. ENABLE_NPAPI_FROM_BROWSER=YES
  7503. else
  7504. AC_MSG_RESULT([no])
  7505. ENABLE_NPAPI_FROM_BROWSER=NO
  7506. fi
  7507. AC_SUBST(ENABLE_NPAPI_FROM_BROWSER)
  7508. dnl ===================================================================
  7509. dnl Check for NPAPI interface to plug LibreOffice into browser windows
  7510. dnl ===================================================================
  7511. AC_MSG_CHECKING([whether to plug LibreOffice into browser windows])
  7512. if test "$_os" != Android -a "$_os" != Darwin -a "$_os" != iOS -a \
  7513. "$enable_headless" != yes -a "$enable_gtk" != no
  7514. then
  7515. AC_MSG_RESULT([yes])
  7516. ENABLE_NPAPI_INTO_BROWSER=YES
  7517. else
  7518. AC_MSG_RESULT([no])
  7519. ENABLE_NPAPI_INTO_BROWSER=NO
  7520. fi
  7521. AC_SUBST(ENABLE_NPAPI_INTO_BROWSER)
  7522. AC_MSG_CHECKING([whether to use X11])
  7523. dnl ***************************************
  7524. dnl testing for X libraries and includes...
  7525. dnl ***************************************
  7526. WANT_X11="no"
  7527. if test $_os != Darwin -a $_os != WINNT -a $_os != Android -a $_os != iOS -a "$enable_headless" != "yes"; then
  7528. WANT_X11="yes"
  7529. fi
  7530. AC_MSG_RESULT([$WANT_X11])
  7531. if test "$WANT_X11" = "yes"; then
  7532. AC_PATH_X
  7533. AC_PATH_XTRA
  7534. CPPFLAGS="$CPPFLAGS $X_CFLAGS"
  7535. if test "x$x_includes" = "x"; then
  7536. x_includes="default_x_includes"
  7537. fi
  7538. if test "x$x_libraries" = "x"; then
  7539. x_libraries="default_x_libraries"
  7540. fi
  7541. dnl The variables $x_libraries and $x_includes are set.
  7542. if test -z "$x_libraries"; then
  7543. AC_MSG_ERROR([No X libraries found]) # Exit
  7544. fi
  7545. if test -z "$x_includes"; then
  7546. AC_MSG_ERROR([No X includes found]) # Exit
  7547. fi
  7548. CFLAGS="$CFLAGS $X_CFLAGS"
  7549. LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
  7550. AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
  7551. else
  7552. x_includes="no_x_includes"
  7553. x_libraries="no_x_libraries"
  7554. fi
  7555. if test -z "$x_includes"; then
  7556. x_includes="no_x_includes"
  7557. fi
  7558. if test -z "$x_libraries"; then
  7559. x_libraries="no_x_libraries"
  7560. fi
  7561. if test "$x_includes" = "default_x_includes"; then
  7562. XINC="/usr/include"
  7563. else
  7564. XINC="$x_includes"
  7565. fi
  7566. AC_SUBST(XINC)
  7567. if test "$x_libraries" = "default_x_libraries"; then
  7568. XLIB=`$PKG_CONFIG --variable=libdir x11`
  7569. if test "x$XLIB" = x; then
  7570. XLIB="/usr/lib"
  7571. fi
  7572. else
  7573. XLIB="$x_libraries"
  7574. fi
  7575. if test "$XLIB" != "no_x_libraries" -a "$XLIB" != "/usr/lib" -a "$XLIB" != "/usr/lib64"; then
  7576. SOLARLIB="$SOLARLIB -L$XLIB"
  7577. fi
  7578. if test "$XINC" != "no_x_includes" -a "$XINC" != "/usr/include"; then
  7579. SOLARINC="$SOLARINC -I$XINC"
  7580. fi
  7581. AC_SUBST(XLIB)
  7582. if test "$WANT_X11" = "yes"; then
  7583. dnl ===================================================================
  7584. dnl Check for Composite.h for Mozilla plugin
  7585. dnl ===================================================================
  7586. AC_CHECK_HEADERS(X11/Composite.h,[],[AC_MSG_ERROR([Xt headers not found])],
  7587. [#include <X11/Intrinsic.h>])
  7588. dnl ===================================================================
  7589. dnl Check for extension headers
  7590. dnl ===================================================================
  7591. AC_MSG_CHECKING([whether to use internal X11 extensions headers])
  7592. if test "$with_system_xextensions_headers" != "no"; then
  7593. AC_MSG_RESULT([no])
  7594. AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
  7595. [#include <X11/extensions/shape.h>])
  7596. else
  7597. AC_MSG_RESULT([yes])
  7598. BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS"
  7599. fi
  7600. fi
  7601. dnl ===================================================================
  7602. dnl Check for system Xrender
  7603. dnl ===================================================================
  7604. AC_MSG_CHECKING([whether to use Xrender])
  7605. if test "$WANT_X11" = "yes" -a "$test_xrender" = "yes"; then
  7606. AC_MSG_RESULT([yes])
  7607. PKG_CHECK_MODULES(XRENDER, xrender)
  7608. AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
  7609. [AC_MSG_ERROR(libXrender not found or functional)], [])
  7610. AC_MSG_CHECKING([which Xrender headers to use])
  7611. if test "$with_system_xextensions_headers" != "no"; then
  7612. AC_MSG_RESULT([external])
  7613. AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
  7614. [AC_MSG_ERROR(Xrender not found. install X)], [])
  7615. else
  7616. AC_MSG_RESULT([internal])
  7617. fi
  7618. else
  7619. AC_MSG_RESULT([no])
  7620. fi
  7621. AC_SUBST(XRENDER_CFLAGS)
  7622. AC_SUBST(XRENDER_LIBS)
  7623. dnl ===================================================================
  7624. dnl Check for XRandr
  7625. dnl ===================================================================
  7626. AC_MSG_CHECKING([whether to enable RandR support])
  7627. if test "$WANT_X11" = "yes" -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
  7628. if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then
  7629. XRANDR_DLOPEN="TRUE"
  7630. AC_MSG_RESULT([configured to dlopen libXrandr at runtime])
  7631. else
  7632. AC_MSG_RESULT([yes])
  7633. XRANDR_DLOPEN="FALSE"
  7634. PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
  7635. if test "$ENABLE_RANDR" != "TRUE"; then
  7636. AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
  7637. [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
  7638. XRANDR_CFLAGS=" "
  7639. AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
  7640. [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
  7641. XRANDR_LIBS="-lXrandr "
  7642. ENABLE_RANDR="TRUE"
  7643. fi
  7644. fi
  7645. else
  7646. ENABLE_RANDR=""
  7647. AC_MSG_RESULT([no])
  7648. fi
  7649. AC_SUBST(XRANDR_DLOPEN)
  7650. AC_SUBST(XRANDR_CFLAGS)
  7651. AC_SUBST(XRANDR_LIBS)
  7652. AC_SUBST(ENABLE_RANDR)
  7653. dnl ===================================================================
  7654. dnl Check for building neon
  7655. dnl ===================================================================
  7656. AC_MSG_CHECKING([whether to use neon])
  7657. if test "$enable_neon" = "no"; then
  7658. AC_MSG_RESULT([no])
  7659. DISABLE_NEON=TRUE
  7660. AC_SUBST(DISABLE_NEON)
  7661. else
  7662. AC_MSG_RESULT([yes])
  7663. dnl ===================================================================
  7664. dnl Check for system neon
  7665. dnl ===================================================================
  7666. AC_MSG_CHECKING([which neon to use])
  7667. if test "$with_system_neon" = "yes"; then
  7668. AC_MSG_RESULT([external])
  7669. PKG_CHECK_MODULES(NEON, neon >= 0.26.0, , AC_MSG_ERROR([you need neon >= 0.26.x for system-neon]))
  7670. NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
  7671. SYSTEM_NEON=YES
  7672. libo_MINGW_CHECK_DLL([NEON], [libneon])
  7673. libo_MINGW_TRY_DLL([TASN1], [libtasn1])
  7674. libo_MINGW_TRY_DLL([GNUTLS], [libgnutls])
  7675. else
  7676. AC_MSG_RESULT([internal])
  7677. SYSTEM_NEON=NO
  7678. BUILD_TYPE="$BUILD_TYPE NEON"
  7679. NEON_VERSION=0295
  7680. fi
  7681. AC_SUBST(SYSTEM_NEON)
  7682. AC_SUBST(NEON_LIBS)
  7683. AC_SUBST(NEON_CFLAGS)
  7684. AC_SUBST(NEON_VERSION)
  7685. AC_SUBST([MINGW_GNUTLS_DLL])
  7686. AC_SUBST([MINGW_NEON_DLL])
  7687. AC_SUBST([MINGW_TASN1_DLL])
  7688. fi
  7689. dnl ===================================================================
  7690. dnl Check for disabling cve_tests
  7691. dnl ===================================================================
  7692. AC_MSG_CHECKING([whether to execute CVE tests])
  7693. if test "$enable_cve_tests" = "no"; then
  7694. AC_MSG_RESULT([no])
  7695. DISABLE_CVE_TESTS=TRUE
  7696. AC_SUBST(DISABLE_CVE_TESTS)
  7697. else
  7698. AC_MSG_RESULT([yes])
  7699. fi
  7700. dnl ===================================================================
  7701. dnl Check for system openssl
  7702. dnl ===================================================================
  7703. if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
  7704. "$_os" = "DragonFly" && test "$with_system_openssl" != "no"; then
  7705. with_system_openssl=yes
  7706. fi
  7707. AC_MSG_CHECKING([which libssl to use])
  7708. if test "$with_system_openssl" = "yes"; then
  7709. AC_MSG_RESULT([external])
  7710. # Mac OS builds should get out without extra stuff is the Mac porters'
  7711. # wish. And pkg-config is although Xcode ships a .pc for openssl
  7712. if test "$_os" = "Darwin" -o "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o \
  7713. "$_os" = "DragonFly"; then
  7714. OPENSSL_CFLAGS=
  7715. OPENSSL_LIBS="-lssl -lcrypto"
  7716. else
  7717. PKG_CHECK_MODULES( OPENSSL, openssl )
  7718. fi
  7719. SYSTEM_OPENSSL=YES
  7720. libo_MINGW_CHECK_DLL([SSL], [libssl])
  7721. libo_MINGW_CHECK_DLL([CRYPTO], [libcrypto])
  7722. else
  7723. AC_MSG_RESULT([internal])
  7724. SYSTEM_OPENSSL=NO
  7725. BUILD_TYPE="$BUILD_TYPE OPENSSL"
  7726. fi
  7727. AC_SUBST(SYSTEM_OPENSSL)
  7728. AC_SUBST(OPENSSL_CFLAGS)
  7729. AC_SUBST(OPENSSL_LIBS)
  7730. AC_SUBST([MINGW_SSL_DLL])
  7731. AC_SUBST([MINGW_CRYPTO_DLL])
  7732. dnl ===================================================================
  7733. dnl Check for system redland
  7734. dnl ===================================================================
  7735. AC_MSG_CHECKING([which redland library to use])
  7736. if test "$with_system_redland" = "yes"; then
  7737. AC_MSG_RESULT([external])
  7738. SYSTEM_REDLAND=YES
  7739. dnl versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
  7740. PKG_CHECK_MODULES(REDLAND, redland >= 1.0.8)
  7741. libo_MINGW_CHECK_DLL([REDLAND], [librdf])
  7742. libo_MINGW_TRY_DLL([RAPTOR], [libraptor])
  7743. libo_MINGW_TRY_DLL([RASQAL], [librasqal])
  7744. libo_MINGW_TRY_DLL([SQLITE3], [libsqlite3])
  7745. else
  7746. AC_MSG_RESULT([internal])
  7747. BUILD_TYPE="$BUILD_TYPE REDLAND"
  7748. SYSTEM_REDLAND=NO
  7749. fi
  7750. AC_SUBST(SYSTEM_REDLAND)
  7751. AC_SUBST(REDLAND_CFLAGS)
  7752. AC_SUBST(REDLAND_LIBS)
  7753. AC_SUBST([MINGW_RAPTOR_DLL])
  7754. AC_SUBST([MINGW_RASQAL_DLL])
  7755. AC_SUBST([MINGW_REDLAND_DLL])
  7756. AC_SUBST([MINGW_SQLITE3_DLL])
  7757. dnl ===================================================================
  7758. dnl Check for system orcus
  7759. dnl ===================================================================
  7760. AC_MSG_CHECKING([which orcus library to use])
  7761. if test "$with_system_orcus" = "yes"; then
  7762. AC_MSG_RESULT([external])
  7763. SYSTEM_LIBORCUS=YES
  7764. PKG_CHECK_MODULES(ORCUS, liborcus-0.4 >= 0.3.0)
  7765. else
  7766. AC_MSG_RESULT([internal])
  7767. BUILD_TYPE="$BUILD_TYPE ORCUS"
  7768. SYSTEM_LIBORCUS=NO
  7769. if test "$SYSTEM_BOOST" = "YES"; then
  7770. # ===========================================================
  7771. # Determine if we are going to need to link with Boost.System
  7772. # ===========================================================
  7773. dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
  7774. dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
  7775. dnl in documentation has no effect.
  7776. AC_MSG_CHECKING([if we need to link with Boost.System])
  7777. AC_LANG_PUSH([C++])
  7778. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  7779. @%:@include <boost/version.hpp>
  7780. ]],[[
  7781. #if BOOST_VERSION >= 105000
  7782. # error yes, we need to link with Boost.System
  7783. #endif
  7784. ]])],[
  7785. AC_MSG_RESULT([no])
  7786. ],[
  7787. AC_MSG_RESULT([yes])
  7788. AX_BOOST_SYSTEM
  7789. ])
  7790. AC_LANG_POP([C++])
  7791. fi
  7792. fi
  7793. AC_SUBST([BOOST_SYSTEM_LIB])
  7794. AC_SUBST(SYSTEM_LIBORCUS)
  7795. AC_SUBST(ORCUS_CFLAGS)
  7796. AC_SUBST(ORCUS_LIBS)
  7797. dnl ===================================================================
  7798. dnl Check for system hunspell
  7799. dnl ===================================================================
  7800. AC_MSG_CHECKING([which libhunspell to use])
  7801. if test "$with_system_hunspell" = "yes"; then
  7802. AC_MSG_RESULT([external])
  7803. SYSTEM_HUNSPELL=YES
  7804. AC_LANG_PUSH([C++])
  7805. PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
  7806. if test "$HUNSPELL_PC" != "TRUE"; then
  7807. AC_CHECK_HEADER(hunspell.hxx, [],
  7808. [
  7809. AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
  7810. [AC_MSG_ERROR(hunspell headers not found.)], [])
  7811. ], [])
  7812. AC_CHECK_LIB([hunspell], [main], [:],
  7813. [ AC_MSG_ERROR(hunspell library not found.) ], [])
  7814. HUNSPELL_LIBS=-lhunspell
  7815. fi
  7816. AC_LANG_POP([C++])
  7817. libo_MINGW_CHECK_DLL([HUNSPELL], [libhunspell-1.3])
  7818. else
  7819. AC_MSG_RESULT([internal])
  7820. SYSTEM_HUNSPELL=NO
  7821. HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
  7822. HUNSPELL_LIBS="-L${OUTDIR}/lib -lhunspell"
  7823. BUILD_TYPE="$BUILD_TYPE HUNSPELL"
  7824. fi
  7825. AC_SUBST(SYSTEM_HUNSPELL)
  7826. AC_SUBST(HUNSPELL_CFLAGS)
  7827. AC_SUBST(HUNSPELL_LIBS)
  7828. AC_SUBST([MINGW_HUNSPELL_DLL])
  7829. dnl ===================================================================
  7830. dnl Checking for altlinuxhyph
  7831. dnl ===================================================================
  7832. AC_MSG_CHECKING([which altlinuxhyph to use])
  7833. if test "$with_system_altlinuxhyph" = "yes"; then
  7834. AC_MSG_RESULT([external])
  7835. SYSTEM_HYPH=YES
  7836. AC_CHECK_HEADER(hyphen.h, [],
  7837. [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
  7838. AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
  7839. [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
  7840. [#include <hyphen.h>])
  7841. AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
  7842. [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
  7843. if test -z "$HYPHEN_LIB"; then
  7844. AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
  7845. [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
  7846. fi
  7847. if test -z "$HYPHEN_LIB"; then
  7848. AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
  7849. [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
  7850. fi
  7851. libo_MINGW_CHECK_DLL([HYPHEN], [libhyphen])
  7852. else
  7853. AC_MSG_RESULT([internal])
  7854. SYSTEM_HYPH=NO
  7855. BUILD_TYPE="$BUILD_TYPE HYPHEN"
  7856. fi
  7857. AC_SUBST(SYSTEM_HYPH)
  7858. AC_SUBST(HYPHEN_LIB)
  7859. AC_SUBST([MINGW_HYPHEN_DLL])
  7860. dnl ===================================================================
  7861. dnl Checking for mythes
  7862. dnl ===================================================================
  7863. AC_MSG_CHECKING([which mythes to use])
  7864. if test "$with_system_mythes" = "yes"; then
  7865. AC_MSG_RESULT([external])
  7866. SYSTEM_MYTHES=YES
  7867. AC_LANG_PUSH([C++])
  7868. PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
  7869. if test "$MYTHES_PKGCONFIG" = "no"; then
  7870. AC_CHECK_HEADER(mythes.hxx, [],
  7871. [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
  7872. AC_CHECK_LIB([mythes-1.2], [main], [:],
  7873. [ MYTHES_FOUND=no], [])
  7874. if test "$MYTHES_FOUND" = "no"; then
  7875. AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
  7876. [ MYTHES_FOUND=no], [])
  7877. fi
  7878. if test "$MYTHES_FOUND" = "no"; then
  7879. AC_MSG_ERROR([mythes library not found!.])
  7880. fi
  7881. fi
  7882. AC_LANG_POP([C++])
  7883. libo_MINGW_CHECK_DLL([MYTHES], [libmythes-1.2])
  7884. else
  7885. AC_MSG_RESULT([internal])
  7886. SYSTEM_MYTHES=NO
  7887. BUILD_TYPE="$BUILD_TYPE MYTHES"
  7888. fi
  7889. AC_SUBST(SYSTEM_MYTHES)
  7890. AC_SUBST(MYTHES_CFLAGS)
  7891. AC_SUBST(MYTHES_LIBS)
  7892. AC_SUBST([MINGW_MYTHES_DLL])
  7893. dnl ===================================================================
  7894. dnl Checking for lpsolve
  7895. dnl ===================================================================
  7896. AC_MSG_CHECKING([which lpsolve to use])
  7897. if test "$with_system_lpsolve" = "yes"; then
  7898. AC_MSG_RESULT([external])
  7899. SYSTEM_LPSOLVE=YES
  7900. AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
  7901. [ AC_MSG_ERROR(lpsolve headers not found.)], [])
  7902. save_LIBS=$LIBS
  7903. # some systems need this. Like Ubuntu....
  7904. AC_CHECK_LIB(m, floor)
  7905. AC_CHECK_LIB(dl, dlopen)
  7906. AC_CHECK_LIB([lpsolve55], [make_lp], [:],
  7907. [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
  7908. LIBS=$save_LIBS
  7909. libo_MINGW_CHECK_DLL([LPSOLVE], [lpsolve55])
  7910. else
  7911. AC_MSG_RESULT([internal])
  7912. SYSTEM_LPSOLVE=NO
  7913. BUILD_TYPE="$BUILD_TYPE LPSOLVE"
  7914. fi
  7915. AC_SUBST(SYSTEM_LPSOLVE)
  7916. AC_SUBST([MINGW_LPSOLVE_DLL])
  7917. dnl ===================================================================
  7918. dnl Checking for libexttextcat
  7919. dnl ===================================================================
  7920. AC_MSG_CHECKING([which libexttextcat to use])
  7921. if test "$with_system_libexttextcat" = "yes"; then
  7922. AC_MSG_RESULT([external])
  7923. SYSTEM_LIBEXTTEXTCAT=YES
  7924. PKG_CHECK_MODULES([LIBEXTTEXTCAT], [libexttextcat >= 3.1.1])
  7925. SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
  7926. else
  7927. AC_MSG_RESULT([internal])
  7928. SYSTEM_LIBEXTTEXTCAT=NO
  7929. BUILD_TYPE="$BUILD_TYPE LIBEXTTEXTCAT"
  7930. fi
  7931. AC_SUBST(SYSTEM_LIBEXTTEXTCAT)
  7932. AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
  7933. AC_SUBST(LIBEXTTEXTCAT_CFLAGS)
  7934. AC_SUBST(LIBEXTTEXTCAT_LIBS)
  7935. dnl ***************************************
  7936. dnl testing libc version for Linux...
  7937. dnl ***************************************
  7938. if test "$_os" = "Linux"; then
  7939. AC_MSG_CHECKING([whether libc is >= 2.1.1])
  7940. exec 6>/dev/null # no output
  7941. AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
  7942. exec 6>&1 # output on again
  7943. if test "$HAVE_LIBC"; then
  7944. AC_MSG_RESULT([yes])
  7945. else
  7946. AC_MSG_ERROR([no, upgrade libc])
  7947. fi
  7948. fi
  7949. if test "$_os" != "WINNT"; then
  7950. AC_CHECK_FUNCS(getopt, HAVE_GETOPT=YES, [HAVE_GETOPT=NO])
  7951. AC_CHECK_FUNCS(readdir_r, HAVE_READDIR_R=YES, [HAVE_READDIR_R=NO])
  7952. if test "$HAVE_GETOPT" = "YES" -a "$HAVE_READDIR_R" = "YES"; then
  7953. SYSTEM_LIBC=YES
  7954. fi
  7955. else
  7956. HAVE_GETOPT=NO
  7957. HAVE_READDIR_R=NO
  7958. SYSTEM_LIBC=YES
  7959. fi
  7960. AC_SUBST(HAVE_GETOPT)
  7961. AC_SUBST(HAVE_READDIR_R)
  7962. AC_SUBST(SYSTEM_LIBC)
  7963. dnl =========================================
  7964. dnl Check for the Windows SDK.
  7965. dnl =========================================
  7966. dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep it until I know better,
  7967. dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
  7968. if test "$_os" = "WINNT"; then
  7969. AC_MSG_CHECKING([for Windows SDK])
  7970. if test "$build_os" = "cygwin"; then
  7971. if test -z "$with_windows_sdk_home"; then
  7972. # This first line will detect a February 2003 Microsoft Platform SDK
  7973. WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
  7974. # But there might be also an April 2005 PSDK, unfortunately MS changed
  7975. # the registry entry. (we prefer the old version!?)
  7976. if test -z "$WINDOWS_SDK_HOME"; then
  7977. WINDOWS_SDK_HOME=`cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\ Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
  7978. fi
  7979. # normalize if found
  7980. if test -n "$WINDOWS_SDK_HOME"; then
  7981. WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
  7982. WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
  7983. # If this sdk is incomplete, lets see if the one
  7984. # recommended to be installed is available.
  7985. # This refers to the Windows SDK 8 (as distributed
  7986. # with Visual Studio 2012, or maybe also
  7987. # separately), I assume.
  7988. # I wouldn't say that it is "incomplete", it is
  7989. # just structured differtently. We do seem to try
  7990. # to adapt to that structure below (look for the
  7991. # Include/um etc stuff), so rejecting it here is a
  7992. # bit premature... *but* then one notices that
  7993. # compiling with MSVS2008 and trying to use SDK 8
  7994. # leads to horrible errors in ICU at least. Oh
  7995. # well.
  7996. if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
  7997. WINDOWS_SDK7_HOME=`cat "/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v7.1/InstallationFolder" 2> /dev/null | tr '\000' '\n' | head -n 1`
  7998. if test -n "$WINDOWS_SDK7_HOME"; then
  7999. WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
  8000. WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
  8001. fi
  8002. fi
  8003. fi
  8004. else
  8005. WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
  8006. fi
  8007. fi
  8008. if test -n "$WINDOWS_SDK_HOME"; then
  8009. # Remove a possible trailing backslash
  8010. WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
  8011. # Problem with current PSDK (iz 49865)
  8012. # (What "current" does that mean?)
  8013. if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
  8014. AC_MSG_ERROR([
  8015. Some modules do not build correctly with MS Platform SDK - April 2005
  8016. Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
  8017. Remove/rename/backup that file and restart configure. Details about this
  8018. problem can be found in issue 49856.])
  8019. fi
  8020. if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
  8021. -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
  8022. -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
  8023. HAVE_PSDK_H="yes"
  8024. elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
  8025. -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
  8026. -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
  8027. HAVE_PSDK_H="yes"
  8028. else
  8029. HAVE_PSDK_H="no"
  8030. fi
  8031. if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
  8032. HAVE_PSDK_LIB="yes"
  8033. elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$SDK_ARCH/user32.lib"; then
  8034. HAVE_PSDK_LIB="yes"
  8035. else
  8036. HAVE_PSDK_LIB="no"
  8037. fi
  8038. if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
  8039. AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
  8040. the Windows SDK are installed.])
  8041. fi
  8042. if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
  8043. -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
  8044. -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
  8045. -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
  8046. elif test ! -x "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
  8047. -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
  8048. -o ! -x "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
  8049. -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
  8050. else
  8051. AC_MSG_ERROR([Some (all) files of the Windows Installer SDK are missing, please install.])
  8052. fi
  8053. fi
  8054. if test -z "$WINDOWS_SDK_HOME"; then
  8055. AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
  8056. elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
  8057. WINDOWS_SDK_VERSION=61
  8058. AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
  8059. elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
  8060. WINDOWS_SDK_VERSION=60
  8061. AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
  8062. elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
  8063. WINDOWS_SDK_VERSION=70
  8064. AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
  8065. elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
  8066. WINDOWS_SDK_VERSION=80
  8067. AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
  8068. else
  8069. AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
  8070. fi
  8071. PathFormat "$WINDOWS_SDK_HOME"
  8072. WINDOWS_SDK_HOME="$formatted_path"
  8073. if test "$build_os" = "cygwin"; then
  8074. SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
  8075. if test -d "$WINDOWS_SDK_HOME/include/um"; then
  8076. SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
  8077. fi
  8078. fi
  8079. fi
  8080. AC_SUBST(WINDOWS_SDK_HOME)
  8081. AC_SUBST(WINDOWS_SDK_VERSION)
  8082. dnl =========================================
  8083. dnl Check for uuidgen
  8084. dnl =========================================
  8085. if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
  8086. if test "$WITH_MINGW" = "yes"; then
  8087. AC_PATH_PROG([UUIDGEN], [uuid])
  8088. if test -z "$UUIDGEN"; then
  8089. AC_MSG_WARN([uuid is needed for dev-install])
  8090. fi
  8091. else
  8092. # presence is already tested above in the WINDOWS_SDK_HOME check
  8093. UUIDGEN=uuidgen.exe
  8094. AC_SUBST(UUIDGEN)
  8095. fi
  8096. else
  8097. AC_PATH_PROG([UUIDGEN], [uuidgen])
  8098. if test -z "$UUIDGEN"; then
  8099. AC_MSG_WARN([uuid is needed for dev-install])
  8100. fi
  8101. fi
  8102. dnl =========================================
  8103. dnl Check for the Microsoft DirectX SDK.
  8104. dnl =========================================
  8105. if test -n "$ENABLE_DIRECTX" -a "$_os" = "WINNT"; then
  8106. AC_MSG_CHECKING([for DirectX SDK])
  8107. if test "$build_os" = "cygwin"; then
  8108. if test -z "$with_directx_home"; then
  8109. dnl A standard installation of the DirectX SDK sets $DXSDK_DIR
  8110. if test -n "$DXSDK_DIR"; then
  8111. DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"`
  8112. DIRECTXSDK_HOME=`cygpath -u "$DIRECTXSDK_HOME"`
  8113. fi
  8114. # At this point $DIRECTXSDK_HOME might still be undefined. This will lead to
  8115. # the "DirectX SDK not found" error later
  8116. else
  8117. DIRECTXSDK_HOME=`cygpath -u "$with_directx_home"`
  8118. fi
  8119. # Remove a possible trailing backslash
  8120. DIRECTXSDK_HOME=`echo $DIRECTXSDK_HOME | $SED 's/\/$//'`
  8121. elif test -n "$with_directx_home"; then
  8122. DIRECTXSDK_HOME="$with_directx_home"
  8123. fi
  8124. if test -f "$DIRECTXSDK_HOME/Include/ddraw.h" -o -f "$DIRECTXSDK_HOME/Include/d3d9.h"; then
  8125. HAVE_DIRECTXSDK_H="yes"
  8126. else
  8127. HAVE_DIRECTXSDK_H="no"
  8128. fi
  8129. if test "$BITNESS_OVERRIDE" = 64; then
  8130. DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x64"
  8131. else
  8132. DIRECTXSDK_LIB="$DIRECTXSDK_HOME/lib/x86"
  8133. fi
  8134. PathFormat "$DIRECTXSDK_LIB"
  8135. DIRECTXSDK_LIB="$formatted_path"
  8136. if test -f "$DIRECTXSDK_LIB/ddraw.lib" -o -f "$DIRECTXSDK_LIB/d3d9.lib"; then
  8137. HAVE_DIRECTXSDK_LIB="yes"
  8138. else
  8139. HAVE_DIRECTXSDK_LIB="no"
  8140. fi
  8141. if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then
  8142. AC_MSG_RESULT([found])
  8143. else
  8144. AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway])
  8145. fi
  8146. PathFormat "$DIRECTXSDK_HOME"
  8147. DIRECTXSDK_HOME="$formatted_path"
  8148. SOLARINC="$SOLARINC -I$DIRECTXSDK_HOME/include"
  8149. fi
  8150. AC_SUBST(DIRECTXSDK_HOME)
  8151. AC_SUBST(DIRECTXSDK_LIB)
  8152. dnl ***************************************
  8153. dnl Checking for bison and flex
  8154. dnl ***************************************
  8155. AC_PATH_PROG(BISON, bison)
  8156. ANCIENT_BISON="NO"
  8157. if test -z "$BISON"; then
  8158. AC_MSG_ERROR([no bison found in \$PATH, install it])
  8159. else
  8160. AC_MSG_CHECKING([the bison version])
  8161. _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
  8162. _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
  8163. # Accept newer than 1.875 or older(equal) than 1.75
  8164. if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then
  8165. if test "$_bison_version" = "1.875"; then
  8166. AC_MSG_WARN([suspect ($BISON $_bison_version)])
  8167. add_warning "Suspect ($BISON $_bison_version) suggest upgrade"
  8168. else
  8169. AC_MSG_RESULT([checked ($BISON $_bison_version)])
  8170. fi
  8171. else
  8172. AC_MSG_ERROR([failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))])
  8173. fi
  8174. if test "$_bison_longver" -lt 2000; then
  8175. ANCIENT_BISON="YES"
  8176. fi
  8177. fi
  8178. AC_SUBST(ANCIENT_BISON)
  8179. AC_PATH_PROG(FLEX, flex)
  8180. if test -z "$FLEX"; then
  8181. AC_MSG_ERROR([no flex found in \$PATH, install it])
  8182. fi
  8183. AC_SUBST([FLEX])
  8184. dnl ***************************************
  8185. dnl Checking for patch
  8186. dnl ***************************************
  8187. AC_PATH_PROG(PATCH, patch)
  8188. if test -z "$PATCH"; then
  8189. AC_MSG_ERROR([\"patch\" not found in \$PATH, install it])
  8190. fi
  8191. dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
  8192. if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
  8193. if test -z "$with_gnu_patch"; then
  8194. GNUPATCH=$PATCH
  8195. else
  8196. if test -x "$with_gnu_patch"; then
  8197. GNUPATCH=$with_gnu_patch
  8198. else
  8199. AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
  8200. fi
  8201. fi
  8202. AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
  8203. if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
  8204. AC_MSG_RESULT([yes])
  8205. else
  8206. AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
  8207. fi
  8208. else
  8209. GNUPATCH=$PATCH
  8210. fi
  8211. dnl We also need to check for --with-gnu-cp
  8212. if test -z "$with_gnu_cp"; then
  8213. # check the place where the good stuff is hidden on Solaris...
  8214. if test -x /usr/gnu/bin/cp; then
  8215. GNUCP=/usr/gnu/bin/cp
  8216. else
  8217. AC_PATH_PROGS(GNUCP, gnucp cp)
  8218. fi
  8219. if test -z $GNUCP; then
  8220. AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
  8221. fi
  8222. else
  8223. if test -x "$with_gnu_cp"; then
  8224. GNUCP=$with_gnu_cp
  8225. else
  8226. AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
  8227. fi
  8228. fi
  8229. AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
  8230. if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
  8231. AC_MSG_RESULT([yes])
  8232. elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
  8233. AC_MSG_RESULT([yes])
  8234. else
  8235. case "$build_os" in
  8236. darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
  8237. x_GNUCP=[\#]
  8238. GNUCP=''
  8239. AC_MSG_RESULT([no gnucp found - using the system's cp command])
  8240. ;;
  8241. *)
  8242. AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
  8243. ;;
  8244. esac
  8245. fi
  8246. AC_SUBST(GNUPATCH)
  8247. AC_SUBST(GNUCP)
  8248. AC_SUBST(x_GNUCP)
  8249. dnl ***************************************
  8250. dnl testing assembler path
  8251. dnl ***************************************
  8252. ML_EXE=""
  8253. if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
  8254. if test "$BITNESS_OVERRIDE" = ""; then
  8255. assembler=ml.exe
  8256. assembler_bin=bin
  8257. else
  8258. assembler=ml64.exe
  8259. assembler_bin=bin/amd64
  8260. fi
  8261. if test -n "$with_asm_home"; then
  8262. with_asm_home=`cygpath -u "$with_asm_home"`
  8263. fi
  8264. if test -x "$with_asm_home/$assembler"; then
  8265. AC_MSG_CHECKING([$assembler assembler path])
  8266. AC_MSG_RESULT([$with_asm_home/$assembler])
  8267. ML_EXE="$with_asm_home/$assembler"
  8268. else
  8269. AC_PATH_PROG(ML_EXE, $assembler)
  8270. if test -z "$ML_EXE"; then
  8271. AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
  8272. if test -x "$with_cl_home/$assembler_bin/$assembler"; then
  8273. with_asm_home=$with_cl_home/$assembler_bin
  8274. AC_MSG_RESULT([found])
  8275. ML_EXE="$with_cl_home/$assembler_bin/$assembler"
  8276. else
  8277. AC_MSG_ERROR([Configure did not find $assembler assembler.])
  8278. fi
  8279. else
  8280. with_asm_home="ASM_IN_PATH"
  8281. ML_EXE="$assembler"
  8282. fi
  8283. fi
  8284. PathFormat "$with_asm_home"
  8285. ASM_HOME="$formatted_path"
  8286. else
  8287. ASM_HOME=""
  8288. fi
  8289. AC_SUBST(ML_EXE)
  8290. dnl ===================================================================
  8291. dnl We need zip and unzip
  8292. dnl ===================================================================
  8293. AC_PATH_PROG(ZIP, zip)
  8294. test -z "$ZIP" && AC_MSG_ERROR([zip is required])
  8295. if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
  8296. AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install it and make sure it is the one found first in PATH],,)
  8297. fi
  8298. AC_PATH_PROG(UNZIP, unzip)
  8299. test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
  8300. dnl ===================================================================
  8301. dnl Zip must be a specific type for different build types.
  8302. dnl ===================================================================
  8303. if test $build_os = cygwin; then
  8304. if test -n "`$ZIP -h | $GREP -i WinNT`"; then
  8305. AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
  8306. fi
  8307. fi
  8308. dnl ===================================================================
  8309. dnl Test which vclplugs have to be built.
  8310. dnl ===================================================================
  8311. R=""
  8312. GTK3_CFLAGS=""
  8313. GTK3_LIBS=""
  8314. ENABLE_GTK3=""
  8315. if test "x$enable_gtk3" = "xyes"; then
  8316. if test "$with_system_cairo" != yes; then
  8317. AC_MSG_WARN([System cairo required for gtk3 support, please use --with-system-cairo])
  8318. add_warning "System cairo required for gtk3 support, please use --with-system-cairo"
  8319. fi
  8320. PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.2 gtk+-unix-print-3.0 gmodule-no-export-2.0 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
  8321. if test "x$ENABLE_GTK3" = "xTRUE"; then
  8322. R="gtk3"
  8323. else
  8324. AC_MSG_ERROR([gtk3 libraries of the correct versions, not found])
  8325. fi
  8326. fi
  8327. AC_SUBST(GTK3_LIBS)
  8328. AC_SUBST(GTK3_CFLAGS)
  8329. AC_SUBST(ENABLE_GTK3)
  8330. AC_MSG_CHECKING([which VCLplugs shall be built])
  8331. if test "$GUIBASE" != "unx" -o "$enable_headless" = "yes"; then
  8332. enable_gtk=no
  8333. fi
  8334. ENABLE_GTK=""
  8335. if test "x$enable_gtk" = "xyes"; then
  8336. ENABLE_GTK="TRUE"
  8337. R="gtk $R"
  8338. fi
  8339. AC_SUBST(ENABLE_GTK)
  8340. ENABLE_TDE=""
  8341. if test "x$enable_tde" = "xyes"; then
  8342. # Libs kab and tdeab in connectivity and kdeab and tdeab in shell
  8343. # are built from the same sources. So we only allow one of them.
  8344. if test "x$enable_kde" = "xyes"; then
  8345. AC_MSG_ERROR([enabling both KDE and TDE is not supported])
  8346. fi
  8347. ENABLE_TDE="TRUE"
  8348. R="$R tde"
  8349. fi
  8350. AC_SUBST(ENABLE_TDE)
  8351. ENABLE_KDE=""
  8352. if test "x$enable_kde" = "xyes"; then
  8353. ENABLE_KDE="TRUE"
  8354. R="$R kde"
  8355. fi
  8356. AC_SUBST(ENABLE_KDE)
  8357. ENABLE_KDE4=""
  8358. if test "x$enable_kde4" = "xyes"; then
  8359. ENABLE_KDE4="TRUE"
  8360. R="$R kde4"
  8361. fi
  8362. AC_SUBST(ENABLE_KDE4)
  8363. ENABLE_HEADLESS=""
  8364. if test "x$enable_headless" = "xyes"; then
  8365. ENABLE_HEADLESS="TRUE"
  8366. SCPDEFS="$SCPDEFS -DLIBO_HEADLESS"
  8367. R="headless"
  8368. fi
  8369. AC_SUBST(ENABLE_HEADLESS)
  8370. if test -z "$R"; then
  8371. AC_MSG_RESULT([none])
  8372. else
  8373. AC_MSG_RESULT([$R])
  8374. fi
  8375. dnl ===================================================================
  8376. dnl GCONF check
  8377. dnl ===================================================================
  8378. ENABLE_GCONF=""
  8379. AC_MSG_CHECKING([whether to enable GConf support])
  8380. if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gconf" = "yes"; then
  8381. ENABLE_GCONF="TRUE"
  8382. AC_MSG_RESULT([yes])
  8383. PKG_CHECK_MODULES( GCONF, gconf-2.0 gobject-2.0 )
  8384. else
  8385. AC_MSG_RESULT([no])
  8386. fi
  8387. AC_SUBST(GCONF_LIBS)
  8388. AC_SUBST(GCONF_CFLAGS)
  8389. AC_SUBST(ENABLE_GCONF)
  8390. dnl ===================================================================
  8391. dnl Gnome VFS check
  8392. dnl ===================================================================
  8393. ENABLE_GNOMEVFS=""
  8394. AC_MSG_CHECKING([whether to enable GNOME VFS support])
  8395. if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes" -a "$enable_gconf" = "yes"; then
  8396. ENABLE_GNOMEVFS="TRUE"
  8397. AC_MSG_RESULT([yes])
  8398. PKG_CHECK_MODULES( GNOMEVFS, gnome-vfs-2.0 >= 2.6.0 )
  8399. else
  8400. AC_MSG_RESULT([no])
  8401. fi
  8402. AC_SUBST(GNOMEVFS_LIBS)
  8403. AC_SUBST(GNOMEVFS_CFLAGS)
  8404. AC_SUBST(ENABLE_GNOMEVFS)
  8405. dnl ===================================================================
  8406. dnl check for dbus support
  8407. dnl ===================================================================
  8408. ENABLE_DBUS=""
  8409. DBUS_CFLAGS=""
  8410. DBUS_LIBS=""
  8411. if test "$enable_dbus" = "no"; then
  8412. test_dbus=no
  8413. fi
  8414. AC_MSG_CHECKING([whether to enable DBUS support])
  8415. if test "$test_dbus" = "yes"; then
  8416. ENABLE_DBUS="TRUE"
  8417. AC_MSG_RESULT([yes])
  8418. PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
  8419. else
  8420. AC_MSG_RESULT([no])
  8421. fi
  8422. AC_SUBST(ENABLE_DBUS)
  8423. AC_SUBST(DBUS_CFLAGS)
  8424. AC_SUBST(DBUS_LIBS)
  8425. AC_MSG_CHECKING([whether to enable font install via packagekit])
  8426. if test "$ENABLE_DBUS" = "TRUE"; then
  8427. if test -n "$enable_packagekit" -a "$enable_packagekit" != "no"; then
  8428. ENABLE_PACKAGEKIT=YES
  8429. AC_MSG_RESULT([yes])
  8430. else
  8431. ENABLE_PACKAGEKIT=NO
  8432. AC_MSG_RESULT([no])
  8433. fi
  8434. else
  8435. AC_MSG_RESULT([no, dbus disabled.])
  8436. fi
  8437. AC_SUBST(ENABLE_PACKAGEKIT)
  8438. AC_MSG_CHECKING([whether to enable sd remotecontrol])
  8439. if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
  8440. AC_MSG_RESULT([yes])
  8441. ENABLE_SDREMOTE=YES
  8442. AC_MSG_CHECKING([whether to enable bluetooth support in sdremote])
  8443. if test -n "$enable_sdremote_bluetooth" -a "$enable_sdremote_bluetooth" != "no"; then
  8444. if test "$OS" = "LINUX"; then
  8445. if test "$ENABLE_DBUS" = "TRUE"; then
  8446. AC_MSG_RESULT([yes])
  8447. ENABLE_SDREMOTE_BLUETOOTH=YES
  8448. dnl ===================================================================
  8449. dnl Check for system bluez
  8450. dnl ===================================================================
  8451. AC_MSG_CHECKING([which bluetooth header to use])
  8452. if test "$with_system_bluez" = "yes"; then
  8453. AC_MSG_RESULT([external])
  8454. AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
  8455. [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
  8456. else
  8457. AC_MSG_RESULT([internal])
  8458. BUILD_TYPE="$BUILD_TYPE BLUEZ"
  8459. fi
  8460. else
  8461. AC_MSG_RESULT([no, dbus disabled])
  8462. ENABLE_SDREMOTE_BLUETOOTH=NO
  8463. fi
  8464. else
  8465. # FIXME: should this really be disabled in everything non-Linux?
  8466. AC_MSG_RESULT([no])
  8467. ENABLE_SDREMOTE_BLUETOOTH=NO
  8468. fi
  8469. else
  8470. AC_MSG_RESULT([no])
  8471. ENABLE_SDREMOTE_BLUETOOTH=NO
  8472. fi
  8473. else
  8474. ENABLE_SDREMOTE=NO
  8475. AC_MSG_RESULT([no])
  8476. fi
  8477. AC_SUBST(ENABLE_SDREMOTE)
  8478. AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
  8479. dnl ===================================================================
  8480. dnl Check whether the gtk 2.0 libraries are available.
  8481. dnl ===================================================================
  8482. GTK_CFLAGS=""
  8483. GTK_LIBS=""
  8484. ENABLE_SYSTRAY_GTK=""
  8485. if test "$test_gtk" = "yes"; then
  8486. if test "$ENABLE_GTK" = "TRUE"; then
  8487. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
  8488. PKG_CHECK_MODULES(GTHREAD, gthread-2.0,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
  8489. BUILD_TYPE="$BUILD_TYPE GTK"
  8490. AC_MSG_CHECKING([whether to enable the systray quickstarter])
  8491. if test "x$enable_systray" = "xyes"; then
  8492. AC_MSG_RESULT([yes])
  8493. PKG_CHECK_MODULES( GTK210, gtk+-2.0 >= 2.10.0,
  8494. [ ENABLE_SYSTRAY_GTK="TRUE" ],
  8495. [ ENABLE_SYSTRAY_GTK="" ])
  8496. else
  8497. AC_MSG_RESULT([no])
  8498. fi
  8499. AC_MSG_CHECKING([whether to enable Gtk print dialog support])
  8500. PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
  8501. [ENABLE_GTK_PRINT="TRUE"],
  8502. [ENABLE_GTK_PRINT=""])
  8503. AC_MSG_CHECKING([whether to enable GIO support])
  8504. if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
  8505. if test "$ENABLE_GNOMEVFS" = "TRUE"; then
  8506. AC_MSG_ERROR([please use --enable-gio only together with --disable-gnome-vfs.])
  8507. fi
  8508. ENABLE_GIO="TRUE"
  8509. AC_MSG_RESULT([yes])
  8510. PKG_CHECK_MODULES( GIO, gio-2.0 )
  8511. else
  8512. AC_MSG_RESULT([no])
  8513. fi
  8514. fi
  8515. fi
  8516. AC_SUBST(ENABLE_GIO)
  8517. AC_SUBST(GIO_CFLAGS)
  8518. AC_SUBST(GIO_LIBS)
  8519. AC_SUBST(ENABLE_SYSTRAY_GTK)
  8520. AC_SUBST(GTK_CFLAGS)
  8521. AC_SUBST(GTK_LIBS)
  8522. AC_SUBST(GTHREAD_CFLAGS)
  8523. AC_SUBST(GTHREAD_LIBS)
  8524. AC_SUBST([ENABLE_GTK_PRINT])
  8525. AC_SUBST([GTK_PRINT_CFLAGS])
  8526. AC_SUBST([GTK_PRINT_LIBS])
  8527. dnl ===================================================================
  8528. dnl Check whether the Telepathy libraries are available.
  8529. dnl ===================================================================
  8530. ENABLE_TELEPATHY=""
  8531. TELEPATHY_CFLAGS=""
  8532. TELEPATHY_LIBS=""
  8533. AC_MSG_CHECKING([whether to enable Telepathy support])
  8534. if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_telepathy" = "yes"; then
  8535. ENABLE_TELEPATHY="TRUE"
  8536. AC_MSG_RESULT([yes])
  8537. PKG_CHECK_MODULES( TELEPATHY, telepathy-glib >= 0.18.0 glib-2.0 gobject-2.0 gthread-2.0 gio-2.0 )
  8538. else
  8539. AC_MSG_RESULT([no])
  8540. fi
  8541. AC_SUBST(ENABLE_TELEPATHY)
  8542. AC_SUBST(TELEPATHY_CFLAGS)
  8543. AC_SUBST(TELEPATHY_LIBS)
  8544. dnl ===================================================================
  8545. PKG_CHECK_MODULES( LIBPNG, libpng, ENABLE_QUICKSTART_LIBPNG="TRUE", ENABLE_QUICKSTART_LIBPNG="" )
  8546. AC_SUBST(LIBPNG_LIBS)
  8547. AC_SUBST(LIBPNG_CFLAGS)
  8548. AC_MSG_CHECKING([whether to enable libpng linking in quickstarter])
  8549. if test "x$enable_unix_qstart_libpng" != "xno"; then
  8550. AC_MSG_RESULT([yes])
  8551. else
  8552. AC_MSG_RESULT([no])
  8553. ENABLE_QUICKSTART_LIBPNG=""
  8554. fi
  8555. AC_SUBST(ENABLE_QUICKSTART_LIBPNG)
  8556. SPLIT_APP_MODULES=""
  8557. if test "$enable_split_app_modules" = "yes"; then
  8558. SPLIT_APP_MODULES="YES"
  8559. fi
  8560. AC_SUBST(SPLIT_APP_MODULES)
  8561. SPLIT_OPT_FEATURES=""
  8562. if test "$enable_split_opt_features" = "yes"; then
  8563. SPLIT_OPT_FEATURES="YES"
  8564. fi
  8565. AC_SUBST(SPLIT_OPT_FEATURES)
  8566. if test $_os = Darwin -o $_os = WINNT; then
  8567. if test "$enable_cairo_canvas" = yes; then
  8568. AC_MSG_ERROR([The cairo canvas should not be used for this platform])
  8569. fi
  8570. enable_cairo_canvas=no
  8571. elif test -z "$enable_cairo_canvas"; then
  8572. enable_cairo_canvas=yes
  8573. fi
  8574. ENABLE_CAIRO_CANVAS=""
  8575. if test "$enable_cairo_canvas" = "yes"; then
  8576. test_cairo=yes
  8577. ENABLE_CAIRO_CANVAS="TRUE"
  8578. fi
  8579. AC_SUBST(ENABLE_CAIRO_CANVAS)
  8580. dnl ===================================================================
  8581. dnl Check whether the GStreamer libraries are available.
  8582. dnl ===================================================================
  8583. ENABLE_GSTREAMER=""
  8584. if test "$build_gstreamer" = "yes"; then
  8585. AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
  8586. if test "x$enable_gstreamer" != "xno"; then
  8587. ENABLE_GSTREAMER="TRUE"
  8588. AC_MSG_RESULT([yes])
  8589. PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
  8590. else
  8591. AC_MSG_RESULT([no])
  8592. fi
  8593. fi
  8594. AC_SUBST(GSTREAMER_CFLAGS)
  8595. AC_SUBST(GSTREAMER_LIBS)
  8596. AC_SUBST(ENABLE_GSTREAMER)
  8597. ENABLE_GSTREAMER_0_10=""
  8598. if test "$build_gstreamer_0_10" = "yes"; then
  8599. AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
  8600. if test "x$enable_gstreamer_0_10" != "xno"; then
  8601. ENABLE_GSTREAMER_0_10="TRUE"
  8602. AC_MSG_RESULT([yes])
  8603. PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
  8604. PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10] )
  8605. ])
  8606. else
  8607. AC_MSG_RESULT([no])
  8608. fi
  8609. fi
  8610. AC_SUBST(GSTREAMER_0_10_CFLAGS)
  8611. AC_SUBST(GSTREAMER_0_10_LIBS)
  8612. AC_SUBST(ENABLE_GSTREAMER_0_10)
  8613. dnl ===================================================================
  8614. dnl Check whether the OpenGL libraries are available
  8615. dnl ===================================================================
  8616. AC_MSG_CHECKING([whether to build the OpenGL Transitions component])
  8617. ENABLE_OPENGL=
  8618. if test "$_os" = "Darwin"; then
  8619. # We use frameworks on Mac OS X, no need for detail checks
  8620. ENABLE_OPENGL=TRUE
  8621. SYSTEM_MESA_HEADERS=YES
  8622. AC_MSG_RESULT([yes])
  8623. else
  8624. if test "x$enable_opengl" != "xno"; then
  8625. if test "$_os" != "WINNT"; then
  8626. save_LDFLAGS=$LDFLAGS
  8627. LDFLAGS="$LDFLAGS -lm"
  8628. AC_MSG_RESULT([yes])
  8629. AC_CHECK_LIB([GL], [main], [:],
  8630. [AC_MSG_ERROR(libGL not installed or functional)], [])
  8631. AC_CHECK_LIB([GLU], [main], [:],
  8632. [AC_MSG_ERROR(libGLU not installed or functional)], [])
  8633. ENABLE_OPENGL=TRUE
  8634. LDFLAGS=$save_LDFLAGS
  8635. dnl ===================================================================
  8636. dnl Check for system Mesa
  8637. dnl ===================================================================
  8638. AC_MSG_CHECKING([which Mesa headers to use])
  8639. if test "$with_system_mesa_headers" = "yes"; then
  8640. AC_MSG_RESULT([external])
  8641. SYSTEM_MESA_HEADERS=YES
  8642. AC_LANG_PUSH(C)
  8643. AC_CHECK_HEADER(GL/glxext.h, [],
  8644. [ AC_MSG_ERROR(mesa headers not found.)], [#include <GL/glx.h>])
  8645. AC_MSG_CHECKING([whether GL/glxext.h defines PFNGLXBINDTEXIMAGEEXTPROC])
  8646. AC_EGREP_HEADER(PFNGLXBINDTEXIMAGEEXTPROC, GL/glxext.h, [AC_MSG_RESULT([yes])], AC_MSG_ERROR(no))
  8647. AC_LANG_POP(C)
  8648. else
  8649. AC_MSG_RESULT([internal])
  8650. SYSTEM_MESA_HEADERS=NO
  8651. BUILD_TYPE="$BUILD_TYPE MESA"
  8652. fi
  8653. else
  8654. AC_MSG_RESULT([not on Windows])
  8655. fi
  8656. else
  8657. AC_MSG_RESULT([no])
  8658. fi
  8659. fi
  8660. AC_SUBST(SYSTEM_MESA_HEADERS)
  8661. AC_SUBST(ENABLE_OPENGL)
  8662. # presenter minimizer extension?
  8663. AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
  8664. if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then
  8665. AC_MSG_RESULT([yes])
  8666. ENABLE_MINIMIZER=YES
  8667. else
  8668. AC_MSG_RESULT([no])
  8669. ENABLE_MINIMIZER=NO
  8670. SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MINIMIZER"
  8671. fi
  8672. AC_SUBST(ENABLE_MINIMIZER)
  8673. # pdf import?
  8674. AC_MSG_CHECKING([whether to build the PDF import])
  8675. if test "$_os" != Android -a "$_os" != iOS -a "$ENABLE_PDFIMPORT" != FALSE; then
  8676. AC_MSG_RESULT([yes])
  8677. ENABLE_PDFIMPORT=TRUE
  8678. dnl ===================================================================
  8679. dnl Check for system poppler
  8680. dnl ===================================================================
  8681. AC_MSG_CHECKING([which pdf backend to use])
  8682. if test "$with_system_poppler" = "yes"; then
  8683. AC_MSG_RESULT([external])
  8684. SYSTEM_POPPLER=YES
  8685. PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
  8686. AC_LANG_PUSH([C++])
  8687. save_CXXFLAGS=$CXXFLAGS
  8688. save_CPPFLAGS=$CPPFLAGS
  8689. CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
  8690. CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
  8691. AC_CHECK_HEADER([cpp/poppler-version.h], [],
  8692. [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
  8693. CXXFLAGS=$save_CXXFLAGS
  8694. CPPFLAGS=$save_CPPFLAGS
  8695. AC_LANG_POP([C++])
  8696. libo_MINGW_CHECK_DLL([POPPLER], [libpoppler])
  8697. else
  8698. AC_MSG_RESULT([internal])
  8699. SYSTEM_POPPLER=NO
  8700. BUILD_TYPE="$BUILD_TYPE XPDF"
  8701. fi
  8702. else
  8703. AC_MSG_RESULT([no])
  8704. ENABLE_PDFIMPORT=FALSE
  8705. fi
  8706. AC_SUBST(ENABLE_PDFIMPORT)
  8707. AC_SUBST(SYSTEM_POPPLER)
  8708. AC_SUBST(POPPLER_CFLAGS)
  8709. AC_SUBST(POPPLER_LIBS)
  8710. AC_SUBST([MINGW_POPPLER_DLL])
  8711. AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
  8712. if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
  8713. AC_MSG_RESULT([yes])
  8714. ENABLE_MEDIAWIKI=YES
  8715. BUILD_TYPE="$BUILD_TYPE XSLTML"
  8716. if test "x$with_java" = "xno"; then
  8717. AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
  8718. fi
  8719. else
  8720. AC_MSG_RESULT([no])
  8721. ENABLE_MEDIAWIKI=NO
  8722. SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
  8723. fi
  8724. AC_SUBST(ENABLE_MEDIAWIKI)
  8725. if test "$ENABLE_MEDIAWIKI" = "YES"; then
  8726. AC_MSG_CHECKING([which Servlet API Jar to use])
  8727. if test "$with_system_servlet_api" = "yes"; then
  8728. AC_MSG_RESULT([external])
  8729. SYSTEM_SERVLETAPI=YES
  8730. if test -z "$SERVLETAPI_JAR"; then
  8731. SERVLETAPI_JAR=/usr/share/java/servlet-api.jar
  8732. fi
  8733. AC_CHECK_FILE($SERVLETAPI_JAR, [],
  8734. [AC_MSG_ERROR(servlet-api.jar not found.)], [])
  8735. else
  8736. AC_MSG_RESULT([internal])
  8737. SYSTEM_SERVLETAPI=NO
  8738. BUILD_TYPE="$BUILD_TYPE TOMCAT"
  8739. fi
  8740. fi
  8741. AC_SUBST(SYSTEM_SERVLETAPI)
  8742. AC_SUBST(SERVLETAPI_JAR)
  8743. AC_MSG_CHECKING([whether to build the Report Builder extension])
  8744. if test "$enable_ext_report_builder" != "no" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
  8745. AC_MSG_RESULT([yes])
  8746. ENABLE_REPORTBUILDER=YES
  8747. AC_MSG_CHECKING([which jfreereport libs to use])
  8748. if test "$with_system_jfreereport" = "yes"; then
  8749. SYSTEM_JFREEREPORT=YES
  8750. AC_MSG_RESULT([external])
  8751. if test -z $SAC_JAR; then
  8752. SAC_JAR=/usr/share/java/sac.jar
  8753. fi
  8754. AC_CHECK_FILE($SAC_JAR, [],
  8755. [AC_MSG_ERROR(sac.jar not found.)], [])
  8756. if test -z $LIBXML_JAR; then
  8757. AC_CHECK_FILE(/usr/share/java/libxml-1.0.0.jar,
  8758. [ LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar ],
  8759. [
  8760. AC_CHECK_FILE(/usr/share/java/libxml.jar,
  8761. [ LIBXML_JAR=/usr/share/java/libxml.jar ],
  8762. [AC_MSG_ERROR(libxml.jar replacement not found.)]
  8763. )
  8764. ]
  8765. )
  8766. else
  8767. AC_CHECK_FILE($LIBXML_JAR, [],
  8768. [AC_MSG_ERROR(libxml.jar not found.)], [])
  8769. fi
  8770. if test -z $FLUTE_JAR; then
  8771. AC_CHECK_FILE(/usr/share/java/flute-1.3.0.jar,
  8772. [ FLUTE_JAR=/usr/share/java/flute-1.3.0.jar ],
  8773. [
  8774. AC_CHECK_FILE(/usr/share/java/flute.jar,
  8775. [ FLUTE_JAR=/usr/share/java/flute.jar ],
  8776. [ AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)]
  8777. )
  8778. ]
  8779. )
  8780. else
  8781. AC_CHECK_FILE($FLUTE_JAR, [],
  8782. [AC_MSG_ERROR(flute-1.3.0.jar not found.)], [])
  8783. fi
  8784. if test -z $JFREEREPORT_JAR; then
  8785. AC_CHECK_FILE(/usr/share/java/flow-engine-0.9.2.jar,
  8786. [ JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar ],
  8787. [
  8788. AC_CHECK_FILE(/usr/share/java/flow-engine.jar,
  8789. [ JFREEREPORT_JAR=/usr/share/java/flow-engine.jar ],
  8790. [AC_MSG_ERROR(jfreereport.jar replacement not found.)]
  8791. )
  8792. ]
  8793. )
  8794. else
  8795. AC_CHECK_FILE($JFREEREPORT_JAR, [],
  8796. [AC_MSG_ERROR(jfreereport.jar not found.)], [])
  8797. fi
  8798. if test -z $LIBLAYOUT_JAR; then
  8799. AC_CHECK_FILE(/usr/share/java/liblayout-0.2.9.jar,
  8800. [ LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar ],
  8801. [
  8802. AC_CHECK_FILE(/usr/share/java/liblayout.jar,
  8803. [ LIBLAYOUT_JAR=/usr/share/java/liblayout.jar ],
  8804. [AC_MSG_ERROR(liblayout.jar replacement not found.)]
  8805. )
  8806. ]
  8807. )
  8808. else
  8809. AC_CHECK_FILE($LIBLAYOUT_JAR, [],
  8810. [AC_MSG_ERROR(liblayout.jar not found.)], [])
  8811. fi
  8812. if test -z $LIBLOADER_JAR; then
  8813. AC_CHECK_FILE(/usr/share/java/libloader-1.0.0.jar,
  8814. [ LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar ],
  8815. [
  8816. AC_CHECK_FILE(/usr/share/java/libloader.jar,
  8817. [ LIBLOADER_JAR=/usr/share/java/libloader.jar ],
  8818. [AC_MSG_ERROR(libloader.jar replacement not found.)]
  8819. )
  8820. ]
  8821. )
  8822. else
  8823. AC_CHECK_FILE($LIBLOADER_JAR, [],
  8824. [AC_MSG_ERROR(libloader.jar not found.)], [])
  8825. fi
  8826. if test -z $LIBFORMULA_JAR; then
  8827. AC_CHECK_FILE(/usr/share/java/libformula-0.2.0.jar,
  8828. [ LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar ],
  8829. [
  8830. AC_CHECK_FILE(/usr/share/java/libformula.jar,
  8831. [ LIBFORMULA_JAR=/usr/share/java/libformula.jar ],
  8832. [AC_MSG_ERROR(libformula.jar replacement not found.)]
  8833. )
  8834. ]
  8835. )
  8836. else
  8837. AC_CHECK_FILE($LIBFORMULA_JAR, [],
  8838. [AC_MSG_ERROR(libformula.jar not found.)], [])
  8839. fi
  8840. if test -z $LIBREPOSITORY_JAR; then
  8841. AC_CHECK_FILE(/usr/share/java/librepository-1.0.0.jar,
  8842. [ LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar ],
  8843. [
  8844. AC_CHECK_FILE(/usr/share/java/librepository.jar,
  8845. [ LIBREPOSITORY_JAR=/usr/share/java/librepository.jar ],
  8846. [AC_MSG_ERROR(librepository.jar replacement not found.)]
  8847. )
  8848. ]
  8849. )
  8850. else
  8851. AC_CHECK_FILE($LIBREPOSITORY_JAR, [],
  8852. [AC_MSG_ERROR(librepository.jar not found.)], [])
  8853. fi
  8854. if test -z $LIBFONTS_JAR; then
  8855. AC_CHECK_FILE(/usr/share/java/libfonts-1.0.0.jar,
  8856. [ LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar ],
  8857. [
  8858. AC_CHECK_FILE(/usr/share/java/libfonts.jar,
  8859. [ LIBFONTS_JAR=/usr/share/java/libfonts.jar ],
  8860. [AC_MSG_ERROR(libfonts.jar replacement not found.)]
  8861. )
  8862. ]
  8863. )
  8864. else
  8865. AC_CHECK_FILE($LIBFONTS_JAR, [],
  8866. [AC_MSG_ERROR(libfonts.jar not found.)], [])
  8867. fi
  8868. if test -z $LIBSERIALIZER_JAR; then
  8869. AC_CHECK_FILE(/usr/share/java/libserializer-1.0.0.jar,
  8870. [ LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar ],
  8871. [
  8872. AC_CHECK_FILE(/usr/share/java/libserializer.jar,
  8873. [ LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar ],
  8874. [AC_MSG_ERROR(libserializer.jar replacement not found.)]
  8875. )
  8876. ]
  8877. )
  8878. else
  8879. AC_CHECK_FILE($LIBSERIALIZER_JAR, [],
  8880. [AC_MSG_ERROR(libserializer.jar not found.)], [])
  8881. fi
  8882. if test -z $LIBBASE_JAR; then
  8883. AC_CHECK_FILE(/usr/share/java/libbase-1.0.0.jar,
  8884. [ LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar ],
  8885. [
  8886. AC_CHECK_FILE(/usr/share/java/libbase.jar,
  8887. [ LIBBASE_JAR=/usr/share/java/libbase.jar ],
  8888. [AC_MSG_ERROR(libbase.jar replacement not found.)]
  8889. )
  8890. ]
  8891. )
  8892. else
  8893. AC_CHECK_FILE($LIBBASE_JAR, [],
  8894. [AC_MSG_ERROR(libbase.jar not found.)], [])
  8895. fi
  8896. else
  8897. AC_MSG_RESULT([internal])
  8898. SYSTEM_JFREEREPORT=NO
  8899. BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
  8900. fi
  8901. else
  8902. AC_MSG_RESULT([no])
  8903. ENABLE_REPORTBUILDER=NO
  8904. SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_REPORTDESIGN"
  8905. SYSTEM_JFREEREPORT=NO
  8906. fi
  8907. AC_SUBST(ENABLE_REPORTBUILDER)
  8908. AC_SUBST(SYSTEM_JFREEREPORT)
  8909. AC_SUBST(SAC_JAR)
  8910. AC_SUBST(LIBXML_JAR)
  8911. AC_SUBST(FLUTE_JAR)
  8912. AC_SUBST(JFREEREPORT_JAR)
  8913. AC_SUBST(LIBBASE_JAR)
  8914. AC_SUBST(LIBLAYOUT_JAR)
  8915. AC_SUBST(LIBLOADER_JAR)
  8916. AC_SUBST(LIBFORMULA_JAR)
  8917. AC_SUBST(LIBREPOSITORY_JAR)
  8918. AC_SUBST(LIBFONTS_JAR)
  8919. AC_SUBST(LIBSERIALIZER_JAR)
  8920. # this has to be here because both the Wiki Publisher and the SRB use
  8921. # commons-logging
  8922. if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
  8923. AC_MSG_CHECKING([which Apache commons-* libs to use])
  8924. if test "$with_system_apache_commons" = "yes"; then
  8925. SYSTEM_APACHE_COMMONS=YES
  8926. AC_MSG_RESULT([external])
  8927. if test "$ENABLE_MEDIAWIKI" = "YES"; then
  8928. if test -z $COMMONS_CODEC_JAR; then
  8929. AC_CHECK_FILE(/usr/share/java/commons-codec-1.3.jar,
  8930. [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar ],
  8931. [
  8932. AC_CHECK_FILE(/usr/share/java/commons-codec.jar,
  8933. [ COMMONS_CODEC_JAR=/usr/share/java/commons-codec.jar ],
  8934. [AC_MSG_ERROR(commons-codec.jar replacement not found.)]
  8935. )
  8936. ]
  8937. )
  8938. else
  8939. AC_CHECK_FILE($COMMONS_CODEC_JAR, [],
  8940. [AC_MSG_ERROR(commons-codec.jar not found.)], [])
  8941. fi
  8942. if test -z $COMMONS_LANG_JAR; then
  8943. AC_CHECK_FILE(/usr/share/java/commons-lang-2.3.jar,
  8944. [ COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar ],
  8945. [
  8946. AC_CHECK_FILE(/usr/share/java/commons-lang.jar,
  8947. [ COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar ],
  8948. [AC_MSG_ERROR(commons-lang.jar replacement not found.)]
  8949. )
  8950. ]
  8951. )
  8952. else
  8953. AC_CHECK_FILE($COMMONS_LANG_JAR, [],
  8954. [AC_MSG_ERROR(commons-lang.jar not found.)], [])
  8955. fi
  8956. if test -z $COMMONS_HTTPCLIENT_JAR; then
  8957. AC_CHECK_FILE(/usr/share/java/commons-httpclient-3.1.jar,
  8958. [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar ],
  8959. [
  8960. AC_CHECK_FILE(/usr/share/java/commons-httpclient.jar,
  8961. [ COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar ],
  8962. [AC_MSG_ERROR(commons-httpclient.jar replacement not found.)]
  8963. )
  8964. ]
  8965. )
  8966. else
  8967. AC_CHECK_FILE($COMMONS_HTTPCLIENT_JAR, [],
  8968. [AC_MSG_ERROR(commons-httpclient.jar not found.)], [])
  8969. fi
  8970. fi
  8971. if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then
  8972. if test -z $COMMONS_LOGGING_JAR; then
  8973. AC_CHECK_FILE(/usr/share/java/commons-logging-1.1.1.jar,
  8974. [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar ],
  8975. [
  8976. AC_CHECK_FILE(/usr/share/java/commons-logging.jar,
  8977. [ COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar ],
  8978. [AC_MSG_ERROR(commons-logging.jar replacement not found.)]
  8979. )
  8980. ]
  8981. )
  8982. else
  8983. AC_CHECK_FILE($COMMONS_LOGGING_JAR, [],
  8984. [AC_MSG_ERROR(commons-logging.jar not found.)], [])
  8985. fi
  8986. fi
  8987. else
  8988. AC_MSG_RESULT([internal])
  8989. SYSTEM_APACHE_COMMONS=NO
  8990. BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT"
  8991. fi
  8992. fi
  8993. AC_SUBST(SYSTEM_APACHE_COMMONS)
  8994. AC_SUBST(COMMONS_CODEC_JAR)
  8995. AC_SUBST(COMMONS_LANG_JAR)
  8996. AC_SUBST(COMMONS_HTTPCLIENT_JAR)
  8997. AC_SUBST(COMMONS_LOGGING_JAR)
  8998. # scripting provider for BeanShell?
  8999. AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
  9000. if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
  9001. AC_MSG_RESULT([yes])
  9002. ENABLE_SCRIPTING_BEANSHELL=YES
  9003. dnl ===================================================================
  9004. dnl Check for system beanshell
  9005. dnl ===================================================================
  9006. AC_MSG_CHECKING([which beanshell to use])
  9007. if test "$with_system_beanshell" = "yes"; then
  9008. AC_MSG_RESULT([external])
  9009. SYSTEM_BSH=YES
  9010. if test -z $BSH_JAR; then
  9011. BSH_JAR=/usr/share/java/bsh.jar
  9012. fi
  9013. AC_CHECK_FILE($BSH_JAR, [],
  9014. [AC_MSG_ERROR(bsh.jar not found.)], [])
  9015. else
  9016. AC_MSG_RESULT([internal])
  9017. SYSTEM_BSH=NO
  9018. BUILD_TYPE="$BUILD_TYPE BSH"
  9019. fi
  9020. else
  9021. AC_MSG_RESULT([no])
  9022. ENABLE_SCRIPTING_BEANSHELL=NO
  9023. SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
  9024. fi
  9025. AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
  9026. AC_SUBST(SYSTEM_BSH)
  9027. AC_SUBST(BSH_JAR)
  9028. # scripting provider for JavaScript?
  9029. AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
  9030. if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
  9031. AC_MSG_RESULT([yes])
  9032. ENABLE_SCRIPTING_JAVASCRIPT=YES
  9033. dnl ===================================================================
  9034. dnl Check for system rhino
  9035. dnl ===================================================================
  9036. AC_MSG_CHECKING([which rhino to use])
  9037. if test "$with_system_rhino" = "yes"; then
  9038. AC_MSG_RESULT([external])
  9039. SYSTEM_RHINO=YES
  9040. if test -z $RHINO_JAR; then
  9041. RHINO_JAR=/usr/share/java/js.jar
  9042. fi
  9043. AC_CHECK_FILE($RHINO_JAR, [],
  9044. [AC_MSG_ERROR(js.jar not found.)], [])
  9045. else
  9046. AC_MSG_RESULT([internal])
  9047. SYSTEM_RHINO=NO
  9048. BUILD_TYPE="$BUILD_TYPE RHINO"
  9049. fi
  9050. else
  9051. AC_MSG_RESULT([no])
  9052. ENABLE_SCRIPTING_JAVASCRIPT=NO
  9053. SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
  9054. fi
  9055. AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
  9056. AC_SUBST(SYSTEM_RHINO)
  9057. AC_SUBST(RHINO_JAR)
  9058. dnl Scripting provider for Python extension?
  9059. dnl We always provide this unless we have disabled Python completely
  9060. if test $enable_python = no; then
  9061. ENABLE_SCRIPTING_PYTHON=NO
  9062. SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_PYTHON"
  9063. else
  9064. ENABLE_SCRIPTING_PYTHON=YES
  9065. fi
  9066. AC_SUBST(ENABLE_SCRIPTING_PYTHON)
  9067. supports_multilib=
  9068. case "$host_cpu" in
  9069. x86_64 | powerpc64 | s390x)
  9070. if test "$SIZEOF_LONG" = "8"; then
  9071. supports_multilib="yes"
  9072. fi
  9073. ;;
  9074. *)
  9075. ;;
  9076. esac
  9077. dnl ===================================================================
  9078. dnl Check whether the TQt and TDE libraries are available.
  9079. dnl ===================================================================
  9080. TDE_CFLAGS=""
  9081. TDE_LIBS=""
  9082. if test "$_os" != "OpenBSD"; then
  9083. MOC="moc"
  9084. fi
  9085. if test "$test_tde" = "yes" -a "$ENABLE_TDE" = "TRUE"; then
  9086. dnl Search paths for TQt and TDE
  9087. if test -z "$supports_multilib"; then
  9088. tqt_incdirs="$QTINC /usr/local/tqt3/include /usr/include/tqt3 /usr/include /usr/X11R6/include/X11/tqt3 /usr/X11R6/include/tqt3 /usr/lib/tqt3/include /usr/lib/tqt3/include /usr/share/tqt3/include /usr/local/include/X11/tqt3 $x_includes"
  9089. tqt_libdirs="$QTLIB /usr/local/tqt3/lib /usr/lib/tqt3 /usr/lib /usr/X11R6/lib/X11/tqt3 /usr/X11R6/lib/tqt3 /usr/lib/tqt3/lib /usr/lib/tqt3/lib /usr/share/tqt3/lib /usr/local/lib/tqt3 $x_libraries"
  9090. else
  9091. tqt_incdirs="$QTINC /usr/local/tqt3/include /usr/include/tqt3 /usr/include /usr/X11R6/include/X11/tqt3 /usr/X11R6/include/tqt3 /usr/lib64/tqt3/include /usr/lib64/tqt3/include /usr/share/tqt3/include /usr/lib/tqt3/include /usr/lib/tqt3/include /usr/local/include/X11/tqt3 $x_includes"
  9092. tqt_libdirs="$QTLIB /usr/local/tqt3/lib64 /usr/lib64/tqt3 /usr/lib64 /usr/X11R6/lib64/X11/tqt3 /usr/X11R6/lib64/tqt3 /usr/lib64/tqt3/lib64 /usr/lib64/tqt3/lib64 /usr/share/tqt3/lib64 /usr/local/tqt3/lib /usr/lib/tqt3 /usr/lib /usr/X11R6/lib/X11/tqt3 /usr/X11R6/lib/tqt3 /usr/lib/tqt3/lib /usr/lib/tqt3/lib /usr/share/tqt3/lib /usr/local/lib/tqt3 $x_libraries"
  9093. fi
  9094. if test -n "$TQTDIR"; then
  9095. tqt_incdirs="$TQTDIR/include $tqt_incdirs"
  9096. if test -z "$supports_multilib"; then
  9097. tqt_libdirs="$TQTDIR/lib $tqt_libdirs"
  9098. else
  9099. tqt_libdirs="$TQTDIR/lib64 $TQTDIR/lib $tqt_libdirs"
  9100. fi
  9101. fi
  9102. if test -z "$supports_multilib"; then
  9103. tde_incdirs="/usr/lib/trinity/include /usr/local/trinity/include /usr/local/include /usr/trinity/include /usr/include/trinity /opt/trinity/include /opt/trinity/include $x_includes"
  9104. tde_libdirs="/usr/lib/trinity/lib /usr/local/trinity/lib /usr/trinity/lib /usr/lib/trinity /usr/lib/trinity /usr/X11R6/lib /usr/local/lib /opt/trinity/lib /opt/trinity/lib /usr/X11R6/trinity/lib /usr/lib $x_libraries"
  9105. else
  9106. tde_incdirs="/usr/lib64/trinity/include /usr/lib/trinity/include /usr/local/trinity/include /usr/local/include /usr/trinity/include /usr/include/trinity /opt/trinity/include /opt/trinity/include $x_includes"
  9107. tde_libdirs="/usr/lib64/trinity/lib64 /usr/local/trinity/lib64 /usr/trinity/lib64 /usr/lib64/trinity /usr/lib64/trinity /usr/X11R6/lib64 /usr/local/lib64 /opt/trinity/lib64 /opt/trinity/lib64 /usr/X11R6/trinity/lib64 /usr/lib/trinity/lib /usr/local/trinity/lib /usr/trinity/lib /usr/lib/trinity /usr/lib/trinity /usr/lib /usr/X11R6/lib /usr/local/lib /opt/trinity/lib /opt/trinity/lib /usr/X11R6/trinity/lib /usr/lib64 $x_libraries"
  9108. fi
  9109. if test -n "$TDEDIR"; then
  9110. tde_incdirs="$TDEDIR/include $tde_incdirs"
  9111. if test -z "$supports_multilib"; then
  9112. tde_libdirs="$TDEDIR/lib $tde_libdirs"
  9113. else
  9114. tde_libdirs="$TDEDIR/lib64 $TDEDIR/lib $tde_libdirs"
  9115. fi
  9116. fi
  9117. dnl What to test
  9118. tqt_test_include="ntqstyle.h"
  9119. tde_test_include="kapp.h"
  9120. if test "$_os" != "OpenBSD"; then
  9121. tqt_test_library="libtqt-mt.so"
  9122. tde_test_library="libDCOP.so"
  9123. else
  9124. tqt_test_library="libtqt-mt.so*"
  9125. tde_test_library="libDCOP.so*"
  9126. fi
  9127. dnl Check for TQt headers
  9128. AC_MSG_CHECKING([for TQt headers])
  9129. tqt_incdir="no"
  9130. for tde_check in $tqt_incdirs; do
  9131. if test -r "$tde_check/$tqt_test_include"; then
  9132. tqt_incdir="$tde_check"
  9133. break
  9134. fi
  9135. done
  9136. AC_MSG_RESULT([$tqt_incdir])
  9137. if test "x$tqt_incdir" = "xno"; then
  9138. AC_MSG_ERROR([TQt headers not found. Please specify the root of
  9139. your TQt installation by exporting TQTDIR before running "configure".])
  9140. fi
  9141. dnl Check for TQt libraries
  9142. AC_MSG_CHECKING([for TQt libraries])
  9143. tqt_libdir="no"
  9144. for tqt_check in $tqt_libdirs; do
  9145. if test -r "`ls $tqt_check/$tqt_test_library 2>/dev/null | head -1`"; then
  9146. tqt_libdir="$tqt_check"
  9147. break
  9148. fi
  9149. done
  9150. AC_MSG_RESULT([$tqt_libdir])
  9151. if test "x$tqt_libdir" = "xno"; then
  9152. AC_MSG_ERROR([TQt libraries not found. Please specify the root of
  9153. your TQt installation by exporting TQTDIR before running "configure".])
  9154. fi
  9155. dnl Check for Meta Object Compiler
  9156. AC_PATH_PROG( MOC, moc, no, [`dirname $tqt_libdir`/bin:$TQTDIR/bin:$PATH] )
  9157. if test "$MOC" = "no"; then
  9158. AC_MSG_ERROR([TQt Meta Object Compiler not found. Please specify
  9159. the root of your TQt installation by exporting TQTDIR before running "configure".])
  9160. fi
  9161. dnl Check for TDE headers
  9162. AC_MSG_CHECKING([for TDE headers])
  9163. tde_incdir="no"
  9164. for tde_check in $tde_incdirs; do
  9165. if test -r "$tde_check/$tde_test_include"; then
  9166. tde_incdir="$tde_check"
  9167. break
  9168. fi
  9169. done
  9170. AC_MSG_RESULT([$tde_incdir])
  9171. if test "x$tde_incdir" = "xno"; then
  9172. AC_MSG_ERROR([TDE headers not found. Please specify the root of
  9173. your TDE installation by exporting TDEDIR before running "configure".])
  9174. fi
  9175. dnl Check for TDE libraries
  9176. AC_MSG_CHECKING([for TDE libraries])
  9177. tde_libdir="no"
  9178. for tde_check in $tde_libdirs; do
  9179. if test -r "`ls $tde_check/$tde_test_library 2>/dev/null | head -1`"; then
  9180. tde_libdir="$tde_check"
  9181. break
  9182. fi
  9183. done
  9184. AC_MSG_RESULT([$tde_libdir])
  9185. if test "x$tde_libdir" = "xno"; then
  9186. AC_MSG_ERROR([TDE libraries not found. Please specify the root of
  9187. your TDE installation by exporting TDEDIR before running "configure".])
  9188. fi
  9189. dnl Set the variables
  9190. TDE_CFLAGS="-I$tqt_incdir -I$tde_incdir -I/usr/include/tqt -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
  9191. TDE_LIBS="-L$tde_libdir -L$tqt_libdir -lkio -ltdeui -ltdecore -ltqt -ltqt-mt"
  9192. fi
  9193. AC_SUBST(TDE_CFLAGS)
  9194. AC_SUBST(TDE_LIBS)
  9195. AC_SUBST(MOC)
  9196. dnl ===================================================================
  9197. dnl Check whether the Qt3 and KDE3 libraries are available.
  9198. dnl ===================================================================
  9199. KDE_CFLAGS=""
  9200. KDE_LIBS=""
  9201. if test "$_os" != "OpenBSD"; then
  9202. MOC="moc"
  9203. fi
  9204. if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE"; then
  9205. dnl Search paths for Qt3 and KDE3
  9206. if test -z "$supports_multilib"; then
  9207. qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include /usr/local/include/X11/qt3 $x_includes"
  9208. qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
  9209. else
  9210. qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib64/qt3/include /usr/lib64/qt/include /usr/share/qt3/include /usr/lib/qt3/include /usr/lib/qt/include /usr/local/include/X11/qt3 $x_includes"
  9211. qt_libdirs="$QTLIB /usr/local/qt/lib64 /usr/lib64/qt /usr/lib64 /usr/X11R6/lib64/X11/qt /usr/X11R6/lib64/qt /usr/lib64/qt3/lib64 /usr/lib64/qt/lib64 /usr/share/qt3/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib /usr/local/lib/qt3 $x_libraries"
  9212. fi
  9213. if test -n "$QTDIR"; then
  9214. qt_incdirs="$QTDIR/include $qt_incdirs"
  9215. if test -z "$supports_multilib"; then
  9216. qt_libdirs="$QTDIR/lib $qt_libdirs"
  9217. else
  9218. qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
  9219. fi
  9220. fi
  9221. if test -z "$supports_multilib"; then
  9222. kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
  9223. kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib $x_libraries"
  9224. else
  9225. kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
  9226. kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib64 $x_libraries"
  9227. fi
  9228. if test -n "$KDEDIR"; then
  9229. kde_incdirs="$KDEDIR/include $kde_incdirs"
  9230. if test -z "$supports_multilib"; then
  9231. kde_libdirs="$KDEDIR/lib $kde_libdirs"
  9232. else
  9233. kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
  9234. fi
  9235. fi
  9236. dnl What to test
  9237. qt_test_include="qstyle.h"
  9238. kde_test_include="kapp.h"
  9239. if test "$_os" != "OpenBSD"; then
  9240. qt_test_library="libqt-mt.so"
  9241. kde_test_library="libDCOP.so"
  9242. else
  9243. qt_test_library="libqt-mt.so*"
  9244. kde_test_library="libDCOP.so*"
  9245. fi
  9246. dnl Check for Qt3 headers
  9247. AC_MSG_CHECKING([for Qt3 headers])
  9248. qt_incdir="no"
  9249. for kde_check in $qt_incdirs; do
  9250. if test -r "$kde_check/$qt_test_include"; then
  9251. qt_incdir="$kde_check"
  9252. break
  9253. fi
  9254. done
  9255. AC_MSG_RESULT([$qt_incdir])
  9256. if test "x$qt_incdir" = "xno"; then
  9257. AC_MSG_ERROR([Qt3 headers not found. Please specify the root of
  9258. your Qt3 installation by exporting QTDIR before running "configure".])
  9259. fi
  9260. dnl Check for Qt3 libraries
  9261. AC_MSG_CHECKING([for Qt3 libraries])
  9262. qt_libdir="no"
  9263. for qt_check in $qt_libdirs; do
  9264. if test -r "`ls $qt_check/$qt_test_library 2>/dev/null | head -1`"; then
  9265. qt_libdir="$qt_check"
  9266. break
  9267. fi
  9268. done
  9269. AC_MSG_RESULT([$qt_libdir])
  9270. if test "x$qt_libdir" = "xno"; then
  9271. AC_MSG_ERROR([Qt3 libraries not found. Please specify the root of
  9272. your Qt3 installation by exporting QTDIR before running "configure".])
  9273. fi
  9274. dnl Check for Meta Object Compiler
  9275. AC_PATH_PROG( MOC, moc, no, [`dirname $qt_libdir`/bin:$QTDIR/bin:$PATH] )
  9276. if test "$MOC" = "no"; then
  9277. AC_MSG_ERROR([Qt3 Meta Object Compiler not found. Please specify
  9278. the root of your Qt3 installation by exporting QTDIR before running "configure".])
  9279. fi
  9280. dnl Check for KDE3 headers
  9281. AC_MSG_CHECKING([for KDE3 headers])
  9282. kde_incdir="no"
  9283. for kde_check in $kde_incdirs; do
  9284. if test -r "$kde_check/$kde_test_include"; then
  9285. kde_incdir="$kde_check"
  9286. break
  9287. fi
  9288. done
  9289. AC_MSG_RESULT([$kde_incdir])
  9290. if test "x$kde_incdir" = "xno"; then
  9291. AC_MSG_ERROR([KDE3 headers not found. Please specify the root of
  9292. your KDE3 installation by exporting KDEDIR before running "configure".])
  9293. fi
  9294. dnl Check for KDE3 libraries
  9295. AC_MSG_CHECKING([for KDE3 libraries])
  9296. kde_libdir="no"
  9297. for kde_check in $kde_libdirs; do
  9298. if test -r "`ls $kde_check/$kde_test_library 2>/dev/null | head -1`"; then
  9299. kde_libdir="$kde_check"
  9300. break
  9301. fi
  9302. done
  9303. AC_MSG_RESULT([$kde_libdir])
  9304. if test "x$kde_libdir" = "xno"; then
  9305. AC_MSG_ERROR([KDE3 libraries not found. Please specify the root of
  9306. your KDE3 installation by exporting KDEDIR before running "configure".])
  9307. fi
  9308. dnl Set the variables
  9309. KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
  9310. KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
  9311. fi
  9312. AC_SUBST(KDE_CFLAGS)
  9313. AC_SUBST(KDE_LIBS)
  9314. AC_SUBST(MOC)
  9315. dnl ===================================================================
  9316. dnl KDE4 Integration
  9317. dnl ===================================================================
  9318. KDE4_CFLAGS=""
  9319. KDE4_LIBS=""
  9320. QMAKE4="qmake"
  9321. MOC4="moc"
  9322. KDE_GLIB_CFLAGS=""
  9323. KDE_GLIB_LIBS=""
  9324. KDE_HAVE_GLIB=""
  9325. if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
  9326. qt_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
  9327. qt_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
  9328. kde_incdirs="/usr/include /usr/include/kde4 $x_includes"
  9329. kde_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
  9330. if test -n "$supports_multilib"; then
  9331. qt_libdirs="$qt_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
  9332. kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
  9333. fi
  9334. if test -n "$QTDIR"; then
  9335. qt_incdirs="$QTDIR/include $qt_incdirs"
  9336. if test -z "$supports_multilib"; then
  9337. qt_libdirs="$QTDIR/lib $qt_libdirs"
  9338. else
  9339. qt_libdirs="$QTDIR/lib64 $QTDIR/lib $qt_libdirs"
  9340. fi
  9341. fi
  9342. if test -n "$QT4DIR"; then
  9343. qt_incdirs="$QT4DIR/include $qt_incdirs"
  9344. if test -z "$supports_multilib"; then
  9345. qt_libdirs="$QT4DIR/lib $qt_libdirs"
  9346. else
  9347. qt_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt_libdirs"
  9348. fi
  9349. fi
  9350. if test -n "$KDEDIR"; then
  9351. kde_incdirs="$KDEDIR/include $kde_incdirs"
  9352. if test -z "$supports_multilib"; then
  9353. kde_libdirs="$KDEDIR/lib $kde_libdirs"
  9354. else
  9355. kde_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde_libdirs"
  9356. fi
  9357. fi
  9358. if test -n "$KDE4DIR"; then
  9359. kde_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde_incdirs"
  9360. if test -z "$supports_multilib"; then
  9361. kde_libdirs="$KDE4DIR/lib $kde_libdirs"
  9362. else
  9363. kde_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde_libdirs"
  9364. fi
  9365. fi
  9366. qt_test_include="Qt/qobject.h"
  9367. qt_test_library="libQtCore.so"
  9368. kde_test_include="kwindowsystem.h"
  9369. kde_test_library="libsolid.so"
  9370. AC_MSG_CHECKING([for Qt4 headers])
  9371. qt_header_dir="no"
  9372. for inc_dir in $qt_incdirs; do
  9373. if test -r "$inc_dir/$qt_test_include"; then
  9374. qt_header_dir="$inc_dir"
  9375. break
  9376. fi
  9377. done
  9378. AC_MSG_RESULT([$qt_header_dir])
  9379. if test "x$qt_header_dir" = "xno"; then
  9380. AC_MSG_ERROR([Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
  9381. fi
  9382. dnl Check for qmake
  9383. AC_PATH_PROG( QMAKEQT4, qmake-qt4, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
  9384. QMAKE4="$QMAKEQT4"
  9385. if test "$QMAKE4" = "no"; then
  9386. AC_PATH_PROG( QMAKE4, qmake, no, [`dirname $qt_header_dir`/bin:$QT4DIR/bin:$PATH] )
  9387. if test "$QMAKE4" = "no"; then
  9388. AC_MSG_ERROR([Qmake not found. Please specify
  9389. the root of your Qt installation by exporting QT4DIR before running "configure".])
  9390. fi
  9391. fi
  9392. qt_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt_libdirs"
  9393. AC_MSG_CHECKING([for Qt4 libraries])
  9394. qt_lib_dir="no"
  9395. for lib_dir in $qt_libdirs; do
  9396. if test -r "$lib_dir/$qt_test_library"; then
  9397. qt_lib_dir="$lib_dir"
  9398. PKG_CONFIG_PATH="$qt_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
  9399. break
  9400. fi
  9401. done
  9402. AC_MSG_RESULT([$qt_lib_dir])
  9403. if test "x$qt_lib_dir" = "xno"; then
  9404. AC_MSG_ERROR([Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
  9405. fi
  9406. dnl Check for Meta Object Compiler
  9407. AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
  9408. MOC4="$MOCQT4"
  9409. if test "$MOC4" = "no"; then
  9410. AC_PATH_PROG( MOC4, moc, no, [`dirname $qt_lib_dir`/bin:$QT4DIR/bin:$PATH] )
  9411. if test "$MOC4" = "no"; then
  9412. AC_MSG_ERROR([Qt Meta Object Compiler not found. Please specify
  9413. the root of your Qt installation by exporting QT4DIR before running "configure".])
  9414. fi
  9415. fi
  9416. dnl Check for KDE4 headers
  9417. AC_MSG_CHECKING([for KDE4 headers])
  9418. kde_incdir="no"
  9419. for kde_check in $kde_incdirs; do
  9420. if test -r "$kde_check/$kde_test_include"; then
  9421. kde_incdir="$kde_check"
  9422. break
  9423. fi
  9424. done
  9425. AC_MSG_RESULT([$kde_incdir])
  9426. if test "x$kde_incdir" = "xno"; then
  9427. AC_MSG_ERROR([KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
  9428. fi
  9429. dnl Check for KDE4 libraries
  9430. AC_MSG_CHECKING([for KDE4 libraries])
  9431. kde_libdir="no"
  9432. for kde_check in $kde_libdirs; do
  9433. if test -r "$kde_check/$kde_test_library"; then
  9434. kde_libdir="$kde_check"
  9435. break
  9436. fi
  9437. done
  9438. AC_MSG_RESULT([$kde_libdir])
  9439. if test "x$kde_libdir" = "xno"; then
  9440. AC_MSG_ERROR([KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
  9441. fi
  9442. KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
  9443. KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkio -lkfile -lkdeui -lkdecore -lQtCore -lQtGui"
  9444. AC_LANG_PUSH([C++])
  9445. save_CXXFLAGS=$CXXFLAGS
  9446. CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
  9447. AC_MSG_CHECKING([whether KDE is >= 4.2])
  9448. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  9449. #include <kdeversion.h>
  9450. int main(int argc, char **argv) {
  9451. if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
  9452. else return 1;
  9453. }
  9454. ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
  9455. CXXFLAGS=$save_CXXFLAGS
  9456. AC_LANG_POP([C++])
  9457. # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled
  9458. PKG_CHECK_MODULES(KDE_GLIB,[glib-2.0 >= 2.4],
  9459. [KDE_HAVE_GLIB=1],
  9460. AC_MSG_WARN([[No Glib found, KDE4 support will not integrate with Qt's Glib event loop support]]))
  9461. fi
  9462. AC_SUBST(KDE4_CFLAGS)
  9463. AC_SUBST(KDE4_LIBS)
  9464. AC_SUBST(MOC4)
  9465. AC_SUBST(KDE_GLIB_CFLAGS)
  9466. AC_SUBST(KDE_GLIB_LIBS)
  9467. AC_SUBST(KDE_HAVE_GLIB)
  9468. dnl ===================================================================
  9469. dnl Test for the enabling the lockdown pieces
  9470. dnl ===================================================================
  9471. AC_MSG_CHECKING([whether to enable the lockdown pieces])
  9472. ENABLE_LOCKDOWN=""
  9473. if test -n "$enable_lockdown" -a "$enable_lockdown" != "no"; then
  9474. ENABLE_LOCKDOWN=YES
  9475. AC_MSG_RESULT([yes])
  9476. else
  9477. AC_MSG_RESULT([no])
  9478. fi
  9479. AC_SUBST(ENABLE_LOCKDOWN)
  9480. dnl ===================================================================
  9481. dnl Test whether to include Evolution 2 support
  9482. dnl ===================================================================
  9483. AC_MSG_CHECKING([whether to enable evolution 2 support])
  9484. if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
  9485. AC_MSG_RESULT([yes])
  9486. PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
  9487. ENABLE_EVOAB2="TRUE"
  9488. else
  9489. ENABLE_EVOAB2=""
  9490. AC_MSG_RESULT([no])
  9491. fi
  9492. AC_SUBST(ENABLE_EVOAB2)
  9493. AC_SUBST(GOBJECT_CFLAGS)
  9494. AC_SUBST(GOBJECT_LIBS)
  9495. dnl ===================================================================
  9496. dnl Test whether to include TDE AB support
  9497. dnl ===================================================================
  9498. AC_MSG_CHECKING([whether to enable TDE address book support])
  9499. if test "$enable_tdeab" = "yes" -a "$enable_tde" = "yes"; then
  9500. AC_MSG_RESULT([yes])
  9501. AC_LANG_PUSH([C++])
  9502. save_CXXFLAGS=$CXXFLAGS
  9503. CXXFLAGS="$CXXFLAGS $TDE_CFLAGS"
  9504. AC_MSG_CHECKING([whether TDE is at least R14.0])
  9505. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  9506. #include <tdeversion.h>
  9507. int main(int argc, char **argv) {
  9508. if (TDE_VERSION_MAJOR >= 14) return 0;
  9509. else return 1;
  9510. }
  9511. ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([TDE version too old or too recent, please use another version of TDE or disable TDE address book support])],[])
  9512. CXXFLAGS=$save_CXXFLAGS
  9513. AC_LANG_POP([C++])
  9514. ENABLE_TDEAB=TRUE
  9515. else
  9516. AC_MSG_RESULT([no])
  9517. ENABLE_TDEAB=
  9518. fi
  9519. AC_SUBST(ENABLE_TDEAB)
  9520. dnl ===================================================================
  9521. dnl Test whether to include KDE AB support
  9522. dnl ===================================================================
  9523. AC_MSG_CHECKING([whether to enable KDE address book support])
  9524. if test "$enable_kdeab" = "yes" -a "$enable_kde" = "yes"; then
  9525. AC_MSG_RESULT([yes])
  9526. AC_LANG_PUSH([C++])
  9527. save_CXXFLAGS=$CXXFLAGS
  9528. CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
  9529. AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
  9530. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  9531. #include <kdeversion.h>
  9532. int main(int argc, char **argv) {
  9533. if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
  9534. else return 1;
  9535. }
  9536. ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old or too recent, please use another version of KDE or disable KDE address book support])],[])
  9537. CXXFLAGS=$save_CXXFLAGS
  9538. AC_LANG_POP([C++])
  9539. ENABLE_KAB=TRUE
  9540. else
  9541. AC_MSG_RESULT([no])
  9542. ENABLE_KAB=
  9543. fi
  9544. AC_SUBST(ENABLE_KAB)
  9545. dnl ===================================================================
  9546. dnl Test whether to include MathMLDTD
  9547. dnl ===================================================================
  9548. AC_MSG_CHECKING([whether to include MathMLDTD])
  9549. if test -n "$enable_mathmldtd"; then
  9550. if test "$enable_mathmldtd" = "no"; then
  9551. AC_MSG_RESULT([no])
  9552. SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
  9553. else
  9554. AC_MSG_RESULT([yes])
  9555. BUILD_TYPE="$BUILD_TYPE MATHMLDTD"
  9556. fi
  9557. else
  9558. AC_MSG_RESULT([no])
  9559. SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD"
  9560. fi
  9561. dnl ===================================================================
  9562. dnl Test which themes to include
  9563. dnl ===================================================================
  9564. AC_MSG_CHECKING([which themes to include])
  9565. # if none given use default subset of available themes
  9566. if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
  9567. with_theme="crystal default hicontrast oxygen tango"
  9568. test "$ENABLE_RELEASE_BUILD" = "FALSE" && with_theme="$with_theme tango_testing"
  9569. fi
  9570. WITH_THEMES=""
  9571. for theme in $with_theme; do
  9572. case $theme in
  9573. crystal|default|galaxy|hicontrast|human|industrial|oxygen|tango|tango_testing) : ;;
  9574. *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
  9575. esac
  9576. WITH_THEMES="$WITH_THEMES $theme"
  9577. SCPDEFS="$SCPDEFS -DTHEME_`echo $theme|tr '[[:lower:]]' '[[:upper:]]'`"
  9578. done
  9579. AC_MSG_RESULT([$WITH_THEMES])
  9580. AC_SUBST([WITH_THEMES])
  9581. dnl ===================================================================
  9582. dnl Test whether to integrate helppacks into the product's installer
  9583. dnl ===================================================================
  9584. AC_MSG_CHECKING([for helppack integration])
  9585. if test "$with_helppack_integration" = "no"; then
  9586. WITH_HELPPACK_INTEGRATION=NO
  9587. AC_MSG_RESULT([no integration])
  9588. else
  9589. WITH_HELPPACK_INTEGRATION=YES
  9590. SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
  9591. AC_MSG_RESULT([integration])
  9592. fi
  9593. AC_SUBST(WITH_HELPPACK_INTEGRATION)
  9594. dnl ===================================================================
  9595. dnl Test whether to use CoreText framework
  9596. dnl ===================================================================
  9597. ENABLE_CORETEXT=NO
  9598. if test "$_os" = "Darwin"; then
  9599. AC_MSG_CHECKING([whether to use CoreText framework])
  9600. if test "$enable_coretext" = yes -o "$BITNESS_OVERRIDE" = 64; then
  9601. AC_MSG_RESULT([yes])
  9602. ENABLE_CORETEXT=YES
  9603. else
  9604. AC_MSG_RESULT([no])
  9605. fi
  9606. fi
  9607. AC_SUBST(ENABLE_CORETEXT)
  9608. ###############################################################################
  9609. # Extensions checking
  9610. ###############################################################################
  9611. dnl ===================================================================
  9612. dnl Test whether to integrate extensions into the product's installer
  9613. dnl ===================================================================
  9614. AC_MSG_CHECKING([for extensions integration])
  9615. if test "x$enable_extension_integration" != "xno"; then
  9616. WITH_EXTENSION_INTEGRATION=YES
  9617. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
  9618. AC_MSG_RESULT([yes, use integration])
  9619. else
  9620. WITH_EXTENSION_INTEGRATION=NO
  9621. AC_MSG_RESULT([no, do not integrate])
  9622. fi
  9623. AC_SUBST(WITH_EXTENSION_INTEGRATION)
  9624. dnl Should any extra extensions be included?
  9625. dnl There are standalone tests for each of these below.
  9626. WITH_EXTRA_EXTENSIONS=
  9627. AC_SUBST([WITH_EXTRA_EXTENSIONS])
  9628. dnl ===================================================================
  9629. dnl Test whether to include Watch Window extension
  9630. dnl ===================================================================
  9631. AC_MSG_CHECKING([for Watch Window extension integration])
  9632. WATCH_WINDOW_EXTENSION_PACK=
  9633. if test "x$enable_ext_watch_window" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9634. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_WATCH_WINDOW"
  9635. WATCH_WINDOW_EXTENSION_PACK="23bd75552206dfcd8fd4e29137dcac84-WatchWindow_1.2.0.0.oxt"
  9636. WITH_EXTRA_EXTENSIONS=YES
  9637. AC_MSG_RESULT([yes])
  9638. else
  9639. AC_MSG_RESULT([no])
  9640. fi
  9641. AC_SUBST(WATCH_WINDOW_EXTENSION_PACK)
  9642. dnl ===================================================================
  9643. dnl Test whether to include SmART Gallery (Diagram) extension
  9644. dnl ===================================================================
  9645. AC_MSG_CHECKING([for SmART Gallery (Diagram) extension integration])
  9646. DIAGRAM_EXTENSION_PACK=
  9647. if test "x$enable_ext_diagram" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9648. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_DIAGRAM"
  9649. DIAGRAM_EXTENSION_PACK="8d74685d41f8bffe8c3e71fe8deac09d-SmART_0.9.5.oxt"
  9650. WITH_EXTRA_EXTENSIONS=YES
  9651. AC_MSG_RESULT([yes])
  9652. else
  9653. AC_MSG_RESULT([no])
  9654. fi
  9655. AC_SUBST(DIAGRAM_EXTENSION_PACK)
  9656. dnl ===================================================================
  9657. dnl Test whether to include Validator extension
  9658. dnl ===================================================================
  9659. AC_MSG_CHECKING([for Validator extension integration])
  9660. VALIDATOR_EXTENSION_PACK=
  9661. if test "x$enable_ext_validator" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9662. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_VALIDATOR"
  9663. VALIDATOR_EXTENSION_PACK="bbdd5639ada63e3130761daaecae1a10-Validator_1.1.0.0.oxt"
  9664. WITH_EXTRA_EXTENSIONS=YES
  9665. AC_MSG_RESULT([yes])
  9666. else
  9667. AC_MSG_RESULT([no])
  9668. fi
  9669. AC_SUBST(VALIDATOR_EXTENSION_PACK)
  9670. dnl ===================================================================
  9671. dnl Test whether to include Barcode extension
  9672. dnl ===================================================================
  9673. AC_MSG_CHECKING([for Barcode extension integration])
  9674. BARCODE_EXTENSION_PACK=
  9675. if test "x$enable_ext_barcode" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9676. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_BARCODE"
  9677. BARCODE_EXTENSION_PACK="3ed18025a766f1e955707b969c8113a5-Barcode_1.3.5.0.oxt"
  9678. WITH_EXTRA_EXTENSIONS=YES
  9679. AC_MSG_RESULT([yes])
  9680. else
  9681. AC_MSG_RESULT([no])
  9682. fi
  9683. AC_SUBST([BARCODE_EXTENSION_PACK])
  9684. dnl ===================================================================
  9685. dnl Test whether to include ConvertTextToNumber extension
  9686. dnl ===================================================================
  9687. AC_MSG_CHECKING([for ConvertTextToNumber extension integration])
  9688. if test "x$enable_ext_ct2n" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9689. BUILD_TYPE="$BUILD_TYPE CT2N"
  9690. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_CT2N"
  9691. AC_MSG_RESULT([yes])
  9692. else
  9693. AC_MSG_RESULT([no])
  9694. fi
  9695. dnl ===================================================================
  9696. dnl Test whether to include Numbertext extension
  9697. dnl ===================================================================
  9698. AC_MSG_CHECKING([for Numbertext extension integration])
  9699. NUMBERTEXT_EXTENSION_PACK=
  9700. if test "x$enable_ext_numbertext" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9701. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NUMBERTEXT"
  9702. NUMBERTEXT_EXTENSION_PACK="b8cbca7b3363e6ca2d02bc0ba2b63904-numbertext_0.9.4.oxt"
  9703. WITH_EXTRA_EXTENSIONS=YES
  9704. AC_MSG_RESULT([yes])
  9705. else
  9706. AC_MSG_RESULT([no])
  9707. fi
  9708. AC_SUBST(NUMBERTEXT_EXTENSION_PACK)
  9709. dnl ===================================================================
  9710. dnl Test whether to include Hungarian Cross-reference Toolbar extension
  9711. dnl ===================================================================
  9712. AC_MSG_CHECKING([for Hungarian Cross-reference Toolbar extension integration])
  9713. HUNART_EXTENSION_PACK=
  9714. if test "x$enable_ext_hunart" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9715. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_HUNART"
  9716. HUNART_EXTENSION_PACK="b632bdd25649cc4067bcb410bae23d2b-hunart_0.3.oxt"
  9717. WITH_EXTRA_EXTENSIONS=YES
  9718. AC_MSG_RESULT([yes])
  9719. else
  9720. AC_MSG_RESULT([no])
  9721. fi
  9722. AC_SUBST(HUNART_EXTENSION_PACK)
  9723. dnl ===================================================================
  9724. dnl Test whether to include Typography Toolbar extension
  9725. dnl ===================================================================
  9726. AC_MSG_CHECKING([for Typography Toolbar extension integration])
  9727. TYPO_EXTENSION_PACK=
  9728. if test "x$enable_ext_typo" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9729. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_TYPO"
  9730. TYPO_EXTENSION_PACK="9d60b6cfa3ef1926848710bbcd11115b-typo_0.4.2.oxt"
  9731. WITH_EXTRA_EXTENSIONS=YES
  9732. AC_MSG_RESULT([yes])
  9733. else
  9734. AC_MSG_RESULT([no])
  9735. fi
  9736. AC_SUBST(TYPO_EXTENSION_PACK)
  9737. dnl ===================================================================
  9738. dnl Test whether to include Google Docs extension
  9739. dnl ===================================================================
  9740. AC_MSG_CHECKING([for Google Docs extension integration])
  9741. GOOGLE_DOCS_EXTENSION_PACK=
  9742. if test "x$enable_ext_google_docs" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9743. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_GOOGLE_DOCS"
  9744. GOOGLE_DOCS_EXTENSION_PACK="2a64b8e6f185a7f6c19d00fb8bb4cf64-gdocs_3.0.1_modified.oxt"
  9745. WITH_EXTRA_EXTENSIONS=YES
  9746. AC_MSG_RESULT([yes])
  9747. else
  9748. AC_MSG_RESULT([no])
  9749. fi
  9750. AC_SUBST(GOOGLE_DOCS_EXTENSION_PACK)
  9751. dnl ===================================================================
  9752. dnl Test whether to include NLPSolver extension
  9753. dnl ===================================================================
  9754. AC_MSG_CHECKING([for NLPSolver extension integration])
  9755. if test "x$enable_ext_nlpsolver" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
  9756. BUILD_TYPE="$BUILD_TYPE NLPSOLVER"
  9757. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_NLPSOLVER"
  9758. AC_MSG_RESULT([yes])
  9759. else
  9760. AC_MSG_RESULT([no])
  9761. fi
  9762. dnl ===================================================================
  9763. dnl Test whether to include LanguageTool extension
  9764. dnl ===================================================================
  9765. AC_MSG_CHECKING([for LanguageTool extension integration])
  9766. if test "x$enable_ext_languagetool" = "xyes" -a "x$enable_extension_integration" != "xno" -a "x$with_java" != "xno"; then
  9767. BUILD_TYPE="$BUILD_TYPE LANGUAGETOOL"
  9768. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_LANGUAGETOOL"
  9769. AC_MSG_RESULT([yes])
  9770. else
  9771. AC_MSG_RESULT([no])
  9772. fi
  9773. dnl ===================================================================
  9774. dnl Test whether to include oooblogger extension
  9775. dnl ===================================================================
  9776. AC_MSG_CHECKING([for oooblogger extension integration])
  9777. OOOBLOGGER_EXTENSION_PACK=
  9778. if test "x$enable_ext_oooblogger" = "xyes" -a "x$enable_extension_integration" != "xno"; then
  9779. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_OOOBLOGGER"
  9780. OOOBLOGGER_EXTENSION_PACK="b7b2d0e04e142f26dd96119c80757d1f-oooblogger_0.1.oxt"
  9781. WITH_EXTRA_EXTENSIONS=YES
  9782. AC_MSG_RESULT([yes])
  9783. else
  9784. AC_MSG_RESULT([no])
  9785. fi
  9786. AC_SUBST(OOOBLOGGER_EXTENSION_PACK)
  9787. ###############################################################################
  9788. dnl ===================================================================
  9789. dnl Test whether to include Sun Professional Template Pack
  9790. dnl ===================================================================
  9791. AC_MSG_CHECKING([for Sun Professional Template Pack integration (only supported languages displayed)])
  9792. if test "$with_sun_templates" = "" -o "$with_sun_templates" = "no"; then
  9793. AC_MSG_RESULT([no integration])
  9794. else
  9795. SCPDEFS="$SCPDEFS -DWITH_EXTENSION_SUN_TEMPLATE_PACK"
  9796. sun_supported_langs="en-US de it fr es hu"
  9797. if test "$with_sun_templates" = "yes"; then
  9798. wanted_sun_templates="$sun_supported_langs"
  9799. else
  9800. # check whether the langs are supported by Sun
  9801. wanted_sun_templates=
  9802. for lang in $with_sun_templates; do
  9803. if test -n "`echo $sun_supported_langs | grep "$lang"`"; then
  9804. wanted_sun_templates="$wanted_sun_templates $lang"
  9805. fi
  9806. done
  9807. fi
  9808. SUNTEMPLATES_LANG=
  9809. SUNTEMPLATES_DE_PACK=
  9810. SUNTEMPLATES_EN_US_PACK=
  9811. SUNTEMPLATES_ES_PACK=
  9812. SUNTEMPLATES_FR_PACK=
  9813. SUNTEMPLATES_HU_PACK=
  9814. SUNTEMPLATES_IT_PACK=
  9815. # check whether the langs are requested at all
  9816. for lang in $wanted_sun_templates; do
  9817. if test "$with_lang" = "ALL" -o -n "`echo $with_lang | grep "$lang"`"; then
  9818. SUNTEMPLATES_LANG="$SUNTEMPLATES_LANG $lang"
  9819. case $lang in
  9820. "de") SUNTEMPLATES_DE_PACK="53ca5e56ccd4cab3693ad32c6bd13343-Sun-ODF-Template-Pack-de_1.0.0.oxt";;
  9821. "en-US") SUNTEMPLATES_EN_US_PACK="472ffb92d82cf502be039203c606643d-Sun-ODF-Template-Pack-en-US_1.0.0.oxt";;
  9822. "es") SUNTEMPLATES_ES_PACK="4ad003e7bbda5715f5f38fde1f707af2-Sun-ODF-Template-Pack-es_1.0.0.oxt";;
  9823. "fr") SUNTEMPLATES_FR_PACK="a53080dc876edcddb26eb4c3c7537469-Sun-ODF-Template-Pack-fr_1.0.0.oxt";;
  9824. "hu") SUNTEMPLATES_HU_PACK="09ec2dac030e1dcd5ef7fa1692691dc0-Sun-ODF-Template-Pack-hu_1.0.0.oxt";;
  9825. "it") SUNTEMPLATES_IT_PACK="b33775feda3bcf823cad7ac361fd49a6-Sun-ODF-Template-Pack-it_1.0.0.oxt";;
  9826. esac
  9827. fi
  9828. done
  9829. WITH_EXTRA_EXTENSIONS=YES
  9830. AC_MSG_RESULT([$SUNTEMPLATES_LANG])
  9831. fi
  9832. AC_SUBST(SUNTEMPLATES_DE_PACK)
  9833. AC_SUBST(SUNTEMPLATES_EN_US_PACK)
  9834. AC_SUBST(SUNTEMPLATES_ES_PACK)
  9835. AC_SUBST(SUNTEMPLATES_FR_PACK)
  9836. AC_SUBST(SUNTEMPLATES_HU_PACK)
  9837. AC_SUBST(SUNTEMPLATES_IT_PACK)
  9838. dnl ===================================================================
  9839. dnl Test whether to include fonts
  9840. dnl ===================================================================
  9841. AC_MSG_CHECKING([whether to include third-party fonts])
  9842. if test "$with_fonts" != "no"; then
  9843. AC_MSG_RESULT([yes])
  9844. WITH_FONTS=YES
  9845. BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
  9846. else
  9847. AC_MSG_RESULT([no])
  9848. WITH_FONTS=NO
  9849. SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
  9850. fi
  9851. AC_SUBST(WITH_FONTS)
  9852. # The agfa monotype fonts options seems broken
  9853. # there is no assocaited entry in Makefile.fetch
  9854. # so we do not fetch the dependencies
  9855. # there is no tie-up with MORE_FONTS, but in dmake mode
  9856. # without more_fonts that option is meaningless
  9857. # so I suspect it is not really used anymore, commenting out for now
  9858. #AC_MSG_CHECKING([whether to include Agfa Monotype fonts])
  9859. #if test "$with_agfa_monotype_fonts" = "yes"; then
  9860. # AC_MSG_RESULT([yes])
  9861. # WITH_AGFA_MONOTYPE_FONTS=YES
  9862. # SCPDEFS="$SCPDEFS -DWITH_AGFA_MONOTYPE_FONTS"
  9863. # BUILD_TYPE="$BUILD_TYPE AGFA_MONOTYPE_FONTS"
  9864. #else
  9865. # AC_MSG_RESULT([no])
  9866. # WITH_AGFA_MONOTYPE_FONTS=NO
  9867. #fi
  9868. #AC_SUBST(WITH_AGFA_MONOTYPE_FONTS)
  9869. dnl ===================================================================
  9870. dnl Test whether to include ppds
  9871. dnl ===================================================================
  9872. AC_MSG_CHECKING([whether to include PPDs])
  9873. if test "$with_ppds" != "no"; then
  9874. AC_MSG_RESULT([yes])
  9875. else
  9876. AC_MSG_RESULT([no])
  9877. WITHOUT_PPDS=YES
  9878. SCPDEFS="$SCPDEFS -DWITHOUT_PPDS"
  9879. fi
  9880. AC_SUBST(WITHOUT_PPDS)
  9881. dnl ===================================================================
  9882. dnl Test whether to include afms
  9883. dnl ===================================================================
  9884. AC_MSG_CHECKING([whether to include AFMs])
  9885. if test "$with_afms" != "no"; then
  9886. AC_MSG_RESULT([yes])
  9887. BUILD_TYPE="$BUILD_TYPE AFMS"
  9888. else
  9889. AC_MSG_RESULT([no])
  9890. WITHOUT_AFMS=YES
  9891. SCPDEFS="$SCPDEFS -DWITHOUT_AFMS"
  9892. fi
  9893. AC_SUBST(WITHOUT_AFMS)
  9894. dnl ===================================================================
  9895. dnl Test whether to include extra galleries
  9896. dnl ===================================================================
  9897. AC_MSG_CHECKING([whether to include extra galleries])
  9898. if test "$enable_extra_gallery" = "" -o "$enable_extra_gallery" = "no"; then
  9899. AC_MSG_RESULT([no])
  9900. WITH_EXTRA_GALLERY=NO
  9901. OOOP_GALLERY_PACK=""
  9902. else
  9903. AC_MSG_RESULT([yes])
  9904. WITH_EXTRA_GALLERY=YES
  9905. BUILD_TYPE="$BUILD_TYPE EXTRA_GALLERY"
  9906. SCPDEFS="$SCPDEFS -DWITH_EXTRA_GALLERY"
  9907. OOOP_GALLERY_PACK="af9314c5972d95a5d6da23ffad818f68-OOOP-gallery-pack-2.8.0.0.zip"
  9908. fi
  9909. AC_SUBST(WITH_EXTRA_GALLERY)
  9910. AC_SUBST(OOOP_GALLERY_PACK)
  9911. dnl ===================================================================
  9912. dnl Test whether to include extra templates
  9913. dnl ===================================================================
  9914. AC_MSG_CHECKING([whether to include extra templates])
  9915. if test "$enable_extra_template" = "" -o "$enable_extra_template" = "no"; then
  9916. AC_MSG_RESULT([no])
  9917. WITH_EXTRA_TEMPLATE=NO
  9918. OOOP_TEMPLATES_PACK=""
  9919. else
  9920. AC_MSG_RESULT([yes])
  9921. WITH_EXTRA_TEMPLATE=YES
  9922. BUILD_TYPE="$BUILD_TYPE EXTRA_TEMPLATE"
  9923. SCPDEFS="$SCPDEFS -DWITH_EXTRA_TEMPLATE"
  9924. OOOP_TEMPLATES_PACK="1be202fbbbc13f10592a98f70a4a87fb-OOOP-templates-pack-2.9.0.0.zip"
  9925. fi
  9926. AC_SUBST(WITH_EXTRA_TEMPLATE)
  9927. AC_SUBST(OOOP_TEMPLATES_PACK)
  9928. dnl ===================================================================
  9929. dnl Test whether to include extra samples
  9930. dnl ===================================================================
  9931. AC_MSG_CHECKING([whether to include extra samples])
  9932. if test "$enable_extra_sample" = "" -o "$enable_extra_sample" = "no"; then
  9933. AC_MSG_RESULT([no])
  9934. WITH_EXTRA_SAMPLE=NO
  9935. OOOP_SAMPLES_PACK=""
  9936. else
  9937. AC_MSG_RESULT([yes])
  9938. WITH_EXTRA_SAMPLE=YES
  9939. BUILD_TYPE="$BUILD_TYPE EXTRA_SAMPLE"
  9940. SCPDEFS="$SCPDEFS -DWITH_EXTRA_SAMPLE"
  9941. OOOP_SAMPLES_PACK="a6bccacf44914969e6e7b2f8faf4132c-OOOP-samples-pack-2.7.0.0.zip"
  9942. fi
  9943. AC_SUBST(WITH_EXTRA_SAMPLE)
  9944. AC_SUBST(OOOP_SAMPLES_PACK)
  9945. dnl ===================================================================
  9946. dnl Test whether to include extra fonts
  9947. dnl ===================================================================
  9948. AC_MSG_CHECKING([whether to include extra fonts])
  9949. if test "$enable_extra_font" = "" -o "$enable_extra_font" = "no"; then
  9950. AC_MSG_RESULT([no])
  9951. WITH_EXTRA_FONT=NO
  9952. OOOP_FONTS_PACK=""
  9953. else
  9954. AC_MSG_RESULT([yes])
  9955. WITH_EXTRA_FONT=YES
  9956. BUILD_TYPE="$BUILD_TYPE EXTRA_FONT"
  9957. SCPDEFS="$SCPDEFS -DWITH_EXTRA_FONT"
  9958. OOOP_FONTS_PACK="a10aa597411643326e27d7fc128af12d-OOOP-fonts-pack-2.9.0.0.zip"
  9959. fi
  9960. AC_SUBST(WITH_EXTRA_FONT)
  9961. AC_SUBST(OOOP_FONTS_PACK)
  9962. dnl ===================================================================
  9963. dnl Test whether to enable online update service
  9964. dnl ===================================================================
  9965. AC_MSG_CHECKING([whether to enable online update])
  9966. ENABLE_ONLINE_UPDATE=
  9967. if test "$enable_online_update" = ""; then
  9968. if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
  9969. AC_MSG_RESULT([yes])
  9970. ENABLE_ONLINE_UPDATE="TRUE"
  9971. else
  9972. AC_MSG_RESULT([no])
  9973. fi
  9974. else
  9975. if test "$enable_online_update" = "yes"; then
  9976. AC_MSG_RESULT([yes])
  9977. ENABLE_ONLINE_UPDATE="TRUE"
  9978. else
  9979. AC_MSG_RESULT([no])
  9980. fi
  9981. fi
  9982. AC_SUBST(ENABLE_ONLINE_UPDATE)
  9983. dnl ===================================================================
  9984. dnl Test whether to create MSI with LIMITUI=1 (silent install)
  9985. dnl ===================================================================
  9986. AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
  9987. if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
  9988. AC_MSG_RESULT([no])
  9989. ENABLE_SILENT_MSI="FALSE"
  9990. else
  9991. AC_MSG_RESULT([yes])
  9992. ENABLE_SILENT_MSI="TRUE"
  9993. SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
  9994. fi
  9995. AC_SUBST(ENABLE_SILENT_MSI)
  9996. AC_MSG_CHECKING([whether and how to use Xinerama])
  9997. if test "$_os" = "Darwin"; then
  9998. USE_XINERAMA=YES
  9999. XINERAMA_LINK=dynamic
  10000. AC_MSG_RESULT([yes])
  10001. elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
  10002. if test "$x_libraries" = "default_x_libraries"; then
  10003. XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
  10004. if test "x$XINERAMALIB" = x; then
  10005. XINERAMALIB="/usr/lib"
  10006. fi
  10007. else
  10008. XINERAMALIB="$x_libraries"
  10009. fi
  10010. if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
  10011. # we have both versions, let the user decide but use the dynamic one
  10012. # per default
  10013. USE_XINERAMA=YES
  10014. if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
  10015. XINERAMA_LINK=dynamic
  10016. else
  10017. XINERAMA_LINK=static
  10018. fi
  10019. elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
  10020. # we have only the dynamic version
  10021. USE_XINERAMA=YES
  10022. XINERAMA_LINK=dynamic
  10023. elif test -e "$XINERAMALIB/libXinerama.a"; then
  10024. # static version
  10025. if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
  10026. USE_XINERAMA=YES
  10027. XINERAMA_LINK=static
  10028. else
  10029. USE_XINERAMA=NO
  10030. XINERAMA_LINK=none
  10031. fi
  10032. else
  10033. # no Xinerama
  10034. USE_XINERAMA=NO
  10035. XINERAMA_LINK=none
  10036. fi
  10037. if test "$USE_XINERAMA" = "YES"; then
  10038. AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
  10039. AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
  10040. [AC_MSG_ERROR(Xinerama header not found.)], [])
  10041. XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
  10042. if test "x$XEXTLIB" = x; then
  10043. XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
  10044. fi
  10045. XINERAMA_EXTRA_LIBS="$XEXTLIBS"
  10046. if test "$_os" = "FreeBSD"; then
  10047. XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
  10048. fi
  10049. if test "$_os" = "Linux"; then
  10050. XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
  10051. fi
  10052. AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
  10053. [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
  10054. else
  10055. AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
  10056. fi
  10057. else
  10058. USE_XINERAMA=NO
  10059. XINERAMA_LINK=none
  10060. AC_MSG_RESULT([no])
  10061. fi
  10062. AC_SUBST(USE_XINERAMA)
  10063. AC_SUBST(XINERAMA_LINK)
  10064. dnl ===================================================================
  10065. dnl Test whether to build cairo or rely on the system version
  10066. dnl ===================================================================
  10067. if test "$GUIBASE" = "unx"; then
  10068. # Used in vcl/Library_vclplug_gen.mk
  10069. test_cairo=yes
  10070. fi
  10071. if test "$test_cairo" = "yes"; then
  10072. AC_MSG_CHECKING([whether to use the system cairo])
  10073. if test "$with_system_cairo" = "yes"; then
  10074. SYSTEM_CAIRO=YES
  10075. AC_MSG_RESULT([yes])
  10076. PKG_CHECK_MODULES( CAIRO, cairo >= 1.0.2 )
  10077. if test "$test_xrender" = "yes"; then
  10078. if test "$with_system_xextensions_headers" != "no"; then
  10079. AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
  10080. AC_LANG_PUSH([C])
  10081. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
  10082. #ifdef PictStandardA8
  10083. #else
  10084. return fail;
  10085. #endif
  10086. ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
  10087. AC_LANG_POP([C])
  10088. fi
  10089. fi
  10090. libo_MINGW_CHECK_DLL([CAIRO], [libcairo])
  10091. libo_MINGW_TRY_DLL([FONTCONFIG], [libfontconfig])
  10092. libo_MINGW_TRY_DLL([FREETYPE], [libfreetype])
  10093. libo_MINGW_TRY_DLL([PIXMAN], [libpixman])
  10094. libo_MINGW_TRY_DLL([PNG15], [libpng15])
  10095. else
  10096. SYSTEM_CAIRO=NO
  10097. AC_MSG_RESULT([no])
  10098. BUILD_TYPE="$BUILD_TYPE CAIRO"
  10099. SCPDEFS="$SCPDEFS -DNEED_CAIRO"
  10100. fi
  10101. fi
  10102. AC_SUBST(SYSTEM_CAIRO)
  10103. AC_SUBST(CAIRO_CFLAGS)
  10104. AC_SUBST(CAIRO_LIBS)
  10105. AC_SUBST([MINGW_CAIRO_DLL])
  10106. AC_SUBST([MINGW_FONTCONFIG_DLL])
  10107. AC_SUBST([MINGW_FREETYPE_DLL])
  10108. AC_SUBST([MINGW_PIXMAN_DLL])
  10109. AC_SUBST([MINGW_PNG15_DLL])
  10110. dnl ===================================================================
  10111. dnl Test whether to use liblangtag
  10112. dnl ===================================================================
  10113. ENABLE_LIBLANGTAG=
  10114. SYSTEM_LIBLANGTAG=
  10115. AC_MSG_CHECKING([whether to use liblangtag])
  10116. if test "$enable_liblangtag" = "yes" -o \( "$enable_liblangtag" = "" -a $_os != Android -a $_os != iOS \); then
  10117. ENABLE_LIBLANGTAG=YES
  10118. AC_MSG_RESULT([yes])
  10119. AC_MSG_CHECKING([whether to use system liblangtag])
  10120. if test "$with_system_liblangtag" = yes; then
  10121. SYSTEM_LIBLANGTAG=YES
  10122. AC_MSG_RESULT([yes])
  10123. PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
  10124. libo_MINGW_CHECK_DLL([LIBLANGTAG], [liblangtag])
  10125. else
  10126. SYSTEM_LIBLANGTAG=NO
  10127. AC_MSG_RESULT([no])
  10128. BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
  10129. fi
  10130. else
  10131. ENABLE_LIBLANGTAG=NO
  10132. AC_MSG_RESULT([no])
  10133. fi
  10134. AC_SUBST(ENABLE_LIBLANGTAG)
  10135. AC_SUBST(SYSTEM_LIBLANGTAG)
  10136. AC_SUBST(LIBLANGTAG_CFLAGS)
  10137. AC_SUBST(LIBLANGTAG_LIBS)
  10138. AC_SUBST([MINGW_LIBLANGTAG_DLL])
  10139. dnl ===================================================================
  10140. dnl Test whether to build libpng or rely on the system version
  10141. dnl ===================================================================
  10142. AC_MSG_CHECKING([whether to use the system libpng])
  10143. dnl How should and does this interact with the checks for libpng
  10144. dnl related to use of libpng in the quickstarter above? This needs to
  10145. dnl be unified.
  10146. if test "$with_system_libpng" = "auto"; then
  10147. case "$_os" in
  10148. WINNT|Darwin|iOS|Android)
  10149. with_system_libpng="$with_system_libs"
  10150. ;;
  10151. *)
  10152. with_system_libpng=yes
  10153. ;;
  10154. esac
  10155. fi
  10156. if test "$with_system_libpng" = yes; then
  10157. SYSTEM_LIBPNG=YES
  10158. AC_MSG_RESULT([yes])
  10159. else
  10160. SYSTEM_LIBPNG=NO
  10161. BUILD_TYPE="$BUILD_TYPE LIBPNG"
  10162. AC_MSG_RESULT([no])
  10163. fi
  10164. AC_SUBST(SYSTEM_LIBPNG)
  10165. dnl ===================================================================
  10166. dnl Check for runtime JVM search path
  10167. dnl ===================================================================
  10168. if test "$SOLAR_JAVA" != ""; then
  10169. AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
  10170. if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
  10171. AC_MSG_RESULT([yes])
  10172. if ! test -d "$with_jvm_path"; then
  10173. AC_MSG_ERROR(["$with_jvm_path" not a directory])
  10174. fi
  10175. if ! test -d "$with_jvm_path"jvm; then
  10176. AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
  10177. fi
  10178. JVM_ONE_PATH_CHECK="$with_jvm_path"
  10179. AC_SUBST(JVM_ONE_PATH_CHECK)
  10180. else
  10181. AC_MSG_RESULT([no])
  10182. fi
  10183. fi
  10184. dnl ===================================================================
  10185. dnl Test for the presence of Ant and that it works
  10186. dnl ===================================================================
  10187. if test "$SOLAR_JAVA" != ""; then
  10188. ANT_HOME=; export ANT_HOME
  10189. WITH_ANT_HOME=; export WITH_ANT_HOME
  10190. if test -z "$with_ant_home"; then
  10191. AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
  10192. else
  10193. if test "$_os" = "WINNT"; then
  10194. with_ant_home=`cygpath -u "$with_ant_home"`
  10195. fi
  10196. AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
  10197. WITH_ANT_HOME=$with_ant_home
  10198. ANT_HOME=$with_ant_home
  10199. fi
  10200. if test -z "$ANT"; then
  10201. AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
  10202. else
  10203. # resolve relative or absolute symlink
  10204. while test -h "$ANT"; do
  10205. a_cwd=`pwd`
  10206. a_basename=`basename "$ANT"`
  10207. a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
  10208. cd "`dirname "$ANT"`"
  10209. cd "`dirname "$a_script"`"
  10210. ANT="`pwd`"/"`basename "$a_script"`"
  10211. cd "$a_cwd"
  10212. done
  10213. AC_MSG_CHECKING([if $ANT works])
  10214. cat > conftest.java << EOF
  10215. public class conftest {
  10216. int testmethod(int a, int b) {
  10217. return a + b;
  10218. }
  10219. }
  10220. EOF
  10221. cat > conftest.xml << EOF
  10222. <project name="conftest" default="conftest">
  10223. <target name="conftest">
  10224. <javac srcdir="." includes="conftest.java">
  10225. </javac>
  10226. </target>
  10227. </project>
  10228. EOF
  10229. oldJAVA_HOME=$JAVA_HOME
  10230. if test "$JAVACISGCJ" = "yes"; then
  10231. JAVA_HOME=; export JAVA_HOME
  10232. ant_gcj="-Dbuild.compiler=gcj"
  10233. fi
  10234. AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
  10235. if test $? = 0 -a -f ./conftest.class; then
  10236. AC_MSG_RESULT([Ant works])
  10237. if test -z "$WITH_ANT_HOME"; then
  10238. ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
  10239. if test -z "$ANT_HOME"; then
  10240. ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
  10241. fi
  10242. else
  10243. ANT_HOME="$WITH_ANT_HOME"
  10244. fi
  10245. else
  10246. echo "configure: Ant test failed" >&5
  10247. cat conftest.java >&5
  10248. cat conftest.xml >&5
  10249. AC_MSG_WARN([Ant does not work - Some Java projects will not build!])
  10250. ANT_HOME=""
  10251. add_warning "Ant does not work - Some Java projects will not build!"
  10252. fi
  10253. JAVA_HOME=$oldJAVA_HOME
  10254. rm -f conftest* core core.* *.core
  10255. fi
  10256. if test -z "$ANT_HOME"; then
  10257. ANT_HOME="NO_ANT_HOME"
  10258. else
  10259. PathFormat "$ANT_HOME"
  10260. ANT_HOME="$formatted_path"
  10261. PathFormat "$ANT"
  10262. ANT="$ANT"
  10263. fi
  10264. AC_SUBST(ANT_HOME)
  10265. AC_SUBST(ANT)
  10266. dnl Checking for ant.jar
  10267. if test "$ANT_HOME" != "NO_ANT_HOME"; then
  10268. AC_MSG_CHECKING([Ant lib directory])
  10269. if test -f $ANT_HOME/lib/ant.jar; then
  10270. ANT_LIB="$ANT_HOME/lib"
  10271. else
  10272. if test -f $ANT_HOME/ant.jar; then
  10273. ANT_LIB="$ANT_HOME"
  10274. else
  10275. if test -f /usr/share/java/ant.jar; then
  10276. ANT_LIB=/usr/share/java
  10277. else
  10278. if test -f /usr/share/ant-core/lib/ant.jar; then
  10279. ANT_LIB=/usr/share/ant-core/lib
  10280. else
  10281. if test -f $ANT_HOME/lib/ant/ant.jar; then
  10282. ANT_LIB="$ANT_HOME/lib/ant"
  10283. else
  10284. if test -f /usr/share/lib/ant/ant.jar; then
  10285. ANT_LIB=/usr/share/lib/ant
  10286. else
  10287. AC_MSG_ERROR([Ant libraries not found!])
  10288. fi
  10289. fi
  10290. fi
  10291. fi
  10292. fi
  10293. fi
  10294. PathFormat "$ANT_LIB"
  10295. ANT_LIB="$formatted_path"
  10296. AC_MSG_RESULT([Ant lib directory found.])
  10297. fi
  10298. AC_SUBST(ANT_LIB)
  10299. ant_minver=1.6.0
  10300. ant_minminor1=`echo $ant_minver | cut -d"." -f2`
  10301. AC_MSG_CHECKING([whether Ant is >= $ant_minver])
  10302. ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
  10303. ant_version_major=`echo $ant_version | cut -d. -f1`
  10304. ant_version_minor=`echo $ant_version | cut -d. -f2`
  10305. echo "configure: ant_version $ant_version " >&5
  10306. echo "configure: ant_version_major $ant_version_major " >&5
  10307. echo "configure: ant_version_minor $ant_version_minor " >&5
  10308. if test "$ant_version_major" -ge "2"; then
  10309. AC_MSG_RESULT([yes, $ant_version])
  10310. elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
  10311. AC_MSG_RESULT([yes, $ant_version])
  10312. else
  10313. AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
  10314. fi
  10315. if test "$ENABLE_MEDIAWIKI" = "YES"; then
  10316. AC_MSG_CHECKING([whether Ant supports mapper type="regexp"])
  10317. rm -rf confdir
  10318. mkdir confdir
  10319. cat > conftest.java << EOF
  10320. public class conftest {
  10321. int testmethod(int a, int b) {
  10322. return a + b;
  10323. }
  10324. }
  10325. EOF
  10326. cat > conftest.xml << EOF
  10327. <project name="conftest" default="conftest">
  10328. <target name="conftest" depends="copytest">
  10329. <javac srcdir="." includes="conftest.java">
  10330. </javac>
  10331. </target>
  10332. <target name="copytest">
  10333. <copy todir="confdir">
  10334. <fileset dir="confdir" includes="**/*.abc" casesensitive="yes"/>
  10335. <filterset/>
  10336. <mapper type="regexp" from="^(.*[/\\])foo([/\\].*)" to="\1baa\2"/>
  10337. </copy>
  10338. </target>
  10339. </project>
  10340. EOF
  10341. if test "$JAVACISGCJ" = "yes"; then
  10342. JAVA_HOME=; export JAVA_HOME
  10343. ant_gcj="-Dbuild.compiler=gcj"
  10344. fi
  10345. AC_TRY_COMMAND("$ANT" $ant_gcj -buildfile conftest.xml 1>&2)
  10346. if test $? = 0 -a -f ./conftest.class; then
  10347. AC_MSG_RESULT([yes])
  10348. rm -rf confdir
  10349. else
  10350. echo "configure: Ant test failed" >&5
  10351. cat conftest.java >&5
  10352. cat conftest.xml >&5
  10353. rm -rf confdir
  10354. AC_MSG_ERROR([no. Did you install ant-apache-regexp?])
  10355. fi
  10356. fi
  10357. rm -f conftest* core core.* *.core
  10358. fi
  10359. OOO_JUNIT_JAR=
  10360. if test "$SOLAR_JAVA" != "" -a "$with_junit" != "no"; then
  10361. AC_MSG_CHECKING([for JUnit 4])
  10362. if test "$with_junit" = "yes"; then
  10363. if test -e /usr/share/java/junit4.jar; then
  10364. OOO_JUNIT_JAR=/usr/share/java/junit4.jar
  10365. else
  10366. if test -e /usr/share/lib/java/junit.jar; then
  10367. OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
  10368. else
  10369. OOO_JUNIT_JAR=/usr/share/java/junit.jar
  10370. fi
  10371. fi
  10372. else
  10373. OOO_JUNIT_JAR=$with_junit
  10374. fi
  10375. if test "$_os" = "WINNT"; then
  10376. OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
  10377. fi
  10378. "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" 2>&5 | \
  10379. grep org/junit/Before.class > /dev/null 2>&5
  10380. if test $? -eq 0; then
  10381. # check if either class-path entry is available for hamcrest or
  10382. # it's bundled
  10383. if "$JAVA_HOME/bin/jar" tf "$OOO_JUNIT_JAR" |$GREP -q hamcrest || \
  10384. "$UNZIP" -c "$OOO_JUNIT_JAR" META-INF/MANIFEST.MF |$GREP 'Class-Path:' | $GREP -q 'hamcrest'; then
  10385. AC_MSG_RESULT([$OOO_JUNIT_JAR])
  10386. else
  10387. AC_MSG_ERROR([your junit jar neither sets a classpath nor includes hamcrest; please
  10388. provide a full junit jar or use --without-junit])
  10389. fi
  10390. else
  10391. AC_MSG_RESULT([no])
  10392. AC_MSG_ERROR([cannot find JUnit 4 jar; please install one in the default
  10393. location (/usr/share/java), specify its pathname via
  10394. --with-junit=..., or disable it via --without-junit])
  10395. fi
  10396. if test $OOO_JUNIT_JAR != ""; then
  10397. BUILD_TYPE="$BUILD_TYPE QADEVOOO"
  10398. fi
  10399. fi
  10400. AC_SUBST(OOO_JUNIT_JAR)
  10401. if test "$enable_odk" = no; then
  10402. unset DOXYGEN
  10403. else
  10404. if test "$with_doxygen" = no; then
  10405. AC_MSG_CHECKING([for doxygen])
  10406. unset DOXYGEN
  10407. AC_MSG_RESULT([no])
  10408. else
  10409. if test "$with_doxygen" = yes; then
  10410. AC_PATH_PROG([DOXYGEN], [doxygen])
  10411. if test -z "$DOXYGEN"; then
  10412. AC_MSG_RESULT([no])
  10413. AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
  10414. fi
  10415. else
  10416. AC_MSG_CHECKING([for doxygen])
  10417. DOXYGEN=$with_doxygen
  10418. AC_MSG_RESULT([$DOXYGEN])
  10419. fi
  10420. fi
  10421. fi
  10422. AC_SUBST([DOXYGEN])
  10423. AC_SUBST(SCPDEFS)
  10424. #
  10425. # check for wget and md5sum
  10426. #
  10427. WGET=
  10428. MD5SUM=
  10429. CURL=`which curl 2>/dev/null`
  10430. for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
  10431. eval "$i --version" > /dev/null 2>&1
  10432. ret=$?
  10433. if test $ret -eq 0; then
  10434. WGET=$i
  10435. break
  10436. fi
  10437. done
  10438. if test -z "$WGET" -a -z "$CURL"; then
  10439. AC_MSG_ERROR([neither wget nor curl found!])
  10440. fi
  10441. for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
  10442. if test "$i" = "md5"; then
  10443. eval "$i -x" > /dev/null 2>&1
  10444. else
  10445. eval "$i --version" > /dev/null 2>&1
  10446. fi
  10447. ret=$?
  10448. if test $ret -eq 0; then
  10449. MD5SUM=$i
  10450. break
  10451. fi
  10452. done
  10453. if test "$MD5SUM" = "md5"; then
  10454. if md5 -r < /dev/null > /dev/null 2>/dev/null; then
  10455. MD5SUM="$MD5SUM -r"
  10456. elif md5 -n < /dev/null > /dev/null 2>/dev/null; then
  10457. MD5SUM="$MD5SUM -n"
  10458. fi
  10459. fi
  10460. if test -z "$MD5SUM"; then
  10461. AC_MSG_WARN([no md5sum: found!])
  10462. add_warning "no md5sum: found!"
  10463. fi
  10464. AC_SUBST(WGET)
  10465. AC_SUBST(CURL)
  10466. AC_SUBST(MD5SUM)
  10467. dnl ===================================================================
  10468. dnl Product version
  10469. dnl ===================================================================
  10470. AC_MSG_CHECKING([for product version])
  10471. PRODUCTVERSION=AC_PACKAGE_VERSION
  10472. AC_MSG_RESULT([$PRODUCTVERSION])
  10473. AC_SUBST(PRODUCTVERSION)
  10474. dnl ===================================================================
  10475. dnl Dealing with l10n options
  10476. dnl ===================================================================
  10477. AC_MSG_CHECKING([which languages to be built])
  10478. # get list of all languages
  10479. # generate shell variable from completelangiso= from solenv/inc/langlist.mk
  10480. # the sed command does the following:
  10481. # + if a line ends with a backslash, append the next line to it
  10482. # + adds " on the beginning of the value (after =)
  10483. # + adds " at the end of the value
  10484. # + removes en-US; we want to put it on the beginning
  10485. # + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
  10486. [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' solenv/inc/langlist.mk)]
  10487. ALL_LANGS="en-US $completelangiso"
  10488. # check the configured localizations
  10489. WITH_LANG="$with_lang"
  10490. if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
  10491. AC_MSG_RESULT([en-US])
  10492. else
  10493. AC_MSG_RESULT([$WITH_LANG])
  10494. GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
  10495. fi
  10496. # check that the list is valid
  10497. for lang in $WITH_LANG; do
  10498. test "$lang" = "ALL" && continue
  10499. # need to check for the exact string, so add space before and after the list of all languages
  10500. for vl in $ALL_LANGS; do
  10501. if test "$vl" = "$lang"; then
  10502. break
  10503. fi
  10504. done
  10505. if test "$vl" != "$lang"; then
  10506. AC_MSG_ERROR([invalid language: $lang; supported languages are: $ALL_LANGS])
  10507. fi
  10508. done
  10509. # list with substituted ALL
  10510. WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
  10511. # this variable is used only by bin/distro-install-* helper scripts
  10512. # they need a real list of languages
  10513. test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
  10514. test "$WITH_LANG" = "en-US" && WITH_LANG=
  10515. AC_SUBST(ALL_LANGS)
  10516. AC_SUBST(WITH_LANG)
  10517. AC_SUBST(WITH_LANG_LIST)
  10518. AC_SUBST(GIT_NEEDED_SUBMODULES)
  10519. PathFormat "$SRC_ROOT/translations"
  10520. L10N_MODULE="$formatted_path"
  10521. WITH_POOR_HELP_LOCALIZATIONS=
  10522. if test -d "$SRC_ROOT/translations/source"; then
  10523. for l in `ls -1 $SRC_ROOT/translations/source`; do
  10524. if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
  10525. WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
  10526. fi
  10527. done
  10528. fi
  10529. AC_SUBST(L10N_MODULE)
  10530. AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
  10531. dnl git-new-workdir
  10532. dnl ===================================================================
  10533. if test -n "${GIT_LINK_SRC}"; then
  10534. for repo in ${GIT_NEEDED_SUBMODULES}; do
  10535. if ! test -d "${GIT_LINK_SRC}"/${repo}; then
  10536. AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
  10537. fi
  10538. done
  10539. fi
  10540. AC_SUBST(GIT_LINK_SRC)
  10541. AC_MSG_CHECKING([for custom 'intro' progress bar color])
  10542. PROGRESSBARCOLOR=
  10543. if test -z "$with_intro_progressbar_color"; then
  10544. PROGRESSBARCOLOR="255,255,255"
  10545. AC_MSG_RESULT([none])
  10546. else
  10547. PROGRESSBARCOLOR="$with_intro_progressbar_color"
  10548. AC_MSG_RESULT([$PROGRESSBARCOLOR])
  10549. fi
  10550. AC_SUBST(PROGRESSBARCOLOR)
  10551. AC_MSG_CHECKING([for custom 'intro' progress bar size])
  10552. PROGRESSSIZE=
  10553. if test -z "$with_intro_progressbar_size"; then
  10554. PROGRESSSIZE="407,6"
  10555. AC_MSG_RESULT([none])
  10556. else
  10557. PROGRESSSIZE="$with_intro_progressbar_size"
  10558. AC_MSG_RESULT([$PROGRESSSIZE])
  10559. fi
  10560. AC_SUBST(PROGRESSSIZE)
  10561. AC_MSG_CHECKING([for custom 'intro' progress bar position])
  10562. PROGRESSPOSITION=
  10563. if test -z "$with_intro_progressbar_position"; then
  10564. PROGRESSPOSITION="61,317"
  10565. AC_MSG_RESULT([none])
  10566. else
  10567. PROGRESSPOSITION="$with_intro_progressbar_position"
  10568. AC_MSG_RESULT([$PROGRESSPOSITION])
  10569. fi
  10570. AC_SUBST(PROGRESSPOSITION)
  10571. AC_MSG_CHECKING([for custom 'intro' progress bar frame color])
  10572. PROGRESSFRAMECOLOR=
  10573. if test -z "$with_intro_progressbar_frame_color"; then
  10574. PROGRESSFRAMECOLOR="20,136,3"
  10575. AC_MSG_RESULT([none])
  10576. else
  10577. PROGRESSFRAMECOLOR="$with_intro_progressbar_frame_color"
  10578. AC_MSG_RESULT([$PROGRESSFRAMECOLOR])
  10579. fi
  10580. AC_SUBST(PROGRESSFRAMECOLOR)
  10581. AC_MSG_CHECKING([for custom 'intro' progress text color])
  10582. PROGRESSTEXTCOLOR=
  10583. if test -z "$with_intro_progressbar_text_color"; then
  10584. PROGRESSTEXTCOLOR="255,255,255"
  10585. AC_MSG_RESULT([none])
  10586. else
  10587. PROGRESSTEXTCOLOR="$with_intro_progressbar_text_color"
  10588. AC_MSG_RESULT([$PROGRESSTEXTCOLOR])
  10589. fi
  10590. AC_SUBST(PROGRESSTEXTCOLOR)
  10591. AC_MSG_CHECKING([for custom 'intro' progress text baseline])
  10592. PROGRESSTEXTBASELINE=
  10593. if test -z "$with_intro_progressbar_text_baseline"; then
  10594. PROGRESSTEXTBASELINE="287"
  10595. AC_MSG_RESULT([none])
  10596. else
  10597. PROGRESSTEXTBASELINE="$with_intro_progressbar_text_baseline"
  10598. AC_MSG_RESULT([$PROGRESSTEXTBASELINE])
  10599. fi
  10600. AC_SUBST(PROGRESSTEXTBASELINE)
  10601. AC_MSG_CHECKING([for alternative branding images directory])
  10602. INTRO_BITMAP=
  10603. ABOUT_BACKGROUND_SVG=
  10604. FLAT_LOGO_SVG=
  10605. STARTCENTER_LEFT_BITMAP=
  10606. STARTCENTER_RIGHT_BITMAP=
  10607. STARTCENTER_RTL_LEFT_BITMAP=
  10608. STARTCENTER_RTL_RIGHT_BITMAP=
  10609. STARTCENTER_SPACE_BITMAP=
  10610. if test -z "$with_branding" -o "$with_branding" = "no"; then
  10611. AC_MSG_RESULT([none])
  10612. else
  10613. INTRO_BITMAP="$with_branding/intro.png"
  10614. FLAT_LOGO_SVG="$with_branding/flat_logo.svg"
  10615. STARTCENTER_LEFT_BITMAP="$with_branding/backing_left.png"
  10616. STARTCENTER_RIGHT_BITMAP="$with_branding/backing_right.png"
  10617. STARTCENTER_RTL_LEFT_BITMAP="$with_branding/backing_rtl_left.png"
  10618. STARTCENTER_RTL_RIGHT_BITMAP="$with_branding/backing_rtl_right.png"
  10619. STARTCENTER_SPACE_BITMAP="$with_branding/backing_space.png"
  10620. for i in $INTRO_BITMAP \
  10621. $FLAT_LOGO_SVG \
  10622. $STARTCENTER_LEFT_BITMAP \
  10623. $STARTCENTER_RIGHT_BITMAP \
  10624. $STARTCENTER_RTL_LEFT_BITMAP \
  10625. $STARTCENTER_RTL_RIGHT_BITMAP \
  10626. $STARTCENTER_SPACE_BITMAP; do
  10627. if test ! -f $i; then
  10628. AC_MSG_WARN([Required file $i does not exist!])
  10629. fi
  10630. done
  10631. AC_MSG_RESULT([$with_branding])
  10632. fi
  10633. AC_MSG_CHECKING([for yet another 'intro' bitmap])
  10634. if test -z "$with_intro_bitmap" -o "$with_intro_bitmap" = "no"; then
  10635. if test "$with_intro_bitmap" = "no"; then
  10636. INTRO_BITMAP=
  10637. fi
  10638. AC_MSG_RESULT([none])
  10639. else
  10640. case "$with_intro_bitmap" in
  10641. *.png) INTRO_BITMAP="$with_intro_bitmap" ;;
  10642. *) AC_MSG_WARN([Intro bitmap should be a .png file!]) ;;
  10643. esac
  10644. AC_MSG_RESULT([$INTRO_BITMAP])
  10645. fi
  10646. AC_SUBST(INTRO_BITMAP)
  10647. AC_MSG_CHECKING([for yet another 'about' svg])
  10648. if test -z "$with_about_background_svg" -o "$with_about_background_svg" = "no"; then
  10649. if test "$with_about_background_svg" = "no"; then
  10650. ABOUT_BACKGROUND_SVG=
  10651. fi
  10652. AC_MSG_RESULT([none])
  10653. else
  10654. case "$with_about_background_svg" in
  10655. *.svg) ABOUT_BACKGROUND_SVG="$with_about_background_svg" ;;
  10656. *) AC_MSG_WARN([About background SVG should be a .svg file!]) ;;
  10657. esac
  10658. AC_MSG_RESULT([$ABOUT_BACKGROUND_SVG])
  10659. fi
  10660. AC_SUBST(ABOUT_BACKGROUND_SVG)
  10661. AC_MSG_CHECKING([for yet another 'flat_logo' svg])
  10662. if test -z "$with_flat_logo_svg" -o "$with_flat_logo_svg" = "no"; then
  10663. if test "$with_flat_logo_svg" = "no"; then
  10664. FLAT_LOGO_SVG=
  10665. fi
  10666. AC_MSG_RESULT([none])
  10667. else
  10668. case "$with_flat_logo_svg" in
  10669. *.svg) FLAT_LOGO_SVG="$with_flat_logo_svg" ;;
  10670. *) AC_MSG_WARN([Flat logo SVG should be a .svg file!]) ;;
  10671. esac
  10672. AC_MSG_RESULT([$ABOUT_BITMAP])
  10673. fi
  10674. AC_SUBST(FLAT_LOGO_SVG)
  10675. AC_MSG_CHECKING([for yet another 'start center left' bitmap])
  10676. if test -z "$with_startcenter_left_bitmap" -o "$with_startcenter_left_bitmap" = "no"; then
  10677. if test "$with_startcenter_left_bitmap" = "no"; then
  10678. STARTCENTER_LEFT_BITMAP=
  10679. fi
  10680. AC_MSG_RESULT([none])
  10681. else
  10682. case "$with_startcenter_left_bitmap" in
  10683. *.png) STARTCENTER_LEFT_BITMAP="$with_startcenter_left_bitmap" ;;
  10684. *) AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
  10685. esac
  10686. AC_MSG_RESULT([$STARTCENTER_LEFT_BITMAP])
  10687. fi
  10688. AC_SUBST(STARTCENTER_LEFT_BITMAP)
  10689. AC_MSG_CHECKING([for yet another 'start center right' bitmap])
  10690. if test -z "$with_startcenter_right_bitmap" -o "$with_startcenter_right_bitmap" = "no"; then
  10691. if test "$with_startcenter_right_bitmap" = "no"; then
  10692. STARTCENTER_RIGHT_BITMAP=
  10693. fi
  10694. AC_MSG_RESULT([none])
  10695. else
  10696. case "$with_startcenter_right_bitmap" in
  10697. *.png) STARTCENTER_RIGHT_BITMAP="$with_startcenter_right_bitmap" ;;
  10698. *) AC_MSG_WARN([Startcenter right bitmap should be a .png file!]) ;;
  10699. esac
  10700. AC_MSG_RESULT([$STARTCENTER_RIGHT_BITMAP])
  10701. fi
  10702. AC_SUBST(STARTCENTER_RIGHT_BITMAP)
  10703. AC_MSG_CHECKING([for yet another 'start center rtl left' bitmap])
  10704. if test -z "$with_startcenter_rtl_left_bitmap" -o "$with_startcenter_rtl_left_bitmap" = "no"; then
  10705. if test "$with_startcenter_rtl_left_bitmap" = "no"; then
  10706. STARTCENTER_RTL_LEFT_BITMAP=
  10707. fi
  10708. AC_MSG_RESULT([none])
  10709. else
  10710. case "$with_startcenter_rtl_left_bitmap" in
  10711. *.png) STARTCENTER_RTL_LEFT_BITMAP="$with_startcenter_rtl_left_bitmap" ;;
  10712. *) AC_MSG_WARN([Startcenter rtl left bitmap should be a .png file!]) ;;
  10713. esac
  10714. AC_MSG_RESULT([$STARTCENTER_RTL_LEFT_BITMAP])
  10715. fi
  10716. AC_SUBST(STARTCENTER_RTL_LEFT_BITMAP)
  10717. AC_MSG_CHECKING([for yet another 'start center rtl right' bitmap])
  10718. if test -z "$with_startcenter_rtl_right_bitmap" -o "$with_startcenter_rtl_right_bitmap" = "no"; then
  10719. if test "$with_startcenter_rtl_right_bitmap" = "no"; then
  10720. STARTCENTER_RTL_RIGHT_BITMAP=
  10721. fi
  10722. AC_MSG_RESULT([none])
  10723. else
  10724. case "$with_startcenter_rtl_right_bitmap" in
  10725. *.png) STARTCENTER_RTL_RIGHT_BITMAP="$with_startcenter_rtl_right_bitmap" ;;
  10726. *) AC_MSG_WARN([Startcenter rtl right bitmap should be a .png file!]) ;;
  10727. esac
  10728. AC_MSG_RESULT([$STARTCENTER_RTL_RIGHT_BITMAP])
  10729. fi
  10730. AC_SUBST(STARTCENTER_RTL_RIGHT_BITMAP)
  10731. AC_MSG_CHECKING([for yet another 'start center space' bitmap])
  10732. if test -z "$with_startcenter_space_bitmap" -o "$with_startcenter_space_bitmap" = "no"; then
  10733. if test "$with_startcenter_space_bitmap" = "no"; then
  10734. STARTCENTER_SPACE_BITMAP=
  10735. fi
  10736. AC_MSG_RESULT([none])
  10737. else
  10738. case "$with_startcenter_space_bitmap" in
  10739. *.png) STARTCENTER_SPACE_BITMAP="$with_startcenter_space_bitmap" ;;
  10740. *) AC_MSG_WARN([Startcenter left bitmap should be a .png file!]) ;;
  10741. esac
  10742. AC_MSG_RESULT([$STARTCENTER_SPACE_BITMAP])
  10743. fi
  10744. AC_SUBST(STARTCENTER_SPACE_BITMAP)
  10745. EXTRA_BUILDID=
  10746. AC_MSG_CHECKING([for extra build ID])
  10747. if test -n "$with_extra_buildid" -a "$with_extra_buildid" != "yes" ; then
  10748. EXTRA_BUILDID="$with_extra_buildid"
  10749. AC_MSG_RESULT([$EXTRA_BUILDID])
  10750. else
  10751. AC_MSG_RESULT([not set])
  10752. fi
  10753. AC_SUBST(EXTRA_BUILDID)
  10754. OOO_VENDOR=
  10755. AC_MSG_CHECKING([for vendor])
  10756. if test -z "$with_vendor" -o "$with_vendor" = "no"; then
  10757. AC_MSG_RESULT([not set])
  10758. else
  10759. OOO_VENDOR="$with_vendor"
  10760. AC_MSG_RESULT([$OOO_VENDOR])
  10761. fi
  10762. AC_SUBST(OOO_VENDOR)
  10763. UNIXWRAPPERNAME=
  10764. AC_MSG_CHECKING([for UNIX wrapper name])
  10765. if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no" -o "$with_unix_wrapper" = "yes"; then
  10766. AC_MSG_RESULT([not set])
  10767. else
  10768. UNIXWRAPPERNAME="$with_unix_wrapper"
  10769. AC_MSG_RESULT([$UNIXWRAPPERNAME])
  10770. fi
  10771. AC_SUBST(UNIXWRAPPERNAME)
  10772. AC_MSG_CHECKING([whether to install the compat oo* wrappers])
  10773. if test "$with_compat_oowrappers" = "yes"; then
  10774. WITH_COMPAT_OOWRAPPERS=YES
  10775. AC_MSG_RESULT(yes)
  10776. else
  10777. WITH_COMPAT_OOWRAPPERS=
  10778. AC_MSG_RESULT(no)
  10779. fi
  10780. AC_SUBST(WITH_COMPAT_OOWRAPPERS)
  10781. AC_MSG_CHECKING([for product name])
  10782. PRODUCTNAME=AC_PACKAGE_NAME
  10783. AC_MSG_RESULT([$PRODUCTNAME])
  10784. AC_SUBST(PRODUCTNAME)
  10785. INSTALLDIRNAME=`echo AC_PACKAGE_NAME | tr '[[:upper:]]' '[[:lower:]]'`
  10786. AC_MSG_CHECKING([for install dirname])
  10787. if test -n "$with_install_dirname" -a "$with_install_dirname" != "no" -a "$with_install_dirname" != "yes"; then
  10788. INSTALLDIRNAME="$with_install_dirname"
  10789. fi
  10790. AC_MSG_RESULT([$INSTALLDIRNAME])
  10791. AC_SUBST(INSTALLDIRNAME)
  10792. AC_MSG_CHECKING([for prefix])
  10793. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  10794. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  10795. PREFIXDIR="$prefix"
  10796. AC_MSG_RESULT([$PREFIXDIR])
  10797. AC_SUBST(PREFIXDIR)
  10798. AC_MSG_CHECKING([for libdir])
  10799. LIBDIR=[$(eval echo $(eval echo $libdir))]
  10800. AC_MSG_RESULT([$LIBDIR])
  10801. AC_SUBST(LIBDIR)
  10802. AC_MSG_CHECKING([for data dir])
  10803. DATADIR=[$(eval echo $(eval echo $datadir))]
  10804. AC_MSG_RESULT([$DATADIR])
  10805. AC_SUBST(DATADIR)
  10806. AC_MSG_CHECKING([for man dir])
  10807. MANDIR=[$(eval echo $(eval echo $mandir))]
  10808. AC_MSG_RESULT([$MANDIR])
  10809. AC_SUBST(MANDIR)
  10810. AC_MSG_CHECKING([for doc dir])
  10811. DOCDIR=[$(eval echo $(eval echo $docdir))]
  10812. AC_MSG_RESULT([$DOCDIR])
  10813. AC_SUBST(DOCDIR)
  10814. AC_MSG_CHECKING([for install dir])
  10815. INSTALLDIR="$LIBDIR/$INSTALLDIRNAME"
  10816. AC_MSG_RESULT([$INSTALLDIR])
  10817. AC_SUBST(INSTALLDIR)
  10818. AC_MSG_CHECKING([for dev-install dir])
  10819. DEVINSTALLDIR="$OUTDIR/installation"
  10820. AC_MSG_RESULT([$DEVINSTALLDIR])
  10821. AC_SUBST(DEVINSTALLDIR)
  10822. # ===================================================================
  10823. # De- or increase default verbosity of build process
  10824. # ===================================================================
  10825. AC_MSG_CHECKING([build verbosity])
  10826. if test -n "$enable_verbose"; then
  10827. if test "$enable_verbose" = "yes"; then
  10828. VERBOSE="TRUE"
  10829. AC_MSG_RESULT([high])
  10830. fi
  10831. if test "$enable_verbose" = "no"; then
  10832. VERBOSE="FALSE"
  10833. AC_MSG_RESULT([low])
  10834. fi
  10835. else
  10836. AC_MSG_RESULT([not set])
  10837. fi
  10838. AC_SUBST(VERBOSE)
  10839. dnl ===================================================================
  10840. dnl Use zenity during build
  10841. dnl ===================================================================
  10842. AC_MSG_CHECKING([whether to use zenity during build])
  10843. if test "$enable_zenity" = "yes"; then
  10844. AC_MSG_RESULT([yes])
  10845. AC_PATH_PROGS( ZNTY, zenity )
  10846. if test -z "$ZNTY"; then
  10847. ENABLE_ZENITY=FALSE
  10848. else
  10849. ENABLE_ZENITY=TRUE
  10850. fi
  10851. else
  10852. ENABLE_ZENITY=FALSE
  10853. AC_MSG_RESULT([no])
  10854. fi
  10855. AC_SUBST(ENABLE_ZENITY)
  10856. dnl ===================================================================
  10857. dnl Hook up LibreOffice's nodep environmental variable to automake's equivalent
  10858. dnl --enable-dependency-tracking configure option
  10859. dnl ===================================================================
  10860. AC_MSG_CHECKING([whether to enable dependency tracking])
  10861. if test "$enable_dependency_tracking" = "no"; then
  10862. nodep=TRUE
  10863. AC_MSG_RESULT([no])
  10864. else
  10865. AC_MSG_RESULT([yes])
  10866. fi
  10867. AC_SUBST(nodep)
  10868. dnl ===================================================================
  10869. dnl Number of CPUs to use during the build
  10870. dnl ===================================================================
  10871. AC_MSG_CHECKING([for number of processors to use])
  10872. # plain --with-parallelism is just the default
  10873. if test -n "$with_parallelism" -a "$with_parallelism" != "yes"; then
  10874. if test "$with_parallelism" = "no"; then
  10875. PARALLELISM=1
  10876. else
  10877. PARALLELISM=$with_parallelism
  10878. fi
  10879. else
  10880. if test "$enable_icecream" = "yes"; then
  10881. PARALLELISM="10"
  10882. else
  10883. case `uname -s` in
  10884. Darwin|FreeBSD|NetBSD|OpenBSD)
  10885. PARALLELISM=`sysctl -n hw.ncpu`
  10886. ;;
  10887. Linux)
  10888. PARALLELISM=`getconf _NPROCESSORS_ONLN`
  10889. ;;
  10890. # what else than above does profit here *and* has /proc?
  10891. *)
  10892. PARALLELISM=`grep $'^processor\t*:' /proc/cpuinfo | wc -l`
  10893. ;;
  10894. esac
  10895. # If we hit the catch-all case, but /proc/cpuinfo doesn't exist or has an
  10896. # unexpected format, 'wc -l' will have returned 0.
  10897. if test "$PARALLELISM" -eq 0; then
  10898. PARALLELISM=1
  10899. fi
  10900. fi
  10901. fi
  10902. if test "$no_parallelism_make" = "YES" && test $PARALLELISM -gt 1; then
  10903. if test -z "$with_parallelism"; then
  10904. AC_MSG_WARN([gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this.])
  10905. add_warning "gmake 3.81 crashes with parallelism > 1, reducing it to 1. upgrade to 3.82 to avoid this."
  10906. PARALLELISM="1"
  10907. else
  10908. add_warning "make 3.81 is prone to crashes with parallelism > 1. Since --with-parallelism was explicitly given, it is honored, but do not complain when make segfaults on you."
  10909. fi
  10910. fi
  10911. AC_MSG_RESULT([$PARALLELISM])
  10912. AC_SUBST(PARALLELISM)
  10913. # ===================================================================
  10914. # Number of parallel jobs to be executed during subsequenttest
  10915. # ===================================================================
  10916. AC_MSG_CHECKING([for maximum no. of jobs during subsequenttest])
  10917. CHECK_PARALLELISM=$PARALLELISM
  10918. if test "$with_check_jobs" != ""; then
  10919. CHECK_PARALLELISM="$with_check_jobs"
  10920. fi
  10921. AC_MSG_RESULT([$CHECK_PARALLELISM])
  10922. AC_SUBST(CHECK_PARALLELISM)
  10923. #
  10924. # Set up ILIB for MSVC build
  10925. #
  10926. if test "$build_os" = "cygwin"; then
  10927. ILIB=".;${SOLARVER}/$INPATH/lib"
  10928. if test -n "$JAVA_HOME" -a "$JAVA_HOME" != "NO_JAVA_HOME"; then
  10929. ILIB="$ILIB;$JAVA_HOME/lib"
  10930. fi
  10931. if test "$BITNESS_OVERRIDE" = 64; then
  10932. ILIB="$ILIB;$COMPATH/lib/amd64"
  10933. ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
  10934. if test "$WINDOWS_SDK_VERSION" = "80"; then
  10935. ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x64"
  10936. fi
  10937. else
  10938. ILIB="$ILIB;$COMPATH/lib"
  10939. ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
  10940. if test "$WINDOWS_SDK_VERSION" = "80"; then
  10941. ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/win8/um/x86"
  10942. fi
  10943. fi
  10944. ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
  10945. if test "$ENABLE_DIRECTX" = "TRUE"; then
  10946. ILIB="$ILIB;$DIRECTXSDK_LIB"
  10947. fi
  10948. AC_SUBST(ILIB)
  10949. fi
  10950. # ===================================================================
  10951. # Creating bigger shared library to link against
  10952. # ===================================================================
  10953. AC_MSG_CHECKING([whether to create huge library])
  10954. MERGELIBS=
  10955. if test "$enable_mergelibs" = "yes"; then
  10956. if test $_os != Linux -a $_os != Android -a $_os != WINNT; then
  10957. add_warning "--enable-mergelibs is not tested for this platform"
  10958. fi
  10959. MERGELIBS="TRUE"
  10960. AC_MSG_RESULT([yes])
  10961. else
  10962. AC_MSG_RESULT([no])
  10963. fi
  10964. AC_SUBST(MERGELIBS)
  10965. dnl ===================================================================
  10966. dnl icerun is a wrapper that stops us spawning tens of processes
  10967. dnl locally - for tools that can't be executed on the compile cluster
  10968. dnl this avoids a dozen javac's ganging up on your laptop to kill it.
  10969. dnl ===================================================================
  10970. ICECREAM_RUN=
  10971. if test "$enable_icecream" = "yes"; then
  10972. ICECREAM_RUN=icerun
  10973. fi
  10974. AC_SUBST(ICECREAM_RUN)
  10975. dnl ===================================================================
  10976. dnl Setting up the environment.
  10977. dnl ===================================================================
  10978. echo "setting up the build environment variables..."
  10979. AC_SUBST(COMPATH)
  10980. if test "$build_os" = "cygwin"; then
  10981. if test "$DISABLE_ACTIVEX" = "YES"; then
  10982. ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
  10983. ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
  10984. MFC_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
  10985. MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
  10986. else
  10987. ATL_LIB="$COMPATH/atlmfc/lib"
  10988. ATL_INCLUDE="$COMPATH/atlmfc/include"
  10989. MFC_LIB="$COMPATH/atlmfc/lib"
  10990. MFC_INCLUDE="$WINDOWS_SDK_HOME/include/mfc"
  10991. fi
  10992. if test "$BITNESS_OVERRIDE" = 64; then
  10993. ATL_LIB="$ATL_LIB/amd64"
  10994. MFC_LIB="$MFC_LIB/amd64"
  10995. fi
  10996. PathFormat "/usr/bin/grep.exe"
  10997. WIN_GREP="$formatted_path"
  10998. PathFormat "/usr/bin/find.exe"
  10999. WIN_FIND="$formatted_path"
  11000. PathFormat "/usr/bin/ls.exe"
  11001. WIN_LS="$formatted_path"
  11002. PathFormat "/usr/bin/touch.exe"
  11003. WIN_TOUCH="$formatted_path"
  11004. fi
  11005. AC_SUBST(ATL_INCLUDE)
  11006. AC_SUBST(ATL_LIB)
  11007. AC_SUBST(MFC_INCLUDE)
  11008. AC_SUBST(MFC_LIB)
  11009. AC_SUBST(WIN_FIND)
  11010. AC_SUBST(WIN_GREP)
  11011. AC_SUBST(WIN_LS)
  11012. AC_SUBST(WIN_TOUCH)
  11013. AC_SUBST(BUILD_TYPE)
  11014. AC_SUBST(SOLARINC)
  11015. AC_SUBST(SOLARLIB)
  11016. if test -z "$SOLARINC_FOR_BUILD"; then
  11017. SOLARINC_FOR_BUILD="$SOLARINC"
  11018. fi
  11019. AC_SUBST(SOLARINC_FOR_BUILD)
  11020. if test -z "$SOLARLIB_FOR_BUILD"; then
  11021. SOLARLIB_FOR_BUILD="$SOLARLIB"
  11022. fi
  11023. AC_SUBST(SOLARLIB_FOR_BUILD)
  11024. PathFormat "$PERL"
  11025. PERL="$formatted_path"
  11026. AC_SUBST(PERL)
  11027. if test "$build_os" = "cygwin"; then
  11028. TEMP_DIRECTORY=`cygpath -m "/tmp"`
  11029. if test -n "$TMP"; then
  11030. TMP_DIRECTORY="$TMP"
  11031. else
  11032. TMP_DIRECTORY="$TEMP_DIRECTORY"
  11033. fi
  11034. else
  11035. if test -n "$TMPDIR"; then
  11036. TEMP_DIRECTORY="$TMPDIR"
  11037. else
  11038. TEMP_DIRECTORY="/tmp"
  11039. fi
  11040. fi
  11041. AC_SUBST(TEMP_DIRECTORY)
  11042. AC_SUBST(TMP_DIRECTORY)
  11043. # setup the PATH for the environment
  11044. if test -n "$LO_PATH_FOR_BUILD"; then
  11045. LO_PATH="$LO_PATH_FOR_BUILD"
  11046. else
  11047. LO_PATH="$PATH"
  11048. case "$host_os" in
  11049. aix*|dragonfly*|freebsd*|linux-gnu*|*netbsd*|openbsd*)
  11050. if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
  11051. pathmunge "$JAVA_HOME/bin" "after"
  11052. fi
  11053. ;;
  11054. cygwin*)
  11055. pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
  11056. pathmunge "$ASM_HOME" "before"
  11057. pathmunge "$WINDOWS_SDK_HOME/bin" "before"
  11058. pathmunge "$CSC_PATH" "before"
  11059. pathmunge "$MIDL_PATH" "before"
  11060. pathmunge "$AL_PATH" "before"
  11061. pathmunge "$MSPDB_PATH" "before"
  11062. if test "$BITNESS_OVERRIDE" = 64; then
  11063. pathmunge "$COMPATH/bin/amd64" "before"
  11064. pathmunge "$WINDOWS_SDK_HOME/bin/x64" "before"
  11065. else
  11066. pathmunge "$COMPATH/bin" "before"
  11067. pathmunge "$WINDOWS_SDK_HOME/bin/x86" "before"
  11068. fi
  11069. if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
  11070. if test -d "$JAVA_HOME/jre/bin/client"; then
  11071. pathmunge "$JAVA_HOME/jre/bin/client" "before"
  11072. fi
  11073. if test -d "$JAVA_HOME/jre/bin/hotspot"; then
  11074. pathmunge "$JAVA_HOME/jre/bin/hotspot" "before"
  11075. fi
  11076. pathmunge "$JAVA_HOME/bin" "before"
  11077. fi
  11078. ;;
  11079. solaris*)
  11080. pathmunge "/usr/css/bin" "before"
  11081. if test "$SOLAR_JAVA" != "" -a "$JDK"!="gcj"; then
  11082. pathmunge "$JAVA_HOME/bin" "after"
  11083. fi
  11084. ;;
  11085. esac
  11086. pathmunge "$SRC_ROOT/solenv/$OUTPATH/bin" "before"
  11087. pathmunge "$SRC_ROOT/solenv/bin" "before"
  11088. pathmunge "." "before"
  11089. fi
  11090. AC_SUBST(LO_PATH)
  11091. # make sure config.guess is +x; we execute config.guess, so it has to be so
  11092. chmod +x ./config.guess
  11093. # Generate a configuration timestamp we can use for deps
  11094. if test -f config_host.mk; then
  11095. mv -f config_host.mk config_host.mk.last
  11096. else
  11097. echo > config_host.mk.last
  11098. fi
  11099. AC_CONFIG_FILES([config_host.mk])
  11100. AC_OUTPUT
  11101. # touch the config timestamp file
  11102. if test ! -f config_host.mk.stamp; then
  11103. echo > config_host.mk.stamp
  11104. elif diff config_host.mk config_host.mk.last >/dev/null 2>&1; then
  11105. echo "Configuration unchanged - avoiding scp2 stamp update"
  11106. else
  11107. echo > config_host.mk.stamp
  11108. fi
  11109. if test "$STALE_MAKE" = "TRUE" -a "$build_os" = "cygwin"; then
  11110. cat << _EOS
  11111. ****************************************************************************
  11112. WARNING:
  11113. Your make version is known to be horribly slow, and hard to debug
  11114. problems with. To get a reasonably functional make please do:
  11115. to install a pre-compiled binary make for cygwin
  11116. mkdir -p /opt/lo/bin
  11117. cd /opt/lo/bin
  11118. wget http://dev-www.libreoffice.org/bin/cygwin/make
  11119. chmod +x make
  11120. to install from source:
  11121. place yourself in a working directory of you choice.
  11122. git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
  11123. cd dev-tools/make-3.82-gbuild
  11124. ./configure --prefix=/opt/lo
  11125. make
  11126. sudo make install
  11127. Then re-run autogen.sh
  11128. Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
  11129. Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
  11130. _EOS
  11131. fi
  11132. cat << _EOF
  11133. ****************************************************************************
  11134. To build, issue:
  11135. $GNUMAKE
  11136. run: $GNUMAKE help
  11137. for details
  11138. _EOF
  11139. if test $_os != WINNT -a "$CROSS_COMPILING" != YES; then
  11140. cat << _EOF
  11141. To install when the build is finished, issue:
  11142. $GNUMAKE install
  11143. If you want to develop LibreOffice, you might prefer:
  11144. $GNUMAKE dev-install
  11145. If you want to run the smoketest, issue:
  11146. $GNUMAKE check
  11147. _EOF
  11148. fi
  11149. cat warn
  11150. dnl vim:set shiftwidth=4 softtabstop=4 expandtab: