comparison configure.ac @ 15134:edae65062740

build: Move unordered_map header tests to acinclude.m4 and add caching of results. * configure.ac: Remove unordered_map header tests * m4/acinclude.m4: New OCTAVE_UNORDERED_MAP_HEADERS macro which checks and caches results of undordered_map and tr1_namespace checks.
author Rik <rik@octave.org>
date Thu, 09 Aug 2012 08:29:50 -0700
parents f635710b3090
children 089b98bdaebf 4388f6518440
comparison
equal deleted inserted replaced
15133:f91eac1bc66d 15134:edae65062740
1769 sys/select.h sys/utsname.h termcap.h) 1769 sys/select.h sys/utsname.h termcap.h)
1770 1770
1771 ## C++ headers 1771 ## C++ headers
1772 1772
1773 AC_LANG_PUSH(C++) 1773 AC_LANG_PUSH(C++)
1774
1774 AC_CHECK_HEADERS(sstream) 1775 AC_CHECK_HEADERS(sstream)
1775 AC_CHECK_HEADERS([unordered_map], [], [ 1776 OCTAVE_UNORDERED_MAP_HEADERS
1776 AC_CHECK_HEADERS([tr1/unordered_map])]) 1777
1777 AC_MSG_CHECKING([whether unordered_map requires tr1 namespace])
1778 unordered_map_requires_tr1_namespace=no
1779 if test "$ac_cv_header_unordered_map" = "yes"; then
1780 ## Have <unordered_map>, but still have to check whether
1781 ## tr1 namespace is required (like MSVC, for instance).
1782 AC_COMPILE_IFELSE([
1783 AC_LANG_PROGRAM([
1784 #include <unordered_map>
1785 ], [
1786 std::unordered_map<int,int> m;
1787 ])], [], [unordered_map_requires_tr1_namespace=yes])
1788 elif test "$ac_cv_header_tr1_unordered_map" = "yes"; then
1789 unordered_map_requires_tr1_namespace=yes
1790 fi
1791 if test "$unordered_map_requires_tr1_namespace" = "yes"; then
1792 AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1, [Define to 1 if unordered_map requires the use of tr1 namespace.])
1793 fi
1794 AC_MSG_RESULT([$unordered_map_requires_tr1_namespace])
1795 AC_LANG_POP(C++) 1778 AC_LANG_POP(C++)
1796 1779
1797 ## Find a termio header to include. 1780 ## Find a termio header to include.
1798 1781
1799 have_termios_h=no 1782 have_termios_h=no
1836 ## Check for long double type (for 64-bit integers) 1819 ## Check for long double type (for 64-bit integers)
1837 AC_CHECK_SIZEOF(long double) 1820 AC_CHECK_SIZEOF(long double)
1838 1821
1839 ### Check structures and existence of necessary members 1822 ### Check structures and existence of necessary members
1840 1823
1841 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev, struct group.gr_passwd]) 1824 AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev])
1842 #AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) 1825 AC_CHECK_MEMBERS([struct group.gr_passwd])
1843 #AC_CHECK_MEMBERS(struct group.gr_passwd)
1844 #AC_CHECK_MEMBERS(struct group.gr_passwd)
1845 1826
1846 AC_STRUCT_TIMEZONE 1827 AC_STRUCT_TIMEZONE
1847 1828
1848 ### Check compiler characteristics. 1829 ### Check compiler characteristics.
1849 1830