home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Programming / Jikes / Source / configure.in < prev    next >
Encoding:
Text File  |  2001-02-24  |  12.1 KB  |  417 lines

  1. # $Id: configure.in,v 1.19 2001/02/17 06:26:54 mdejong Exp $
  2. dnl    This file is an input file used by the GNU "autoconf" program to
  3. dnl    generate the file "configure", which is run to configure the
  4. dnl    Makefile in this directory.
  5.  
  6. AC_INIT(ChangeLog)
  7. AM_INIT_AUTOMAKE(jikes, 1.13)
  8. AC_DEFINE(JIKES_VERSION_STRING, "Version 1.13 3/1/2001",
  9.     [A string to indicate the release of jikes: Version 1.11 1/10/2000])
  10.  
  11. AC_PREREQ(2.14)
  12.  
  13. dnl AC_CACHE_LOAD
  14.  
  15. AM_CONFIG_HEADER(src/config.h)
  16.  
  17. dnl    Do not autoupdate if configure.in and friends are changed
  18. dnl    unless the --enable-maintaier-mode flag is used.
  19. AM_MAINTAINER_MODE()
  20.  
  21. dnl    Set up host checks using config.sub and config.guess.
  22. AC_CANONICAL_HOST()
  23.  
  24. dnl    Tell the system that we are going to use the C++ language
  25. AC_LANG_CPLUSPLUS()
  26.  
  27. dnl    Have the system search for and test out the C++ compiler
  28. dnl    We expect AC_PROG_CXX to automatically find a cross compiler
  29. AC_PROG_CXX()
  30.  
  31. dnl    Do cygwin and migwin checks (gnu on win32)
  32. AC_CYGWIN()
  33.  
  34. dnl    Find the object file extension (like .o or .obj) and subst it
  35. AC_OBJEXT()
  36.  
  37. dnl    Find the executable file extension (like .exe or "") and subst it
  38. AC_EXEEXT()
  39.  
  40. dnl    See if this host uses DOS style path names
  41. ACX_CHECK_PATHNAME_STYLE_DOS()
  42.  
  43. dnl FIXME: This is a quick hack to define UNIX_FILE_SYSTEM
  44. dnl or WIN32_FILE_SYSTEM, we need to go back and fix this
  45. dnl to do a feature test in each place this symbol is used
  46. if test "$acx_cv_pathname_style_dos" = "yes"; then
  47.   AC_DEFINE(WIN32_FILE_SYSTEM,,[quick hack to use Win32 file system, fixme])
  48. else
  49.   AC_DEFINE(UNIX_FILE_SYSTEM,,[quick hack to use UNIX file system, fixme])
  50. fi
  51.  
  52. dnl    Disable Jikes namespace support for now, feature needs more testing.
  53. dnl    If you really want to use a namespace, set HAVE_JIKES_NAMESPACE env var.
  54. if test "x$HAVE_JIKES_NAMESPACE" != "x" ; then
  55.    AC_DEFINE(HAVE_JIKES_NAMESPACE, 1, [Define Jikes functions in a namespace])
  56. fi
  57.  
  58.  
  59. dnl    Check for standard c and c++ headers and libraries
  60. AC_HEADER_STDC()
  61.  
  62. AC_CHECK_HEADERS(stdio.h assert.h limits.h ctype.h time.h float.h)
  63.  
  64. dnl    Check for some headers which are not present on all supported platforms
  65. AC_CHECK_HEADERS(windows.h direct.h dirent.h sys/cygwin.h)
  66.  
  67. dnl    Check for math.h and see if we need to link to the math library
  68. AC_CHECK_MATHLIB()
  69.  
  70. AC_CXX_HAVE_STD()
  71.  
  72. dnl    Don't check for libstdc++, we should not need to do this.
  73. dnl AC_CHECK_LIB(stdc++, main)
  74.  
  75. dnl    see if "bool" is a builtin type
  76. AC_CXX_BOOL()
  77.  
  78. dnl    Check for <new> style include for the set_new_handler function
  79. AC_CXX_CHECK_SET_NEW_HANDLER()
  80.  
  81. dnl    Check for wide string functions
  82. AC_CHECK_WCS_FUNCS()
  83.  
  84. dnl    Check for iconv functions and library
  85. AC_CHECK_ICONV()
  86.  
  87. dnl    Check if "IBM Classes for UNICODE library" is present
  88. AC_CHECK_LIB(icu-uc, u_getVersion)
  89.  
  90. dnl    Check for cygwin path conversion functions
  91. AC_CHECK_FUNCS(cygwin_win32_to_posix_path_list)
  92.  
  93. dnl    Check for the strip utility, we use it to remove debugging info
  94. AC_CHECK_TOOL(STRIP, strip, :)
  95.  
  96. dnl    Check to see if "static const FOO = 1" is allowed in a class
  97. AC_CXX_MEMBER_CONSTANTS()
  98.  
  99. dnl    Check to see if the explicit C++ keyword is supported
  100. AC_CXX_EXPLICIT()
  101.  
  102. dnl    Check to see if RTTI is implemented, it is needed
  103. dnl    to support dynamic casting and type queries. RTTI
  104. dnl    is known to be buggy so it is disabled by default
  105. ac_cv_cxx_rtti=no
  106. AC_CXX_RTTI()
  107.  
  108. dnl    Check for newer C++ style cast support
  109. AC_CXX_CONST_CAST()
  110. AC_CXX_DYNAMIC_CAST()
  111. AC_CXX_REINTERPRET_CAST()
  112. AC_CXX_STATIC_CAST()
  113.  
  114.  
  115. #FIXME : do we need to add the -funsigned-char option when compiling with
  116. # g++? If we always use the u1 type (see platform.h), then I think not.
  117.  
  118. # It might also be better to use the following macro for these tests!
  119. #AC_CHECK_SIZEOF (TYPE, [CROSS-SIZE], [INCLUDES])
  120.  
  121.  
  122. AC_CACHE_CHECK(correct value for UINT_MAX,
  123.     jikes_cv_uint_max,
  124.     AC_TRY_COMPILE([
  125. #include <limits.h>
  126. #if ! (UINT_MAX == 0xFFFFFFFF)
  127. # error "UINT_MAX"
  128. #endif
  129. ],[return 0;],
  130.     jikes_cv_uint_max=yes,
  131.     AC_MSG_ERROR([unsigned int does not store values in the range
  132.     0..4294967295 on this system])))
  133.  
  134. AC_CACHE_CHECK(correct value for INT_MAX,
  135.     jikes_cv_int_max,
  136.     AC_TRY_COMPILE([
  137. #include <limits.h>
  138. #if ! ((INT_MAX == 2147483647) && (INT_MIN + 1 == -INT_MAX))
  139. # error "INT_MAX"
  140. #endif
  141. ],[return 0;],
  142.     jikes_cv_int_max=yes,
  143.     AC_MSG_ERROR([int does not store values in the range
  144.     -2147483648..+2147483647 on this system])))
  145.  
  146. dnl   Check for broken USHRT_MAX (under Mingwin and maybe some other systems)
  147. AC_CACHE_CHECK(for broken USHRT_MAX, jikes_cv_ushrt_max_is_broken,
  148.     AC_TRY_COMPILE([
  149. #include <limits.h>
  150. #if ! (USHRT_MAX == 0xFFFF)
  151. int hi=0;
  152. #endif
  153. ],[return 0;], jikes_cv_ushrt_max_is_broken=no ,
  154.                jikes_cv_ushrt_max_is_broken=yes)
  155. )
  156. if test "$jikes_cv_ushrt_max_is_broken" = "yes" ; then
  157.     AC_DEFINE(HAVE_BROKEN_USHRT_MAX, , [known to be broken on mingwin beta 20])
  158. fi
  159.  
  160. AC_CACHE_CHECK(correct value for USHRT_MAX,
  161.     jikes_cv_ushrt_max,
  162.     AC_TRY_COMPILE([
  163. #include <limits.h>
  164. #if ! (USHRT_MAX == 0xFFFF)
  165. # error "USHRT_MAX"
  166. #endif
  167. ],[return 0;],
  168.     jikes_cv_ushrt_max=yes,
  169.     AC_MSG_ERROR([unsigned short does not store values in the range
  170.     0..65535 on this system])))
  171.  
  172. AC_CACHE_CHECK(correct value for SHRT_MAX,
  173.     jikes_cv_shrt_max,
  174.     AC_TRY_COMPILE([
  175. #include <limits.h>
  176. #if ! ((SHRT_MAX == 32767) && (SHRT_MIN + 1 == -SHRT_MAX))
  177. # error "SHRT_MAX"
  178. #endif
  179. ],[return 0;],
  180.     jikes_cv_shrt_max=yes,
  181.     AC_MSG_ERROR([short does not store values in the range
  182.     -32767..+32768 on this system])))
  183.  
  184. AC_CACHE_CHECK(correct value for UCHAR_MAX,
  185.     jikes_cv_uchar_max,
  186.     AC_TRY_COMPILE([
  187. #include <limits.h>
  188. #if ! (UCHAR_MAX == 0xFF)
  189. # error "UCHAR_MAX"
  190. #endif
  191. ],[return 0;],
  192.     jikes_cv_uchar_max=yes,
  193.     AC_MSG_ERROR([unsigned char does not store values in the range
  194.     0..255 on this system])))
  195.  
  196. AC_CACHE_CHECK(correct value for SCHAR_MAX,
  197.     jikes_cv_schar_max,
  198.     AC_TRY_COMPILE([
  199. #include <limits.h>
  200. #if ! ((SCHAR_MAX == 127) && (SCHAR_MIN + 1 == -SCHAR_MAX))
  201. # error "SCHAR_MAX"
  202. #endif
  203. ],[return 0;],
  204.     jikes_cv_schar_max=yes,
  205.     AC_MSG_ERROR([char does not store values in the range
  206.     -128..+127 on this system])))
  207.  
  208.  
  209. dnl Check to see if build will use emulated floating point
  210.  
  211. AC_ARG_ENABLE(fp-emulation, [  --enable-fp-emulation         Use floating point emulation instead of native floating point operations (disabled)],
  212.     [ok=$enableval], [ok=no])
  213.  
  214. AC_MSG_CHECKING([for floating point support])
  215.  
  216. if test "$ok" = "yes"; then
  217.   # Do nothing, floating point emulation is used when HAVE_IEEE754 is not defined
  218.   AC_MSG_RESULT([emulated])
  219. else
  220.   AC_DEFINE(HAVE_IEEE754, 1,
  221.     [Defined when Jikes is built with native floating support])
  222.  
  223.   AC_MSG_RESULT([native])
  224. fi
  225.  
  226. dnl Check for broken compilers that do not support the long long type!
  227. AC_CHECK_TYPE(unsigned long long)
  228.  
  229. #FIXME: we might also want to check for the __int64 type
  230. #which seems to be defined on some windows systems.
  231.  
  232. # FIXME: What about the u_int64_t type, would that work too?
  233.  
  234. if test "$ac_cv_type_unsigned_long_long" != "yes" ; then
  235.   dnl GROAN!! need to "support" systems that do not define
  236.   dnl a 64 bit long long type (some folks refuse to use gcc).
  237.  
  238.   dnl   Check for endianness
  239.   AC_C_BIGENDIAN()
  240. else
  241.   AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, ,
  242.     [Defined when the compiler supports the unsigned long long type])
  243. fi
  244.  
  245.  
  246. # FIXME : we would need to readdress this when porting to new systems
  247. AC_DEFINE(HAVE_32BIT_TYPES, ,
  248.     [Defined when bit sizes are int = 32, short = 16, char = 8])
  249.  
  250.  
  251.  
  252. dnl    Check the stat() system call to find out how many
  253. dnl    underscores are needed in front of S_IFDIR
  254.  
  255. AC_CACHE_CHECK(for __S_IFDIR symbol,
  256.     jikes_cv_stat_ifdir_2underscore,
  257.     AC_TRY_COMPILE([
  258. #include <sys/stat.h>
  259. ],[int i = __S_IFDIR;],
  260.     jikes_cv_stat_ifdir_2underscore=yes,
  261.     jikes_cv_stat_ifdir_2underscore=no))
  262.  
  263. AC_CACHE_CHECK(for _S_IFDIR symbol,
  264.     jikes_cv_stat_ifdir_1underscore,
  265.     AC_TRY_COMPILE([
  266. #include <sys/stat.h>
  267. ],[int i = _S_IFDIR;],
  268.     jikes_cv_stat_ifdir_1underscore=yes,
  269.     jikes_cv_stat_ifdir_1underscore=no))
  270.  
  271. AC_CACHE_CHECK(for S_IFDIR symbol,
  272.     jikes_cv_stat_ifdir_0underscore,
  273.     AC_TRY_COMPILE([
  274. #include <sys/stat.h>
  275. ],[int i = S_IFDIR;],
  276.     jikes_cv_stat_ifdir_0underscore=yes,
  277.     jikes_cv_stat_ifdir_0underscore=no))
  278.  
  279. if test "$jikes_cv_stat_ifdir_2underscore" = "yes"; then
  280.     AC_DEFINE(JIKES_STAT_S_IFDIR, __S_IFDIR,
  281.     [Used to test results of stat call to see if it is a directory])
  282. elif test "$jikes_cv_stat_ifdir_1underscore" = "yes"; then
  283.     AC_DEFINE(JIKES_STAT_S_IFDIR, _S_IFDIR,
  284.     [Used to test results of stat call to see if it is a directory])
  285. elif test "$jikes_cv_stat_ifdir_0underscore" = "yes"; then
  286.     AC_DEFINE(JIKES_STAT_S_IFDIR, S_IFDIR,
  287.     [Used to test results of stat call to see if it is a directory])
  288. else
  289.     AC_MSG_ERROR([Could not find stat S_IFDIR symbol])
  290. fi
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. dnl We need to do some nasty checks here to make sure that
  298. dnl we know what version of mkdir() to call.
  299.  
  300. dnl First, we just make sure mkdir() actually exists
  301. AC_CHECK_FUNCS(mkdir, , AC_MSG_ERROR([No mkdir() function found]))
  302.  
  303. AC_CACHE_CHECK(for mac style mkdir, jikes_cv_mac_mkdir,
  304.     AC_TRY_LINK([
  305. #include <sys/stat.h>
  306. #include <stat.mac.h>
  307. ], [mkdir("foo.dir", 0);
  308. ], jikes_cv_mac_mkdir=yes,
  309.    jikes_cv_mac_mkdir=no)
  310. )
  311.  
  312. AC_CACHE_CHECK(for glibc style mkdir, jikes_cv_glibc_mkdir,
  313.     AC_TRY_LINK([
  314. #include <sys/stat.h>
  315. #include <unistd.h>
  316. ], [mkdir("foo.dir", S_IRWXU | S_IRWXG | S_IRWXO);
  317. ], jikes_cv_glibc_mkdir=yes,
  318.    jikes_cv_glibc_mkdir=no)
  319. )
  320.  
  321. AC_CACHE_CHECK(for libc5 style mkdir, jikes_cv_libc5_mkdir,
  322.     AC_TRY_LINK([
  323. #include <sys/stat.h>
  324. #include <unistd.h>
  325. ], [mkdir("foo.dir", S_IRWXU);
  326. ], jikes_cv_libc5_mkdir=yes,
  327.    jikes_cv_libc5_mkdir=no)
  328. )
  329.  
  330. AC_CACHE_CHECK(for win32 style mkdir, jikes_cv_win32_mkdir,
  331.     AC_TRY_LINK([
  332. #include <direct.h>
  333. ], [mkdir("foo.dir");
  334. ], jikes_cv_win32_mkdir=yes,
  335.    jikes_cv_win32_mkdir=no)
  336. )
  337.  
  338. if test "$jikes_cv_glibc_mkdir" = "yes" ; then
  339.     AC_DEFINE(HAVE_GLIBC_MKDIR, ,
  340.         [use unix style mkdir(str, S_IRWXU | S_IRWXG | S_IRWXO)])
  341. elif test "$jikes_cv_libc5_mkdir" = "yes" ; then
  342.     AC_DEFINE(HAVE_LIBC5_MKDIR, ,
  343.         [use unix style mkdir(str, S_IRWXU)])
  344. elif test "$jikes_cv_win32_mkdir" = "yes" ; then
  345.     AC_DEFINE(HAVE_WIN32_MKDIR, ,
  346.         [use win32 style mkdir(str) from <direct.h>])
  347. elif test "$jikes_cv_mac_mkdir" = "yes" ; then
  348.     AC_DEFINE(HAVE_MAC_MKDIR, ,
  349.         [use mac style mkdir(str,0) from <stat.mac.h>])
  350. else
  351.     AC_MSG_ERROR([Could not locate a working mkdir() implementation])
  352. fi
  353.  
  354.  
  355. dnl xlC (AIX), ICC (Win*, OS/2) and vacpp (all) are all compilers from
  356. dnl IBM, they are related in that there is a common code base. On the
  357. dnl x86 platform when compiling with ICC we need to set control registers
  358. dnl on the math co-proc inorder to work around floating point oddities.
  359.  
  360. dnl FIXME: need to limit to x86 architecture.
  361. dnl FIXME: case sensitive string compare to compiler name is BAD.
  362. dnl FIXME: need a better test than "does it compile"...
  363. dnl        need to acutally USE it. Ask Dave.
  364.  
  365. dnl old logic within the ICC/xlC shared config block (added by cabbey@home.net
  366. dnl because it was setting this flag on PowerRS based AIX boxen)
  367. dnl To really fix this, we need to find out what ${host_os} is set
  368. dnl to when compiling on windows or OS2.
  369.  
  370. dnl Something like this ???
  371. dnl case "${host_os}" in                                                       
  372. dnl        *86)
  373. dnl            jikes_cv_icc_fp_bugs=yes
  374. dnl            ;;
  375. dnl esac
  376.  
  377. AC_CACHE_CHECK(floating point bug workaround for ICC compiler, jikes_cv_icc_fp_bugs,
  378.     AC_TRY_COMPILE([#include <float.h>],
  379. [ _control87(EM_UNDERFLOW, EM_UNDERFLOW); ],
  380. [  if "$CXX" = "ICC" || test "$CXX" = "vacpp" ; then
  381.        jikes_cv_icc_fp_bugs=yes
  382.    else
  383.        jikes_cv_icc_fp_bugs=no
  384.    fi
  385. ],
  386.     jikes_cv_icc_fp_bugs=no)
  387. )
  388. if test "$jikes_cv_icc_fp_bugs" = "yes" ; then
  389.     AC_DEFINE(HAVE_ICC_FP_BUGS, , [known to be broken on Win and OS2 when compiled with ICC])
  390. fi
  391.  
  392.  
  393.  
  394.  
  395. dnl    see if jikespg location is given on the command line
  396.  
  397. AC_ARG_WITH(jikespg, [  --with-jikespg=PROG     location of jikes parser generator (optional)],
  398.     JIKESPG=$withval, JIKESPG=NONE)
  399.  
  400. if test "$JIKESPG" != "NONE"; then
  401.     if test ! -f "$JIKESPG" || test ! -x "$JIKESPG"; then
  402.         AC_MSG_ERROR([jikespg argument '$JIKESPG' is not a file or is not executable])
  403.     fi
  404. else
  405.     JIKESPG=jikespg
  406. fi
  407. AC_SUBST(JIKESPG)
  408.  
  409.  
  410.  
  411.  
  412. # Subst variables into Makefile.in to produce the Makefile
  413.  
  414. dnl AC_CACHE_SAVE
  415.  
  416. AC_OUTPUT([Makefile doc/Makefile src/Makefile])
  417.