Skip to content

Commit 9e08470

Browse files
author
Hodong
authored
build: Fix prefix for FreeBSD, OpenBSD (#916)
FreeBSD and OpenBSD typically use /usr/local as the prefix.
1 parent 3c1c478 commit 9e08470

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ configure_file(
204204
add_custom_target(remove
205205
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
206206

207-
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|DragonFly|GNU|Darwin" OR MINGW)
207+
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|DragonFly|GNU|Darwin" OR MINGW)
208208
set(prefix "${CMAKE_INSTALL_PREFIX}")
209209
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
210210
set(bindir "${CMAKE_INSTALL_FULL_BINDIR}")

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ RIME_ROOT ?= $(CURDIR)
22

33
RIME_SOURCE_PATH = plugins sample src test tools
44

5-
ifeq ($(shell uname),Darwin) # for macOS
5+
OS_NAME = $(shell uname)
6+
ifeq ($(OS_NAME),Darwin) # for macOS
67
prefix ?= $(RIME_ROOT)/dist
78

89
ifdef BOOST_ROOT
@@ -22,6 +23,10 @@ export CMAKE_OSX_ARCHITECTURES = arm64;x86_64
2223
endif
2324
else ifeq ($(shell test -n "$$PREFIX" && echo "$$PREFIX" | grep -q "/data/data/com.termux" && echo "termux"),termux)
2425
prefix ?= $(PREFIX)
26+
else ifeq ($(OS_NAME),FreeBSD)
27+
prefix ?= $(DESTDIR)/usr/local
28+
else ifeq ($(OS_NAME),OpenBSD)
29+
prefix ?= $(DESTDIR)/usr/local
2530
else # for Linux
2631
prefix ?= $(DESTDIR)/usr
2732
endif

0 commit comments

Comments
 (0)