File: acinclude.m4

package info (click to toggle)
libsmdev 20160320-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,896 kB
  • ctags: 3,283
  • sloc: ansic: 93,038; sh: 11,929; makefile: 805; python: 223; sed: 134
file content (145 lines) | stat: -rw-r--r-- 3,407 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
dnl Functions for libsmdev
dnl
dnl Version: 20130328

dnl Check if winioctl.h defines STORAGE_BUS_TYPE
AC_DEFUN([AX_LIBSMDEV_CHECK_HEADER_WINIOCTL_H_STORAGE_BUS_TYPE],
 [AC_CACHE_CHECK(
  [whether winioctl.h defines STORAGE_BUS_TYPE],
  [ac_cv_header_winioctl_h_storage_bus_type],
  [AC_LANG_PUSH(C)
  AC_COMPILE_IFELSE(
   [AC_LANG_PROGRAM(
    [[#include <windows.h>
#include <winioctl.h>]],
    [[STORAGE_BUS_TYPE storage_bus_type;
storage_bus_type = BusTypeUnknown;]] )],
   [ac_cv_header_winioctl_h_storage_bus_type=yes],
   [ac_cv_header_winioctl_h_storage_bus_type=no])
  AC_LANG_POP(C)],
  [ac_cv_header_winioctl_h_storage_bus_type=no])

 AS_IF(
  [test "x$ac_cv_header_winioctl_h_storage_bus_type" = xyes],
  [AC_DEFINE(
   [HAVE_WINIOCTL_H_STORAGE_BUS_TYPE],
   [1],
   [Define to 1 if STORAGE_BUS_TYPE is defined.])
  ])
 ])

dnl Function to detect if libsmdev dependencies are available
AC_DEFUN([AX_LIBSMDEV_CHECK_LOCAL],
 [dnl Headers included in libsmdev/libsmdev_handle.c and libsmdev/libsmdev_support.c
 AC_CHECK_HEADERS([errno.h sys/stat.h unistd.h])

 dnl Headers included in libsmdev/libsmdev_metadata.c
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xno],
  [AC_CHECK_HEADERS([cygwin/fs.h linux/fs.h sys/disk.h sys/disklabel.h])
 ])

 dnl Headers included in libsmdev/libsmdev_ata.c
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xno],
  [AC_CHECK_HEADERS([cygwin/hdreg.h linux/hdreg.h])
 ])

 dnl Headers included in libsmdev/libsmdev_scsi.c
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xno],
  [AC_CHECK_HEADERS([scsi/scsi.h scsi/scsi_ioctl.h scsi/sg.h])
 ])

 dnl Headers included in libsmdev/libsmdev_optical_disk.c
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xno],
  [AC_CHECK_HEADERS([linux/cdrom.h])
 ])

 dnl Headers included in libsmdev/libsmdev_usb.c
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xno],
  [AC_CHECK_HEADERS([linux/usbdevice_fs.h linux/usb/ch9.h sys/ioctl.h])
 ])

 dnl File input/output functions used in libbfio/libbfio_file.h
 AC_CHECK_FUNCS([close fstat ftruncate lseek open read stat write])

 AS_IF(
  [test "x$ac_cv_func_close" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: close],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_fstat" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: fstat],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_ftruncate" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: ftruncate],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_lseek" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: lseek],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_open" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: open],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_read" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: read],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_stat" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: stat],
   [1])
  ])
 
 AS_IF(
  [test "x$ac_cv_func_write" != xyes],
  [AC_MSG_FAILURE(
   [Missing function: write],
   [1])
  ])

 dnl Check for error string functions used in libsmdev/libsmdev_error_string.c
 AC_FUNC_STRERROR_R()

 AS_IF(
  [test "x$ac_cv_have_decl_strerror_r" = xno],
  [AC_CHECK_FUNCS([strerror])

  AS_IF(
   [test "x$ac_cv_func_strerror" != xyes],
   [AC_MSG_FAILURE(
    [Missing functions: strerror and strerror_r],
    [1])
   ])
  ])

 dnl Check if winioctl.h defines STORAGE_BUS_TYPE
 AS_IF(
  [test "x$ac_cv_enable_winapi" = xyes],
  [AX_LIBSMDEV_CHECK_HEADER_WINIOCTL_H_STORAGE_BUS_TYPE])
 ])