patches for NetBSD

master
an 2019-08-05 19:52:58 -04:00
parent 757b4fe239
commit 1a3f682329
1 changed files with 17 additions and 10 deletions

View File

@ -1,14 +1,23 @@
# st version
VERSION = 0.8.2
# Customize below to fit your system
OS = $(shell uname)
# paths
ifeq $(OS) NetBSD
PREFIX = $(HOME)
else
PREFIX = $(HOME)/.local
endif
MANPREFIX = $(PREFIX)/share/man
ifeq $(OS) NetBSD
X11INC = /usr/X11R7/include
X11LIB = /usr/X11R7/lib
else
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
endif
PKG_CONFIG = pkg-config
@ -20,16 +29,14 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender \
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
ifeq $(OS) NetBSD
LIBS = $(LIBS) -Wl,-rpath,$(X11LIB)
endif
# flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
ifeq $(OS) NetBSD
STCPPFLAGS = $(STCPPFLAGS) -D_BSD_SOURCE
endif
STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) -mtune=native -march=native -O3 -pipe -fstack-protector-strong -fno-plt
STLDFLAGS = $(LIBS) $(LDFLAGS)
# OpenBSD:
#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \
# `pkg-config --libs fontconfig` \
# `pkg-config --libs freetype2`
# compiler and linker
# CC = c99