歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

編譯4.7.2的gcc的針對libstdc++的configure解讀

http://www.tuicool.com/articles/nMjmay
When configuring libstdc++, you'll have to configure the entire gccsrcdir directory. Consider using the toplevel gcc configuration option
--enable-languages=c++
,
which saves time by only building the C++ toolchain.
只編譯c++的話使用--enable-languages=c++,都支持的話使用--enable-languages=c,c++,前者節省時間。
Here are all of the configure options specific to libstdc++. Keep in mind that
這裡有全部的configure選項,針對libstdc++。
they all have opposite forms as well (enable/disable and with/without). The defaults are for the current development sources , which may be different than
those for released versions.選項都有相反的(enable/disable and with/without)
The canonical way to find out the configure options that are available for a given set of libstdc++ sources is to go to the source directory and then type: ./configure --help .
./configure --help是典型的查看選項的方法
--enable-multilib
[default]
This is part of the generic multilib support for building cross compilers. As such, targets like "powerpc-elf" will have libstdc++ built many different ways: "-msoft-float" and not, etc. A different libstdc++ will be built for each of the different multilib
versions. This option is on by default.
這是部分的通用multilib支持構建交叉編譯器,不同的libstdc++將建為每個不同的multilib版本。默認選項。
--enable-sjlj-exceptions

Forces old, set-jump/long-jump exception handling model. If at all possible, the new, frame unwinding exception handling routines should be used instead, as they significantly reduce both runtime memory usage and executable size. This option can change the
library ABI.
強制用舊的set-jump/long-jump異常處理模塊(C語言的)。如果可能的話,應該使用新的框架解除異常處理例程,因為他們大大減少運行時內存使用量和可執行的大小。
--enable-version-specific-runtime-libs

