Skip to content

Commit 3b86b46

Browse files
committed
Make pgcompinclude/pgrminclude less tied to Bruce's personal machine.
Not everyone has /pg linked to the src subdirectory of their PostgreSQL tree. Also, cc isn't the way to invoke the compiler everywhere.
1 parent 65d9aed commit 3b86b46

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/tools/pginclude/pgcompinclude

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# takes -v option to display compile failure message and line numbers
44
# src/tools/pginclude/pgcompinclude
55

6+
: ${CC:=cc}
7+
: ${PGSRC:=src}
8+
69
if ! pgdefine
710
then echo "pgdefine must be in your PATH" 1>&2
811
exit 1
@@ -29,9 +32,9 @@ do
2932

3033
# Use -O1 to get warnings only generated by optimization,
3134
# but -O2 is too slow.
32-
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
33-
-Wmissing-declarations -I/pg/include -I/pg/backend \
34-
-I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
35+
$CC -fsyntax-only -Werror -Wall -Wmissing-prototypes \
36+
-Wmissing-declarations -I$PGSRC/include -I$PGSRC/backend \
37+
-I$PGSRC/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
3538
-o /tmp/$$.o >/tmp/$$ 2>&1
3639
if [ "$?" -ne 0 ]
3740
then echo "$FILE"

src/tools/pginclude/pgrminclude

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
# be compiled on the platform from which pgrminclude is run cannot be
1919
# processed, and are skipped.
2020

21+
: ${CC:=cc}
22+
: ${PGSRC:=src}
23+
2124
if ! pgdefine
2225
then echo "pgdefine must be in your PATH" 1>&2
2326
exit 1
@@ -104,9 +107,9 @@ compile_file() {
104107

105108
# Use -O1 to get warnings only generated by optimization,
106109
# but -O2 is too slow.
107-
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
108-
-Wmissing-declarations -I/pg/include -I/pg/backend \
109-
-I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
110+
$CC -fsyntax-only -Werror -Wall -Wmissing-prototypes \
111+
-Wmissing-declarations -I$PGSRC/include -I$PGSRC/backend \
112+
-I$PGSRC/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
110113
-o /tmp/$$.o >/tmp/$$ 2>&1
111114
if [ "$?" -eq 0 ]
112115
then [ "$INCLUDE" -o "$VERBOSE" ] && echo "$FILE $INCLUDE"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy