configure.ac 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl -----------------------------------------------------------
  3. dnl Turning off cache for debug reasons
  4. dnl -----------------------------------------------------------
  5. dnl define([AC_CACHE_LOAD], )dnl
  6. dnl define([AC_CACHE_SAVE], )dnl
  7. AC_INIT([GNU Classpath],[0.99.1-pre],[classpath@gnu.org],[classpath])
  8. AC_CONFIG_SRCDIR(java/lang/System.java)
  9. AC_CONFIG_MACRO_DIR([m4])
  10. dnl GCJ LOCAL
  11. AC_CONFIG_AUX_DIR(../..)
  12. dnl END GCJ LOCAL
  13. AC_CANONICAL_TARGET
  14. dnl GCJ LOCAL
  15. AC_ARG_ENABLE(java-maintainer-mode,
  16. AS_HELP_STRING([--enable-java-maintainer-mode],
  17. [allow rebuilding of .class and .h files]))
  18. AM_CONDITIONAL(JAVA_MAINTAINER_MODE, test "$enable_java_maintainer_mode" = yes)
  19. dnl END GCJ LOCAL
  20. dnl GCJ LOCAL
  21. # We would like to our source tree to be readonly. However when releases or
  22. # pre-releases are generated, the man pages need to be included as they are
  23. # converted from the texi files via perl which we don't require end users to
  24. # have installed.
  25. # Therefore we have --enable-generated-files-in-srcdir to do just that.
  26. AC_MSG_CHECKING([whether to place generated files in the source directory])
  27. dnl generated-files-in-srcdir is disabled by default
  28. AC_ARG_ENABLE(generated-files-in-srcdir,
  29. [ --enable-generated-files-in-srcdir
  30. put copies of generated files in source dir
  31. intended for creating source tarballs for users
  32. without texinfo, perl, bison or flex.],
  33. generated_files_in_srcdir=$enableval,
  34. generated_files_in_srcdir=no)
  35. AC_MSG_RESULT($generated_files_in_srcdir)
  36. AM_CONDITIONAL(GENINSRC, test x$generated_files_in_srcdir = xyes)
  37. dnl END GCJ LOCAL
  38. # Find the rest of the source tree framework.
  39. AM_ENABLE_MULTILIB(, ../..)
  40. AM_CONDITIONAL(INSTALL_BINARIES, test -z "${with_multisubdir}")
  41. dnl -----------------------------------------------------------
  42. dnl Fold all IA-32 CPU architectures into "x86"
  43. dnl -----------------------------------------------------------
  44. if expr ${target_cpu} : '.*86' > /dev/null; then target_cpu=x86; fi
  45. dnl -----------------------------------------------------------
  46. dnl We will not track/change lib version until we reach version 1.0
  47. dnl at which time we'll have to be more anal about such things
  48. dnl -----------------------------------------------------------
  49. AC_SUBST(LIBVERSION, "0:0:0")
  50. case "$host_os" in
  51. darwin*)
  52. cp_module=""
  53. ;;
  54. *)
  55. cp_module="-module"
  56. ;;
  57. esac
  58. CLASSPATH_MODULE="${cp_module} -version-info ${LIBVERSION} -no-undefined"
  59. AC_SUBST(CLASSPATH_MODULE)
  60. CLASSPATH_CONVENIENCE="-no-undefined"
  61. AC_SUBST(CLASSPATH_CONVENIENCE)
  62. AC_PREREQ(2.64)
  63. AM_INIT_AUTOMAKE([1.9.0 no-dist gnu std-options tar-ustar -Wno-portability])
  64. AC_CONFIG_HEADERS([include/config.h])
  65. AC_PREFIX_DEFAULT(/usr/local/classpath)
  66. dnl GCC LOCAL
  67. GCC_NO_EXECUTABLES
  68. dnl -----------------------------------------------------------
  69. dnl Enable collections.jar (disabled by default)
  70. dnl -----------------------------------------------------------
  71. AC_ARG_ENABLE([collections],
  72. [AS_HELP_STRING(--enable-collections,create collections.jar [default=no])],
  73. [case x"${enableval}" in
  74. xyes) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
  75. xno) COMPILE_COLLECTIONS=no ;;
  76. x) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"gnu/java/util/collections\"" ;;
  77. *) COMPILE_COLLECTIONS=yes; COLLECTIONS_PREFIX="\"${enableval}\"" ;;
  78. esac],
  79. [COMPILE_COLLECTIONS=no])
  80. AM_CONDITIONAL(CREATE_COLLECTIONS, test "x${COMPILE_COLLECTIONS}" = xyes)
  81. dnl -----------------------------------------------------------
  82. dnl Enable JNI libraries (enabled by default)
  83. dnl -----------------------------------------------------------
  84. AC_ARG_ENABLE([jni],
  85. [AS_HELP_STRING(--enable-jni,compile JNI source [default=yes])],
  86. [case "${enableval}" in
  87. yes) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
  88. no) COMPILE_JNI=no ;;
  89. *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
  90. esac],
  91. [COMPILE_JNI=yes])
  92. AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test "x${COMPILE_JNI}" = xyes)
  93. dnl -----------------------------------------------------------
  94. dnl Enable core JNI libraries (enabled by default)
  95. dnl -----------------------------------------------------------
  96. AC_ARG_ENABLE([core-jni],
  97. [AS_HELP_STRING(--enable-core-jni,
  98. compile JNI sources for core [default=yes])],
  99. [case "${enableval}" in
  100. yes) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
  101. no) COMPILE_CORE_JNI=no ;;
  102. *) COMPILE_CORE_JNI=yes; COMPILE_JAVA=yes ;;
  103. esac],
  104. [COMPILE_CORE_JNI=yes])
  105. AM_CONDITIONAL(CREATE_CORE_JNI_LIBRARIES, test "x${COMPILE_CORE_JNI}" = xyes)
  106. dnl -----------------------------------------------------------
  107. dnl Default Preference Backend
  108. dnl -----------------------------------------------------------
  109. AC_ARG_ENABLE([default-preferences-peer],
  110. [AS_HELP_STRING([--enable-default-preferences-peer@<:@=peer type or class name@:>@],
  111. [specify one of: "gconf" [default] for a GConf based backend, "file" for a file based one, "memory" for a transient one, or a fully qualified class name implementing java.util.prefs.PreferencesFactory])],
  112. [case "${enableval}" in
  113. file) DEFAULT_PREFS_PEER=gnu.java.util.prefs.FileBasedFactory ;;
  114. gconf|yes|true) DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory ;;
  115. memory) DEFAULT_PREFS_PEER=gnu.java.util.prefs.MemoryBasedFactory ;;
  116. no|false) AC_MSG_ERROR(bad value '${enableval}' for --enable-default-preferences-peer) ;;
  117. *) DEFAULT_PREFS_PEER=${enableval} ;;
  118. esac],
  119. [DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory])
  120. dnl AC_SUBST(DEFAULT_PREFS_PEER)
  121. dnl -----------------------------------------------------------
  122. dnl GConf native peer (enabled by default)
  123. dnl -----------------------------------------------------------
  124. AC_ARG_ENABLE([gconf-peer],
  125. [AS_HELP_STRING(--disable-gconf-peer,compile GConf native peers (disabled by --disable-jni) [default=yes])],
  126. [case "${enableval}" in
  127. yes) COMPILE_GCONF_PEER=yes ;;
  128. no) COMPILE_GCONF_PEER=no ;;
  129. *) COMPILE_GCONF_PEER=yes ;;
  130. esac],
  131. [COMPILE_GCONF_PEER=yes])
  132. AM_CONDITIONAL(CREATE_GCONF_PEER_LIBRARIES, test "x${COMPILE_GCONF_PEER}" = xyes)
  133. dnl -----------------------------------------------------------
  134. dnl GConf native peer error checking
  135. dnl -----------------------------------------------------------
  136. AC_ARG_ENABLE([gconf-peers],,AC_MSG_ERROR([No --enable-gconf-peers (or --disable-gconf-peers) option; you want --enable-gconf-peer]))
  137. dnl ------------------------------------------------------------
  138. dnl GStreamer based sound provider backend (disabled by default)
  139. dnl ------------------------------------------------------------
  140. AC_ARG_ENABLE([gstreamer-peer],
  141. [AS_HELP_STRING(--enable-gstreamer-peer,compile GStreamer native peers (disabled by --disable-jni) [default=no])],
  142. [case "${enableval}" in
  143. yes) COMPILE_GSTREAMER_PEER=yes ;;
  144. no) COMPILE_GSTREAMER_PEER=no ;;
  145. *) COMPILE_GSTREAMER_PEER=default ;;
  146. esac],
  147. [COMPILE_GSTREAMER_PEER=default])
  148. AM_CONDITIONAL(CREATE_GSTREAMER_PEER_LIBRARIES, test "x${COMPILE_GSTREAMER_PEER}" = xyes)
  149. dnl -----------------------------------------------------------
  150. dnl GStreamer native peer error checking
  151. dnl -----------------------------------------------------------
  152. AC_ARG_ENABLE([gstreamer-peers],,AC_MSG_ERROR([No --enable-gstreamer-peers (or --disable-gstreamer-peers) option; you want --enable-gstreamer-peer]))
  153. dnl ------------------------------------------------------------
  154. dnl Whether to compile with -Werror or not (disabled by default)
  155. dnl ------------------------------------------------------------
  156. AC_ARG_ENABLE([Werror],
  157. [AS_HELP_STRING(--enable-Werror,whether to compile C code with -Werror which turns any compiler warning into a compilation failure [default=no])],
  158. [case "${enableval}" in
  159. yes) ENABLE_WERROR=yes ;;
  160. no) ENABLE_WERROR=no ;;
  161. *) ENABLE_WERROR=no ;;
  162. esac],
  163. [ENABLE_WERROR=no])
  164. dnl -----------------------------------------------------------
  165. dnl Default AWT toolkit
  166. dnl -----------------------------------------------------------
  167. AC_ARG_ENABLE(default-toolkit,
  168. AS_HELP_STRING([--enable-default-toolkit],
  169. [fully qualified class name of default AWT toolkit]))
  170. default_toolkit=$enable_default_toolkit
  171. if test "$default_toolkit" = ""; then
  172. default_toolkit=gnu.java.awt.peer.gtk.GtkToolkit
  173. fi
  174. AC_SUBST(default_toolkit)
  175. dnl -----------------------------------------------------------
  176. dnl Native libxml/xslt library (disabled by default)
  177. dnl -----------------------------------------------------------
  178. AC_ARG_ENABLE([xmlj],
  179. [AS_HELP_STRING(--enable-xmlj,compile native libxml/xslt library [default=no])],
  180. [case "${enableval}" in
  181. yes) COMPILE_XMLJ=yes ;;
  182. no) COMPILE_XMLJ=no ;;
  183. *) COMPILE_XMLJ=no ;;
  184. esac],
  185. [COMPILE_XMLJ=no])
  186. AM_CONDITIONAL(CREATE_XMLJ_LIBRARY, test "x${COMPILE_XMLJ}" = xyes)
  187. dnl -----------------------------------------------------------
  188. dnl ALSA code (enabled by default)
  189. dnl -----------------------------------------------------------
  190. AC_ARG_ENABLE([alsa],
  191. [AS_HELP_STRING(--disable-alsa,compile ALSA providers (enable by --enable-alsa) [default=yes])],
  192. [case "${enableval}" in
  193. yes) COMPILE_ALSA=yes ;;
  194. no) COMPILE_ALSA=no ;;
  195. *) COMPILE_ALSA=yes ;;
  196. esac],
  197. [AC_CHECK_HEADERS([alsa/asoundlib.h],
  198. [AC_CHECK_LIB([asound], [snd_seq_open], COMPILE_ALSA=yes,COMPILE_ALSA=no)],
  199. COMPILE_ALSA=no)])
  200. AM_CONDITIONAL(CREATE_ALSA_LIBRARIES, test "x${COMPILE_ALSA}" = xyes)
  201. dnl -----------------------------------------------------------
  202. dnl DSSI code (enabled by default)
  203. dnl -----------------------------------------------------------
  204. AC_ARG_ENABLE([dssi],
  205. [AS_HELP_STRING(--disable-dssi,compile DSSI providers (enable by --enable-dssi) [default=yes])],
  206. [case "${enableval}" in
  207. yes) COMPILE_DSSI=yes ;;
  208. no) COMPILE_DSSI=no ;;
  209. *) COMPILE_DSSI=yes ;;
  210. esac],
  211. [COMPILE_DSSI=no
  212. AC_CHECK_HEADERS([dssi.h], [
  213. AC_CHECK_HEADERS([jack/jack.h],COMPILE_DSSI=yes)])])
  214. AM_CONDITIONAL(CREATE_DSSI_LIBRARIES, test "x${COMPILE_DSSI}" = xyes)
  215. dnl -----------------------------------------------------------
  216. dnl GTK native peer (enabled by default)
  217. dnl -----------------------------------------------------------
  218. AC_ARG_ENABLE([gtk-peer],
  219. [AS_HELP_STRING(--disable-gtk-peer,compile GTK native peers (disabled by --disable-jni) [default=yes])],
  220. [case "${enableval}" in
  221. yes) COMPILE_GTK_PEER=yes ;;
  222. no) COMPILE_GTK_PEER=no ;;
  223. *) COMPILE_GTK_PEER=yes ;;
  224. esac],
  225. [COMPILE_GTK_PEER=yes])
  226. AM_CONDITIONAL(CREATE_GTK_PEER_LIBRARIES, test "x${COMPILE_GTK_PEER}" = xyes)
  227. dnl -----------------------------------------------------------
  228. dnl GTK native peer error checking
  229. dnl -----------------------------------------------------------
  230. AC_ARG_ENABLE([gtk-peers],,AC_MSG_ERROR([No --enable-gtk-peers (or --disable-gtk-peers) option; you want --enable-gtk-peer]))
  231. dnl -----------------------------------------------------------
  232. dnl Qt native peer (disabled by default)
  233. dnl -----------------------------------------------------------
  234. AC_ARG_ENABLE([qt-peer],
  235. [AS_HELP_STRING(--enable-qt-peer,compile Qt4 native peers (disabled by --disable-jni) [default=no])],
  236. [case "${enableval}" in
  237. yes) COMPILE_QT_PEER=yes ;;
  238. no) COMPILE_QT_PEER=no ;;
  239. *) COMPILE_QT_PEER=yes ;;
  240. esac],
  241. [COMPILE_QT_PEER=no])
  242. AM_CONDITIONAL(CREATE_QT_PEER_LIBRARIES, test "x${COMPILE_QT_PEER}" = xyes)
  243. dnl -----------------------------------------------------------
  244. dnl Plugin (disabled by default)
  245. dnl -----------------------------------------------------------
  246. AC_ARG_ENABLE([plugin],
  247. [AS_HELP_STRING(--disable-plugin,compile gcjwebplugin (disabled by --disable-plugin) [default=yes])],
  248. [case "${enableval}" in
  249. yes) COMPILE_PLUGIN=yes ;;
  250. no) COMPILE_PLUGIN=no ;;
  251. *) COMPILE_PLUGIN=yes ;;
  252. esac],
  253. [COMPILE_PLUGIN=no])
  254. AM_CONDITIONAL(CREATE_PLUGIN, test "x${COMPILE_PLUGIN}" = xyes)
  255. dnl -----------------------------------------------------------
  256. dnl Native java.math.BigInteger (enabled by default)
  257. dnl -----------------------------------------------------------
  258. AC_ARG_ENABLE([gmp],
  259. [AS_HELP_STRING(--enable-gmp,
  260. compile native java.math.BigInteger library (disabled by --disable-gmp) [default=yes])],
  261. [case "${enableval}" in
  262. yes|true) COMPILE_GMP=yes ;;
  263. no|false) COMPILE_GMP=no ;;
  264. *) COMPILE_GMP=yes ;;
  265. esac],
  266. [COMPILE_GMP=yes])
  267. dnl -----------------------------------------------------------
  268. dnl GJDoc (enabled by default)
  269. dnl -----------------------------------------------------------
  270. AC_ARG_ENABLE([gjdoc],
  271. [AS_HELP_STRING(--disable-gjdoc,compile GJDoc (disabled by --disable-gjdoc) [default=yes])],
  272. [case "${enableval}" in
  273. yes) COMPILE_GJDOC=yes ;;
  274. no) COMPILE_GJDOC=no ;;
  275. *) COMPILE_GJDOC=yes ;;
  276. esac],
  277. [COMPILE_GJDOC=yes])
  278. AM_CONDITIONAL(CREATE_GJDOC, test "x${COMPILE_GJDOC}" = xyes)
  279. dnl GCJ LOCAL: Calculates and substitutes toolexeclibdir. $libdir is
  280. dnl defined to the same value for all multilibs. We define toolexeclibdir
  281. dnl so that we can refer to the multilib installation directories from
  282. dnl classpath's build files.
  283. dnl -----------------------------------------------------------
  284. case ${host_alias} in
  285. "") host_noncanonical=${build_noncanonical} ;;
  286. *) host_noncanonical=${host_alias} ;;
  287. esac
  288. case ${target_alias} in
  289. "") target_noncanonical=${host_noncanonical} ;;
  290. *) target_noncanonical=${target_alias} ;;
  291. esac
  292. AC_SUBST(target_noncanonical)
  293. AC_ARG_ENABLE(version-specific-runtime-libs,
  294. AS_HELP_STRING([--enable-version-specific-runtime-libs],
  295. [specify that runtime libraries should be installed in a compiler-specific directory]),
  296. [case "$enableval" in
  297. yes) version_specific_libs=yes ;;
  298. no) version_specific_libs=no ;;
  299. *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
  300. esac],
  301. [version_specific_libs=no]
  302. )
  303. CLASSPATH_TOOLEXECLIBDIR
  304. dnl -----------------------------------------------------------
  305. dnl Sets the native libraries installation dir
  306. dnl -----------------------------------------------------------
  307. dnl GCJ LOCAL: default to ${toolexeclibdir}/gcj-${gcc_version}-${libgcj_soversion}
  308. AC_ARG_WITH([native-libdir],
  309. [AS_HELP_STRING(--with-native-libdir,sets the installation directory for native libraries [default='${libdir}/${PACKAGE}'])],
  310. [
  311. nativeexeclibdir=${withval}
  312. ],
  313. [
  314. nativeexeclibdir='${toolexeclibdir}/gcj-'`cat ${srcdir}/../../gcc/BASE-VER`-`awk -F: '/^[[^#]].*:/ { print $1 }' ${srcdir}/../libtool-version`
  315. ])
  316. AC_SUBST(nativeexeclibdir)
  317. dnl -----------------------------------------------------------
  318. dnl Sets the Java library installation dir.
  319. dnl -----------------------------------------------------------
  320. AC_ARG_WITH([glibj-dir],
  321. [AS_HELP_STRING(--with-glibj-dir,sets the installation directory for glibj.zip [default='${libdir}/${PACKAGE}'])],
  322. [
  323. glibjdir=${withval}
  324. ],
  325. [
  326. glibjdir='${datadir}/${PACKAGE}'
  327. ])
  328. AC_SUBST(glibjdir)
  329. dnl -----------------------------------------------------------
  330. dnl Sets the Antlr jar to use for compiling gjdoc
  331. dnl -----------------------------------------------------------
  332. AC_ARG_WITH([antlr-jar],
  333. [AS_HELP_STRING([--with-antlr-jar=file],[Use ANTLR from the specified jar file])],
  334. [
  335. ANTLR_JAR=$withval
  336. ],
  337. [
  338. ANTLR_JAR="$ANTLR_JAR"
  339. ])
  340. dnl -----------------------------------------------------------
  341. dnl Regenerate headers at build time (enabled if not found)
  342. dnl -----------------------------------------------------------
  343. AC_MSG_CHECKING([whether to regenerate the headers])
  344. AC_ARG_ENABLE([regen-headers],
  345. [AS_HELP_STRING(--enable-regen-headers,automatically regenerate JNI headers [default=yes if headers don't exist])],
  346. [case "${enableval}" in
  347. yes) REGENERATE_JNI_HEADERS=yes ;;
  348. no) REGENERATE_JNI_HEADERS=no ;;
  349. *) REGENERATE_JNI_HEADERS=yes ;;
  350. esac],
  351. [if test -e ${srcdir}/include/java_lang_VMSystem.h; then
  352. REGENERATE_JNI_HEADERS=no ;
  353. else
  354. REGENERATE_JNI_HEADERS=yes ;
  355. fi])
  356. AC_MSG_RESULT(${REGENERATE_JNI_HEADERS})
  357. AM_CONDITIONAL(CREATE_JNI_HEADERS, test "x${REGENERATE_JNI_HEADERS}" = xyes)
  358. dnl ------------------------------------------------------------------------
  359. dnl Regenerate GJDoc parser at build time (enabled if not found)
  360. dnl ------------------------------------------------------------------------
  361. AC_MSG_CHECKING([whether to regenerate the GJDoc parser])
  362. AC_ARG_ENABLE([regen-gjdoc-parser],
  363. [AS_HELP_STRING(--enable-regen-gjdoc-parser,automatically regenerate the GJDoc parser [default=yes if generated source doesn't exist])],
  364. [case "${enableval}" in
  365. yes) REGENERATE_GJDOC_PARSER=yes ;;
  366. no) REGENERATE_GJDOC_PARSER=no ;;
  367. *) REGENERATE_GJDOC_PARSER=yes ;;
  368. esac],
  369. [if test -e ${srcdir}/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java; then
  370. REGENERATE_GJDOC_PARSER=no ;
  371. else
  372. REGENERATE_GJDOC_PARSER=yes ;
  373. fi])
  374. AC_MSG_RESULT(${REGENERATE_GJDOC_PARSER})
  375. AM_CONDITIONAL(CREATE_GJDOC_PARSER, test "x${REGENERATE_GJDOC_PARSER}" = xyes)
  376. dnl -----------------------------------------------------------
  377. dnl Enable tool wrapper binaries (disabled by default)
  378. dnl -----------------------------------------------------------
  379. AC_ARG_ENABLE([tool-wrappers],
  380. [AS_HELP_STRING(--enable-tool-wrappers,create tool wrapper binaries [default=no])],
  381. [case x"${enableval}" in
  382. xyes)
  383. COMPILE_WRAPPERS=yes;
  384. AC_CHECK_HEADERS([ltdl.h],, [AC_MSG_ERROR(cannot find ltdl.h)])
  385. AC_CHECK_LIB(ltdl, lt_dlopen,, [AC_MSG_ERROR(cannot find libltdl)])
  386. ;;
  387. xno) COMPILE_WRAPPERS=no ;;
  388. x) COMPILE_WRAPPERS=yes ;;
  389. *) COMPILE_WRAPPERS=yes ;;
  390. esac],
  391. [COMPILE_WRAPPERS=no])
  392. AM_CONDITIONAL(CREATE_WRAPPERS, test "x${COMPILE_WRAPPERS}" = xyes)
  393. AC_PROG_LN_S
  394. AC_PROG_INSTALL
  395. dnl -----------------------------------------------------------
  396. dnl Checks for programs.
  397. dnl -----------------------------------------------------------
  398. dnl Initialize libtool
  399. AC_DISABLE_STATIC
  400. LT_INIT
  401. AC_PROG_AWK
  402. AC_PROG_CC
  403. AM_PROG_CC_C_O
  404. AC_PROG_CPP
  405. AC_PROG_CXX
  406. # Handle -Werror default case.
  407. if test "$ENABLE_WERROR" = default; then
  408. case "$host_os" in
  409. *linux*)
  410. if test "$GCC" = yes; then
  411. ENABLE_WERROR=yes
  412. fi
  413. ;;
  414. esac
  415. fi
  416. if test "x${COMPILE_COLLECTIONS}" = xyes; then
  417. AC_PATH_PROG(PERL, [perl])
  418. AC_SUBST(PERL)
  419. AC_SUBST(COLLECTIONS_PREFIX)
  420. AC_CONFIG_FILES([lib/mkcollections.pl])
  421. AC_CONFIG_COMMANDS([mkcollections.pl],[chmod 755 lib/mkcollections.pl])
  422. fi
  423. if test "x${COMPILE_JNI}" = xyes; then
  424. GCC_ATTRIBUTE_UNUSED
  425. AC_HEADER_STDC
  426. dnl Checking sizeof void * is needed for fdlibm to work properly on ppc64,
  427. dnl at least.
  428. AC_COMPILE_CHECK_SIZEOF(void *)
  429. dnl Checking for endianess.
  430. AC_C_BIGENDIAN_CROSS
  431. dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
  432. dnl On that system, sys/ioctl.h will not include sys/filio.h unless
  433. dnl BSD_COMP is defined; just including sys/filio.h is simpler.
  434. dnl Check for crt_externs.h on Darwin.
  435. dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
  436. dnl Check for sys/loadavg.h for getloadavg() on Solaris 9.
  437. dnl Check for sys/sockio.h for SIOCGIFFLAGS on OpenSolaris.
  438. AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
  439. asm/ioctls.h \
  440. inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
  441. sys/time.h \
  442. sys/select.h \
  443. crt_externs.h \
  444. fcntl.h \
  445. sys/mman.h \
  446. magic.h \
  447. sys/event.h sys/epoll.h \
  448. ifaddrs.h \
  449. netinet/in_systm.h netinet/ip.h net/if.h \
  450. sys/loadavg.h sys/sockio.h])
  451. AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
  452. AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
  453. AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
  454. AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED, 1, [Define to 1 if you have BSD u_int32_t]))
  455. AC_SEARCH_LIBS([clock_gettime], [rt])
  456. AC_SEARCH_LIBS([inet_pton],[nsl])
  457. AC_CHECK_LIB([socket], [gethostname])
  458. AC_CHECK_FUNCS([ftruncate fsync select \
  459. gethostname socket strerror fork pipe execve open close \
  460. lseek fstat read readv write writev htonl memset htons connect \
  461. getsockname getpeername bind listen accept \
  462. recvfrom send sendto setsockopt getsockopt time mktime clock_gettime \
  463. gethostbyname_r localtime_r \
  464. strerror_r \
  465. fcntl \
  466. statvfs \
  467. mmap munmap mincore msync madvise getpagesize sysconf \
  468. lstat readlink \
  469. inet_aton inet_addr inet_pton \
  470. getifaddrs kqueue kevent epoll_create \
  471. getloadavg])
  472. LIBMAGIC=
  473. AC_CHECK_LIB(magic, magic_open, LIBMAGIC=-lmagic)
  474. AC_SUBST(LIBMAGIC)
  475. AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
  476. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[struct sockaddr_in6 addr6;]])],
  477. [AC_DEFINE(HAVE_INET6, 1,
  478. [Define if inet6 structures are defined in netinet/in.h.])
  479. AC_MSG_RESULT(yes)],
  480. [AC_MSG_RESULT(no)])
  481. AC_HEADER_TIME
  482. AC_STRUCT_TM
  483. AC_STRUCT_TIMEZONE
  484. AC_MSG_CHECKING([for tm_gmtoff in struct tm])
  485. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],[[struct tm tim; tim.tm_gmtoff = 0;]])],
  486. [AC_DEFINE(STRUCT_TM_HAS_GMTOFF, 1, [Define if struct tm has tm_gmtoff field.])
  487. AC_MSG_RESULT(yes)],
  488. [AC_MSG_RESULT(no)
  489. AC_MSG_CHECKING([for global timezone variable])
  490. dnl FIXME: we don't want a link check here because that won't work
  491. dnl when cross-compiling. So instead we make an assumption that
  492. dnl the header file will mention timezone if it exists.
  493. dnl Don't find the win32 function timezone
  494. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[void i(){long z2 = 2*timezone;}]])],
  495. [AC_DEFINE(HAVE_TIMEZONE, 1, [Define if global 'timezone' exists.])
  496. AC_MSG_RESULT(yes)],
  497. [AC_MSG_RESULT(no)
  498. AC_MSG_CHECKING([for global _timezone variable])
  499. dnl FIXME: As above, don't want link check
  500. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[long z2 = _timezone;]])],
  501. [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE, 1,
  502. [Define if your platform has the global _timezone variable.])
  503. AC_MSG_RESULT(yes)],
  504. [AC_MSG_RESULT(no)])])])
  505. AC_C_CONST
  506. AC_C_INLINE
  507. AC_C_ATTRIBUTE
  508. AX_FUNC_WHICH_GETHOSTBYNAME_R
  509. dnl See if we HAVE_ICONV, how ICONV_CONST is set and LTLIBICONV
  510. AM_ICONV
  511. dnl When using gcc we want warnings, lots of warnings :-)
  512. if test "x${GCC}" = xyes; then
  513. dnl We want ISO C90 ansi, but with longlong (jlong) support
  514. dnl and modern POSIX and BSD C library functions/prototypes.
  515. dnl Warning flags for (almost) everybody.
  516. dnl Should probably be configurable
  517. WARNING_CFLAGS='-W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long'
  518. AC_SUBST(WARNING_CFLAGS)
  519. dnl CFLAGS that are used for all native code. We want to compile
  520. dnl everything with unwinder data so that backtrace() will always
  521. dnl work.
  522. EXTRA_CFLAGS='-fexceptions -fasynchronous-unwind-tables'
  523. AC_SUBST(EXTRA_CFLAGS)
  524. dnl Strict warning flags which not every module uses.
  525. dnl Should probably be configurable.
  526. STRICT_WARNING_CFLAGS='-Wstrict-prototypes -pedantic'
  527. AC_SUBST(STRICT_WARNING_CFLAGS)
  528. dnl Whether or not to add -Werror, also not used by all modueles.
  529. dnl Can be configured by --disable-Werror
  530. ERROR_CFLAGS=
  531. if test "x${ENABLE_WERROR}" = xyes; then
  532. ERROR_CFLAGS='-Werror'
  533. fi
  534. AC_SUBST(ERROR_CFLAGS)
  535. fi
  536. dnl Check for libxml and libxslt libraries (when xmlj is enabled).
  537. if test "x${COMPILE_XMLJ}" = xyes; then
  538. PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
  539. PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
  540. AC_SUBST(XML_LIBS)
  541. AC_SUBST(XML_CFLAGS)
  542. AC_SUBST(XSLT_LIBS)
  543. AC_SUBST(XSLT_CFLAGS)
  544. fi
  545. dnl Check for AWT related gthread/gtk
  546. if test "x${COMPILE_GTK_PEER}" = xyes; then
  547. AC_PATH_XTRA
  548. if test "$no_x" = yes; then
  549. AC_MSG_ERROR([GTK+ peers requested but no X library available])
  550. fi
  551. dnl Check if we can link against the XTest library and set
  552. dnl HAVE_XTEST accordingly.
  553. AC_CHECK_LIB([Xtst], [XTestQueryExtension],
  554. [AC_DEFINE(HAVE_XTEST, 1, [Define to 1 if you have libXtst.])[XTEST_LIBS="$XTEST_LIBS -X11 -lXtst"]],
  555. [true],
  556. [${X_LIBS}])
  557. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
  558. PKG_CHECK_MODULES(FREETYPE2, freetype2)
  559. PKG_CHECK_MODULES(PANGOFT2, pangoft2)
  560. PKG_CHECK_MODULES(CAIRO, cairo >= 1.1.8)
  561. dnl Check if we can link against the XRender library and set
  562. dnl HAVE_XRENDER accordingly.
  563. AC_CHECK_LIB([Xrender], [XRenderQueryExtension],
  564. [AC_DEFINE(HAVE_XRENDER, 1, [Define to 1 if you have libXrender.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrender"]],
  565. [true],
  566. [${X_LIBS}])
  567. dnl Check if we can link against the XRandR library and set
  568. dnl HAVE_XRANDR accordingly.
  569. AC_CHECK_LIB([Xrandr], [XRRQueryExtension],
  570. [AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have libXrandr.])[X_EXTRA_LIBS="$X_EXTRA_LIBS -lXrandr"]],
  571. [true],
  572. [${X_LIBS}])
  573. AC_SUBST(GTK_CFLAGS)
  574. AC_SUBST(GTK_LIBS)
  575. AC_SUBST(FREETYPE2_LIBS)
  576. AC_SUBST(FREETYPE2_CFLAGS)
  577. AC_SUBST(PANGOFT2_LIBS)
  578. AC_SUBST(PANGOFT2_CFLAGS)
  579. AC_SUBST(XTEST_LIBS)
  580. fi
  581. dnl gconf-peer
  582. if test "x${COMPILE_GCONF_PEER}" = xyes; then
  583. PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.6.0)
  584. AC_SUBST(GCONF_CFLAGS)
  585. AC_SUBST(GCONF_LIBS)
  586. dnl we also need gdk for locking
  587. PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
  588. AC_SUBST(GDK_CFLAGS)
  589. AC_SUBST(GDK_LIBS)
  590. dnl check if the config value was given form the command line,
  591. dnl if not, overwrite the default if we have the gconf backend
  592. dnl compiled in
  593. USE_GCONF_PREFS_PEER=$enable_default_preferences_peer
  594. if test "$USE_GCONF_PREFS_PEER" = ""; then
  595. DEFAULT_PREFS_PEER=gnu.java.util.prefs.GConfBasedFactory
  596. fi
  597. fi
  598. dnl gstreamer-peer
  599. if test "x${COMPILE_GSTREAMER_PEER}" = xyes; then
  600. GST_MAJORMINOR=0.10
  601. GST_REQUIRED=0.10.10
  602. dnl gstreamer
  603. PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED)
  604. AC_SUBST(GSTREAMER_CFLAGS)
  605. AC_SUBST(GSTREAMER_LIBS)
  606. dnl gstreamer-base
  607. PKG_CHECK_MODULES(GSTREAMER_BASE,
  608. gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED)
  609. AC_SUBST(GSTREAMER_BASE_CFLAGS)
  610. AC_SUBST(GSTREAMER_BASE_LIBS)
  611. dnl gstreamer-plugin-base
  612. PKG_CHECK_MODULES(GSTREAMER_PLUGINS_BASE,
  613. gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQUIRED)
  614. AC_SUBST(GSTREAMER_PLUGINS_BASE_CFLAGS)
  615. AC_SUBST(GSTREAMER_PLUGINS_BASE_LIBS)
  616. GST_PLUGIN_LDFLAGS='-module -avoid-version -Wno-unused-parameter -no-undefined'
  617. AC_SUBST(GST_PLUGIN_LDFLAGS)
  618. PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.8)
  619. AC_SUBST(GDK_CFLAGS)
  620. AC_SUBST(GDK_LIBS)
  621. dnl set the gstreamer based file reader, writer and mixer
  622. GSTREAMER_FILE_READER=gnu.javax.sound.sampled.gstreamer.io.GstAudioFileReader
  623. GSTREAMER_MIXER_PROVIDER=gnu.javax.sound.sampled.gstreamer.GStreamerMixerProvider
  624. fi
  625. dnl add the gstreamer resources
  626. AC_SUBST(GSTREAMER_FILE_READER)
  627. AC_SUBST(GSTREAMER_MIXER_PROVIDER)
  628. dnl Check for AWT related Qt4
  629. if test "x${COMPILE_QT_PEER}" = xyes; then
  630. PKG_CHECK_MODULES(QT, QtCore QtGui >= 4.1.0, HAVE_QT4="yes", HAVE_QT4="no")
  631. if test "x$HAVE_QT4" = "xyes"; then
  632. dnl Check needed because in some cases the QtGui includedir
  633. dnl doesn't contain the subsystem dir.
  634. QT_INCLUDE_DIR=`$PKG_CONFIG --variable=includedir QtGui`
  635. EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
  636. AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
  637. AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
  638. AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
  639. QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
  640. AC_MSG_WARN([QWidget not found])))
  641. AC_CHECK_PROG(MOC, [moc], [moc])
  642. AC_CHECK_PROG(MOC4, [moc-qt4], [moc-qt4])
  643. if test x"$MOC4" != x ; then
  644. AC_MSG_NOTICE([Using $MOC4 as moc])
  645. MOC=$MOC4;
  646. fi
  647. fi
  648. if test "x$HAVE_QT4" = "xno"; then
  649. AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
  650. case "$host_os" in
  651. darwin*)
  652. AC_ARG_WITH([qt4dir],
  653. [AS_HELP_STRING([--with-qt4dir=DIR],
  654. [Qt4 installation directory used for OS-X.
  655. For other systems use pkg-config.])],
  656. [QT4DIR=$withval]
  657. )
  658. if test x"$QT4DIR" = x ; then
  659. AC_MSG_ERROR([*** No path for Qt4 --with-qt4dir option given])
  660. fi
  661. AC_MSG_RESULT([QT4DIR... $QT4DIR])
  662. AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
  663. if test x"$MOC" = x; then
  664. AC_MSG_ERROR([*** This is not the right Qt installation])
  665. fi
  666. QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
  667. QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
  668. QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
  669. QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
  670. ;;
  671. *)
  672. AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
  673. of your installed Qt4 installation.])
  674. ;;
  675. esac
  676. fi
  677. AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
  678. AC_SUBST(QT_CFLAGS)
  679. AC_SUBST(QT_LIBS)
  680. fi
  681. dnl **********************************************************************
  682. dnl Check for MSG_NOSIGNAL
  683. dnl **********************************************************************
  684. AC_MSG_CHECKING(for MSG_NOSIGNAL)
  685. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_NOSIGNAL; ]])],[ AC_MSG_RESULT(yes)
  686. AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,
  687. [Define this symbol if you have MSG_NOSIGNAL]) ],[ AC_MSG_RESULT(no)
  688. ])
  689. dnl **********************************************************************
  690. dnl Check for SO_NOSIGPIPE (Darwin equivalent for MSG_NOSIGNAL)
  691. dnl **********************************************************************
  692. AC_MSG_CHECKING(for SO_NOSIGPIPE )
  693. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = SO_NOSIGPIPE; ]])],[ AC_MSG_RESULT(yes)
  694. AC_DEFINE(HAVE_SO_NOSIGPIPE, 1,
  695. [Define this symbol if you have SO_NOSIGPIPE]) ],[ AC_MSG_RESULT(no)
  696. ])
  697. dnl **********************************************************************
  698. dnl Check for MSG_WAITALL
  699. dnl **********************************************************************
  700. AC_MSG_CHECKING(for MSG_WAITALL)
  701. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[ int f = MSG_WAITALL; ]])],[ AC_MSG_RESULT(yes)
  702. AC_DEFINE(HAVE_MSG_WAITALL, 1,
  703. [Define this symbol if you have MSG_WAITALL]) ],[ AC_MSG_RESULT(no)
  704. ])
  705. dnl Check for plugin support headers and libraries.
  706. if test "x${COMPILE_PLUGIN}" = xyes; then
  707. PKG_CHECK_MODULES(MOZILLA, mozilla-plugin libxul-unstable, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  708. if test "x${MOZILLA_FOUND}" = xno; then
  709. PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  710. fi
  711. if test "x${MOZILLA_FOUND}" = xno; then
  712. PKG_CHECK_MODULES(MOZILLA, firefox-plugin firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  713. fi
  714. if test "x${MOZILLA_FOUND}" = xno; then
  715. PKG_CHECK_MODULES(MOZILLA, xulrunner-plugin xulrunner-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  716. fi
  717. if test "x${MOZILLA_FOUND}" = xno; then
  718. PKG_CHECK_MODULES(MOZILLA, mozilla-firefox-plugin mozilla-firefox-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  719. fi
  720. if test "x${MOZILLA_FOUND}" = xno; then
  721. PKG_CHECK_MODULES(MOZILLA, seamonkey-plugin seamonkey-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  722. fi
  723. if test "x${MOZILLA_FOUND}" = xno; then
  724. PKG_CHECK_MODULES(MOZILLA, iceape-plugin iceape-xpcom, [MOZILLA_FOUND=yes], [MOZILLA_FOUND=no])
  725. fi
  726. if test "x${MOZILLA_FOUND}" = xno; then
  727. AC_MSG_ERROR([Couldn't find plugin support headers and libraries, try --disable-plugin])
  728. fi
  729. PKG_CHECK_MODULES(GLIB, glib-2.0)
  730. PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.8 gthread-2.0 >= 2.2 gdk-pixbuf-2.0)
  731. AC_SUBST(MOZILLA_CFLAGS)
  732. AC_SUBST(MOZILLA_LIBS)
  733. AC_SUBST(GLIB_CFLAGS)
  734. AC_SUBST(GLIB_LIBS)
  735. AC_SUBST(GTK_CFLAGS)
  736. AC_SUBST(GTK_LIBS)
  737. AC_SUBST(PLUGIN_DIR, $HOME/.mozilla/plugins/)
  738. fi
  739. dnl Check for GNU MP library and header file
  740. dnl for GNU MP versions >= 4.2 use __gmpz_combit; otherwise look for
  741. dnl __gmpz_mul_si for earlier versions (>= 3.1).
  742. dnl IMPORTANT: if you decide to look for __gmpz_combit, don't forget to
  743. dnl change the name of the corresponding ac_ variable on lines 860...
  744. AC_ARG_WITH(gmp, [ --with-gmp=PATH specify prefix directory for the installed GMP package.
  745. Equivalent to --with-gmp-include=PATH/include
  746. plus --with-gmp-lib=PATH/lib])
  747. AC_ARG_WITH(gmp_include, [ --with-gmp-include=PATH specify directory for installed GMP include files])
  748. AC_ARG_WITH(gmp_lib, [ --with-gmp-lib=PATH specify directory for the installed GMP library])
  749. if test "x$with_gmp" != x; then
  750. gmplibs=-lgmp
  751. gmpinc=
  752. gmplibs="-L$with_gmp/lib $gmplibs"
  753. gmpinc="-I$with_gmp/include $gmpinc"
  754. if test "x$with_gmp_include" != x; then
  755. gmpinc="-I$with_gmp_include $gmpinc"
  756. fi
  757. if test "x$with_gmp_lib" != x; then
  758. gmplibs="-L$with_gmp_lib $gmplibs"
  759. fi
  760. else
  761. gmplibs="-lgmp"
  762. gmpinc="-I/usr/include"
  763. fi
  764. if test "x${COMPILE_GMP}" = xyes; then
  765. AC_MSG_CHECKING([for GMP directories])
  766. if test "x$with_gmp" != x; then
  767. gmplibs="-L$with_gmp/lib -lgmp"
  768. gmpinc="-I$with_gmp/include"
  769. if test "x$with_gmp_include" != x; then
  770. gmpinc="-I$with_gmp_include $gmpinc"
  771. fi
  772. if test "x$with_gmp_lib" != x; then
  773. gmplibs="-L$with_gmp_lib $gmplibs"
  774. fi
  775. else
  776. with_gmp="/usr"
  777. gmplibs="-lgmp"
  778. gmpinc="-I/usr/include"
  779. fi
  780. AC_MSG_RESULT([prefix=$with_gmp, libs=$gmplibs, inc=$gmpinc])
  781. AC_CHECK_LIB(gmp, __gmpz_mul_si,
  782. [GMP_CFLAGS="$gmpinc"
  783. GMP_LIBS="$gmplibs" ],
  784. [GMP_CFLAGS=
  785. GMP_LIBS= ])
  786. AC_SUBST(GMP_CFLAGS)
  787. AC_SUBST(GMP_LIBS)
  788. AC_CHECK_HEADERS([gmp.h])
  789. fi
  790. else
  791. COMPILE_GMP=no
  792. fi
  793. if test "x${REGENERATE_JNI_HEADERS}" = xyes; then
  794. CLASSPATH_WITH_JAVAH
  795. fi
  796. dnl -----------------------------------------------------------
  797. dnl Add the include files for the native abstraction layer.
  798. dnl Used by AM_CPPFLAGS in the different modules.
  799. dnl -----------------------------------------------------------
  800. CLASSPATH_INCLUDES="-I\$(top_srcdir)/include -I\$(top_srcdir)/native/jni/classpath -I\$(top_srcdir)/native/jni/native-lib"
  801. AC_SUBST(CLASSPATH_INCLUDES)
  802. dnl -----------------------------------------------------------
  803. if test "x${COMPILE_JNI}" = xyes; then
  804. AC_MSG_CHECKING(jni_md.h support)
  805. if test -f ${srcdir}/include/jni_md-${target_cpu}-${target_os}.h; then
  806. AC_MSG_RESULT(yes)
  807. else
  808. target_cpu=x86
  809. target_os=linux-gnu
  810. AC_MSG_WARN(no, using x86-linux-gnu)
  811. fi
  812. ac_sources="include/jni_md-${target_cpu}-${target_os}.h"
  813. ac_dests="include/jni_md.h"
  814. while test -n "$ac_sources"; do
  815. set $ac_dests; ac_dest=$1; shift; ac_dests=$*
  816. set $ac_sources; ac_source=$1; shift; ac_sources=$*
  817. ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
  818. done
  819. AC_CONFIG_LINKS([$ac_config_links_1])
  820. fi
  821. CLASSPATH_WITH_CLASSLIB
  822. dnl -----------------------------------------------------------
  823. dnl Initialize maintainer mode
  824. dnl -----------------------------------------------------------
  825. AM_MAINTAINER_MODE
  826. dnl -----------------------------------------------------------
  827. dnl Enable debugging statements at compile time. By default
  828. dnl these statements should be optimized out of the bytecode
  829. dnl produced by an optimizing Java compiler and not hinder
  830. dnl performance because debugging is turned off by default.
  831. dnl -----------------------------------------------------------
  832. AC_ARG_ENABLE([debug],
  833. [AS_HELP_STRING(--enable-debug,enable runtime debugging code)],
  834. [case "${enableval}" in
  835. yes)
  836. LIBDEBUG="true"
  837. AC_DEFINE(DEBUG, 1, [Define to 1 if you want native library runtime debugging code enabled])
  838. ;;
  839. no) LIBDEBUG="false" ;;
  840. *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
  841. esac],
  842. [LIBDEBUG="false"])
  843. AC_SUBST(LIBDEBUG)
  844. dnl -----------------------------------------------------------
  845. dnl Enable execution of all static initializer loadLibrary()
  846. dnl calls at compile time. By default most people will not
  847. dnl want to disable this, but some VMs (gcj) don't need or want
  848. dnl them.
  849. dnl -----------------------------------------------------------
  850. AC_ARG_ENABLE([load-library],
  851. [AS_HELP_STRING(--enable-load-library,enable to use JNI native methods [default=yes])],
  852. [case "${enableval}" in
  853. yes) INIT_LOAD_LIBRARY="true" ;;
  854. no) INIT_LOAD_LIBRARY="false" ;;
  855. *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
  856. esac],
  857. [INIT_LOAD_LIBRARY="true"])
  858. AC_SUBST(INIT_LOAD_LIBRARY)
  859. dnl -----------------------------------------------------------
  860. dnl Specify the jar file containing the Eclipse Java Compiler. If
  861. dnl this option is not specified then the com.sun.tools.javac
  862. dnl implementation will not be included in tools.zip.
  863. dnl -----------------------------------------------------------
  864. dnl GCJ LOCAL: default to $multi_basedir/ecj.jar
  865. dnl In the default case where $multi_basedir/ecj.jar is found
  866. dnl $(jardir)/ecj.jar will not expand properly in GNU Classpath's
  867. dnl gnu/classpath/Configuration.java. That is OK though since libjava's
  868. dnl gnu/classpath/Configuration.java overrides GNU Classpath's and
  869. dnl ECJ_JAR_FILE will be properly expanded in libjava's
  870. dnl gnu/classpath/natConfiguration.cc.
  871. AC_ARG_WITH([ecj-jar],
  872. [AS_HELP_STRING([--with-ecj-jar=ABS.PATH],
  873. [specify jar file containing the Eclipse Java Compiler])],
  874. [ECJ_JAR=$withval],
  875. [if test -f $multi_basedir/ecj.jar; then
  876. ECJ_JAR='$(jardir)/ecj.jar'
  877. fi])
  878. AC_SUBST(ECJ_JAR)
  879. dnl -----------------------------------------------------------
  880. dnl Should the VM explicitly run class initialization subfunctions for
  881. dnl java.lang.System? (default is false -- the subfunctions will be run
  882. dnl automatically by the class initializer)
  883. dnl -----------------------------------------------------------
  884. AC_ARG_ENABLE([java-lang-system-explicit-initialization],
  885. [AS_HELP_STRING(--enable-java-lang-system-explicit-initialization,will the VM explicitly invoke java.lang.System's static initialization methods [default=no])],
  886. [case "${enableval}" in
  887. yes|true) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="true" ;;
  888. no|false) JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false" ;;
  889. *) AC_MSG_ERROR(bad value ${enableval} for --enable-java-lang-system-explicit-initialization) ;;
  890. esac],
  891. [JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION="false"])
  892. AC_SUBST(JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION)
  893. dnl -----------------------------------------------------------
  894. dnl avoiding automake complaints
  895. dnl -----------------------------------------------------------
  896. REMOVE=""
  897. AC_SUBST(REMOVE)
  898. dnl -----------------------------------------------------------
  899. dnl This is probably useless.
  900. dnl -----------------------------------------------------------
  901. AC_PATH_PROG(MKDIR, mkdir)
  902. AC_PATH_PROG(CP, cp)
  903. AC_PATH_PROG(DATE, date)
  904. dnl -----------------------------------------------------------
  905. dnl According to the GNU coding guide, we shouldn't require find,
  906. dnl and zip, however GNU provides both so it should be okay
  907. dnl -----------------------------------------------------------
  908. AC_PATH_PROG(FIND, find)
  909. dnl -----------------------------------------------------------
  910. dnl Specify what to install (install only glibj.zip by default)
  911. dnl -----------------------------------------------------------
  912. CLASSPATH_WITH_GLIBJ
  913. dnl -----------------------------------------------------------
  914. dnl Enable API documentation generation (disabled by default)
  915. dnl -----------------------------------------------------------
  916. CLASSPATH_WITH_GJDOC
  917. dnl -----------------------------------------------------------
  918. dnl Whether to use jay to regenerate parsers.
  919. dnl -----------------------------------------------------------
  920. REGEN_WITH_JAY
  921. dnl -----------------------------------------------------------
  922. dnl This sets the build-time default, which can now be overridden
  923. dnl by setting the system property gnu.classpath.awt.gtk.portable.native.sync
  924. dnl to "true" or "false".
  925. dnl -----------------------------------------------------------
  926. AC_ARG_ENABLE([portable-native-sync],
  927. [AS_HELP_STRING(--enable-portable-native-sync,synchronize VM threads portably)],
  928. [case "${enableval}" in
  929. yes)
  930. AC_DEFINE(PORTABLE_NATIVE_SYNC, 1, [Define if you want to synchronize VM threads portably by default; undef otherwise])
  931. ;;
  932. no) ;;
  933. *)
  934. AC_MSG_ERROR(bad value ${enableval} for --enable-portable-native-sync)
  935. ;;
  936. esac],
  937. [])
  938. AX_CREATE_STDINT_H([include/config-int.h])
  939. dnl -----------------------------------------------------------------------
  940. dnl Support for using a prebuilt class library
  941. dnl -----------------------------------------------------------------------
  942. AC_ARG_WITH([glibj_zip],
  943. AS_HELP_STRING([--with-glibj-zip=ABS.PATH],
  944. [use prebuilt glibj.zip class library]))
  945. case "$with_glibj_zip" in
  946. "")
  947. use_glibj_zip=false
  948. ;;
  949. "no" )
  950. use_glibj_zip=false
  951. ;;
  952. "yes")
  953. AC_MSG_ERROR([Please suply an absolute path to a prebuilt glibj.zip])
  954. ;;
  955. *)
  956. use_glibj_zip=true
  957. PATH_TO_GLIBJ_ZIP=$with_glibj_zip
  958. ;;
  959. esac;
  960. AM_CONDITIONAL(USE_PREBUILT_GLIBJ_ZIP, test x$use_glibj_zip = xtrue)
  961. AC_SUBST(PATH_TO_GLIBJ_ZIP)
  962. if test "x${TOOLSDIR}" != x; then
  963. dnl GCJ LOCAL
  964. if test "x${COMPILE_WRAPPERS}" = xno && test "x${enable_java_maintainer_mode}" = xyes; then
  965. AC_PROG_JAVA_WORKS
  966. fi
  967. dnl END GCJ LOCAL
  968. if test "x${COMPILE_GJDOC}" = xyes; then
  969. AC_LIB_ANTLR
  970. dnl GCJ LOCAL
  971. if test "x${REGENERATE_GJDOC_PARSER}" = xyes && test "x${enable_java_maintainer_mode}" = xyes; then
  972. dnl END GCJ LOCAL
  973. AC_PROG_ANTLR(2,7,1)
  974. fi
  975. fi
  976. fi
  977. # Check for javac if we need to build either the class library,
  978. # the examples or the tools
  979. if test "x${use_glibj_zip}" = xfalse || \
  980. test "x${EXAMPLESDIR}" != x || \
  981. test "x${TOOLSDIR}" != x && \
  982. test "x${build_class_files}" != xno && \
  983. test "${enable_java_maintainer_mode}" = yes; then dnl GCJ_LOCAL
  984. AC_PROG_JAVAC_WORKS
  985. CLASSPATH_JAVAC_MEM_CHECK
  986. else
  987. AM_CONDITIONAL(GCJ_JAVAC, false)
  988. fi
  989. dnl -----------------------------------------------------------
  990. dnl Build with Escher based X peers.
  991. dnl -----------------------------------------------------------
  992. AC_ARG_WITH([escher],
  993. AS_HELP_STRING([--with-escher=ABS.PATH],
  994. [specify path to escher dir or JAR for X peers]))
  995. case "$with_escher" in
  996. "")
  997. use_escher=false
  998. ;;
  999. "no")
  1000. use_escher=false
  1001. ;;
  1002. "yes")
  1003. AC_MSG_ERROR([Please supply an absolute path to Escher library])
  1004. ;;
  1005. *)
  1006. use_escher=true
  1007. PATH_TO_ESCHER=$with_escher
  1008. ;;
  1009. esac
  1010. AM_CONDITIONAL(USE_ESCHER, test x$use_escher = xtrue)
  1011. AC_SUBST(PATH_TO_ESCHER)
  1012. dnl -----------------------------------------------------------
  1013. dnl Check if local socket support should be included.
  1014. dnl -----------------------------------------------------------
  1015. AC_ARG_ENABLE([local-sockets],
  1016. [AS_HELP_STRING(--enable-local-sockets,enables local (AF_LOCAL) socket API [default: no])],
  1017. [case "${enableval}" in
  1018. yes)
  1019. ENABLE_LOCAL_SOCKETS=yes
  1020. ;;
  1021. *)
  1022. ENABLE_LOCAL_SOCKETS=no
  1023. ;;
  1024. esac],
  1025. [])
  1026. if test "x$ENABLE_LOCAL_SOCKETS" = "xyes"
  1027. then
  1028. AC_CHECK_HEADER([sys/un.h])
  1029. AC_CHECK_FUNCS([read write bind listen accept shutdown], [],
  1030. AC_MSG_ERROR([networking support not available]))
  1031. AC_DEFINE(ENABLE_LOCAL_SOCKETS, [1], [Define to enable support for local sockets.])
  1032. fi
  1033. AM_CONDITIONAL(ENABLE_LOCAL_SOCKETS, test "x$ENABLE_LOCAL_SOCKETS" = "xyes")
  1034. dnl -----------------------------------------------------------
  1035. dnl Add the default preference peer
  1036. dnl -----------------------------------------------------------
  1037. AC_SUBST(DEFAULT_PREFS_PEER)
  1038. dnl -----------------------------------------------------------
  1039. dnl Set GNU MP related params
  1040. dnl -----------------------------------------------------------
  1041. WANT_NATIVE_BIG_INTEGER=false
  1042. if test "x${COMPILE_GMP}" = xyes; then
  1043. if test "x${ac_cv_lib_gmp___gmpz_mul_si}" = xyes; then
  1044. if test "x${ac_cv_header_gmp_h}" = xyes; then
  1045. WANT_NATIVE_BIG_INTEGER=true
  1046. AC_DEFINE(WITH_GNU_MP, 1, [Define to 1 if gmp is usable])
  1047. else
  1048. COMPILE_GMP=no
  1049. fi
  1050. else
  1051. COMPILE_GMP=no
  1052. fi
  1053. fi
  1054. AC_SUBST(WANT_NATIVE_BIG_INTEGER)
  1055. AM_CONDITIONAL(CREATE_GMPBI_LIBRARY, test "x${COMPILE_GMP}" = xyes)
  1056. dnl -----------------------------------------------------------
  1057. dnl output files
  1058. dnl -----------------------------------------------------------
  1059. AC_CONFIG_FILES([Makefile
  1060. doc/Makefile
  1061. doc/api/Makefile
  1062. external/Makefile
  1063. external/sax/Makefile
  1064. external/w3c_dom/Makefile
  1065. external/relaxngDatatype/Makefile
  1066. external/jsr166/Makefile
  1067. gnu/classpath/Configuration.java
  1068. gnu/java/security/Configuration.java
  1069. include/Makefile
  1070. native/Makefile
  1071. native/fdlibm/Makefile
  1072. native/jawt/Makefile
  1073. native/jni/Makefile
  1074. native/jni/classpath/Makefile
  1075. native/jni/java-io/Makefile
  1076. native/jni/java-lang/Makefile
  1077. native/jni/java-math/Makefile
  1078. native/jni/java-net/Makefile
  1079. native/jni/java-nio/Makefile
  1080. native/jni/java-util/Makefile
  1081. native/jni/gtk-peer/Makefile
  1082. native/jni/gconf-peer/Makefile
  1083. native/jni/gstreamer-peer/Makefile
  1084. native/jni/qt-peer/Makefile
  1085. native/jni/xmlj/Makefile
  1086. native/jni/midi-alsa/Makefile
  1087. native/jni/midi-dssi/Makefile
  1088. native/jni/native-lib/Makefile
  1089. native/plugin/Makefile
  1090. resource/Makefile
  1091. resource/META-INF/services/java.util.prefs.PreferencesFactory
  1092. resource/META-INF/services/javax.sound.sampled.spi.AudioFileReader
  1093. resource/META-INF/services/javax.sound.sampled.spi.MixerProvider
  1094. scripts/Makefile
  1095. scripts/classpath.spec
  1096. lib/Makefile
  1097. lib/gen-classlist.sh
  1098. lib/copy-vmresources.sh
  1099. scripts/check_jni_methods.sh
  1100. tools/Makefile
  1101. examples/Makefile
  1102. examples/Makefile.jawt
  1103. examples/Makefile.java2d])
  1104. CLASSPATH_COND_IF([CREATE_WRAPPERS], [test "x${COMPILE_WRAPPERS}" = xyes], [],
  1105. [AC_CONFIG_FILES([tools/gappletviewer
  1106. tools/gjarsigner
  1107. tools/gkeytool
  1108. tools/gjar
  1109. tools/gnative2ascii
  1110. tools/gserialver
  1111. tools/grmiregistry
  1112. tools/gtnameserv
  1113. tools/gorbd
  1114. tools/grmid
  1115. tools/grmic
  1116. tools/gjavah])
  1117. AC_CONFIG_COMMANDS([gappletviewer],[chmod 755 tools/gappletviewer])
  1118. AC_CONFIG_COMMANDS([gjarsigner],[chmod 755 tools/gjarsigner])
  1119. AC_CONFIG_COMMANDS([gkeytool],[chmod 755 tools/gkeytool])
  1120. AC_CONFIG_COMMANDS([gjar],[chmod 755 tools/gjar])
  1121. AC_CONFIG_COMMANDS([gnative2ascii],[chmod 755 tools/gnative2ascii])
  1122. AC_CONFIG_COMMANDS([gserialver],[chmod 755 tools/gserialver])
  1123. AC_CONFIG_COMMANDS([grmiregistry],[chmod 755 tools/grmiregistry])
  1124. AC_CONFIG_COMMANDS([gtnameserv],[chmod 755 tools/gtnameserv])
  1125. AC_CONFIG_COMMANDS([gorbd],[chmod 755 tools/gorbd])
  1126. AC_CONFIG_COMMANDS([grmid],[chmod 755 tools/grmid])
  1127. AC_CONFIG_COMMANDS([grmic],[chmod 755 tools/grmic])
  1128. AC_CONFIG_COMMANDS([gjavah], [chmod 755 tools/gjavah])
  1129. ])
  1130. if test "x${COMPILE_GJDOC}" = xyes
  1131. then
  1132. AC_CONFIG_FILES([tools/gjdoc])
  1133. AC_CONFIG_COMMANDS([gjdoc], [chmod 755 tools/gjdoc])
  1134. fi
  1135. AC_CONFIG_COMMANDS([gen-classlist],[chmod 755 lib/gen-classlist.sh])
  1136. AC_CONFIG_COMMANDS([copy-vmresources],[chmod 755 lib/copy-vmresources.sh])
  1137. AC_OUTPUT
  1138. # Create standard.omit based on decisions we just made.
  1139. cat ${srcdir}/lib/standard.omit.in > lib/standard.omit
  1140. if test x$use_escher != xtrue; then
  1141. echo gnu/java/awt/peer/x/.*java$ >> lib/standard.omit
  1142. fi
  1143. if test "x${COMPILE_PLUGIN}" = "xyes" ; then
  1144. AC_MSG_WARN([You have enabled the browser plugin. Please note that this is no longer maintained as part of GNU Classpath; development has moved to the IcedTea project.])
  1145. fi