通过pg_config可以看到PG的一些库目录,编译器,预编译FLAG,等等:
BINDIR = /home/digoal/pgsql9.5/binDOCDIR = /home/digoal/pgsql9.5/share/docHTMLDIR = /home/digoal/pgsql9.5/share/docINCLUDEDIR = /home/digoal/pgsql9.5/includePKGINCLUDEDIR = /home/digoal/pgsql9.5/includeINCLUDEDIR-SERVER = /home/digoal/pgsql9.5/include/serverLIBDIR = /home/digoal/pgsql9.5/libPKGLIBDIR = /home/digoal/pgsql9.5/libLOCALEDIR = /home/digoal/pgsql9.5/share/localeMANDIR = /home/digoal/pgsql9.5/share/manSHAREDIR = /home/digoal/pgsql9.5/shareSYSCONFDIR = /home/digoal/pgsql9.5/etcPGXS = /home/digoal/pgsql9.5/lib/pgxs/src/makefiles/pgxs.mkCONFIGURE = '--prefix=/home/digoal/pgsql9.5'CC = gccCPPFLAGS = -D_GNU_SOURCECFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2CFLAGS_SL = -fpicLDFLAGS = -L../../../src/common -Wl,--as-needed -Wl,-rpath,'/home/digoal/pgsql9.5/lib',--enable-new-dtagsLDFLAGS_EX =LDFLAGS_SL =LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lmVERSION = PostgreSQL 9.5.0
但是configure的配置项是看不到的。
怎么看呢?
1. 在源码的config.log中可以看到。
less $PGSRC/config.log
This file contains any messages produced by compilers whilerunning configure, to aid debugging if configure makes a mistake.It was created by PostgreSQL configure 9.5.0, which wasgenerated by GNU Autoconf 2.69. Invocation command line was$ ./configure --prefix=/home/digoal/pgsql9.5
2. 如果源码遗失了,可以在软件目录中看到。
$PGHOME/lib/pgxs/src/Makefile.global
# Saved arguments from configureconfigure_args = '--prefix=/home/digoal/pgsql9.5'
greenplum的发行版本编译项
$GPHOME/lib/postgresql/pgxs/src/Makefile.global# Saved arguments from configureconfigure_args = '--enable-snmp' '--enable-connectemc' '--enable-ddboost' '--with-gssapi' '--enable-netbackup' '--enable-orca' '--with-libxml' '--with-pgport=5432' '--with-libedit-preferred' '--with-perl' '--with-python' '--with-java' '--with-includes=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/src/ext/rhel5_x86_64/include /data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/src/ext/rhel5_x86_64/include/libxml2' '--with-libraries=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/src/ext/rhel5_x86_64/lib' '--with-openssl' '--with-pam' '--with-krb5' '--with-ldap' 'CURL_CONFIG=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/src/ext/rhel5_x86_64/bin/curl-config' '--prefix=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/4.3.6.1-build-2_output/greenplum-db-4.3.6.1-build-2' '--with-docdir=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/4.3.6.1-build-2_output/greenplum-db-4.3.6.1-build-2/doc' '--mandir=/data/pulse2-agent/agents/agent1/work/GPDB-4_3_x-rcbuilds/rhel5_x86_64/4.3.6.1-build-2_output/greenplum-db-4.3.6.1-build-2/man' 'CC=gcc -m64' 'CFLAGS=-O3 -funroll-loops -fargument-noalias-global -fno-omit-frame-pointer -g -finline-limit=1800'
通过这个你可以拿到edb或greenplum的发行版本,看看他们的编译参数是什么样的。