[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW
From: |
Greg Chicares |
Subject: |
Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW |
Date: |
Wed, 27 Jan 2016 00:37:38 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 |
On 2016-01-26 15:07, Vadim Zeitlin wrote:
> On Tue, 26 Jan 2016 04:29:56 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> On 2016-01-23 15:40, Vadim Zeitlin wrote:
> GC> >
> GC> > I have a pending patch to lmi configure which adds flags for C++11
> GC> > support, I can post it if you'd like. But until then you indeed need to
> GC> > pass it configure manually, although I usually use it as part of CXX and
> GC> > not CXXFLAGS to ensure that it's used also for linking. I don't actually
> GC> > think it makes any difference under Linux, but it definitely does under
> OS
> GC> > X (because C++11 uses a different standard library there) and so I just
> do
> GC> > it consistency under all platforms.
> GC>
> GC> Then for OSX, wouldn't it make sense to add it to LDFLAGS? Just curious.
>
> This works too, of course, but then you need to add it to two different
> places instead of only one. And, to be incredibly pedantic, in principle
> LDFLAGS could be used to link a C-only target, in which case -std=c++11
> would be out of place (although almost certainly still harmless).
I understand why the 'g++' driver is used as the linker for C++ programs
as a general rule. If, on OSX, you use something like 'g++ -std=c++11' to link,
then we have a g++_as_linker flag that can't be passed in CXXFLAGS or LDFLAGS.
Isn't that a design flaw in the gnu build system?
This isn't just pedantry: what if we don't know the name of the C++ compiler,
because it's deduced from '--host'? In this self-contained example...
cd ~/build/wxpdfdoc-msw
~/src/3rdparty/wxpdfdoc/configure \
--prefix=$HOME/msw/i686-w64-mingw32 \
--host=i686-w64-mingw32 \
--with-wx-config=$HOME/msw/i686-w64-mingw32/bin/wx-config \
CXXFLAGS='-std=c++11'
make $coefficiency install
...we don't define $(CXX) at all. The lmi makefiles presently do define it:
config_options = \
--prefix=$(prefix) \
--build=i686-pc-cygwin \
--host=i686-w64-mingw32 \
--disable-dependency-tracking \
--with-wx-config=$(prefix)/bin/wx-config-portable \
AR='$(mingw_bin_dir)/$(triplet_prefix)ar' \
AS='$(mingw_bin_dir)/$(triplet_prefix)as' \
CC='$(mingw_bin_dir)/$(triplet_prefix)gcc $(wx_cc_flags)' \
CPP='$(mingw_bin_dir)/$(triplet_prefix)cpp' \
CXX='$(mingw_bin_dir)/$(triplet_prefix)g++ $(wx_cxx_flags)' \
DLLTOOL='$(mingw_bin_dir)/$(triplet_prefix)dlltool' \
LD='$(mingw_bin_dir)/$(triplet_prefix)ld' \
...
but that seems to be a flaw (because $(triplet_prefix) has to be specified
for cross compiling, as we as for other reasons).
If you don't know what $(CXX) is, how do you add '-std=c++11' to it?
(Maybe that's why you're patching 'configure'.)
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, (continued)
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/24
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/24
- Re: [lmi] libtool and _putenv (was: Cross-compiling lmi from Linux to MSW), Vadim Zeitlin, 2016/01/25
- Re: [lmi] libtool and _putenv, Greg Chicares, 2016/01/25
- Re: [lmi] libtool and _putenv, Vadim Zeitlin, 2016/01/25
- Re: [lmi] libtool and _putenv, Greg Chicares, 2016/01/25
- Re: [lmi] libtool and _putenv, Vadim Zeitlin, 2016/01/25
- Re: [lmi] libtool and _putenv, Greg Chicares, 2016/01/25
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/25
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, Vadim Zeitlin, 2016/01/26
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW,
Greg Chicares <=
- Re: [lmi] [Bulk] Re: Cross-compiling lmi from Linux to MSW, Vadim Zeitlin, 2016/01/26
- Re: [lmi] Cross-compiling lmi from Linux to MSW, Vadim Zeitlin, 2016/01/22
- Re: [lmi] Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/22
- Re: [lmi] Cross-compiling lmi from Linux to MSW, Vadim Zeitlin, 2016/01/22
- Re: [lmi] Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/31
- Re: [lmi] Cross-compiling lmi from Linux to MSW, Vadim Zeitlin, 2016/01/31
Re: [lmi] Cross-compiling lmi from Linux to MSW, Greg Chicares, 2016/01/24