Skip to content

Commit 2b10a87

Browse files
committed
use gcc -dumpmachine to detect target OS, istead of uname -m
see euslisp/EusLisp#486 and euslisp/EusLisp#485 for more info
1 parent 317c29c commit 2b10a87

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Makefile

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ ifneq ($(GCC_MACHINE),)
1414
ifeq ($(GCC_MACHINE),i686-linux-gnu)
1515
MACHINE=x86
1616
endif
17+
ifeq ($(GCC_MACHINE),aarch64-linux-gnu)
18+
MACHINE=aarch64
19+
endif
20+
ifeq ($(GCC_MACHINE),arm-linux-gnueabihf)
21+
MACHINE=arm
22+
endif
1723
endif
1824
ifeq ($(MACHINE),)
1925
MACHINE=$(shell uname -m)
@@ -26,7 +32,7 @@ ifeq ($(OS),Linux)
2632
export ARCHDIR=Linux64
2733
export MAKEFILE=Makefile.Linux64
2834
else
29-
ifneq (, $(findstring armv,$(MACHINE)))
35+
ifneq (, $(findstring arm,$(MACHINE)))
3036
export ARCHDIR=LinuxARM
3137
export MAKEFILE=Makefile.LinuxARM
3238
else ifneq (, $(findstring aarch,$(MACHINE)))

irteus/Makefile.Linux

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ CXXFLAGS=$(CFLAGS)
7272
CFLAGS+= -g -falign-functions=4
7373
CXXFLAGS+=-g -falign-functions=4
7474

75-
ifeq ($(shell /bin/uname -m), x86_64)
75+
ifeq ($(shell gcc -dumpmachine), x86_64-linux-gnu)
7676
CC += -m32
7777
CXX += -m32
7878
LD += -m32

irteus/Makefile.LinuxARM

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ FFTW=-L/usr/local/lib -lfftw -lrfftw
6363

6464
SVNVERSION=\"$(shell git rev-parse --short HEAD)\"
6565

66-
MACHINE=$(shell uname -m | sed 's/\(armv[0-9]\).*/\1/')
66+
# gcc -dumpmachine retruns target triplet consists of three fields separated by a hyphen (-).
67+
MACHINE=$(shell gcc -dumpmachine | sed 's/\(.*\)-.*-.*/\1/')
6768
THREAD= -DTHREADED -DPTHREAD
6869

6970
CFLAGS=-O2 -D$(MACHINE) -D$(ARCH) -DLinux -DARM -D_REENTRANT -DGCC -I$(EUSDIR)/include $(THREAD) -DSVNVERSION=$(SVNVERSION) -fPIC

irteus/PQP/Makefile.Linux

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LPFX = lib
1010
LIBS = -L$(ARCHDIR) -lRAPID
1111

1212

13-
ifeq ($(shell /bin/uname -m), x86_64)
13+
ifeq ($(shell gcc -dumpmachine), x86_64-linux-gnu)
1414
CC += -m32
1515
LD += -m32
1616
EXELD += -m32

0 commit comments

Comments
 (0)