File: cpp_check_class.m4

package info (click to toggle)
liquidsoap 2.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,924 kB
  • sloc: ml: 73,577; javascript: 24,836; sh: 3,440; makefile: 764; xml: 114; ansic: 96; lisp: 62; python: 35; perl: 8; ruby: 8
file content (24 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (79)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
dnl $1: linker lib name
dnl $2: included file
dnl $3: tested class
dnl $4: emitted variable
AC_DEFUN([AC_CPP_CHECK_CLASS],
[AC_LANG_PUSH([C++])
 SAVED_LDFLAGS=$LDFLAGS
 LDFLAGS="$LDFLAGS -l$1"
 AC_MSG_CHECKING([for class $3 in $1 library])
 AC_LINK_IFELSE(
   [AC_LANG_PROGRAM([#include <$2>],
     [$3 *x = NULL])],
   [TEST_LIBS="$TEST_LIBS -l$1"] [RESULT=1],
   [RESULT=])
 if test -z $RESULT; then
   AC_MSG_RESULT([not found])
 else
   AC_DEFINE([$4], [1], [Defined if class $3 has been found in $1 library])
   AC_MSG_RESULT([ok])
 fi
 $4=$RESULT
 AC_SUBST([$4])
 LDFLAGS=$SAVED_LDFLAGS
 AC_LANG_POP([C++])])