Re: [Log4cplus-devel] Fixes for CMake build files.
Logging Framework for C++
Brought to you by:
wilx
|
From: Chernyshev V. <ast...@ro...> - 2012-09-13 10:44:51
|
13.09.12, 9:55, Václav Zeman wrote:
> I wonder what difficulties you have had with the Autotools build system
> on MacOS X. I am keen on fixing those as well.
There are some link problems when C++11 mode and Clang's libc++ is
requested. Configure is done with something like that:
../configure
--prefix=/opt/log4cplus_clang
--with-iconv
CC=/usr/bin/clang
CXX=/usr/bin/clang++
CXXFLAGS="-std=gnu++11 -stdlib=libc++ -O3 -march=native -DNDEBUG"
CFLAGS="-std=gnu99 -O3 -march=native -DNDEBUG"
LDFLAGS="-stdlib=libc++"
Link failures appear after this line in output:
libtool: link: /usr/bin/clang++
-dynamiclib -o .libs/liblog4cplus-1.1.4.dylib
<skipped object files list>
-liconv -O3 -march=native -O2
-install_name /opt/log4cplus_cmake/lib/liblog4cplus-1.1.4.dylib
-compatibility_version 5
-current_version 5.0
-Wl,-single_module
I think that the problem is that CXXFLAGS and/or LDFLAGS are not
properly passed to final link command. Without "-std=gnu++11
-stdlib=libc++" a default c++ runtime library is linked to log4cplus and
it results in undefined references. As a side note, probably
user-provided CXXFLAGS should be appended to the end of the list,
otherwise default -O2 overrides user's decision.
|