[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libtool links with g++ even with only c file
From: |
Vincent Torri |
Subject: |
Re: libtool links with g++ even with only c file |
Date: |
Sat, 18 Apr 2009 18:57:17 +0200 (CEST) |
Hey,
* Vincent Torri wrote on Sat, Apr 18, 2009 at 09:45:24AM CEST:
i have written a library which can be compiled for windows xp or windows
ce. The source files are only C files with windows ce, and there is a c++
file with windows xp.
I assume that this C++ file is added with an Automake conditional.
indeed
when i compile for windows ce, only gcc i used, but the link uses g++ to
create the DLL. There is also no c++ flags.
Is there a reason why libtool still uses g++ to create the DLL ?
This is an Automake question. automake doesn't take into account
conditionals when deciding which linker to use (this is a bug or
limitation or feature, depending on how you see it).
sorry for using the wrong ML.
Anyway, you
can work around it by setting foo_LINK. Here's an example.
ok, so it's just a matter of using the correct link options
thank you
Vincent Torri
cat >configure.ac <<'END'
AC_INIT(a,1)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AC_PROG_CXX
AM_CONDITIONAL(COND, false)
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
END
cat >Makefile.am <<'END'
bin_PROGRAMS = foo
foo_SOURCES = foo.c
if COND
foo_SOURCES += bar.cc
foo_LINK = $(CXXLINK)
else
foo_LINK = $(LINK)
endif
END