public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* pre-announce: MELT 0.9.5rc1 plugin for GCC 4.6 & 4.7 pre-release candidate 1 (and help needed on make issues)
@ 2012-03-29 20:02 Basile Starynkevitch
  2012-03-29 20:45 ` [GCC-MELT-386] " Romain Geissler
  2012-04-02 10:31 ` Announce: MELT 0.9.5rc2 release candidate (for GCC 4.6 and 4.7) Basile Starynkevitch
  0 siblings, 2 replies; 18+ messages in thread
From: Basile Starynkevitch @ 2012-03-29 20:02 UTC (permalink / raw)
  To: gcc-melt; +Cc: gcc


Hello All,

The pre-release candidate 1 of MELT 0.9.5 is available for testing on
http://gcc-melt.org/melt-0.9.5rc1-plugin-for-gcc-4.6-or-4.7.tar.gz
as a gzipped tar archive of 4473286 bytes and md5sum ae00b9bd31f481e1bbc406711ca4c2f4.
 extracted from MELT branch 185969, march 29th 2012

You could try building it e.g. with 
  make MELTGCC=gcc-4.7 GCCMELT_CC=gcc-4.7 
It seems to be also buildable for GCC 4.6 with
  make MELTGCC=gcc-4.6 GCCMELT_CC=gcc-4.6

(both commands sort of work, with perhaps minor issues very late in the build process;
I'm not very afraid of these)

But I'm trying to code a makefile which would autodetect in GCC 4.7 was compiled in C++
mode (or if the GCC was compiled in C mode, then it is probably a 4.6 or a 4.7
configured in a weird fashion).
 
So far I tried to code in my Makefile the following trick
############################################################################
## the compiler with which melt.so is used
ifndef MELTGCC
MELTGCC = $(or $(CC),gcc)
endif

## gives yes if MELTGCC has been built with C++ or else the empty string
MELTGCC_BUILD_WITH_CXX = $(shell grep -q 'define +ENABLE_BUILD_WITH_CXX +1' \
  `$(MELTGCC) -print-file-name=plugin/include/auto-host.h` && echo yes)

## The compiler and flags used to build the melt.so plugin and to
## compile MELT generated code.  Notice that melt-module.mk use the
## same Make variables.  For a melt plugin to GCC 4.7 or later, that
## could be a C++ compiler! eg
##   make MELTGCC=gcc-4.7 GCCMELT_CC=g++-4.7
## hence we add a test if $(MELTGCC) was built with C++ or with C
ifeq ($(strip $(MELTGCC_BUILD_WITH_CXX)),)
GCCMELT_CC ?= $(or $(CC),gcc) -Wc++-compat
else
GCCMELT_CC ?= $(or $(CXX),g++)
endif

GCCMELT_CFLAGS ?= -g -O -Wall

$(info MELT plugin for MELTGCC= $(MELTGCC) to be compiled with GCCMELT_CC= $(GCCMELT_CC) \
flags $(GCCMELT_CFLAGS) $(if $(MELTGCC_BUILD_WITH_CXX),built with C++ \
$(MELTGCC_BUILD_WITH_CXX)))
### rest of makefile skipped
#############################################################################

but for some reason it does not work. (Maybe a := versus = make variable thing).

Do you have any suggestions about such things?  Assuming a plugin whose source code
should work with both 4.6 & 4.7, how would you autodetect if GCC was compiled in C++ or
in C mode? What am I doing wrong?

Regards.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-04-02 10:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-29 20:02 pre-announce: MELT 0.9.5rc1 plugin for GCC 4.6 & 4.7 pre-release candidate 1 (and help needed on make issues) Basile Starynkevitch
2012-03-29 20:45 ` [GCC-MELT-386] " Romain Geissler
2012-03-29 21:03   ` [GCC-MELT-387] " Basile Starynkevitch
2012-03-29 21:29     ` Romain Geissler
2012-03-30  5:22       ` Basile Starynkevitch
2012-03-30  9:41       ` MELT 0.9.5rc1 etc Basile Starynkevitch
2012-03-31  0:23         ` [GCC-MELT-391] " Romain Geissler
2012-03-31  7:08           ` Basile Starynkevitch
2012-03-31  8:52             ` Romain Geissler
2012-03-31 10:28               ` Basile Starynkevitch
2012-03-31 11:55                 ` Romain Geissler
2012-03-31 12:03                   ` Romain Geissler
2012-03-31 12:39                     ` [GCC-MELT-397] " Basile Starynkevitch
2012-03-31 13:07                       ` Jonathan Wakely
2012-03-31 13:56                         ` Romain Geissler
2012-03-31 14:30                           ` Basile Starynkevitch
2012-04-02 10:31 ` Announce: MELT 0.9.5rc2 release candidate (for GCC 4.6 and 4.7) Basile Starynkevitch
2012-04-02 10:35   ` Basile Starynkevitch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).