11ifeq ($(filter clean install,$(MAKECMDGOALS ) ) ,)
2+ MACH = $(subst -, ,$(shell $(CC ) -dumpmachine) )
3+ ifeq ($(MACH ) ,)
4+ $(error unknown target architecture)
5+ endif
26# find the suitable cross-assembler
37DJ64AS = $(CROSS_PREFIX ) as
48DJ64ASFLAGS = --32 --defsym _DJ64=1
@@ -12,7 +16,7 @@ CROSS_PREFIX := x86_64-linux-gnu-
1216endif
1317ifeq ($(shell $(DJ64AS ) --version 2>/dev/null) ,)
1418CROSS_PREFIX :=
15- ifneq ($(filter x86_64 amd64 i686 i386,$(shell uname -m ) ) ,)
19+ ifneq ($(filter x86_64 amd64 i686 i386,$(MACH ) ) ,)
1620ifeq ($(shell $(DJ64AS ) --version 2>/dev/null) ,)
1721# found nothing, try built-in assembler
1822DJ64AS = $(CC ) -x assembler
@@ -47,10 +51,10 @@ LD = $(CC)
4751DJ64_XLDFLAGS = -V 5
4852# freebsd's dlopen() ignores link order and binds to libc the symbols
4953# defined in libdj64.so. Use static linking as a work-around.
50- ifeq ($(shell uname -s) ,FreeBSD )
54+ ifneq ($(filter freebsd % , $( MACH ) ) , )
5155DJ64STATIC = 1
5256endif
53- ifeq ($(shell uname -o) ,Android )
57+ ifneq ($(filter android % , $( MACH ) ) , )
5458DJ64STATIC = 1
5559endif
5660ifeq ($(DJ64STATIC ) ,0)
0 commit comments