File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -15,19 +15,27 @@ function pgbuild() {
15
15
echo " not postgres directory?"
16
16
return
17
17
fi
18
- local destname=" ${1:- " $( basename $( pwd) ) " } "
18
+ local destname=" ${1:- .} "
19
+ if [ -z " $destname " -o " $destname " == " ." ]; then
20
+ destname=" $( basename $( pwd) ) "
21
+ fi
19
22
local variant=" ${2:- } "
20
- local configure_args
21
- local CC=/usr/lib64/ccache/gcc
23
+ declare -a configure_args=(--enable-debug --enable-cassert --enable-tap-tests --enable-dtrace)
24
+ local CPP=" /usr/lib64/ccache/gcc -E"
25
+ local CC=" /usr/lib64/ccache/gcc"
26
+ local LD=" /usr/bin/ld"
27
+ local CPPFLAGS=
28
+ local CFLAGS=" -Og -ggdb3"
22
29
case " ${variant:- } " in
23
30
" " )
24
- configure_args=" --enable-debug --enable-cassert --enable-tap-tests --enable-dtrace"
25
31
;;
26
32
" NDEBUG" )
27
- configure_args=" "
33
+ configure_args=()
28
34
;;
29
35
" CLANG" )
30
- configure_args=" --enable-debug --enable-cassert --enable-tap-tests --enable-dtrace CC=/usr/lib64/ccache/clang"
36
+ CPP=" /usr/lib64/ccache/clang -E"
37
+ CC=" /usr/lib64/ccache/clang"
38
+ LD=" /usr/bin/lld"
31
39
;;
32
40
* )
33
41
echo " unrecognised build variant $variant "
@@ -68,7 +76,7 @@ function pgbuild() {
68
76
cd $builddir
69
77
set -e
70
78
echo " configuring for $dest "
71
- CFLAGS=" -ggdb3 -O0 " $ configurepath $CONFQUIET --cache-file=config.cache --prefix=" $dest " --enable-debug --enable-cassert --enable-tap-tests --enable-dtrace
79
+ CPPFLAGS= " ${CPPFLAGS} " CFLAGS=" ${CFLAGS} " CPP= " ${CPP} " CC= " ${CC} " LD= " ${LD} " $ configurepath $CONFQUIET --cache-file=config.cache${variant := - ${variant} } --prefix=" $dest " " ${configure_args[@]} "
72
80
echo " configured, making"
73
81
make $SILENT clean
74
82
make $SILENT -j4
You can’t perform that action at this time.
0 commit comments