File: ac_cxx_extern_template.m4

package info (click to toggle)
libitpp 4.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 7,520 kB
  • ctags: 6,341
  • sloc: cpp: 51,608; sh: 9,248; makefile: 636; fortran: 8
file content (38 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
##### http://autoconf-archive.cryp.to/ac_cxx_extern_template.html
#
# SYNOPSIS
#
#   AC_CXX_EXTERN_TEMPLATE
#
# DESCRIPTION
#
#   Test whether the C++ compiler supports "extern template".
#
# LAST MODIFICATION
#
#   2007-11-21  by Adam Piatyszek <ediap@users.sourceforge.net>
#
# COPYLEFT
#
#   Copyright (c) 2005 Patrick Mauritz <oxygene@studentenbude.ath.cx>
#
#   Copying and distribution of this file, with or without
#   modification, are permitted in any medium without royalty provided
#   the copyright notice and this notice are preserved.

AC_DEFUN([AC_CXX_EXTERN_TEMPLATE],
[AC_CACHE_CHECK([whether the compiler supports extern template],
                [ac_cv_cxx_extern_template],
                [AC_LANG_PUSH([C++])
                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[template <typename T> void foo(T);
extern template void foo<int>(int);]],
                                                    [])],
                                   [ac_cv_cxx_extern_template=yes],
                                   [ac_cv_cxx_extern_template=no])
                 AC_LANG_POP([C++])])
 if test "$ac_cv_cxx_extern_template" = yes; then
   AC_DEFINE([HAVE_EXTERN_TEMPLATE], [1],
             [Define if the compiler supports extern template])
 fi
])