configure.ac 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ([2.64])
  4. AC_INIT([GNU Vtable Verification Runtime Library], 1.0,,[libvtv])
  5. #AC_INIT(package-unused, version-unused, libvtv)
  6. AC_CONFIG_SRCDIR([vtv_rts.h])
  7. # -------
  8. # Options
  9. # -------
  10. AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
  11. AC_ARG_ENABLE(version-specific-runtime-libs,
  12. [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
  13. [case "$enableval" in
  14. yes) version_specific_libs=yes ;;
  15. no) version_specific_libs=no ;;
  16. *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
  17. esac],
  18. [version_specific_libs=no])
  19. AC_MSG_RESULT($version_specific_libs)
  20. # Do not delete or change the following two lines. For why, see
  21. # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
  22. AC_CANONICAL_SYSTEM
  23. target_alias=${target_alias-$host_alias}
  24. AC_SUBST(target_alias)
  25. GCC_LIBSTDCXX_RAW_CXX_FLAGS
  26. # Use same top-level configure hooks in libgcc/libstdc++/libvtv.
  27. AC_MSG_CHECKING([for --enable-vtable-verify])
  28. AC_ARG_ENABLE(vtable-verify,
  29. [ --enable-vtable-verify Enable vtable verification feature ],
  30. [case "$enableval" in
  31. yes) enable_vtable_verify=yes ;;
  32. no) enable_vtable_verify=no ;;
  33. *) enable_vtable_verify=no;;
  34. esac],
  35. [enable_vtable_verify=no])
  36. AC_MSG_RESULT($enable_vtable_verify)
  37. # See if supported.
  38. unset VTV_SUPPORTED
  39. AC_MSG_CHECKING([for host support for vtable verification])
  40. . ${srcdir}/configure.tgt
  41. AC_MSG_RESULT($VTV_SUPPORTED)
  42. # Decide if it's usable.
  43. use_vtable_verify=no
  44. if test "x$VTV_SUPPORTED" = "xyes"; then
  45. if test "x$enable_vtable_verify" = "xyes"; then
  46. use_vtable_verify=yes
  47. AC_MSG_NOTICE(using vtable verification)
  48. fi
  49. fi
  50. AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $use_vtable_verify = yes)
  51. AM_INIT_AUTOMAKE(foreign no-dist)
  52. AM_ENABLE_MULTILIB(, ..)
  53. AM_MAINTAINER_MODE
  54. LIBVTV_CONFIGURE
  55. # Calculate toolexeclibdir
  56. # Also toolexecdir, though it's only used in toolexeclibdir
  57. case ${version_specific_libs} in
  58. yes)
  59. # Need the gcc compiler version to know where to install libraries
  60. # and header files if --enable-version-specific-runtime-libs option
  61. # is selected.
  62. toolexecdir='$(libdir)/gcc/$(target_alias)'
  63. toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
  64. ;;
  65. no)
  66. if test -n "$with_cross_host" &&
  67. test x"$with_cross_host" != x"no"; then
  68. # Install a library built with a cross compiler in tooldir, not libdir.
  69. toolexecdir='$(exec_prefix)/$(target_alias)'
  70. toolexeclibdir='$(toolexecdir)/lib'
  71. else
  72. toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
  73. toolexeclibdir='$(libdir)'
  74. fi
  75. multi_os_directory=`$CC -print-multi-os-directory`
  76. case $multi_os_directory in
  77. .) ;; # Avoid trailing /.
  78. *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
  79. esac
  80. ;;
  81. esac
  82. AC_SUBST(toolexecdir)
  83. AC_SUBST(toolexeclibdir)
  84. AC_GNU_SOURCE
  85. AC_CHECK_FUNCS([__secure_getenv])
  86. AC_GNU_SOURCE
  87. AC_CHECK_FUNCS([secure_getenv])
  88. # Check for programs.
  89. m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
  90. m4_define([_AC_ARG_VAR_PRECIOUS],[])
  91. AC_PROG_CC
  92. AC_PROG_CXX
  93. m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  94. AM_PROG_CC_C_O
  95. AC_SUBST(CFLAGS)
  96. AC_SUBST(CXXFLAGS)
  97. # Newer automakes demand CCAS and CCASFLAGS.
  98. : ${CCAS='$(CC)'}
  99. : ${CCASFLAGS='$(CFLAGS)'}
  100. AC_SUBST(CCAS)
  101. AC_SUBST(CCASFLAGS)
  102. AC_CHECK_TOOL(AS, as)
  103. AC_CHECK_TOOL(AR, ar)
  104. AC_CHECK_TOOL(RANLIB, ranlib, :)
  105. # Configure libtool
  106. AC_LIBTOOL_DLOPEN
  107. AM_PROG_LIBTOOL
  108. ACX_LT_HOST_FLAGS
  109. AC_SUBST(enable_shared)
  110. AC_SUBST(enable_static)
  111. # For libtool versioning info, format is CURRENT:REVISION:AGE
  112. libtool_VERSION=1:0:0
  113. AC_SUBST(libtool_VERSION)
  114. XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
  115. AC_SUBST(XCFLAGS)
  116. if test "${multilib}" = "yes"; then
  117. multilib_arg="--enable-multilib"
  118. else
  119. multilib_arg=
  120. fi
  121. AC_CONFIG_FILES([Makefile])
  122. if test "x$VTV_SUPPORTED" = "xyes"; then
  123. AC_CONFIG_FILES(AC_FOREACH([DIR], [testsuite], [DIR/Makefile ]),
  124. [cat > vpsed$$ << \_EOF
  125. s!`test -f '$<' || echo '$(srcdir)/'`!!
  126. _EOF
  127. sed -f vpsed$$ $ac_file > tmp$$
  128. mv tmp$$ $ac_file
  129. rm vpsed$$
  130. echo 'MULTISUBDIR =' >> $ac_file
  131. ml_norecursion=yes
  132. . ${multi_basedir}/config-ml.in
  133. AS_UNSET([ml_norecursion])
  134. ])
  135. fi
  136. case "$target_os" in
  137. cygwin*|mingw32*)
  138. vtv_cygmin="yes"
  139. ;;
  140. *)
  141. vtv_cygmin="no"
  142. ;;
  143. esac
  144. AM_CONDITIONAL(VTV_CYGMIN, test $vtv_cygmin = yes)
  145. AC_OUTPUT