libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtool links with g++ even with only c file


From: Ralf Wildenhues
Subject: Re: libtool links with g++ even with only c file
Date: Sat, 18 Apr 2009 18:24:59 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Vincent,

* 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.

> 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).  Anyway, you
can work around it by setting foo_LINK.  Here's an example.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]