Basic parameters of Linux compilation and installation

Source: Internet
Author: User
Tags openssl parent directory syslog install perl

This article is reproduced; thanks to zjt289198457 's column.

./configure

The script will run some tests to guess some system-related variables and detect special settings for your operating system, and finally create some files in the tree to record what it finds.

The default setting is to make the server and the application, and all the client programs and interfaces that only require the C compiler. By default, all files are installed to/usr/local/pgsql.

You can custom make and install processes by giving one or more of the following configure command line options:


--prefix=prefix
Put all the files under directory prefix instead of/usr/local/pgsql. The actual file will be installed in a different subdirectory, and no file will be installed directly into the PREFIX directory.

If you have special needs, you can also use the following options to client the location of different subdirectories.

--exec-prefix=exec-prefix
You can install system-related files to a different location, Exec-prefix, instead of PREFIX settings.   This makes it easier to share system-related files between different hosts. If you omit these, then the Exec-prefix will be set to equal PREFIX and the system-dependent and system-independent files will be installed under the same directory tree, which may be what you want.

--bindir=directory
Declares the directory for the executable, the default is Exec-prefix/bin, which is usually/usr/local/pgsql/bin.

--datadir=directory
Sets the directory of read-only files required by the installed program.   The default is Prefix/share. Please note that this directory has nothing to do with where you put the database files.

--sysconfdir=directory
A directory for a wide variety of configuration files, default to Prefix/etc.

--libdir=directory
Catalog of library files and dynamic load modules. The default is Exec-prefix/lib.

--includedir=directory
Directories for C and C + + header files. The default is Prefix/include.

--docdir=directory
Document files, (except for "man", will be installed in this directory.) The default is Prefix/doc.

--mandir=directory
Along with PostgreSQL the hand album will be installed into this directory.   In their corresponding Manx subdirectories. The default is Prefix/man.

Note: In order to reduce contamination of shared installation locations (such as/usr/local/include), configure automatically attaches a datadir, sysconfdir,includedir, and Docdir "/postgresql" string, unless fully expanded after the name of the directory already contains the string "Postgres" or "Pgsql". For example, if you choose/usr/local to prefix, then C's header file will be installed to/usr/local/include/postgresql, but if the prefix is/opt/postgres, then they will be put in/op T/postgres/include.




--with-includes=directories
Directories is a series of colon-delimited directories that are added to the compiler's header file search list. If you have some optional packages (such as GNU Readline) installed in non-standard locations, you must use this option, and there may be a corresponding--with-libraries option.

Example:--with-includes=/opt/gnu/include:/usr/sup/include.

--with-libraries=directories
Directories is a series of colon-delimited directories that are used to locate library files. If you have some packages installed in non-standard locations, you may need to use this option (as well as the corresponding--with-includes option).

Example:--with-libraries=/opt/gnu/lib:/usr/sup/lib.

--enable-locale
Open Zone support. Zone support can be a loss of performance, but if you don't use the database in an English-speaking environment, you probably need this option.

--enable-recode
Turns on support for single-byte character set records. See section 5.3 For more information on this feature.

--enable-multibyte
Multi-byte encoding is allowed. This option is mainly used in languages such as Japanese, Korean and Chinese. Read Section 5.2 For more information.

--with-pgport=number
Set number to the default port for the server and client.   The default is 5432. This port can be set at a later time, but if you declare it here, then the server and the client will have the same compiled default value. This will be convenient.

--with-cxx
Make a C + + support library.

--with-perl
Make a Perl interface module. The Perl interface will be installed to the usual installation location of the Perl module (typically/usr/lib/perl), so you must have root permission to perform the installation steps (see step 4). With this option you need to install Perl 5.

--with-python
Make a Python interface module.   You need root permissions to install the Python module to its default location (/USR/LIB/PYTHONX.Y). To use this option, you must already have Python installed and your system must support shared libraries. If you want to create a new complete binary interpreter, you can only make it yourself.

--with-tcl
Make the parts that need TCL/TK, namely libpgtcl,pgtclsh,pgtksh,pgaccess and PL/TCL. You can also look at the following--without-tk.

--without-tk
If you declare--WITH-TCL and this option at the same time, programs that require Tk (that is, Pgtksh and pgaccess) will be excluded.

--with-tclconfig=directory,--with-tkconfig=directory
TCL/TK installation files tclconfig.sh and tkconfig.sh, they contain configuration information for making TCL or Tk module interfaces. Configure usually find these files automatically in their well-known locations, but if you need a different version of TCL or TK, you can also declare that you can find their directory.

--enable-odbc
Make an ODBC driver package.

--with-odbcinst=directory
Declares the path to ODBC's expected Odbcinst.ini configuration file.   The default is/USR/LOCAL/PGSQL/ETC or the content of the--SYSCONFDIR option you declared. The installer will install a default file there.

--with-krb4=directory,--with-krb5=directory
Create something that supports Kerberos authentication.   You can choose Kerberos version 4 or 5, but not two at a time. The directory parameter declares the root directory of the Kerberos installation, and the default assumption is/usr/athena if the associated header and library files are not in the usual parent directory, then you must use the additional--with-includes and--WI Th-libraries option. On the other hand, if the required files are in a default search directory (for example,/usr/lib), then you do not have to enter these parameters.

Configure will check the required header and library files before installing to make sure that your Kerberos installation is complete.

--with-krb-srvnam=name
The name of the Kerberos service master. The default is "Postgres". There is usually no reason to change this value.

--with-openssl=directory
Make a postgres that supports SSL (encrypted) joins.   This option requires the installation of the OpenSSL package. The directory parameter declares the root directory of the OpenSSL installation; the default is/usr/local/ssl.

Configure will check the required header and library files prior to installation to make sure that your OpenSSL installation is adequate.

--with-java
Make the JDBC driver and the associated Java package.   This option requires you to first install Ant (and, of course, a JDK). Please refer to the documentation for the JDBC driver in the Programmer's Manual for more information.

--enable-syslog
Turn on the functionality of the PostgreSQL server using the Syslog log system. (using this feature does not mean that you have to log in a syslog, or that the server lacks the capital to do this, but rather gives you the possibility of using this option at run time.) )

--enable-debug
Compile all Programs and libraries in a way with debug symbols.   This means that you can run the program through a debugger to analyze the problem. This significantly increases the size of the last executable that is installed, and in the case of non-GCC compilers, this usually turns off compiler optimizations, resulting in a decrease in speed. However, if you have these symbol tables, you can greatly help locate the location where the problem might occur. Currently, we think this option is a marginal variable for production purposes, but if you are working on a development or are using a beta version, you should open it.

--enable-cassert
Open the assertion check in the server and it will check for many "impossible" conditions.   It's priceless for the purpose of code development, but these tests slow things down a little bit.   These assertion checks are not necessarily for critical errors, so some relatively harmless bugs can also cause postmaster to restart-as long as it triggers an assertion failure. Currently, we do not recommend using this option in a production environment, but you should open it if you are developing or using a beta version.


If you like to use the different compilers that you find with configure, you can set your environment variables CC and CXX separately and set them as the program you choose. Similarly, you can override the default compiler flags with the CFLAGS and cxxflags variables. Like what:

Env CC=/OPT/BIN/GCC cflags= ' -02-pipe './configure

Basic parameters of Linux compilation and installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.