meson.build 6.82 KB
Newer Older
Bastien Nocera's avatar
Bastien Nocera committed
1 2
libfprint_sources = [
    'fp_internal.h',
3
    'drivers_api.h',
4 5
    'fpi-async.c',
    'fpi-async.h',
6 7
    'fpi-assembling.c',
    'fpi-assembling.h',
8 9
    'fpi-core.c',
    'fpi-core.h',
10 11
    'fpi-data.c',
    'fpi-data.h',
12 13
    'fpi-dev.c',
    'fpi-dev.h',
14 15
    'fpi-dev-img.c',
    'fpi-dev-img.h',
16 17
    'fpi-img.c',
    'fpi-img.h',
18
    'fpi-log.h',
19 20
    'fpi-ssm.c',
    'fpi-ssm.h',
21
    'fpi-sync.c',
22 23
    'fpi-poll.h',
    'fpi-poll.c',
24 25
    'fpi-usb.h',
    'fpi-usb.c',
Bastien Nocera's avatar
Bastien Nocera committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    'drivers/driver_ids.h',
]

nbis_sources = [
    'nbis/include/bozorth.h',
    'nbis/include/bz_array.h',
    'nbis/include/defs.h',
    'nbis/include/lfs.h',
    'nbis/include/log.h',
    'nbis/include/morph.h',
    'nbis/include/sunrast.h',
    'nbis/bozorth3/bozorth3.c',
    'nbis/bozorth3/bz_alloc.c',
    'nbis/bozorth3/bz_drvrs.c',
    'nbis/bozorth3/bz_gbls.c',
    'nbis/bozorth3/bz_io.c',
    'nbis/bozorth3/bz_sort.c',
    'nbis/mindtct/binar.c',
    'nbis/mindtct/block.c',
45
    'nbis/mindtct/chaincod.c',
Bastien Nocera's avatar
Bastien Nocera committed
46 47 48 49
    'nbis/mindtct/contour.c',
    'nbis/mindtct/detect.c',
    'nbis/mindtct/dft.c',
    'nbis/mindtct/free.c',
50
    'nbis/mindtct/getmin.c',
Bastien Nocera's avatar
Bastien Nocera committed
51 52 53 54
    'nbis/mindtct/globals.c',
    'nbis/mindtct/imgutil.c',
    'nbis/mindtct/init.c',
    'nbis/mindtct/line.c',
55
    'nbis/mindtct/link.c',
Bastien Nocera's avatar
Bastien Nocera committed
56 57 58 59 60 61 62 63 64 65 66 67
    'nbis/mindtct/log.c',
    'nbis/mindtct/loop.c',
    'nbis/mindtct/maps.c',
    'nbis/mindtct/matchpat.c',
    'nbis/mindtct/minutia.c',
    'nbis/mindtct/morph.c',
    'nbis/mindtct/quality.c',
    'nbis/mindtct/remove.c',
    'nbis/mindtct/ridges.c',
    'nbis/mindtct/shape.c',
    'nbis/mindtct/sort.c',
    'nbis/mindtct/util.c',
68
    'nbis/mindtct/xytreps.c',
Bastien Nocera's avatar
Bastien Nocera committed
69 70 71 72 73 74 75 76 77 78 79 80
]

aeslib = false
aesx660 = false
aes3k = false
drivers_sources = []
drivers_cflags = []
foreach driver: drivers
    if driver == 'upekts'
        drivers_sources += [ 'drivers/upekts.c' ]
    endif
    if driver == 'upektc'
81
        drivers_sources += [ 'drivers/upektc.c', 'drivers/upektc.h', 'drivers/upek_proto.c', 'drivers/upek_proto.h' ]
