Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b77a0e

Browse files
committed
Document usage of COPT environment variable for adjusting configure flags.
Also add to the existing rather half-baked description of PROFILE,which does exactly the same thing, but I think people use it differently.Discussion:https://postgr.es/m/16461.1487361849@sss.pgh.pa.us
1 parent6a4941f commit6b77a0e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

‎doc/src/sgml/installation.sgml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,26 @@ su - postgres
14261426
</variablelist>
14271427
</para>
14281428

1429+
<para>
1430+
Sometimes it is useful to add compiler flags after-the-fact to the set
1431+
that were chosen by <filename>configure</>. An important example is
1432+
that <application>gcc</>'s <option>-Werror</> option cannot be included
1433+
in the <envar>CFLAGS</envar> passed to <filename>configure</>, because
1434+
it will break many of <filename>configure</>'s built-in tests. To add
1435+
such flags, include them in the <envar>COPT</envar> environment variable
1436+
while running <filename>gmake</>. The contents of <envar>COPT</envar>
1437+
are added to both the <envar>CFLAGS</envar> and <envar>LDFLAGS</envar>
1438+
options set up by <filename>configure</>. For example, you could do
1439+
<screen>
1440+
<userinput>gmake COPT='-Werror'</>
1441+
</screen>
1442+
or
1443+
<screen>
1444+
<userinput>export COPT='-Werror'</>
1445+
<userinput>gmake</>
1446+
</screen>
1447+
</para>
1448+
14291449
<note>
14301450
<para>
14311451
When developing code inside the server, it is recommended to
@@ -1446,6 +1466,14 @@ su - postgres
14461466
<option>-O0</>. An easy way to do this is by passing an option
14471467
to <application>make</>: <command>gmake PROFILE=-O0 file.o</>.
14481468
</para>
1469+
1470+
<para>
1471+
The <envar>COPT</> and <envar>PROFILE</> environment variables are
1472+
actually handled identically by the <productname>PostgreSQL</>
1473+
makefiles. Which to use is a matter of preference, but a common habit
1474+
among developers is to use <envar>PROFILE</> for one-time flag
1475+
adjustments, while <envar>COPT</> might be kept set all the time.
1476+
</para>
14491477
</note>
14501478
</step>
14511479

‎src/Makefile.global.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,11 @@ ifneq ($(CUSTOM_COPT),)
483483
COPT=$(CUSTOM_COPT)
484484
endif
485485

486+
#
487+
# These variables are meant to be set in the environment of "make"
488+
# to add flags to whatever configure picked. Unlike the ones above,
489+
# they are documented.
490+
#
486491
ifdefCOPT
487492
CFLAGS +=$(COPT)
488493
LDFLAGS +=$(COPT)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp