dpkg-buildflags.1 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .TH dpkg\-buildflags 1 "2010-04-11" "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 \-\-get " flag"
  42. Print the value of the flag on standard output. Exits with 0
  43. if the flag is known otherwise exits with 1.
  44. .TP
  45. .BI \-\-origin " flag"
  46. Print the origin of the value that is returned by \fB\-\-get\fP. Exits
  47. with 0 if the flag is known otherwise exits with 1. The origin can be one
  48. of the following values:
  49. .RS
  50. .TP
  51. .B vendor
  52. the original flag set by the vendor is returned;
  53. .TP
  54. .B system
  55. the flag is set/modified by a system-wide configuration;
  56. .TP
  57. .B user
  58. the flag is set/modified by a user-specific configuration;
  59. .TP
  60. .B env
  61. the flag is set/modified by an environment-specific configuration.
  62. .RE
  63. .TP
  64. .B \-\-help
  65. Show the usage message and exit.
  66. .TP
  67. .B \-\-version
  68. Show the version and exit.
  69. .
  70. .SH SUPPORTED FLAGS
  71. .TP
  72. .B CFLAGS
  73. Options for the C compiler. The default value set by the vendor
  74. includes \fI-g\fP and the default optimization level (\fI-O2\fP usually,
  75. or \fI-O0\fP if the \fBDEB_BUILD_OPTIONS\fP environment variable defines
  76. \fInoopt\fP).
  77. .TP
  78. .B CPPFLAGS
  79. Options for the C preprocessor. Default value: empty.
  80. .TP
  81. .B CXXFLAGS
  82. Options for the C++ compiler. Same as \fBCFLAGS\fP.
  83. .TP
  84. .B FFLAGS
  85. Options for the Fortran compiler. Same as \fBCFLAGS\fP.
  86. .TP
  87. .B LDFLAGS
  88. Options passed to the compiler when linking executables or shared
  89. objects (if the linker is called directly, then
  90. .B -Wl
  91. and
  92. .B ,
  93. have to be stripped from these options). Default value: empty.
  94. .
  95. .SH FILES
  96. .TP
  97. .B /etc/dpkg/buildflags.conf
  98. System wide configuration file.
  99. .TP
  100. .BR $XDG_CONFIG_HOME/dpkg/buildflags.conf " or " $HOME/.config/dpkg/buildflags.conf
  101. User configuration file.
  102. .SH ENVIRONMENT
  103. .TP
  104. .BI DEB_ flag _SET
  105. This variable can be used to force the value returned for the given
  106. \fIflag\fP.
  107. .TP
  108. .BI DEB_ flag _APPEND
  109. This variable can be used to append supplementary options to the value
  110. returned for the given \fIflag\fP.
  111. .
  112. .SH AUTHOR
  113. Copyright \(co 2010 Rapha\[:e]l Hertzog
  114. .sp
  115. This is free software; see the GNU General Public Licence version 2 or
  116. later for copying conditions. There is NO WARRANTY.