dpkg-buildflags.1 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .TH dpkg\-buildflags 1 "2010-07-29" "Debian Project" "dpkg suite"
  2. .SH NAME
  3. dpkg\-buildflags \- returns build flags to use during package build
  4. .
  5. .SH SYNOPSIS
  6. .B dpkg\-buildflags
  7. .RI [ option "...] " command
  8. .
  9. .SH DESCRIPTION
  10. \fBdpkg\-buildflags\fP is a tool to retrieve compilation flags to use during
  11. build of Debian packages.
  12. .
  13. The default flags are defined by the vendor but they can be
  14. extended/overriden in several ways:
  15. .IP 1.
  16. system-wide with \fB/etc/dpkg/buildflags.conf\fP;
  17. .IP 2.
  18. for the current user with \fB$XDG_CONFIG_HOME/dpkg/buildflags.conf\fP
  19. where \fB$XDG_CONFIG_HOME\fP defaults to \fB$HOME/.config\fP;
  20. .IP 3.
  21. temporarily with environment variables (see section \fBENVIRONMENT\fP).
  22. .P
  23. The configuration files can contain two types of directives:
  24. .TP
  25. .BI SET " flag value"
  26. Override the flag named \fIflag\fP to have the value \fIvalue\fP.
  27. .TP
  28. .BI APPEND " flag value"
  29. Extend the flag named \fIflag\fP with the options given in \fIvalue\fP.
  30. A space is prepended to the appended value if the flag's current value is non-empty.
  31. .P
  32. The configuration files can contain comments on lines starting with a hash
  33. (#). Empty lines are also ignored.
  34. .SH COMMANDS
  35. .TP
  36. .BI \-\-list
  37. Print the list of flags supported by the current vendor
  38. (one per line). See the \fBSUPPORTED FLAGS\fP section for more
  39. information about them.
  40. .TP
  41. .BI \-\-export= format
  42. Print to standard output shell (if \fIformat\fP is \fBsh\fP) or make
  43. (if \fIformat\fP is \fBmake\fP) commands that can be used to export
  44. all the compilation flags in the environment. If the \fIformat\fP value is not
  45. given, \fBsh\fP is assumed. Only compilation flags starting with an
  46. upper case character are included, others are assumed to not be suitable
  47. for the environment.
  48. .TP
  49. .BI \-\-get " flag"
  50. Print the value of the flag on standard output. Exits with 0
  51. if the flag is known otherwise exits with 1.
  52. .TP
  53. .BI \-\-origin " flag"
  54. Print the origin of the value that is returned by \fB\-\-get\fP. Exits
  55. with 0 if the flag is known otherwise exits with 1. The origin can be one
  56. of the following values:
  57. .RS
  58. .TP
  59. .B vendor
  60. the original flag set by the vendor is returned;
  61. .TP
  62. .B system
  63. the flag is set/modified by a system-wide configuration;
  64. .TP
  65. .B user
  66. the flag is set/modified by a user-specific configuration;
  67. .TP
  68. .B env
  69. the flag is set/modified by an environment-specific configuration.
  70. .RE
  71. .TP
  72. .B \-\-help
  73. Show the usage message and exit.
  74. .TP
  75. .B \-\-version
  76. Show the version and exit.
  77. .
  78. .SH SUPPORTED FLAGS
  79. .TP
  80. .B CFLAGS
  81. Options for the C compiler. The default value set by the vendor
  82. includes \fI-g\fP and the default optimization level (\fI-O2\fP usually,
  83. or \fI-O0\fP if the \fBDEB_BUILD_OPTIONS\fP environment variable defines
  84. \fInoopt\fP).
  85. .TP
  86. .B CPPFLAGS
  87. Options for the C preprocessor. Default value: empty.
  88. .TP
  89. .B CXXFLAGS
  90. Options for the C++ compiler. Same as \fBCFLAGS\fP.
  91. .TP
  92. .B FFLAGS
  93. Options for the Fortran compiler. Same as \fBCFLAGS\fP.
  94. .TP
  95. .B LDFLAGS
  96. Options passed to the compiler when linking executables or shared
  97. objects (if the linker is called directly, then
  98. .B -Wl
  99. and
  100. .B ,
  101. have to be stripped from these options). Default value: empty.
  102. .
  103. .SH FILES
  104. .TP
  105. .B /etc/dpkg/buildflags.conf
  106. System wide configuration file.
  107. .TP
  108. .BR $XDG_CONFIG_HOME/dpkg/buildflags.conf " or " $HOME/.config/dpkg/buildflags.conf
  109. User configuration file.
  110. .SH ENVIRONMENT
  111. .TP
  112. .BI DEB_ flag _SET
  113. This variable can be used to force the value returned for the given
  114. \fIflag\fP.
  115. .TP
  116. .BI DEB_ flag _APPEND
  117. This variable can be used to append supplementary options to the value
  118. returned for the given \fIflag\fP.
  119. .
  120. .SH AUTHOR
  121. Copyright \(co 2010 Rapha\[:e]l Hertzog
  122. .sp
  123. This is free software; see the GNU General Public Licence version 2 or
  124. later for copying conditions. There is NO WARRANTY.