Skip to content

Commit 1d501fb

Browse files
author
David Sommerseth
committed
Take endinanness into consideration when compiling
1 parent 2b34fc4 commit 1d501fb

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/setup-dbg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
# misc info
4444
dmidec_version = get_version()
45+
macros = get_macros()
4546

4647
#
4748
# Python setup
@@ -73,7 +74,8 @@
7374
include_dirs = incdir,
7475
library_dirs = libdir,
7576
libraries = libs,
76-
undef_macros = [ "NDEBUG" ]
77+
undef_macros = [ "NDEBUG" ],
78+
define_macros = macros
7779
)
7880
],
7981
py_modules = [ "dmidecode" ]

src/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
# misc info
4444
dmidec_version = get_version()
45+
macros = get_macros()
4546

4647
#
4748
# Python setup
@@ -73,7 +74,8 @@
7374
include_dirs = incdir,
7475
library_dirs = libdir,
7576
libraries = libs,
76-
undef_macros = [ "NDEBUG" ]
77+
undef_macros = [ "NDEBUG" ],
78+
define_macros = macros
7779
)
7880
],
7981
py_modules = [ "dmidecode" ]

src/setup_common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@ def get_version():
9191

9292
return version
9393

94+
def get_macros():
95+
"Sets macros which is relevant for all setup*.py files"
96+
97+
macros = []
98+
if sys.byteorder == 'big':
99+
macros.append(("ALIGNMENT_WORKAROUND", None))
100+
return macros
101+

0 commit comments

Comments
 (0)