File: libfplist.m4

package info (click to toggle)
libfvde 20190104-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 13,884 kB
  • sloc: ansic: 206,296; sh: 6,111; makefile: 1,444; python: 487; yacc: 356; lex: 247; sed: 16
file content (229 lines) | stat: -rw-r--r-- 6,061 bytes parent folder | download | duplicates (3)
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
dnl Functions for libfplist
dnl
dnl Version: 20190919

dnl Function to detect if libfplist is available
dnl ac_libfplist_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l<library> arguments
AC_DEFUN([AX_LIBFPLIST_CHECK_LIB],
  [dnl Check if parameters were provided
  AS_IF(
    [test "x$ac_cv_with_libfplist" != x && test "x$ac_cv_with_libfplist" != xno && test "x$ac_cv_with_libfplist" != xauto-detect],
    [AS_IF(
      [test -d "$ac_cv_with_libfplist"],
      [CFLAGS="$CFLAGS -I${ac_cv_with_libfplist}/include"
      LDFLAGS="$LDFLAGS -L${ac_cv_with_libfplist}/lib"],
      [AC_MSG_WARN([no such directory: $ac_cv_with_libfplist])
      ])
    ])

  AS_IF(
    [test "x$ac_cv_with_libfplist" = xno],
    [ac_cv_libfplist=no],
    [dnl Check for a pkg-config file
    AS_IF(
      [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"],
      [PKG_CHECK_MODULES(
        [libfplist],
        [libfplist >= 20170919],
        [ac_cv_libfplist=yes],
        [ac_cv_libfplist=check])
      ])

    AS_IF(
      [test "x$ac_cv_libfplist" = xyes],
      [ac_cv_libfplist_CPPFLAGS="$pkg_cv_libfplist_CFLAGS"
      ac_cv_libfplist_LIBADD="$pkg_cv_libfplist_LIBS"])

    AS_IF(
      [test "x$ac_cv_libfplist" = xcheck],
      [dnl Check for headers
      AC_CHECK_HEADERS([libfplist.h])

      AS_IF(
        [test "x$ac_cv_header_libfplist_h" = xno],
        [ac_cv_libfplist=no],
        [dnl Check for the individual functions
        ac_cv_libfplist=yes
        AC_CHECK_LIB(
          fplist,
          libfplist_get_version,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        dnl Plist functions
        AC_CHECK_LIB(
          fplist,
          libfplist_property_list_initialize,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_list_free,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_list_copy_from_byte_stream,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_list_has_plist_root_element,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_list_get_root_property,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        dnl Property functions
        AC_CHECK_LIB(
          fplist,
          libfplist_property_free,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_value_type,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_value_data_size,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_value_data,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_value_integer,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_value_string,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        AC_CHECK_LIB(
          fplist,
          libfplist_property_value_uuid_string_copy_to_byte_stream,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_array_number_of_entries,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])
        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_array_entry_by_index,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        AC_CHECK_LIB(
          fplist,
          libfplist_property_get_sub_property_by_utf8_name,
          [ac_cv_libfplist_dummy=yes],
          [ac_cv_libfplist=no])

        ac_cv_libfplist_LIBADD="-lfplist"
        ])
      ])
    ])

  AS_IF(
    [test "x$ac_cv_libfplist" = xyes],
    [AC_DEFINE(
      [HAVE_LIBFPLIST],
      [1],
      [Define to 1 if you have the `fplist' library (-lfplist).])
    ])

  AS_IF(
    [test "x$ac_cv_libfplist" = xyes],
    [AC_SUBST(
      [HAVE_LIBFPLIST],
      [1]) ],
    [AC_SUBST(
      [HAVE_LIBFPLIST],
      [0])
    ])
  ])

dnl Function to detect if libfplist dependencies are available
AC_DEFUN([AX_LIBFPLIST_CHECK_LOCAL],
  [AM_PROG_LEX
  AC_PROG_YACC

  ac_cv_libfplist_CPPFLAGS="-I../libfplist";
  ac_cv_libfplist_LIBADD="../libfplist/libfplist.la";

  ac_cv_libfplist=local
  ])

dnl Function to detect how to enable libfplist
AC_DEFUN([AX_LIBFPLIST_CHECK_ENABLE],
  [AX_COMMON_ARG_WITH(
    [libfplist],
    [libfplist],
    [search for libfplist in includedir and libdir or in the specified DIR, or no if to use local version],
    [auto-detect],
    [DIR])

  AX_LIBFPLIST_CHECK_LIB

  AS_IF(
    [test "x$ac_cv_libfplist" != xyes],
    [AX_LIBFPLIST_CHECK_LOCAL

    AC_DEFINE(
      [HAVE_LOCAL_LIBFPLIST],
      [1],
      [Define to 1 if the local version of libfplist is used.])
    AC_SUBST(
      [HAVE_LOCAL_LIBFPLIST],
      [1])
    ])

  AM_CONDITIONAL(
    [HAVE_LOCAL_LIBFPLIST],
    [test "x$ac_cv_libfplist" = xlocal])
  AS_IF(
    [test "x$ac_cv_libfplist_CPPFLAGS" != "x"],
    [AC_SUBST(
      [LIBFPLIST_CPPFLAGS],
      [$ac_cv_libfplist_CPPFLAGS])
    ])
  AS_IF(
    [test "x$ac_cv_libfplist_LIBADD" != "x"],
    [AC_SUBST(
      [LIBFPLIST_LIBADD],
      [$ac_cv_libfplist_LIBADD])
    ])

  AS_IF(
    [test "x$ac_cv_libfplist" = xyes],
    [AC_SUBST(
      [ax_libfplist_pc_libs_private],
      [-lfplist])
    ])

  AS_IF(
    [test "x$ac_cv_libfplist" = xyes],
    [AC_SUBST(
      [ax_libfplist_spec_requires],
      [libfplist])
    AC_SUBST(
      [ax_libfplist_spec_build_requires],
      [libfplist-devel])
    ])
  ])