mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
Add build_rpm script and rpm spec (#1831)
Also, link stdlib++ and libgcc statically. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
684bf97ce6
commit
02fff36e3e
13 changed files with 149 additions and 20 deletions
20
Makefile
20
Makefile
|
@ -2,18 +2,30 @@ BUILD_ARCH := $(shell uname -m)
|
|||
RELEASE_NAME := "dragonfly-${BUILD_ARCH}"
|
||||
|
||||
HELIO_RELEASE := $(if $(HELIO_RELEASE),y,)
|
||||
HELIO_RELEASE_FLAGS = -DHELIO_RELEASE_FLAGS="-flto -g1 -gz"
|
||||
|
||||
HELIO_RELEASE_FLAGS = -DHELIO_RELEASE_FLAGS="-g1 -gz"
|
||||
HELIO_USE_STATIC_LIBS = ON
|
||||
HELIO_OPENSSL_USE_STATIC_LIBS = ON
|
||||
HELIO_ENABLE_GIT_VERSION = ON
|
||||
HELIO_WITH_UNWIND = OFF
|
||||
|
||||
# Some distributions (old fedora) have incorrect dependencies for crypto
|
||||
# so we add -lz for them.
|
||||
LINKER_FLAGS=-lz
|
||||
|
||||
# equivalent to: if $(uname_m) == x86_64 || $(uname_m) == amd64
|
||||
ifneq (, $(filter $(BUILD_ARCH),x86_64 amd64))
|
||||
HELIO_MARCH_OPT := -march=core2 -msse4.1 -mpopcnt -mtune=skylake
|
||||
endif
|
||||
|
||||
# For release builds we link statically libstdc++ and libgcc. Currently,
|
||||
# all the release builds are performed by gcc.
|
||||
ifeq ($(HELIO_RELEASE),y)
|
||||
LINKER_FLAGS += -static-libstdc++ -static-libgcc
|
||||
endif
|
||||
|
||||
HELIO_FLAGS = $(if $(HELIO_RELEASE),-release $(HELIO_RELEASE_FLAGS),) \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="$(LINKER_FLAGS)" \
|
||||
-DBoost_USE_STATIC_LIBS=$(HELIO_USE_STATIC_LIBS) \
|
||||
-DOPENSSL_USE_STATIC_LIBS=$(HELIO_OPENSSL_USE_STATIC_LIBS) \
|
||||
-DENABLE_GIT_VERSION=$(HELIO_ENABLE_GIT_VERSION) \
|
||||
|
@ -26,13 +38,11 @@ configure:
|
|||
|
||||
build:
|
||||
cd build-opt; \
|
||||
ninja dragonfly; \
|
||||
ldd dragonfly
|
||||
ninja dragonfly && ldd dragonfly
|
||||
|
||||
build-debug:
|
||||
cd build-dbg; \
|
||||
ninja dragonfly; \
|
||||
ldd dragonfly
|
||||
ninja dragonfly && ldd dragonfly
|
||||
|
||||
package:
|
||||
cd build-opt; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue