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' |
| 7 | add_project_arguments('-D__FLASHROM_LITTLE_ENDIAN__=1', language : 'c') |
| 8 | endif |
| 9 | if host_machine.endian() == 'big' |
| 10 | add_project_arguments('-D__FLASHROM_BIG_ENDIAN__=1', language : 'c') |
| 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 | |
| 24 | # NetBSD requires libx86 or libx86_64 for I/O port handling |
| 25 | if host_machine.system() == 'netbsd' |
| 26 | if host_machine.cpu_family() == 'x86' |
| 27 | libx86 = cc.find_library('x86') |
| 28 | deps += libx86 |
| 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 |