aboutsummaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-20 10:13:45 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-03-21 11:44:46 +0100
commit66015cde8cb421915553e273adc5917ce75a5e9b (patch)
tree65ff93570d4b4358fb649a6674b65770d37d9f8e /config.mk
parenta3ef0d1246f9f0d52f8e705efa7300d68dd81ac3 (diff)
downloadvis-66015cde8cb421915553e273adc5917ce75a5e9b.tar.gz
vis-66015cde8cb421915553e273adc5917ce75a5e9b.tar.xz
build: overhaul build system auto detect stuff using a configure script
The new build instructions are: $ ./configure && make && sudo make install The configure script tries to auto detect support for various libraries and compiler options. These choices can be overwritten by explicitly specifing --{en,dis}able-{lua,selinux,acl}. See ./configure --help for all supported options. The configure script generates config.mk which should allow portable (among GNU and BSD make) Makefiles. Manually editing config.mk is still supported.
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk68
1 files changed, 0 insertions, 68 deletions
diff --git a/config.mk b/config.mk
deleted file mode 100644
index bdc1702..0000000
--- a/config.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# vis version
-VERSION = 0.1
-
-# optional features
-CONFIG_LUA=1
-CONFIG_ACL=0
-CONFIG_SELINUX=0
-
-# Customize below to fit your system
-
-PREFIX ?= /usr/local
-MANPREFIX = ${PREFIX}/share/man
-SHAREPREFIX = ${PREFIX}/share/vis
-
-LIBS = -lc
-
-CFLAGS_TERMKEY = $(shell pkg-config --cflags termkey 2> /dev/null || echo "")
-LDFLAGS_TERMKEY = $(shell pkg-config --libs termkey 2> /dev/null || echo "-ltermkey")
-
-CFLAGS_CURSES = $(shell pkg-config --cflags ncursesw 2> /dev/null || echo "-I/usr/include/ncursesw")
-LDFLAGS_CURSES = $(shell pkg-config --libs ncursesw 2> /dev/null || echo "-lncursesw")
-
-ifeq (${CONFIG_LUA},1)
- CFLAGS_LUA = $(shell pkg-config --cflags lua5.2 2> /dev/null || echo "-I/usr/include/lua5.2")
- LDFLAGS_LUA = $(shell pkg-config --libs lua5.2 2> /dev/null || echo "-llua -lm")
-endif
-
-ifeq (${CONFIG_ACL},1)
- LIBS += -lacl
-endif
-
-OS = $(shell uname)
-
-ifeq (${OS},Linux)
- ifeq (${CONFIG_SELINUX},1)
- LIBS += -lselinux
- endif
-else ifeq (${OS},Darwin)
- CFLAGS += -D_DARWIN_C_SOURCE
-else ifeq (${OS},OpenBSD)
- CFLAGS += -D_BSD_SOURCE
-else ifeq (${OS},FreeBSD)
- CFLAGS += -D_BSD_SOURCE
-else ifeq (${OS},NetBSD)
- CFLAGS += -D_BSD_SOURCE
-else ifeq (${OS},AIX)
- CFLAGS += -D_ALL_SOURCE
-endif
-
-CFLAGS_LIBS = $(CFLAGS_LUA) $(CFLAGS_TERMKEY) $(CFLAGS_CURSES)
-LDFLAGS_LIBS = $(LDFLAGS_LUA) $(LDFLAGS_TERMKEY) $(LDFLAGS_CURSES) $(LIBS)
-
-CFLAGS_STD = -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
-
-CFLAGS_VIS = $(CFLAGS_LIBS) $(CFLAGS_STD) -Os -DVERSION=\"${VERSION}\" -DNDEBUG
-CFLAGS_VIS += -DCONFIG_LUA=${CONFIG_LUA}
-CFLAGS_VIS += -DCONFIG_SELINUX=${CONFIG_SELINUX}
-CFLAGS_VIS += -DCONFIG_ACL=${CONFIG_ACL}
-ifeq (${CONFIG_LUA},1)
- CFLAGS_VIS += -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DLUA_COMPAT_ALL
-endif
-
-LDFLAGS_VIS = $(LDFLAGS_LIBS)
-
-DEBUG_CFLAGS_VIS = ${CFLAGS_VIS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -pedantic -Wno-missing-field-initializers -Wno-unused-parameter
-
-CC ?= cc
-STRIP ?= strip