aboutsummaryrefslogtreecommitdiff
path: root/src/build
blob: 4cce793f8578c9d30885e4a08c5e8400a64dd443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/sh
#
# PostgreSQL Build Script
#
BUILDRUN=true

if echo '\c' | grep -s c >/dev/null 2>&1
then
        ECHO_N="echo -n"
        ECHO_C=""
else
        ECHO_N="echo"
        ECHO_C='\c'
fi

ls template
TEMPLATE=generic
#
#     Use the file template/.similar to find an appropriate file
#     We get the architecture from the config.guess script.
#
CONFIG=`./config.guess`
GUESS=`grep $CONFIG template/.similar 2>/dev/null`
if [ $GUESS ]; then
      TEMPLATE=`echo $GUESS | sed 's/.*=//'`
fi

$ECHO_N "Appropriate template file [$TEMPLATE]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
	echo "You must choose an appropriate template file"
	exit
else
	if [ "$a." = "." ]; then 
		TEMPLATE=template/$TEMPLATE
	else
		TEMPLATE=template/$a
	fi
	AROPT=`grep AROPT $TEMPLATE | awk -F: '{print $2}'`
	SHARED_LIB=`grep SHARED_LIB $TEMPLATE | awk -F: '{print $2}'`
	CFLAGS=`grep CFLAGS $TEMPLATE | awk -F: '{print $2}'`
	SRCH_INC=`grep SRCH_INC $TEMPLATE | awk -F: '{print $2}'`
	SRCH_LIB=`grep SRCH_LIB $TEMPLATE | awk -F: '{print $2}'`
	USE_LOCALE=`grep USE_LOCALE $TEMPLATE | awk -F: '{print $2}'`
	DLSUFFIX=`grep DLSUFFIX $TEMPLATE | awk -F: '{print $2}'`
	DL_LIB=`grep DL_LIB $TEMPLATE | awk -F: '{print $2}'`
	YACC=`grep YACC $TEMPLATE | awk -F: '{print $2}'`
	YFLAGS=`grep YFLAGS $TEMPLATE | awk -F: '{print $2}'`
fi

$ECHO_N "Additional directories to search for .h files [$SRCH_INC]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
        CPPFLAGS=
else
	if [ "$a." != "." ]; then
		SRCH_INC = $a
	fi
        CPPFLAGS=`echo "$SRCH_INC" | sed 's@  *@ @g; s@^\([^ ]\)@-I\1@; s@ \([^ ]\)@ -I\1@g'`
fi


$ECHO_N "Additional directories to search for library files [$SRCH_LIB]: $ECHO_C"
read a
if [ "$a." = " ." ]
then
	LDFLAGS=
else
        if [ "$a." != "." ]; then
                SRCH_LIB = $a
        fi
        LDFLAGS=`echo "$SRCH_LIB" | sed 's@  *@ @g; s@^\([^ ]\)@-L\1@; s@ \([^ ]\)@ -L\1@g'`
fi

IDIR=/usr/local/pgsql
$ECHO_N "Installation directory [/usr/local/pgsql]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        IDIR=${a}
fi

echo ""
echo "Define USE_LOCALE to get Postgres work (sort, search)"
$ECHO_N "with national alphabet. [$USE_LOCALE]: $ECHO_C"
read a
if [ "$a." != " ." ]
then
	USE_LOCALE=no
else
        if [ "$a." != "." ]; then
                USE_LOCALE=$a
        fi
fi

DEF_PGPORT=5432
echo ""
echo "DEF_PGPORT is the TCP port number on which the Postmaster listens by"
echo "default.  This can be overriden by command options, environment "
echo "variables, and the postconfig hook."
echo ""

$ECHO_N "Define DEF_PGPORT to [$DEF_PGPORT]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        DEF_PGPORT=${a}
fi

NOHBA=no
echo ""
$ECHO_N "Do you wish to disable Host Based Authentication(HBA) [no]: $ECHO_C"
read a
if [ "$a." != "." ]
then
        NOHBA=${a}
fi

export BUILDRUN USE_LOCALE DEF_PGPORT NOHBA AROPT DLSUFFIX DL_LIB YACC
export SHARED_LIB CFLAGS CPPFLAGS LDFLAGS YFLAGS

./configure --prefix=${IDIR}