|
![]() ![]() ![]() |
Special compile-time flags and additional libraries are required when compiling threaded applications on Solaris. If you are compiling a threaded application, you must compile with the _REENTRANT flag and link with the libpthread.a or libthread.a libraries:
cc -mt ... cc -D_REENTRANT ... -lthread cc -D_REENTRANT ... -lpthread
The Berkeley DB library will automatically build with the correct options.
On some versions of Solaris, there is a cc executable in the user's path, but all it does is display an error message and fail:
% which cc /usr/ucb/cc % cc /usr/ucb/cc: language optional software package not installed
As Berkeley DB always uses the native compiler in preference to gcc, this is a fatal error. If the error message you're seeing is:
checking whether the C compiler (cc -O ) works... no configure: error: installation or configuration problem: C compiler cannot create executables.
then this may be the problem you're seeing. The simplest workaround is to set your CC environment variable to the system compiler, e.g.:
env CC=gcc ../dist/configure
and reconfigure.
If you are using the --configure-cxx option, you may also want to specify a C++ compiler, e.g.:
env CC=gcc CCC=g++ ../dist/configure
This is a known bug in Solaris 2.5 and it is fixed by Sun patch 103187-25.
![]() ![]() ![]() |