Bastien Nocera's avatar
Bastien Nocera committed
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
    endif
    if driver == 'upeksonly'
        drivers_sources += [ 'drivers/upeksonly.c', 'drivers/upeksonly.h' ]
    endif
    if driver == 'uru4000'
        drivers_sources += [ 'drivers/uru4000.c' ]
    endif
    if driver == 'aes1610'
        drivers_sources += [ 'drivers/aes1610.c' ]
        aeslib = true
    endif
    if driver == 'aes1660'
        drivers_sources += [ 'drivers/aes1660.c', 'drivers/aes1660.h' ]
        aeslib = true
        aesx660 = true
    endif
    if driver == 'aes2501'
        drivers_sources += [ 'drivers/aes2501.c', 'drivers/aes2501.h' ]
        aeslib = true
    endif
    if driver == 'aes2550'
        drivers_sources += [ 'drivers/aes2550.c', 'drivers/aes2550.h' ]
        aeslib = true
    endif
    if driver == 'aes2660'
        drivers_sources += [ 'drivers/aes2660.c', 'drivers/aes2660.h' ]
        aeslib = true
        aesx660 = true
    endif
    if driver == 'aes3500'
        drivers_sources += [ 'drivers/aes3500.c' ]
        aeslib = true
        aes3k = true
    endif
    if driver == 'aes4000'
        drivers_sources += [ 'drivers/aes4000.c' ]
        aeslib = true
        aes3k = true
    endif
    if driver == 'fdu2000'
        drivers_sources += [ 'drivers/fdu2000.c' ]
    endif
    if driver == 'vcom5s'
        drivers_sources += [ 'drivers/vcom5s.c' ]
    endif
    if driver == 'vfs101'
        drivers_sources += [ 'drivers/vfs101.c' ]
    endif
    if driver == 'vfs301'
        drivers_sources += [ 'drivers/vfs301.c', 'drivers/vfs301_proto.c',  'drivers/vfs301_proto.h', 'drivers/vfs301_proto_fragments.h' ]
    endif
    if driver == 'vfs5011'
        drivers_sources += [ 'drivers/vfs5011.c', 'drivers/vfs5011_proto.h' ]
    endif
    if driver == 'upektc_img'
137
        drivers_sources += [ 'drivers/upektc_img.c', 'drivers/upektc_img.h', 'drivers/upek_proto.c', 'drivers/upek_proto.h' ]
Bastien Nocera's avatar
Bastien Nocera committed
138 139 140 141 142 143 144 145 146 147 148 149 150
    endif
    if driver == 'etes603'
        drivers_sources += [ 'drivers/etes603.c' ]
    endif
    if driver == 'vfs0050'
        drivers_sources += [ 'drivers/vfs0050.c', 'drivers/vfs0050.h' ]
    endif
    if driver == 'elan'
        drivers_sources += [ 'drivers/elan.c', 'drivers/elan.h' ]
    endif
endforeach

if aeslib
151
    drivers_sources += [ 'drivers/aeslib.c', 'drivers/aeslib.h' ]
Bastien Nocera's avatar
Bastien Nocera committed
152 153 154 155 156 157 158 159 160 161
endif
if aesx660
    drivers_sources += ['drivers/aesx660.c', 'drivers/aesx660.h' ]
endif
if aes3k
    drivers_sources += ['drivers/aes3k.c', 'drivers/aes3k.h' ]
endif

other_sources = []
if imaging_dep.found()
162
    other_sources += [ 'fpi-img-pixman.c' ]
Bastien Nocera's avatar
Bastien Nocera committed
163 164
endif

165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
libfprint_sources += configure_file(input: 'empty_file',
                                    output: 'drivers_definitions.h',
                                    capture: true,
                                    command: [
                                      '/bin/echo',
                                      drivers_struct_list
                                    ])

libfprint_sources += configure_file(input: 'empty_file',
                                    output: 'drivers_arrays.h',
                                    capture: true,
                                    command: [
                                      '/bin/echo',
                                      drivers_primitive_array + '\n\n' + drivers_img_array
                                    ])

Bastien Nocera's avatar
Bastien Nocera committed
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
deps = [ mathlib_dep, glib_dep, libusb_dep, nss_dep, imaging_dep ]
libfprint = library('fprint',
                    libfprint_sources + drivers_sources + nbis_sources + other_sources,
                    soversion: soversion,
                    version: libversion,
                    c_args: common_cflags + drivers_cflags,
                    include_directories: [
                      root_inc,
                      include_directories('nbis/include'),
                    ],
                    dependencies: deps,
                    install: true)

libfprint_dep = declare_dependency(link_with: libfprint,
                                   include_directories: root_inc)

197
install_headers(['fprint.h'], subdir: 'libfprint')
Bastien Nocera's avatar
Bastien Nocera committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215

udev_rules = executable('fprint-list-udev-rules',
                        'fprint-list-udev-rules.c',
                        include_directories: [
                          root_inc,
                        ],
                        dependencies: [ deps, libfprint_dep ],
                        install: false)

if get_option('udev_rules')
    custom_target('udev-rules',
                  output: '60-fprint-autosuspend.rules',
                  capture: true,
                  command: [ udev_rules ],
                  install: true,
                  install_dir: udev_rules_dir)
endif

216 217 218 219 220 221 222
supported_devices = executable('fprint-list-supported-devices',
                               'fprint-list-supported-devices.c',
                               include_directories: [
                                 root_inc,
                               ],
                               dependencies: [ deps, libfprint_dep ],
                               install: false)