Specify that run-time libraries should be installed in the compiler-specific subdirectory (i.e.,
${libdir}/gcc-lib/${target_alias}/${gcc_version}
)
instead of
${libdir}
. This option is useful if you intend to use several versions of gcc in
parallel. In addition, libstdc++'s include files will be installed in
${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++
,
unless you also specify
--with-gxx-include-dir=
dirname
during
configuration.
指定運行時庫應該安裝在編譯器特定的子目錄中,也就是${libdir}/gcc-lib/${target_alias}/${gcc_version}代替${libdir}。這個選項是有用的,如果你打算使用多個版本的gcc。
另外,libstdc++的包含文件將安裝在${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++,除非你指定--with-gxx-include-dir= 目錄名。
--with-gxx-include-dir=<include-files dir>

Adds support for named libstdc++ include directory. For instance, the following puts all the libstdc++ headers into a directory called "4.4-20090404" instead of the usual "c++/(version)".
可以支持命名libstdc++包含目錄。例如:……。
--with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404

--enable-cstdio

This is an abbreviated form of
'--enable-cstdio=stdio'
(described next).
這是--enable-cstdio=stdio的縮寫
--enable-cstdio=OPTION

Select a target-specific I/O package. At the moment, the only choice is to use 'stdio', a generic "C" abstraction. The default is 'stdio'. This option can change the library ABI.
選擇一個有針對性的I/O包。目前,唯一的選擇是使用“stdio”,一個通用的“C”的抽象。默認的是“stdio”。這個選項可以改變庫應用程序二進制接口。
--enable-clocale

This is an abbreviated form of
'--enable-clocale=generic'
(described next).
這是--enable-clocale=generic的縮寫
--enable-clocale=OPTION

Select a target-specific underlying locale package. The choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets, 'gnu' to specify a model based on functionality from the GNU C library
(langinfo/iconv/gettext) (from glibc , the GNU C library), or 'generic' to use a generic "C" abstraction which consists of "C" locale info.
選擇一個有針對性的底層本地包。選擇是‘ieee_1003.1-2001’指定一個X/Open標准Unix (IEEE Std. 1003.1-2001)模型基於langinfo/iconv/catgets,‘gnu’指定一個基於GNU C庫(langinfo/iconv/gettext)(來自 glibc , the GNU C library),或'generic'使用一個通用的由“C”語言環境信息的“C”抽象。
If not explicitly specified, the configure proccess tries to guess the most suitable package from the choices above. The default is 'generic'. On glibc-based systems of sufficient vintage (2.3 and newer), 'gnu' is automatically selected. This option can change
the library ABI.
configure默認猜測最適合的選擇,默認是'generic'。基於glibc系統,很古董。。自動選擇‘gnu’。這個選項能改變應用程序二進制接口。
--enable-libstdcxx-allocator

This is an abbreviated form of
'--enable-libstdcxx-allocator=auto'
(described next).
這是--enable-libstdcxx-allocator=auto的縮寫。
--enable-libstdcxx-allocator=OPTION

Select a target-specific underlying std::allocator. The choices are 'new' to specify a wrapper for new, 'malloc' to specify a wrapper for malloc, 'mt' for a fixed power of two allocator, 'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
See this page for more information on allocator extensions . This option can change the library ABI.
選擇一個有針對性的底層std::allocator。選擇‘new’指定新封裝,‘malloc’指定malloc封裝。‘mt’確定的強大的兩個alloctor,‘pool’SGI的池allocator,‘bitmap’一個位圖
allocator。查看allocator更多信息 extensions 。這個選項改變應用程序二進制接口。
--enable-cheaders=OPTION

This allows the user to define the approach taken for C header compatibility with C++. Options are c, c_std, and c_global. These correspond to the source directory's include/c, include/c_std, and include/c_global, and may also include include/c_compatibility.
The default is 'c_global'.
這允許用戶定義的方法被用於C++兼容C的頭文件。選項是c, c_std, 和c_global。和源碼的include/c, include/c_std, include/c_global一致,通常也包含include/c_compatibility
。默認是c_global。
--enable-threads

This is an abbreviated form of
'--enable-threads=yes'
(described next).
這是--enable-threads=yes縮寫。
--enable-threads=OPTION

Select a threading library. A full description is given in the general compiler configuration instructions . This option can change the library ABI.
選擇一個線程庫。全部的描述在 compiler configuration instructions 。這個選項改變庫的應用程序二進制接口。
--enable-libstdcxx-time

This is an abbreviated form of
'--enable-libstdcxx-time=yes'
(described next).
這是--enable-libstdcxx-time=yes的縮寫。
--enable-libstdcxx-time=OPTION

Enables link-type checks for the availability of the clock_gettime clocks, used in the implementation of [time.clock], and of the nanosleep and sched_yield functions, used in the implementation of [thread.thread.this] of the 2011 ISO C++ standard. The choice
OPTION=yes checks for the availability of the facilities in libc and libposix4. In case of need the latter is also linked to libstdc++ as part of the build process. OPTION=rt also searches (and, in case, links) librt. Note that the latter is not always desirable
because, in glibc, for example, in turn it triggers the linking of libpthread too, which activates locking, a large overhead for single-thread programs. OPTION=no skips the tests completely. The default is OPTION=no.
選項:yes或no或rt。yes優先測試開啟C++2011標准的time.clock實現所使用的 clock_gettime時鐘,優先使用libposix4部分鏈接到 libstdc++。默認是no,取消測試。
rt通常搜索librt,鏈接glibc和pthread,將激活鎖和導致單線程程序的巨大開銷。
--enable-libstdcxx-debug

Build separate debug libraries in addition to what is normally built. By default, the debug libraries are compiled with
CXXFLAGS='-g3
 -O0 -fno-inline'
, are installed in
${libdir}/debug
, and have the same names and versioning
information as the non-debug libraries. This option is off by default.
額外構建獨立的debug庫。它的編譯標志使用
CXXFLAGS='-g3 -O0 -fno-inline',將安裝在${libdir}/debug下面,和非debug庫有一樣的名字和版本信息。默認是關閉。

Note this make command, executed in the build directory, will do much the same thing, without the configuration difference and without building everything twice:
make
 CXXFLAGS='-g3 -O0 -fno-inline' all

--enable-libstdcxx-debug-flags=FLAGS

This option is only valid when
--enable-debug
is also specified, and applies to the debug builds
only. With this option, you can pass a specific string of flags to the compiler to use when building the debug versions of libstdc++. FLAGS is a quoted string of options, like
--enable-debug設定時,這個選項才有效,僅適用於debug構建。當編譯debug版libstdc++使你可以傳遞特定字符串標志給編譯器。FLAGS使用單引號引用字符串。如:
--enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline'

--enable-cxx-flags=FLAGS

With this option, you can pass a string of -f (functionality) flags to the compiler to use when building libstdc++. This option can change the library ABI. FLAGS is a quoted string of options, like
此選項使你在構建libstdc++時傳遞一個字符串 -f(功能性標志) 給編譯器使用。這個選項能改變應用程序二進制接口。FLAGS使用單引號引用字符串。如:
--enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'

Note that the flags don't necessarily have to all be -f flags, as shown, but usually those are the ones that will make sense for experimentation and configure-time overriding.
注意此標志不需要所有的都加-f標志。但他們通常是有意義的實驗和配置時的重新定義。(就是-f的一般將重寫配置標志)
The advantage of --enable-cxx-flags over setting CXXFLAGS in the 'make' environment is that, if files are automatically rebuilt, the same flags will be used when compiling those files as well, so that everything matches.
--enable-cxx-flags比在'make'環境設置CXXFLAGS的優勢是:如果文件自動重新構建,同樣的標志將會在編譯時使用,以使所有都匹配。
Fun flags to try might include combinations of 值得嘗試的組合是
-fstrict-aliasing
  -fno-exceptions
  -ffunction-sections
  -fvtable-gc

and opposite forms (-fno-) of the same. Tell us (the libstdc++ mailing list) if you discover more!
相反的形式是-fno-
--enable-c99

The "long long" type was introduced in C99, along with many other functions for wide characters, and math classification macros, etc. If enabled, all C99 functions not specified by the C++ standard will be put into
namespace
 __gnu_cxx
, and then all these names will be injected into namespace std, so that C99 functions can be used "as if" they were in the C++ standard (as they will eventually be in some future revision of the standard, without a doubt). By default, C99
support is on, assuming the configure probes find all the necessary functions and bits necessary. This option can change the library ABI.
啟用c99標准。。。。待續
--enable-wchar_t
[default]
Template specializations for the "wchar_t" type are required for wide character conversion support. Disabling wide character specializations may be expedient for initial porting efforts, but builds only a subset of what is required by ISO, and is not recommended.
By default, this option is on. This option can change the library ABI.
啟用wchar_t。。。默認
--enable-long-long

The "long long" type was introduced in C99. It is provided as a GNU extension to C++98 in g++. This flag builds support for "long long" into the library (specialized templates and the like for iostreams). This option is on by default: if enabled, users will
have to either use the new-style "C" headers by default (i.e., <cmath> not <math.h>) or add appropriate compile-time flags to all compile lines to allow "C" visibility of this feature (on GNU/Linux, the flag is -D_ISOC99_SOURCE, which is added automatically
via CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE). This option can change the library ABI.
開啟longlong。。默認
--enable-fully-dynamic-string

This option enables a special version of basic_string avoiding the optimization that allocates empty objects in static memory. Mostly useful together with shared memory allocators, see PR libstdc++/16612 for details.
開啟特殊版本basic_string避免優化在靜態內存分配空對象。。通常和共享內存allocator一樣有用。詳見PR libstdc++/16612。
--enable-concept-checks

This turns on additional compile-time checks for instantiated library templates, in the form of specialized templates, described
here . They can help users discover when they break the rules of the STL, before their programs run.
開啟編譯時檢查實例化的庫模板。詳見 described here 。可在程序運行前發現是否不符合STL規則。
--enable-symvers[=style]

In 3.1 and later, tries to turn on symbol versioning in the shared library (if a shared library has been requested). Values for 'style' that are currently supported are 'gnu', 'gnu-versioned-namespace', 'darwin', 'darwin-export', and 'sun'. Both gnu- options
require that a recent version of the GNU linker be in use. Both darwin options are equivalent. With no style given, the configure script will try to guess correct defaults for the host system, probe to see if additional requirements are necessary and present
for activation, and if so, will turn symbol versioning on. This option can change the library ABI.
3.1和以後的版本,嘗試打開共享庫的符號版本。支持'gnu', 'gnu-versioned-namespace', 'darwin', 'darwin-export', 'sun'。如果未指定則猜測系統,看是否可激活版本信息。
--enable-libstdcxx-visibility

In 4.2 and later, enables or disables visibility attributes. If enabled (as by default), and the compiler seems capable of passing the simple sanity checks thrown at it, adjusts items in namespace std, namespace std::tr1, namespace std::tr2, and namespace __gnu_cxx
to have
visibility ("default")
so that -fvisibility options can be used without affecting the
normal external-visibility of namespace std entities. Prior to 4.7 this option was spelled
--enable-visibility
.
4.2和以後的版本,開啟或關閉可見屬性。默認開啟。可以使用- fvisibility選項而不影響正常的外部std名稱空間實體可見性。4.7以前,寫法是--enable-visibility
--enable-libstdcxx-pch

In 3.4 and later, tries to turn on the generation of stdc++.h.gch, a pre-compiled file including all the standard C++ includes. If enabled (as by default), and the compiler seems capable of passing the simple sanity checks thrown at it, try to build stdc++.h.gch
as part of the make process. In addition, this generated file is used later on (by appending
--include
 bits/stdc++.h
to CXXFLAGS) when running the testsuite.
3.4和以後版本,嘗試打開stdc++.h.gch的建立,標准C++頭文件的預編譯頭文件。默認開啟。另外,這個文件將在運行測試集時使用(追加--include bits/stdc++.h 給CXXFLAGS)
--enable-extern-template
[default]
Use extern template to pre-instantiate all required specializations for certain types defined in the standard libraries. These types include
string
and
dependents like
char_traits
, the templateized io classes,
allocator
,
and others. Disabling means that implicit template generation will be used when compiling these types. By default, this option is on. This option can change the library ABI.
對於某些類型定義在標准庫使用外來的模板實例化之前所有必需的專門化。這些類型包含string char_traits 類模板 allocator 其他。
關閉意味著編譯那些類型時隱式模板建立將被使用。
--disable-hosted-libstdcxx

By default, a complete hosted C++ library is built. The C++ Standard also describes a freestanding environment, in which only a minimal set of headers are provided. This option builds such an environment.
默認建立一個完整的托管c++庫。獨立的環境,僅提供最小限度的頭文件
Copyright © Linux教程網 All Rights Reserved