File: comex_function.m4

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (22 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# COMEX_FUNCTION
# -----------
# Define FUNCTION_NAME to either __func__ or __FUNCTION__ appropriately.
# If all else fails, #define FUNCTION_NAME <blank>.
AC_DEFUN([COMEX_FUNCTION],
[AC_CACHE_CHECK([for preprocessor symbol for function name],
[comex_cv_cpp_function],
[AS_IF([test x$comex_cv_cpp_function = x],
    [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[extern int printf(const char *format, ...);]],
            [[printf("__func__ = %s\n", __func__);]])],
        [comex_cv_cpp_function=__func__])])
AS_IF([test x$comex_cv_cpp_function = x],
    [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM([[extern int printf(const char *format, ...);]],
            [[printf("__FUNCTION__ = %s\n", __FUNCTION__);]])],
        [comex_cv_cpp_function=__FUNCTION__])])
AS_IF([test x$comex_cv_cpp_function = x],
    [comex_cv_cpp_function='"Unknown"'])])
AC_DEFINE_UNQUOTED([FUNCTION_NAME], [$comex_cv_cpp_function],
    [CPP symbol for function name, if available])
])# COMEX_FUNCTION