Skip to content

Commit

Permalink
build: Fix prefix for FreeBSD, OpenBSD (#916)
Browse files Browse the repository at this point in the history
FreeBSD and OpenBSD typically use /usr/local as the prefix.
  • Loading branch information
hodong-kim authored Aug 17, 2024
1 parent 3c1c478 commit 9e08470
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ configure_file(
add_custom_target(remove
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|DragonFly|GNU|Darwin" OR MINGW)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|DragonFly|GNU|Darwin" OR MINGW)
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(bindir "${CMAKE_INSTALL_FULL_BINDIR}")
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ RIME_ROOT ?= $(CURDIR)

RIME_SOURCE_PATH = plugins sample src test tools

ifeq ($(shell uname),Darwin) # for macOS
OS_NAME = $(shell uname)
ifeq ($(OS_NAME),Darwin) # for macOS
prefix ?= $(RIME_ROOT)/dist

ifdef BOOST_ROOT
Expand All @@ -22,6 +23,10 @@ export CMAKE_OSX_ARCHITECTURES = arm64;x86_64
endif
else ifeq ($(shell test -n "$$PREFIX" && echo "$$PREFIX" | grep -q "/data/data/com.termux" && echo "termux"),termux)
prefix ?= $(PREFIX)
else ifeq ($(OS_NAME),FreeBSD)
prefix ?= $(DESTDIR)/usr/local
else ifeq ($(OS_NAME),OpenBSD)
prefix ?= $(DESTDIR)/usr/local
else # for Linux
prefix ?= $(DESTDIR)/usr
endif
Expand Down

0 comments on commit 9e08470

Please sign in to comment.