blob: e4dc7c57c71595467553809282f3a82767b022c5 [file] [log] [blame]
Thomas Heijligen328a64a2022-04-25 14:42:17 +02001srcs += files(
2 ('endian_' + host_machine.endian() + '.c'),
3 'memaccess.c',
4)
5
6if host_machine.endian() == 'little'
Nico Huberc3b02dc2023-08-12 01:13:45 +02007 add_project_arguments('-D__FLASHPROG_LITTLE_ENDIAN__=1', language : 'c')
Thomas Heijligen328a64a2022-04-25 14:42:17 +02008endif
9if host_machine.endian() == 'big'
Nico Huberc3b02dc2023-08-12 01:13:45 +020010 add_project_arguments('-D__FLASHPROG_BIG_ENDIAN__=1', language : 'c')
Thomas Heijligen328a64a2022-04-25 14:42:17 +020011endif
Thomas Heijligen3ecf0b62022-08-18 12:16:29 +020012
13# OpenBSD requires libi386 or libamd64 for I/O port handling
14if host_machine.system() == 'openbsd'
15 if host_machine.cpu_family() == 'x86'
16 libi386 = cc.find_library('i386')
17 deps += libi386
18 elif host_machine.cpu_family() == 'x86_64'
19 libamd64 = cc.find_library('amd64')
20 deps += libamd64
21 endif
22endif
23
Nico Huberf2797622024-04-21 13:25:17 +020024# NetBSD requires libi386 or libx86_64 for I/O port handling
Thomas Heijligen3ecf0b62022-08-18 12:16:29 +020025if host_machine.system() == 'netbsd'
26 if host_machine.cpu_family() == 'x86'
Nico Huberf2797622024-04-21 13:25:17 +020027 libi386 = cc.find_library('i386')
28 deps += libi386
Thomas Heijligen3ecf0b62022-08-18 12:16:29 +020029 elif host_machine.cpu_family() == 'x86_64'
30 libx86_64 = cc.find_library('x86_64')
31 deps += libx86_64
32 endif
33endif
34
35
36# SunOS requires external libraries for network sockets
37# they are used to support serial devices via network
38if host_machine.system() == 'sunos'
39 libsocket = cc.find_library('socket')
40 libnsl = cc.find_library('nsl')
41 deps += [ libsocket, libnsl]
42endif