]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pkgs/build-essentials/buildsystem/Constants
avahi: Update to 0.6.30.
[people/ms/ipfire-3.x.git] / pkgs / build-essentials / buildsystem / Constants
CommitLineData
54fb3a5e
MT
1
2###############################################################################
3#
4# Constant definitions of the naoki build system
5#
6###############################################################################
7
235217d2
MT
8BASEDIR = /build
9
10BUILD_TOOLS = /usr/lib/buildsystem-tools
54fb3a5e
MT
11
12# Set default directories
13DIR_APP = $(DIR_SRC)/$(THISAPP)
235217d2 14DIR_DL = $(BASEDIR)/files
54fb3a5e 15DIR_PACKAGES = /usr/src/packages/$(PKG_ARCH)
235217d2 16DIR_PATCHES = $(BASEDIR)/patches
54fb3a5e
MT
17DIR_SRC = /usr/src
18DIR_TMP = /tmp
235217d2 19DIR_SOURCE = $(BASEDIR)
54fb3a5e
MT
20DIR_TOOLS = $(BASEDIR)/tools
21
22# Directory where to search for object files
23VPATH = $(DIR_DL)
24
25# Paths to scripts
26DO_EXTRACT = tar xaf
235217d2 27DO_QUALITY_AGENT = quality-agent
6ea175e4 28DO_STRIP = /usr/lib/buildsystem-tools/stripper $(BUILDROOT)
54fb3a5e
MT
29
30###############################################################################
31#
32# Build environment
33#
34###############################################################################
35
36# Export CFLAGS + CXXFLAGS
235217d2
MT
37GLOBAL_CFLAGS = -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4
38
39CFLAGS_i686 = -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables
40CFLAGS_x86_64 = -m64 -mtune=generic
41
11c3b5e8
MT
42export CFLAGS := $(GLOBAL_CFLAGS) $(CFLAGS_$(DISTRO_ARCH))
43export CXXFLAGS := $(CFLAGS)
54fb3a5e
MT
44
45# Options that get passed to configure by default
46CONFIGURE_OPTIONS = \
235217d2
MT
47 --host=$(DISTRO_MACHINE) \
48 --build=$(DISTRO_MACHINE) \
54fb3a5e
MT
49 --prefix=/usr
50
03c73156 51SYSTEMD_UNIT_DIR = /lib/systemd/system
d3d5a421 52SYSTEMD_TMPFILES_DIR = /usr/lib/tmpfiles.d
03c73156 53
54fb3a5e
MT
54###############################################################################
55#
56# Packager variables
57#
58###############################################################################
59# Variables that get exported (and expanded for the sub-packages) to the
60# packager process
61PKG_VARIABLES = \
62 CONTROL_PREIN \
63 CONTROL_PREUN \
3b95b236 64 CONTROL_PREUP \
54fb3a5e
MT
65 CONTROL_POSTIN \
66 CONTROL_POSTUN \
3b95b236
MT
67 CONTROL_POSTUP \
68 CONTROL_POSTTRANSIN \
69 CONTROL_POSTTRANSUN \
54fb3a5e
MT
70 \
71 PKG_ARCH \
72 PKG_BUILD_DEPS \
73 PKG_DEPS \
74 PKG_DESCRIPTION \
75 PKG_EPOCH \
76 PKG_FILES \
5b8e837a 77 PKG_GROUPS \
54fb3a5e
MT
78 PKG_MAINTAINER \
79 PKG_LICENSE \
8a93ea4c 80 PKG_OBSOLETES \
54fb3a5e 81 PKG_PROVIDES \
235217d2 82 PKG_RELEASE \
54fb3a5e
MT
83 PKG_SUMMARY \
84 PKG_URL \
0c9e602e
MT
85 PKG_VER \
86 \
3b95b236 87 PKG_PREREQUIRES \
0c9e602e
MT
88 PKG_PROVIDES_FILTER \
89 PKG_REQUIRES_FILTER
54fb3a5e
MT
90
91# Variables that exported to the packager process
92# These reflect settings from the build system
93export BUILD_DATE ?= $(shell date -u)
94export BUILD_HOST ?= $(shell cat /proc/sys/kernel/hostname)
95export BUILD_ID
96
97###############################################################################
98#
99# Package variables
100#
101###############################################################################
102#
103# Variables
104#
105
106# The actual package name (the name of the directory)
235217d2 107PKG_NAME_REAL = $(notdir $(subst .nm,,$(firstword $(MAKEFILE_LIST))))
54fb3a5e
MT
108PKG_NAME = $(PKG_NAME_REAL)
109
235217d2 110# Set default epoch, release and arch
54fb3a5e 111PKG_EPOCH = 0
235217d2
MT
112PKG_RELEASE = $(PKG_REL).$(DISTRO_DISTTAG)
113PKG_ARCH = $(DISTRO_ARCH)
54fb3a5e 114
91bfc58e
MT
115# Helper variable that says if EPOCH was set to another value than 0.
116HAVE_EPOCH = $(filter-out $(EPOCH),0)
117
54fb3a5e
MT
118# Shortcut to package name + version
119THISAPP = $(PKG_NAME)-$(PKG_VER)
91bfc58e 120THISVER = $(if $(HAVE_EPOCH),$(PKG_EPOCH):)$(PKG_VER)-$(PKG_RELEASE)
54fb3a5e
MT
121
122# All packages depend on gcc and headers by default.
123PKG_BUILD_DEPS+= gcc glibc-devel kernel-headers
124PKG_DEPS +=
125
126# All PKG_OBJECTS are downloaded. This is in most cases the tarball.
127PKG_OBJECTS = $(PKG_TARBALL)
128OBJECTS = $(PKG_OBJECTS)
129
130# List of packages to build
131PKG_PACKAGES = $(PKG_NAME_REAL)
132
133#
134# Macros
135#
136
137# Abstract variable that translates the package names to a list of filenames
138PKG_PACKAGES_FILES = $(foreach package,$(PKG_PACKAGES),$(call DO_PACKAGE_FILENAME,$(package)))
139
140# Automatically detect all patches in "patches"
141PKG_PATCHES = \
142 $(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch),$(notdir $(patch)))
143PKG_PATCHES += \
144 $(foreach patch,$(wildcard $(DIR_PATCHES)/*.patch0),$(notdir $(patch)))
145PKG_PATCHES += \
146 $(foreach patch,$(wildcard $(DIR_PATCHES)/*.diff),$(notdir $(patch)))
147
148# Dynamic command that applies all patches
235217d2
MT
149DO_PATCHES = cd $(DIR_APP) && $(BUILD_TOOLS)/patch \
150 $(foreach patch,$(PKG_PATCHES),$(DIR_PATCHES)/$(patch))
54fb3a5e
MT
151
152# Get a list of files that are installed automatically
d51f073b
MT
153PKG_DEFAULT_FILES = $(wildcard $(DIR_SOURCE)/*.default)
154PKG_DEFAULT_FILES += $(wildcard $(DIR_SOURCE)/default/*)
d51f073b
MT
155PKG_PAM_FILES = $(wildcard $(DIR_SOURCE)/*.pam)
156PKG_PAM_FILES += $(wildcard $(DIR_SOURCE)/pam.d/*)
03c73156 157PKG_SYSTEMD_FILES += $(wildcard $(DIR_SOURCE)/systemd/*)
d3d5a421 158PKG_SYSTEMD_TMPFILES += $(wildcard $(DIR_SOURCE)/*.tmpfiles)
54fb3a5e
MT
159
160###############################################################################
161#
162# Quality agent
163#
164###############################################################################
165
166export QUALITY_AGENT_PERMIT_NOT_FULL_RELRO
167export QUALITY_AGENT_RPATH_ALLOW_ORIGIN
168export QUALITY_AGENT_WHITELIST_EXECSTACK
169export QUALITY_AGENT_WHITELIST_NX
170export QUALITY_AGENT_WHITELIST_RPATH
171export QUALITY_AGENT_WHITELIST_SONAME
e337df8a 172export QUALITY_AGENT_WHITELIST_SYMLINK
b2eea8f6
MT
173export QUALITY_AGENT_NO_DIRECTORY_CHECK
174export QUALITY_AGENT_NO_DIRECTORY_PRUNE