Skip to content

Commit

Permalink
Merge pull request #9 from JJL772/enh_autodetect_rhel
Browse files Browse the repository at this point in the history
src/defs.mak: Improve host system autodetection
  • Loading branch information
JJL772 authored Feb 8, 2024
2 parents c0fad94 + 9ec8882 commit af6d4f4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.mak
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PACKAGE_TOP=/afs/slac/g/lcls/package
# you can redefine the name of the host architecture:
# HARCH = www
#HARCH=linux-x86_64
HARCH=rhel6-x86_64
#HARCH=rhel6-x86_64

# Assuming you also want 'xxx' and 'yyy' then you'd
# add these to the 'ARCHES' variable:
Expand Down
20 changes: 20 additions & 0 deletions src/arch-detect.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# //@C Copyright Notice
# //@C ================
# //@C This file is part of CPSW. It is subject to the license terms in the LICENSE.txt
# //@C file found in the top-level directory of this distribution and at
# //@C https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# //@C
# //@C No part of CPSW, including this file, may be copied, modified, propagated, or
# //@C distributed except according to the terms contained in the LICENSE.txt file.

#=================================================#
# Simple utility script to detect host arch
#=================================================#

HOST_ARCH:=$(shell uname -r | grep -Eo "el[0-9][0-9]?")
ifneq ($(HOST_ARCH),)
HOST_ARCH:=rhel$(subst el,,$(HOST_ARCH))-$(shell uname -m)
else
HOST_ARCH:=linux-$(shell uname -m)
endif

4 changes: 3 additions & 1 deletion src/defs.mak
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
# (Default) Definitions for CPSW Makefiles

# host architecture
HARCH_DEFAULT:=linux-$(shell uname -m)
include $(CPSW_DIR)/arch-detect.mak
HARCH_DEFAULT:=$(HOST_ARCH)
HARCH=$(HARCH_DEFAULT)

# Architectures to build
ARCHES=$(HARCH)

Expand Down

0 comments on commit af6d4f4

Please sign in to comment.