1 # This Makefile fragment (since dpkg 1.16.1) defines the following host
4 # ASFLAGS: flags for the host assembler (since 1.21.0).
5 # CFLAGS: flags for the host C compiler.
6 # CPPFLAGS: flags for the host C preprocessor.
7 # CXXFLAGS: flags for the host C++ compiler.
8 # OBJCFLAGS: flags for the host Objective C compiler.
9 # OBJCXXFLAGS: flags for the host Objective C++ compiler.
10 # DFLAGS: flags for the host D compiler.
11 # FFLAGS: flags for the host Fortran 77 compiler.
12 # FCFLAGS: flags for the host Fortran 9x compiler.
13 # LDFLAGS: flags for the host linker.
15 # And the following variables for the build tools (since dpkg 1.22.1):
17 # ASFLAGS_FOR_BUILD: flags for the build assembler.
18 # CFLAGS_FOR_BUILD: flags for the build C compiler.
19 # CPPFLAGS_FOR_BUILD: flags for the build C preprocessor.
20 # CXXFLAGS_FOR_BUILD: flags for the build C++ compiler.
21 # OBJCFLAGS_FOR_BUILD: flags for the build Objective C compiler.
22 # OBJCXXFLAGS_FOR_BUILD: flags for the build Objective C++ compiler.
23 # DFLAGS_FOR_BUILD: flags for the build D compiler.
24 # FFLAGS_FOR_BUILD: flags for the build Fortran 77 compiler.
25 # FCFLAGS_FOR_BUILD: flags for the build Fortran 9x compiler.
26 # LDFLAGS_FOR_BUILD: flags for the build linker.
28 # You can also export them in the environment by setting
29 # DPKG_EXPORT_BUILDFLAGS to a non-empty value.
31 # This list is kept in sync with the default set of flags returned
34 dpkg_lazy_eval ?
= $$(or
$$(value DPKG_CACHE_
$(1)),$$(eval DPKG_CACHE_
$(1) := $$(shell $(2)))$$(value DPKG_CACHE_
$(1)))
36 DPKG_BUILDFLAGS_LIST
= \
48 OBJCXXFLAGS_FOR_BUILD \
59 define dpkg_buildflags_export_envvar
61 DPKG_BUILDFLAGS_EXPORT_ENVVAR
+= $(1)="$$(value $(1))"
65 $(eval
$(call dpkg_buildflags_export_envvar
,DEB_BUILD_OPTIONS
))
66 $(eval
$(call dpkg_buildflags_export_envvar
,DEB_BUILD_MAINT_OPTIONS
))
67 $(eval
$(call dpkg_buildflags_export_envvar
,DEB_BUILD_PATH
))
68 $(foreach flag
,$(DPKG_BUILDFLAGS_LIST
),\
69 $(foreach operation
,SET STRIP APPEND PREPEND
,\
70 $(eval
$(call dpkg_buildflags_export_envvar
,DEB_
$(flag
)_MAINT_
$(operation
)))))
72 dpkg_buildflags_setvar
= $(1) = $(call dpkg_lazy_eval
,$(1),$(DPKG_BUILDFLAGS_EXPORT_ENVVAR
) dpkg-buildflags
--get $(1))
74 $(foreach flag
,$(DPKG_BUILDFLAGS_LIST
),\
75 $(eval
$(call dpkg_buildflags_setvar
,$(flag
))))
77 ifdef DPKG_EXPORT_BUILDFLAGS
78 export $(DPKG_BUILDFLAGS_LIST
)