File: libsysfs.m4

package info (click to toggle)
libchipcard 5.1.0beta-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,688 kB
  • sloc: ansic: 21,052; xml: 6,746; sh: 4,177; makefile: 610; cpp: 448
file content (36 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (18)
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
AC_DEFUN([AC_LIBSYSFS], [
dnl searches for libusysfs
dnl IN: 
dnl   nothing
dnl OUT:
dnl   Variables:
dnl     libsysfs_libs     : stuff for LDFLAGS (or LIBADD)
dnl     libsysfs_includes : includes (for CFLAGS)
dnl     have_libsysfs     : "yes" if libsysfs is supported
have_libsysfs="no"
libsysfs_libs=""
libsysfs_includes=""
AC_CHECK_HEADER([sysfs/libsysfs.h],
                [
  AC_CHECK_LIB(sysfs,sysfs_get_mnt_path,[
        have_libsysfs="yes"
	libsysfs_libs="-lsysfs"
	AC_SUBST(libsysfs_libs)
	AC_SUBST(libsysfs_includes)
	
     ],AC_MSG_RESULT([libsysfs not found.]))
  ],
                [AC_MSG_RESULT([sysfs/libsysfs.h not found.])])

  if test "x$have_libsysfs" = "xyes"; then
    AC_CHECK_MEMBERS([struct sysfs_driver.attrlist], 
                     [HAVE_SYSFS2="yes"], [],
                     [#include <sysfs/libsysfs.h>])
    if test "x$HAVE_SYSFS2" = "xyes"; then
       AC_DEFINE_UNQUOTED(HAVE_SYSFS2, 1, [whether sysfs2 is available])
    fi
  fi

])