To build Free and Open Source Software (FOSS) components on Oracle Solaris, you must consider the following.
Using pkg-config – You can use the pkg-config utility to find build configuration flags. To get the appropriate flags for a 64-bit build, you must set the following environment variable before you run the pkg-config utility.
PKG_CONFIG_PATH=/usr/lib/64/pkgconfig
If you have additional third-party libraries installed in other paths, you must include the 64-bit variants of those paths in the PKG_CONFIG_PATH setting. For example:
PKG_CONFIG_PATH=/usr/lib/64/pkgconfig:/opt/local/lib/64/pkgconfig
The pkg-config utility will search the default path after searching the directories mentioned in the PKG_CONFIG_PATH setting. Therefore, the pkg-config utility finds the configuration files that are independent of bit size in the /usr/share/pkgconfig directory and the 32-bit configuration files in the /usr/lib/pkgconfig directory.
Using GNU autoconf – You can use the GNU autoconf utility to find the build flags for C or C++ code. To get the appropriate flags for a 64-bit build, you must set the following in your environment variables before running the configure script.
CFLAGS="-m64" CXXFLAGS="-m64"
If the configure script calls pkg-config for library paths, you must need the PKG_CONFIG_PATH variable listed above. If it finds any libraries via LDFLAGS, adding any flags for libraries in the default paths of /lib/64 or /usr/lib/64, files is not required. For other libraries in other paths you must set following flag.
LDFLAGS="-L/opt/local/lib/64 -R/opt/local/lib/64"