mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-15 08:20:16 +08:00
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.
This commit is contained in:
parent
65d9aedb1b
commit
3b86b4653c
@ -3,6 +3,9 @@
|
|||||||
# takes -v option to display compile failure message and line numbers
|
# takes -v option to display compile failure message and line numbers
|
||||||
# src/tools/pginclude/pgcompinclude
|
# src/tools/pginclude/pgcompinclude
|
||||||
|
|
||||||
|
: ${CC:=cc}
|
||||||
|
: ${PGSRC:=src}
|
||||||
|
|
||||||
if ! pgdefine
|
if ! pgdefine
|
||||||
then echo "pgdefine must be in your PATH" 1>&2
|
then echo "pgdefine must be in your PATH" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -29,9 +32,9 @@ do
|
|||||||
|
|
||||||
# Use -O1 to get warnings only generated by optimization,
|
# Use -O1 to get warnings only generated by optimization,
|
||||||
# but -O2 is too slow.
|
# but -O2 is too slow.
|
||||||
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
|
$CC -fsyntax-only -Werror -Wall -Wmissing-prototypes \
|
||||||
-Wmissing-declarations -I/pg/include -I/pg/backend \
|
-Wmissing-declarations -I$PGSRC/include -I$PGSRC/backend \
|
||||||
-I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
|
-I$PGSRC/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
|
||||||
-o /tmp/$$.o >/tmp/$$ 2>&1
|
-o /tmp/$$.o >/tmp/$$ 2>&1
|
||||||
if [ "$?" -ne 0 ]
|
if [ "$?" -ne 0 ]
|
||||||
then echo "$FILE"
|
then echo "$FILE"
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
# be compiled on the platform from which pgrminclude is run cannot be
|
# be compiled on the platform from which pgrminclude is run cannot be
|
||||||
# processed, and are skipped.
|
# processed, and are skipped.
|
||||||
|
|
||||||
|
: ${CC:=cc}
|
||||||
|
: ${PGSRC:=src}
|
||||||
|
|
||||||
if ! pgdefine
|
if ! pgdefine
|
||||||
then echo "pgdefine must be in your PATH" 1>&2
|
then echo "pgdefine must be in your PATH" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -104,9 +107,9 @@ compile_file() {
|
|||||||
|
|
||||||
# Use -O1 to get warnings only generated by optimization,
|
# Use -O1 to get warnings only generated by optimization,
|
||||||
# but -O2 is too slow.
|
# but -O2 is too slow.
|
||||||
cc -fsyntax-only -Werror -Wall -Wmissing-prototypes \
|
$CC -fsyntax-only -Werror -Wall -Wmissing-prototypes \
|
||||||
-Wmissing-declarations -I/pg/include -I/pg/backend \
|
-Wmissing-declarations -I$PGSRC/include -I$PGSRC/backend \
|
||||||
-I/pg/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
|
-I$PGSRC/interfaces/libpq -I`dirname $FILE` $CFLAGS -O1 -c /tmp/$$.c \
|
||||||
-o /tmp/$$.o >/tmp/$$ 2>&1
|
-o /tmp/$$.o >/tmp/$$ 2>&1
|
||||||
if [ "$?" -eq 0 ]
|
if [ "$?" -eq 0 ]
|
||||||
then [ "$INCLUDE" -o "$VERBOSE" ] && echo "$FILE $INCLUDE"
|
then [ "$INCLUDE" -o "$VERBOSE" ] && echo "$FILE $INCLUDE"
|
||||||
|
Loading…
Reference in New Issue
Block a user