configure.in 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  1. dnl Process this with autoconf to create configure
  2. AC_INIT(java/lang/System.java)
  3. # This works around the fact that libtool configuration may change LD
  4. # for this particular configuration, but some shells, instead of
  5. # keeping the changes in LD private, export them just because LD is
  6. # exported.
  7. ORIGINAL_LD_FOR_MULTILIBS=$LD
  8. AC_PROG_LN_S
  9. dnl We use these options to decide which functions to include.
  10. AC_ARG_WITH(target-subdir,
  11. [ --with-target-subdir=SUBDIR
  12. configuring in a subdirectory])
  13. AC_ARG_WITH(cross-host,
  14. [ --with-cross-host=HOST configuring with a cross compiler])
  15. AC_ARG_WITH(newlib,
  16. [ --with-newlib Configuring with newlib])
  17. LIBGCJ_CONFIGURE(.)
  18. AM_CONFIG_HEADER(include/config.h gcj/libgcj-config.h)
  19. # Only use libltdl for native builds.
  20. if test -z "${with_cross_host}"; then
  21. AC_LIBLTDL_CONVENIENCE
  22. AC_LIBTOOL_DLOPEN
  23. DIRLTDL=libltdl
  24. AC_DEFINE(USE_LTDL)
  25. # Sigh. Libtool's macro doesn't do the right thing.
  26. INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
  27. # FIXME: this is a hack.
  28. sub_auxdir="`cd $ac_aux_dir && ${PWDCMD-pwd}`"
  29. ac_configure_args="$ac_configure_args --with-auxdir=$sub_auxdir"
  30. fi
  31. AC_SUBST(INCLTDL)
  32. AC_SUBST(LIBLTDL)
  33. AC_SUBST(DIRLTDL)
  34. AM_PROG_LIBTOOL
  35. AC_CONFIG_SUBDIRS($DIRLTDL)
  36. if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
  37. COMPPATH=.
  38. else
  39. COMPPATH=..
  40. fi
  41. AC_SUBST(COMPPATH)
  42. dnl The -no-testsuite modules omit the test subdir.
  43. AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
  44. dnl Should the runtime set system properties by examining the
  45. dnl environment variable GCJ_PROPERTIES?
  46. AC_ARG_ENABLE(getenv-properties,
  47. [ --disable-getenv-properties
  48. don't set system properties from GCJ_PROPERTIES])
  49. dnl Whether GCJ_PROPERTIES is used depends on the target.
  50. if test -z "$enable_getenv_properties"; then
  51. enable_getenv_properties=${enable_getenv_properties_default-yes}
  52. fi
  53. if test "$enable_getenv_properties" = no; then
  54. AC_DEFINE(DISABLE_GETENV_PROPERTIES)
  55. fi
  56. dnl Whether we should use arguments to main()
  57. if test -z "$enable_main_args"; then
  58. enable_main_args=${enable_main_args_default-yes}
  59. fi
  60. if test "$enable_main_args" = no; then
  61. AC_DEFINE(DISABLE_MAIN_ARGS)
  62. fi
  63. dnl Should we use hashtable-based synchronization?
  64. dnl Currently works only for Linux X86/ia64
  65. dnl Typically faster and more space-efficient
  66. AC_ARG_ENABLE(hash-synchronization,
  67. [ --enable-hash-synchronization
  68. Use global hash table for monitor locks])
  69. if test -z "$enable_hash_synchronization"; then
  70. enable_hash_synchronization=$enable_hash_synchronization_default
  71. fi
  72. dnl configure.host sets slow_pthread_self if the synchronization code should
  73. dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
  74. if test "${slow_pthread_self}" = "yes"; then
  75. AC_DEFINE(SLOW_PTHREAD_SELF)
  76. fi
  77. dnl See if the user has requested runtime debugging.
  78. LIBGCJDEBUG="false"
  79. AC_SUBST(LIBGCJDEBUG)
  80. AC_ARG_ENABLE(libgcj-debug,
  81. [ --enable-libgcj-debug enable runtime debugging code],
  82. if test "$enable_libgcj_debug" = yes; then
  83. AC_DEFINE(DEBUG)
  84. LIBGCJDEBUG="true"
  85. fi)
  86. dnl See if the user has the interpreter included.
  87. AC_ARG_ENABLE(interpreter,
  88. [ --enable-interpreter enable interpreter],
  89. if test "$enable_interpreter" = yes; then
  90. # This can also be set in configure.host.
  91. libgcj_interpreter=yes
  92. elif test "$enable_interpreter" = no; then
  93. libgcj_interpreter=no
  94. fi)
  95. if test "$libgcj_interpreter" = yes; then
  96. AC_DEFINE(INTERPRETER)
  97. fi
  98. INTERPRETER="$libgcj_interpreter"
  99. AC_SUBST(INTERPRETER)
  100. AC_MSG_CHECKING([for exception model to use])
  101. AC_LANG_SAVE
  102. AC_LANG_CPLUSPLUS
  103. AC_ARG_ENABLE(sjlj-exceptions,
  104. [ --enable-sjlj-exceptions force use of builtin_setjmp for exceptions],
  105. [:],
  106. [dnl Botheration. Now we've got to detect the exception model.
  107. dnl Link tests against libgcc.a are problematic since -- at least
  108. dnl as of this writing -- we've not been given proper -L bits for
  109. dnl single-tree newlib and libgloss.
  110. dnl
  111. dnl This is what AC_TRY_COMPILE would do if it didn't delete the
  112. dnl conftest files before we got a change to grep them first.
  113. cat > conftest.$ac_ext << EOF
  114. [#]line __oline__ "configure"
  115. struct S { ~S(); };
  116. void bar();
  117. void foo()
  118. {
  119. S s;
  120. bar();
  121. }
  122. EOF
  123. old_CXXFLAGS="$CXXFLAGS"
  124. CXXFLAGS=-S
  125. if AC_TRY_EVAL(ac_compile); then
  126. if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then
  127. enable_sjlj_exceptions=yes
  128. elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then
  129. enable_sjlj_exceptions=no
  130. fi
  131. fi
  132. CXXFLAGS="$old_CXXFLAGS"
  133. rm -f conftest*])
  134. if test x$enable_sjlj_exceptions = xyes; then
  135. AC_DEFINE(SJLJ_EXCEPTIONS, 1,
  136. [Define if the compiler is configured for setjmp/longjmp exceptions.])
  137. ac_exception_model_name=sjlj
  138. elif test x$enable_sjlj_exceptions = xno; then
  139. ac_exception_model_name="call frame"
  140. else
  141. AC_MSG_ERROR([unable to detect exception model])
  142. fi
  143. AC_LANG_RESTORE
  144. AC_MSG_RESULT($ac_exception_model_name)
  145. # If we are non using SJLJ exceptions, and this host does not have support
  146. # for unwinding from a signal handler, enable checked dereferences and divides.
  147. if test $can_unwind_signal = no && test $enable_sjlj_exceptions = no; then
  148. CHECKREFSPEC=-fcheck-references
  149. DIVIDESPEC=-fuse-divide-subroutine
  150. EXCEPTIONSPEC=
  151. fi
  152. dnl See if the user wants to disable java.net. This is the mildly
  153. dnl ugly way that we admit that target-side configuration sucks.
  154. AC_ARG_ENABLE(java-net,
  155. [ --disable-java-net disable java.net])
  156. dnl Whether java.net is built by default can depend on the target.
  157. if test -z "$enable_java_net"; then
  158. enable_java_net=${enable_java_net_default-yes}
  159. fi
  160. if test "$enable_java_net" = no; then
  161. AC_DEFINE(DISABLE_JAVA_NET)
  162. fi
  163. dnl See if the user wants to configure without libffi. Some
  164. dnl architectures don't support it, and default values are set in
  165. dnl configure.host.
  166. AC_ARG_WITH(libffi,
  167. [ --without-libffi don't use libffi],,with_libffi=${with_libffi_default-yes})
  168. LIBFFI=
  169. LIBFFIINCS=
  170. if test "$with_libffi" != no; then
  171. AC_DEFINE(USE_LIBFFI)
  172. LIBFFI=../libffi/libffi_convenience.la
  173. LIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'
  174. fi
  175. AC_SUBST(LIBFFI)
  176. AC_SUBST(LIBFFIINCS)
  177. dnl See if the user wants to disable JVMPI support.
  178. AC_ARG_ENABLE(jvmpi,
  179. [ --disable-jvmpi disable JVMPI support])
  180. if test "$enable_jvmpi" != no; then
  181. AC_DEFINE(ENABLE_JVMPI)
  182. fi
  183. dnl If the target is an eCos system, use the appropriate eCos
  184. dnl I/O routines.
  185. dnl FIXME: this should not be a local option but a global target
  186. dnl system; at present there is no eCos target.
  187. TARGET_ECOS=${PROCESS-"no"}
  188. AC_ARG_WITH(ecos,
  189. [ --with-ecos enable runtime eCos target support],
  190. TARGET_ECOS="$with_ecos"
  191. )
  192. PLATFORMOBJS=
  193. case "$TARGET_ECOS" in
  194. no) case "$host" in
  195. *mingw*)
  196. PLATFORM=Win32
  197. PLATFORMOBJS=win32.lo
  198. PLATFORMH=win32.h
  199. CHECK_FOR_BROKEN_MINGW_LD
  200. ;;
  201. *)
  202. PLATFORM=Posix
  203. PLATFORMOBJS=posix.lo
  204. PLATFORMH=posix.h
  205. ;;
  206. esac
  207. ;;
  208. *)
  209. PLATFORM=Ecos
  210. AC_DEFINE(ECOS)
  211. PLATFORMOBJS=posix.lo
  212. PLATFORMH=posix.h
  213. ;;
  214. esac
  215. AC_SUBST(PLATFORMOBJS)
  216. AC_LINK_FILES(include/$PLATFORMH, include/platform.h)
  217. AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
  218. AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
  219. AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
  220. AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
  221. dnl These may not be defined in a non-ANS conformant embedded system.
  222. dnl FIXME: Should these case a runtime exception in that case?
  223. AC_EGREP_HEADER(mktime, time.h, AC_DEFINE(HAVE_MKTIME))
  224. AC_EGREP_HEADER(localtime, time.h, AC_DEFINE(HAVE_LOCALTIME))
  225. dnl Create the subdirectory for natFileDescriptor.cc, or the attempt
  226. dnl to create the link will fail.
  227. test -d java || mkdir java
  228. test -d java/io || mkdir java/io
  229. test -d gnu || mkdir gnu
  230. AC_LINK_FILES(java/io/natFile${FILE-${PLATFORM}}.cc, java/io/natFile.cc)
  231. AC_LINK_FILES(java/io/natFileDescriptor${FILE-${PLATFORM}}.cc, java/io/natFileDescriptor.cc)
  232. dnl Likewise for ConcreteProcess.java and natConcreteProcess.cc.
  233. test -d java/lang || mkdir java/lang
  234. AC_LINK_FILES(java/lang/${PLATFORM}Process.java, java/lang/ConcreteProcess.java)
  235. AC_LINK_FILES(java/lang/nat${PLATFORM}Process.cc, java/lang/natConcreteProcess.cc)
  236. case "${host}" in
  237. *mingw*)
  238. SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
  239. ;;
  240. *)
  241. SYSTEMSPEC=
  242. ;;
  243. esac
  244. AC_SUBST(SYSTEMSPEC)
  245. LIBGCJTESTSPEC="-L`${PWDCMD-pwd}`/.libs -rpath `${PWDCMD-pwd}`/.libs"
  246. AC_SUBST(LIBGCJTESTSPEC)
  247. AC_ARG_WITH(system-zlib,
  248. [ --with-system-zlib use installed libz])
  249. ZLIBSPEC=
  250. AC_SUBST(ZLIBSPEC)
  251. ZLIBTESTSPEC=
  252. AC_SUBST(ZLIBTESTSPEC)
  253. dnl FIXME: this should be _libs on some hosts.
  254. libsubdir=.libs
  255. dnl Allow the GC to be disabled. Can be useful when debugging.
  256. AC_MSG_CHECKING([for garbage collector to use])
  257. AC_ARG_ENABLE(java-gc,
  258. changequote(<<,>>)dnl
  259. << --enable-java-gc=TYPE choose garbage collector [boehm]>>,
  260. changequote([,])
  261. GC=$enableval,
  262. GC=boehm)
  263. GCLIBS=
  264. GCINCS=
  265. GCDEPS=
  266. GCOBJS=
  267. GCSPEC=
  268. JC1GCSPEC=
  269. GCTESTSPEC=
  270. case "$GC" in
  271. boehm)
  272. AC_MSG_RESULT(boehm)
  273. GCLIBS=../boehm-gc/libgcjgc_convenience.la
  274. GCINCS='-I$(top_srcdir)/../boehm-gc/include'
  275. JC1GCSPEC='-fuse-boehm-gc'
  276. GCTESTSPEC="-L`${PWDCMD-pwd}`/../boehm-gc/.libs -rpath `${PWDCMD-pwd}`/../boehm-gc/.libs"
  277. dnl We also want to pick up some cpp flags required when including
  278. dnl boehm-config.h. Yuck.
  279. GCINCS="$GCINCS `cat ../boehm-gc/boehm-cflags`"
  280. GCOBJS=boehm.lo
  281. GCHDR=boehm-gc.h
  282. dnl The POSIX thread support needs to know this.
  283. AC_DEFINE(HAVE_BOEHM_GC)
  284. ;;
  285. no)
  286. AC_MSG_RESULT(none)
  287. GCOBJS=nogc.lo
  288. GCHDR=no-gc.h
  289. ;;
  290. *)
  291. AC_MSG_ERROR(unrecognized collector \"$GC\")
  292. ;;
  293. esac
  294. AC_SUBST(GCLIBS)
  295. AC_SUBST(GCINCS)
  296. AC_SUBST(GCDEPS)
  297. AC_SUBST(GCOBJS)
  298. AC_SUBST(GCSPEC)
  299. AC_SUBST(JC1GCSPEC)
  300. AC_SUBST(GCTESTSPEC)
  301. AC_LINK_FILES(include/$GCHDR, include/java-gc.h)
  302. AC_MSG_CHECKING([for thread model used by GCC])
  303. THREADS=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
  304. AC_MSG_RESULT([$THREADS])
  305. case "$THREADS" in
  306. no | none | single)
  307. THREADS=none
  308. ;;
  309. posix | pthreads)
  310. THREADS=posix
  311. case "$host" in
  312. *-*-linux*)
  313. AC_DEFINE(LINUX_THREADS)
  314. ;;
  315. esac
  316. ;;
  317. win32)
  318. ;;
  319. decosf1 | irix | mach | os2 | solaris | dce | vxworks)
  320. AC_MSG_ERROR(thread package $THREADS not yet supported)
  321. ;;
  322. *)
  323. AC_MSG_ERROR($THREADS is an unknown thread package)
  324. ;;
  325. esac
  326. THREADLDFLAGS=
  327. THREADLIBS=
  328. THREADINCS=
  329. THREADDEPS=
  330. THREADOBJS=
  331. THREADH=
  332. THREADSPEC=
  333. case "$THREADS" in
  334. posix)
  335. case "$host" in
  336. *-*-cygwin*)
  337. # Don't set THREADLIBS here. Cygwin doesn't have -lpthread.
  338. ;;
  339. changequote(<<,>>)
  340. *-*-freebsd[1234]*)
  341. changequote([,])
  342. # Before FreeBSD 5, it didn't have -lpthread (or any library which
  343. # merely adds pthread_* functions) but it does have a -pthread switch
  344. # which is required at link-time to select -lc_r *instead* of -lc.
  345. THREADLDFLAGS=-pthread
  346. # Don't set THREADSPEC here as might be expected since -pthread is
  347. # not processed when found within a spec file, it must come from
  348. # the command line. For now, the user must provide the -pthread
  349. # switch to link code compiled with gcj. In future, consider adding
  350. # support for weak references to pthread_* functions ala gthr.h API.
  351. THREADSPEC='%{!pthread: %eUnder this configuration, the user must provide -pthread when linking.}'
  352. ;;
  353. *-*-freebsd*)
  354. # FreeBSD 5 implements a model much closer to other modern UNIX
  355. # which support threads. However, it still does not support
  356. # -lpthread.
  357. THREADLDFLAGS=-pthread
  358. THREADSPEC=-lc_r
  359. ;;
  360. *)
  361. THREADLIBS=-lpthread
  362. THREADSPEC=-lpthread
  363. ;;
  364. esac
  365. THREADOBJS=posix-threads.lo
  366. THREADH=posix-threads.h
  367. # MIT pthreads doesn't seem to have the mutexattr functions.
  368. # But for now we don't check for it. We just assume you aren't
  369. # using MIT pthreads.
  370. AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
  371. # If we're using the Boehm GC, then we happen to know that it
  372. # defines _REENTRANT, so we don't bother. Eww.
  373. if test "$GC" != boehm; then
  374. AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
  375. fi
  376. AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX threads])
  377. ;;
  378. win32)
  379. THREADOBJS=win32-threads.lo
  380. THREADH=win32-threads.h
  381. ;;
  382. none)
  383. THREADOBJS=no-threads.lo
  384. THREADH=no-threads.h
  385. ;;
  386. esac
  387. AC_LINK_FILES(include/$THREADH, include/java-threads.h)
  388. AC_SUBST(THREADLIBS)
  389. AC_SUBST(THREADINCS)
  390. AC_SUBST(THREADDEPS)
  391. AC_SUBST(THREADOBJS)
  392. AC_SUBST(THREADSPEC)
  393. AC_SUBST(THREADLDFLAGS)
  394. if test -d sysdep; then true; else mkdir sysdep; fi
  395. AC_LINK_FILES(sysdep/$sysdeps_dir/locks.h, sysdep/locks.h)
  396. HASH_SYNC_SPEC=
  397. # Hash synchronization is only useful with posix threads right now.
  398. if test "$enable_hash_synchronization" = yes && test "$THREADS" != "none"; then
  399. HASH_SYNC_SPEC=-fhash-synchronization
  400. AC_DEFINE(JV_HASH_SYNCHRONIZATION, 1, [Define if hash synchronization is in use])
  401. fi
  402. AC_SUBST(HASH_SYNC_SPEC)
  403. AM_CONDITIONAL(USING_GCC, test "$GCC" = yes)
  404. CANADIAN=no
  405. NULL_TARGET=no
  406. NATIVE=yes
  407. # We're in the tree with gcc, and need to include some of its headers.
  408. GCC_UNWIND_INCLUDE='-I$(libgcj_basedir)/../gcc'
  409. # Figure out where generated headers like libgcj-config.h get installed.
  410. changequote(,)dnl
  411. gcc_version_trigger=${libgcj_basedir}/../gcc/version.c
  412. gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
  413. gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
  414. tool_include_dir='$(libdir)/gcc-lib/$(target_alias)/'${gcc_version}/include
  415. changequote([,])dnl
  416. AC_SUBST(tool_include_dir)
  417. AC_SUBST(gcc_version)
  418. if test "x${with_newlib}" = "xyes"; then
  419. # We are being configured with a cross compiler. AC_REPLACE_FUNCS
  420. # may not work correctly, because the compiler may not be able to
  421. # link executables.
  422. # We assume newlib. This lets us hard-code the functions we know
  423. # we'll have.
  424. AC_DEFINE(HAVE_MEMMOVE)
  425. AC_DEFINE(HAVE_MEMCPY)
  426. AC_DEFINE(HAVE_STRERROR)
  427. AC_DEFINE(HAVE_TIME)
  428. AC_DEFINE(HAVE_GMTIME_R)
  429. AC_DEFINE(HAVE_LOCALTIME_R)
  430. dnl This is only for POSIX threads.
  431. AC_DEFINE(HAVE_PTHREAD_MUTEXATTR_INIT)
  432. dnl We also assume we are using gcc, which provides alloca.
  433. AC_DEFINE(HAVE_ALLOCA)
  434. dnl Assume we do not have getuid and friends.
  435. AC_DEFINE(NO_GETUID)
  436. # If Canadian cross, then don't pick up tools from the build
  437. # directory.
  438. if test x"$build" != x"$with_cross_host" \
  439. && test x"$build" != x"$target"; then
  440. CANADIAN=yes
  441. GCC_UNWIND_INCLUDE=
  442. GCJ="${target_alias}-gcj"
  443. fi
  444. NATIVE=no
  445. else
  446. AC_CHECK_FUNCS(strerror ioctl select fstat open fsync sleep opendir)
  447. AC_CHECK_FUNCS(gmtime_r localtime_r readdir_r getpwuid_r getcwd)
  448. AC_CHECK_FUNCS(access stat mkdir rename rmdir unlink realpath utime chmod)
  449. AC_CHECK_FUNCS(nl_langinfo setlocale)
  450. AC_CHECK_FUNCS(inet_aton inet_addr, break)
  451. AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
  452. AC_CHECK_FUNCS(fork execvp pipe sigaction ftruncate)
  453. AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
  454. AC_CHECK_FUNC(backtrace, [
  455. case "$host" in
  456. ia64-*-linux*)
  457. # Has broken backtrace()
  458. ;;
  459. *)
  460. AC_DEFINE(HAVE_BACKTRACE)
  461. ;;
  462. esac
  463. ], [
  464. case "$host" in
  465. *mingw*)
  466. # Has backtrace() defined in libgcj itself
  467. AC_DEFINE(HAVE_BACKTRACE)
  468. ;;
  469. esac
  470. ])
  471. AC_CHECK_LIB(dl, dladdr, [
  472. AC_DEFINE(HAVE_DLADDR)])
  473. if test x"$build" = x"$host"; then
  474. AC_CHECK_FILES(/proc/self/exe, [
  475. AC_DEFINE(HAVE_PROC_SELF_EXE)])
  476. else
  477. case $host in
  478. *-linux*)
  479. AC_DEFINE(HAVE_PROC_SELF_EXE)
  480. ;;
  481. esac
  482. fi
  483. AM_ICONV
  484. AM_LC_MESSAGES
  485. AC_STRUCT_TIMEZONE
  486. AC_CHECK_FUNCS(gethostbyname_r, [
  487. AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  488. # There are two different kinds of gethostbyname_r.
  489. # We look for the one that returns `int'.
  490. # Hopefully this check is robust enough.
  491. AC_EGREP_HEADER(int.*gethostbyname_r, netdb.h, [
  492. AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT)])
  493. case " $GCINCS " in
  494. *" -D_REENTRANT "*) ;;
  495. *)
  496. dnl On DU4.0, gethostbyname_r is only declared with -D_REENTRANT
  497. AC_CACHE_CHECK([whether gethostbyname_r declaration requires -D_REENTRANT],
  498. [libjava_cv_gethostbyname_r_needs_reentrant],
  499. [ AC_LANG_SAVE
  500. AC_LANG_CPLUSPLUS
  501. AC_TRY_COMPILE([#include <netdb.h>],
  502. [gethostbyname_r("", 0, 0);],
  503. [libjava_cv_gethostbyname_r_needs_reentrant=no], [dnl
  504. CPPFLAGS_SAVE="$CPPFLAGS"
  505. CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  506. AC_TRY_COMPILE([#include <netdb.h>], [gethostbyname_r("", 0, 0);],
  507. [libjava_cv_gethostbyname_r_needs_reentrant=yes],
  508. [libjava_cv_gethostbyname_r_needs_reentrant=fail])
  509. CPPFLAGS="$CPPFLAGS_SAVE"
  510. ])
  511. AC_LANG_RESTORE
  512. ])
  513. if test "x$libjava_cv_gethostbyname_r_needs_reentrant" = xyes; then
  514. AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
  515. fi
  516. ;;
  517. esac
  518. AC_CACHE_CHECK([for struct hostent_data],
  519. [libjava_cv_struct_hostent_data], [dnl
  520. AC_TRY_COMPILE([
  521. #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
  522. # define _REENTRANT 1
  523. #endif
  524. #include <netdb.h>], [struct hostent_data data;],
  525. [libjava_cv_struct_hostent_data=yes],
  526. [libjava_cv_struct_hostent_data=no])])
  527. if test "x$libjava_cv_struct_hostent_data" = xyes; then
  528. AC_DEFINE(HAVE_STRUCT_HOSTENT_DATA, 1,
  529. [Define if struct hostent_data is defined in netdb.h])
  530. fi
  531. ])
  532. # FIXME: libjava source code expects to find a prototype for
  533. # gethostbyaddr_r in netdb.h. The outer check ensures that
  534. # HAVE_GETHOSTBYADDR_R will not be defined if the prototype fails
  535. # to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C
  536. # linkage check is enough, yet C++ code requires proper prototypes.)
  537. AC_EGREP_HEADER(gethostbyaddr_r, netdb.h, [
  538. AC_CHECK_FUNCS(gethostbyaddr_r, [
  539. AC_DEFINE(HAVE_GETHOSTBYADDR_R)
  540. # There are two different kinds of gethostbyaddr_r.
  541. # We look for the one that returns `int'.
  542. # Hopefully this check is robust enough.
  543. AC_EGREP_HEADER(int.*gethostbyaddr_r, netdb.h, [
  544. AC_DEFINE(GETHOSTBYADDR_R_RETURNS_INT)])])])
  545. AC_CHECK_FUNCS(gethostname, [
  546. AC_DEFINE(HAVE_GETHOSTNAME)
  547. AC_EGREP_HEADER(gethostname, unistd.h, [
  548. AC_DEFINE(HAVE_GETHOSTNAME_DECL)])])
  549. # Look for these functions in the thread library, but only bother
  550. # if using POSIX threads.
  551. if test "$THREADS" = posix; then
  552. save_LIBS="$LIBS"
  553. LIBS="$LIBS $THREADLIBS"
  554. # Some POSIX thread systems don't have pthread_mutexattr_settype.
  555. # E.g., Solaris.
  556. AC_CHECK_FUNCS(pthread_mutexattr_settype pthread_mutexattr_setkind_np)
  557. # Look for sched_yield. Up to Solaris 2.6, it is in libposix4, since
  558. # Solaris 7 the name librt is preferred.
  559. AC_CHECK_FUNCS(sched_yield, , [
  560. AC_CHECK_LIB(rt, sched_yield, [
  561. AC_DEFINE(HAVE_SCHED_YIELD)
  562. THREADLIBS="$THREADLIBS -lrt"
  563. THREADSPEC="$THREADSPEC -lrt"], [
  564. AC_CHECK_LIB(posix4, sched_yield, [
  565. AC_DEFINE(HAVE_SCHED_YIELD)
  566. THREADLIBS="$THREADLIBS -lposix4"
  567. THREADSPEC="$THREADSPEC -lposix4"])])])
  568. LIBS="$save_LIBS"
  569. # We can save a little space at runtime if the mutex has m_count
  570. # or __m_count. This is a nice hack for Linux.
  571. AC_TRY_COMPILE([#include <pthread.h>], [
  572. extern pthread_mutex_t *mutex; int q = mutex->m_count;
  573. ], AC_DEFINE(PTHREAD_MUTEX_HAVE_M_COUNT), [
  574. AC_TRY_COMPILE([#include <pthread.h>], [
  575. extern pthread_mutex_t *mutex; int q = mutex->__m_count;
  576. ], AC_DEFINE(PTHREAD_MUTEX_HAVE___M_COUNT))])
  577. fi
  578. # We require a way to get the time.
  579. time_found=no
  580. AC_CHECK_FUNCS(gettimeofday time ftime, time_found=yes)
  581. if test "$time_found" = no; then
  582. AC_MSG_ERROR([no function found to get the time])
  583. fi
  584. AC_CHECK_FUNCS(memmove)
  585. # We require memcpy.
  586. memcpy_found=no
  587. AC_CHECK_FUNCS(memcpy, memcpy_found=yes)
  588. if test "$memcpy_found" = no; then
  589. AC_MSG_ERROR([memcpy is required])
  590. fi
  591. AC_CHECK_LIB(dl, dlopen, [
  592. AC_DEFINE(HAVE_DLOPEN, 1, [Define if dlopen is available])])
  593. # Some library-finding code we stole from Tcl.
  594. #--------------------------------------------------------------------
  595. # Check for the existence of the -lsocket and -lnsl libraries.
  596. # The order here is important, so that they end up in the right
  597. # order in the command line generated by make. Here are some
  598. # special considerations:
  599. # 1. Use "connect" and "accept" to check for -lsocket, and
  600. # "gethostbyname" to check for -lnsl.
  601. # 2. Use each function name only once: can't redo a check because
  602. # autoconf caches the results of the last check and won't redo it.
  603. # 3. Use -lnsl and -lsocket only if they supply procedures that
  604. # aren't already present in the normal libraries. This is because
  605. # IRIX 5.2 has libraries, but they aren't needed and they're
  606. # bogus: they goof up name resolution if used.
  607. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
  608. # To get around this problem, check for both libraries together
  609. # if -lsocket doesn't work by itself.
  610. #--------------------------------------------------------------------
  611. AC_CACHE_CHECK([for socket libraries], gcj_cv_lib_sockets,
  612. [gcj_cv_lib_sockets=
  613. gcj_checkBoth=0
  614. unset ac_cv_func_connect
  615. AC_CHECK_FUNC(connect, gcj_checkSocket=0, gcj_checkSocket=1)
  616. if test "$gcj_checkSocket" = 1; then
  617. unset ac_cv_func_connect
  618. AC_CHECK_LIB(socket, main, gcj_cv_lib_sockets="-lsocket",
  619. gcj_checkBoth=1)
  620. fi
  621. if test "$gcj_checkBoth" = 1; then
  622. gcj_oldLibs=$LIBS
  623. LIBS="$LIBS -lsocket -lnsl"
  624. unset ac_cv_func_accept
  625. AC_CHECK_FUNC(accept,
  626. [gcj_checkNsl=0
  627. gcj_cv_lib_sockets="-lsocket -lnsl"])
  628. unset ac_cv_func_accept
  629. LIBS=$gcj_oldLibs
  630. fi
  631. unset ac_cv_func_gethostbyname
  632. gcj_oldLibs=$LIBS
  633. LIBS="$LIBS $gcj_cv_lib_sockets"
  634. AC_CHECK_FUNC(gethostbyname, ,
  635. [AC_CHECK_LIB(nsl, main,
  636. [gcj_cv_lib_sockets="$gcj_cv_lib_sockets -lnsl"])])
  637. unset ac_cv_func_gethostbyname
  638. LIBS=$gcj_oldLIBS
  639. ])
  640. SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
  641. if test "$with_system_zlib" = yes; then
  642. AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=)
  643. fi
  644. # On Solaris, and maybe other architectures, the Boehm collector
  645. # requires -ldl.
  646. if test "$GC" = boehm; then
  647. AC_CHECK_LIB(dl, main, SYSTEMSPEC="$SYSTEMSPEC -ldl")
  648. fi
  649. if test -z "${with_multisubdir}"; then
  650. builddotdot=.
  651. else
  652. changequote(<<,>>)
  653. builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`
  654. changequote([,])
  655. fi
  656. if test -x "${builddotdot}/../../gcc/gcj"; then
  657. dir="`cd ${builddotdot}/../../gcc && ${PWDCMD-pwd}`"
  658. GCJ="$dir/gcj -B`${PWDCMD-pwd}`/ -B$dir/"
  659. else
  660. CANADIAN=yes
  661. NULL_TARGET=yes
  662. GCJ="gcj -B`${PWDCMD-pwd}`/"
  663. fi
  664. fi
  665. # Create it, so that compile/link tests don't fail
  666. test -f libgcj.spec || touch libgcj.spec
  667. # We must search the source tree for java.lang, since we still don't
  668. # have libgcj.jar nor java/lang/*.class
  669. GCJ_SAVE_CPPFLAGS=$CPPFLAGS
  670. CPPFLAGS="$CPPFLAGS -I`${PWDCMD-pwd}` -I`cd $srcdir && ${PWDCMD-pwd}`"
  671. # Since some classes depend on this one, we need its source available
  672. # before we can do any GCJ compilation test :-(
  673. if test ! -f gnu/classpath/Configuration.java; then
  674. test -d gnu || mkdir gnu
  675. test -d gnu/classpath || mkdir gnu/classpath
  676. sed 's,@LIBGCJDEBUG@,$LIBGCJDEBUG,' \
  677. < $srcdir/gnu/classpath/Configuration.java.in \
  678. > gnu/classpath/Configuration.java
  679. # We do not want to redirect the output of the grep below to /dev/null,
  680. # but we add /dev/null to the input list so that grep will print the
  681. # filename of Configuration.java in case it finds any matches.
  682. if grep @ gnu/classpath/Configuration.java /dev/null; then
  683. AC_MSG_ERROR([configure.in is missing the substitutions above])
  684. fi
  685. fi
  686. LT_AC_PROG_GCJ
  687. CPPFLAGS=$GCJ_SAVE_CPPFLAGS
  688. AC_COMPILE_CHECK_SIZEOF(void *)
  689. ZLIBS=
  690. SYS_ZLIBS=
  691. ZINCS=
  692. if test -z "$ZLIBSPEC"; then
  693. # Use zlib from the GCC tree.
  694. ZINCS='-I$(top_srcdir)/../zlib'
  695. ZLIBS=../zlib/libzgcj_convenience.la
  696. else
  697. # System's zlib.
  698. SYS_ZLIBS="$ZLIBSPEC"
  699. fi
  700. AC_SUBST(ZLIBS)
  701. AC_SUBST(SYS_ZLIBS)
  702. AC_SUBST(ZINCS)
  703. AC_SUBST(DIVIDESPEC)
  704. AC_SUBST(CHECKREFSPEC)
  705. AC_SUBST(EXCEPTIONSPEC)
  706. AC_SUBST(IEEESPEC)
  707. AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
  708. AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
  709. AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
  710. AM_CONDITIONAL(NEEDS_DATA_START, test "$NEEDS_DATA_START" = yes && test "$NATIVE" = yes)
  711. AC_SUBST(GCC_UNWIND_INCLUDE)
  712. if test -n "$with_cross_host" &&
  713. test x"$with_cross_host" != x"no"; then
  714. toolexecdir='$(exec_prefix)/$(target_alias)'
  715. toolexecmainlibdir='$(toolexecdir)/lib'
  716. else
  717. toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
  718. toolexecmainlibdir='$(libdir)'
  719. fi
  720. toolexeclibdir=$toolexecmainlibdir/`$CC -print-multi-os-directory`
  721. AC_SUBST(toolexecdir)
  722. AC_SUBST(toolexecmainlibdir)
  723. AC_SUBST(toolexeclibdir)
  724. # Determine gcj version number.
  725. changequote(<<,>>)
  726. gcjversion=`$GCJ -v 2>&1 | sed -n 's/^.*version \([^ ]*\).*$/\1/p'`
  727. changequote([,])
  728. GCJVERSION=$gcjversion
  729. AC_SUBST(GCJVERSION)
  730. AC_DEFINE_UNQUOTED(GCJVERSION, "$GCJVERSION", [Short GCJ version ID])
  731. dnl Work around a g++ bug. Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000.
  732. AC_MSG_CHECKING([for g++ -ffloat-store bug])
  733. save_CFLAGS="$CFLAGS"
  734. CFLAGS="-x c++ -O2 -ffloat-store"
  735. AC_TRY_COMPILE([#include <math.h>], ,
  736. [AC_MSG_RESULT(no)],
  737. [AC_DEFINE(__NO_MATH_INLINES)
  738. AC_MSG_RESULT(yes)])
  739. CFLAGS="$save_CFLAGS"
  740. dnl We check for sys/filio.h because Solaris 2.5 defines FIONREAD there.
  741. dnl On that system, sys/ioctl.h will not include sys/filio.h unless
  742. dnl BSD_COMP is defined; just including sys/filio.h is simpler.
  743. AC_CHECK_HEADERS(unistd.h bstring.h sys/time.h sys/types.h fcntl.h sys/ioctl.h sys/filio.h sys/stat.h sys/select.h sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h pwd.h sys/config.h stdint.h langinfo.h locale.h)
  744. dnl We avoid AC_HEADER_DIRENT since we really only care about dirent.h
  745. dnl for now. If you change this, you also must update natFile.cc.
  746. AC_CHECK_HEADERS(dirent.h)
  747. AC_CHECK_HEADERS(inttypes.h, [
  748. AC_DEFINE(HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
  749. AC_DEFINE(JV_HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
  750. ])
  751. AC_HEADER_SYS_WAIT
  752. AC_CHECK_TYPE([ssize_t], [int])
  753. AC_MSG_CHECKING([for in_addr_t])
  754. AC_TRY_COMPILE([#include <sys/types.h>
  755. #if STDC_HEADERS
  756. #include <stdlib.h>
  757. #include <stddef.h>
  758. #endif
  759. #if HAVE_NETINET_IN_H
  760. #include <netinet/in.h>
  761. #endif], [in_addr_t foo;],
  762. [AC_DEFINE([HAVE_IN_ADDR_T])
  763. AC_MSG_RESULT(yes)],
  764. [AC_MSG_RESULT(no)])
  765. AC_MSG_CHECKING([whether struct ip_mreq is in netinet/in.h])
  766. AC_TRY_COMPILE([#include <netinet/in.h>], [struct ip_mreq mreq;],
  767. [AC_DEFINE(HAVE_STRUCT_IP_MREQ)
  768. AC_MSG_RESULT(yes)],
  769. [AC_MSG_RESULT(no)])
  770. AC_MSG_CHECKING([whether struct ipv6_mreq is in netinet/in.h])
  771. AC_TRY_COMPILE([#include <netinet/in.h>], [struct ipv6_mreq mreq6;],
  772. [AC_DEFINE(HAVE_STRUCT_IPV6_MREQ)
  773. AC_MSG_RESULT(yes)],
  774. [AC_MSG_RESULT(no)])
  775. AC_MSG_CHECKING([whether struct sockaddr_in6 is in netinet/in.h])
  776. AC_TRY_COMPILE([#include <netinet/in.h>], [struct sockaddr_in6 addr6;],
  777. [AC_DEFINE(HAVE_INET6)
  778. AC_MSG_RESULT(yes)],
  779. [AC_MSG_RESULT(no)])
  780. AC_MSG_CHECKING([for socklen_t in sys/socket.h])
  781. AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
  782. #include <sys/types.h>
  783. #include <sys/socket.h>], [socklen_t x = 5;],
  784. [AC_DEFINE(HAVE_SOCKLEN_T)
  785. AC_MSG_RESULT(yes)],
  786. [AC_MSG_RESULT(no)])
  787. AC_MSG_CHECKING([for tm_gmtoff in struct tm])
  788. AC_TRY_COMPILE([#include <time.h>], [struct tm tim; tim.tm_gmtoff = 0;],
  789. [AC_DEFINE(STRUCT_TM_HAS_GMTOFF)
  790. AC_MSG_RESULT(yes)],
  791. [AC_MSG_RESULT(no)
  792. AC_MSG_CHECKING([for global timezone variable])
  793. dnl FIXME: we don't want a link check here because that won't work
  794. dnl when cross-compiling. So instead we make an assumption that
  795. dnl the header file will mention timezone if it exists.
  796. dnl Don't find the win32 function timezone
  797. AC_TRY_COMPILE([#include <time.h>], [void i(){long z2 = 2*timezone;}],
  798. [AC_DEFINE(HAVE_TIMEZONE)
  799. AC_MSG_RESULT(yes)],
  800. [AC_MSG_RESULT(no)
  801. AC_MSG_CHECKING([for global _timezone variable])
  802. dnl FIXME: As above, don't want link check
  803. AC_TRY_COMPILE([#include <time.h>], [long z2 = _timezone;],
  804. [AC_DEFINE(HAVE_UNDERSCORE_TIMEZONE)
  805. AC_MSG_RESULT(yes)],
  806. [AC_MSG_RESULT(no)])])])
  807. AC_FUNC_ALLOCA
  808. AC_CHECK_PROGS(PERL, perl, false)
  809. SYSDEP_SOURCES=
  810. case "${host}" in
  811. i?86-*-linux*)
  812. SIGNAL_HANDLER=include/i386-signal.h
  813. ;;
  814. sparc*-sun-solaris*)
  815. SIGNAL_HANDLER=include/sparc-signal.h
  816. ;;
  817. # ia64-*)
  818. # SYSDEP_SOURCES=sysdep/ia64.c
  819. # test -d sysdep || mkdir sysdep
  820. # ;;
  821. ia64-*-linux*)
  822. SIGNAL_HANDLER=include/dwarf2-signal.h
  823. ;;
  824. powerpc-*-linux*)
  825. SIGNAL_HANDLER=include/powerpc-signal.h
  826. ;;
  827. alpha*-*-linux*)
  828. SIGNAL_HANDLER=include/dwarf2-signal.h
  829. ;;
  830. s390*-*-linux*)
  831. SIGNAL_HANDLER=include/s390-signal.h
  832. ;;
  833. x86_64*-*-linux*)
  834. SIGNAL_HANDLER=include/x86_64-signal.h
  835. ;;
  836. sparc*-*-linux*)
  837. SIGNAL_HANDLER=include/dwarf2-signal.h
  838. ;;
  839. *mingw*)
  840. SIGNAL_HANDLER=include/win32-signal.h
  841. ;;
  842. *)
  843. SIGNAL_HANDLER=include/default-signal.h
  844. ;;
  845. esac
  846. # If we're using sjlj exceptions, forget what we just learned.
  847. if test "$enable_sjlj_exceptions" = yes; then
  848. SIGNAL_HANDLER=include/default-signal.h
  849. fi
  850. # Define here any compiler flags that you need in order to make backtrace() work.
  851. BACKTRACESPEC=
  852. case "${host}" in
  853. x86_64*-*-linux*)
  854. BACKTRACESPEC=-fno-omit-frame-pointer
  855. ;;
  856. esac
  857. AC_SUBST(BACKTRACESPEC)
  858. AC_SUBST(SYSDEP_SOURCES)
  859. AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)
  860. if test "${multilib}" = "yes"; then
  861. multilib_arg="--enable-multilib"
  862. else
  863. multilib_arg=
  864. fi
  865. AC_PATH_XTRA
  866. dnl Determine which AWT peer libraries to build
  867. AC_ARG_ENABLE(java-awt,
  868. [ --enable-java-awt list of AWT peer implementations to be built])
  869. peerlibs="`echo ${enable_java_awt} | tr ',' ' '`"
  870. use_xlib_awt=""
  871. use_gtk_awt=""
  872. for peer in $peerlibs ; do
  873. case $peer in
  874. xlib)
  875. if [test "$no_x" = yes]; then
  876. echo "*** xlib peers requested but no X library available" 1>&2
  877. exit 1
  878. else
  879. use_xlib_awt="yes"
  880. fi
  881. ;;
  882. gtk)
  883. # Nothing, yet...
  884. ;;
  885. no)
  886. use_xlib_awt=
  887. use_gtk_awt=
  888. break
  889. ;;
  890. *)
  891. echo "*** unrecognised argument \"${peer}\" for --enable-java-awt" 1>&2
  892. exit 1
  893. esac
  894. done
  895. AM_CONDITIONAL(XLIB_AWT, test "$use_xlib_awt" = yes)
  896. AM_CONDITIONAL(GTK_AWT, test "$use_gtk_awt" = yes)
  897. here=`${PWDCMD-pwd}`
  898. AC_SUBST(here)
  899. # We get this from the environment.
  900. AC_SUBST(GCJFLAGS)
  901. AC_OUTPUT(Makefile libgcj.spec libgcj-test.spec gnu/classpath/Configuration.java gcj/Makefile include/Makefile testsuite/Makefile,
  902. [# Only add multilib support code if we just rebuilt top-level Makefile.
  903. case " $CONFIG_FILES " in
  904. *" Makefile "*)
  905. LD="${ORIGINAL_LD_FOR_MULTILIBS}"
  906. ac_file=Makefile . ${libgcj_basedir}/../config-ml.in
  907. ;;
  908. esac
  909. # Make subdirectories and `.d' files. Look in both srcdir and
  910. # builddir for the .java files.
  911. h=`${PWDCMD-pwd}`
  912. : > deps.mk
  913. ( (cd $srcdir && find . \( -name '*.java' -o -name '*.cc' \) -print) ;
  914. find . \( -name '*.java' -o -name '*.cc' \) -print) | \
  915. fgrep -v testsuite | \
  916. sed -e 's/\.java/.d/'\;'s/\.cc/.d/' | \
  917. while read f; do
  918. echo "include $f" >> deps.mk
  919. test -f $f || {
  920. changequote(<<,>>)
  921. d=`echo $f | sed -e 's,/[^/]*$,,'`
  922. changequote([,])
  923. if test ! -d $d; then
  924. $libgcj_basedir/../mkinstalldirs $d
  925. fi;
  926. echo > $f
  927. }
  928. done
  929. ],
  930. srcdir=${srcdir}
  931. host=${host}
  932. target=${target}
  933. with_multisubdir=${with_multisubdir}
  934. ac_configure_args="${multilib_arg} ${ac_configure_args}"
  935. CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  936. libgcj_basedir=${libgcj_basedir}
  937. CC="${CC}"
  938. CXX="${CXX}"
  939. ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
  940. )