Thomas Heijligen | 328a64a | 2022-04-25 14:42:17 +0200 | [diff] [blame] | 1 | srcs += files( |
| 2 | ('endian_' + host_machine.endian() + '.c'), |
| 3 | 'memaccess.c', |
| 4 | ) |
| 5 | |
| 6 | if host_machine.endian() == 'little' |
Nico Huber | c3b02dc | 2023-08-12 01:13:45 +0200 | [diff] [blame] | 7 | add_project_arguments('-D__FLASHPROG_LITTLE_ENDIAN__=1', language : 'c') |
Thomas Heijligen | 328a64a | 2022-04-25 14:42:17 +0200 | [diff] [blame] | 8 | endif |
| 9 | if host_machine.endian() == 'big' |
Nico Huber | c3b02dc | 2023-08-12 01:13:45 +0200 | [diff] [blame] | 10 | add_project_arguments('-D__FLASHPROG_BIG_ENDIAN__=1', language : 'c') |
Thomas Heijligen | 328a64a | 2022-04-25 14:42:17 +0200 | [diff] [blame] | 11 | endif |
Thomas Heijligen | 3ecf0b6 | 2022-08-18 12:16:29 +0200 | [diff] [blame] | 12 | |
| 13 | # OpenBSD requires libi386 or libamd64 for I/O port handling |
| 14 | if 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 |
| 22 | endif |
| 23 | |
Nico Huber | f279762 | 2024-04-21 13:25:17 +0200 | [diff] [blame^] | 24 | # NetBSD requires libi386 or libx86_64 for I/O port handling |
Thomas Heijligen | 3ecf0b6 | 2022-08-18 12:16:29 +0200 | [diff] [blame] | 25 | if host_machine.system() == 'netbsd' |
| 26 | if host_machine.cpu_family() == 'x86' |
Nico Huber | f279762 | 2024-04-21 13:25:17 +0200 | [diff] [blame^] | 27 | libi386 = cc.find_library('i386') |
| 28 | deps += libi386 |
Thomas Heijligen | 3ecf0b6 | 2022-08-18 12:16:29 +0200 | [diff] [blame] | 29 | elif host_machine.cpu_family() == 'x86_64' |
| 30 | libx86_64 = cc.find_library('x86_64') |
| 31 | deps += libx86_64 |
| 32 | endif |
| 33 | endif |
| 34 | |
| 35 | |
| 36 | # SunOS requires external libraries for network sockets |
| 37 | # they are used to support serial devices via network |
| 38 | if host_machine.system() == 'sunos' |
| 39 | libsocket = cc.find_library('socket') |
| 40 | libnsl = cc.find_library('nsl') |
| 41 | deps += [ libsocket, libnsl] |
| 42 | endif |