@@ -1494,6 +1494,26 @@ su - postgres
14941494 </variablelist>
14951495 </para>
14961496
1497+ <para>
1498+ Sometimes it is useful to add compiler flags after-the-fact to the set
1499+ that were chosen by <filename>configure</>. An important example is
1500+ that <application>gcc</>'s <option>-Werror</> option cannot be included
1501+ in the <envar>CFLAGS</envar> passed to <filename>configure</>, because
1502+ it will break many of <filename>configure</>'s built-in tests. To add
1503+ such flags, include them in the <envar>COPT</envar> environment variable
1504+ while running <filename>make</>. The contents of <envar>COPT</envar>
1505+ are added to both the <envar>CFLAGS</envar> and <envar>LDFLAGS</envar>
1506+ options set up by <filename>configure</>. For example, you could do
1507+ <screen>
1508+ <userinput>make COPT='-Werror'</>
1509+ </screen>
1510+ or
1511+ <screen>
1512+ <userinput>export COPT='-Werror'</>
1513+ <userinput>make</>
1514+ </screen>
1515+ </para>
1516+
14971517 <note>
14981518 <para>
14991519 When developing code inside the server, it is recommended to
@@ -1514,6 +1534,14 @@ su - postgres
15141534 <option>-O0</>. An easy way to do this is by passing an option
15151535 to <application>make</>: <command>make PROFILE=-O0 file.o</>.
15161536 </para>
1537+
1538+ <para>
1539+ The <envar>COPT</> and <envar>PROFILE</> environment variables are
1540+ actually handled identically by the <productname>PostgreSQL</>
1541+ makefiles. Which to use is a matter of preference, but a common habit
1542+ among developers is to use <envar>PROFILE</> for one-time flag
1543+ adjustments, while <envar>COPT</> might be kept set all the time.
1544+ </para>
15171545 </note>
15181546 </step>
15191547
0 commit comments