[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using different compilers
From: |
Sanatan Rai |
Subject: |
Re: Using different compilers |
Date: |
Wed, 1 Aug 2001 14:48:29 -0700 (PDT) |
: On Wed, 1 Aug 2001, Sanatan Rai wrote:
: > I am using cons to build a simulation project in C++. However, I am using
: > a library which is in (ANSI) C. How do I tell cons to use gcc and not g++
: > when building the library? I tried putting an override command in the
: > Conscript file for the library, but that didn't work.
:
: Set the CXX construction variable when you create or clone the
: environment:
:
: $env = new cons ( CXX => 'gcc' );
:
Nope, that doesn't work.
I have two directories that need to be done
#./sim
#./prng
sim has the C++ code that needs to be compiled with g++, prng has the
library which needs to be compiled with gcc.
Since #./Construct has
$SIM = new cons(
CC => 'g++',
...
) ;
all compilations invoke g++. I tried defining
$SIM2 = $SIM->clone(
CC => 'gcc'
) ;
and then:
# Get variables from parent
Import qw( SIM SIM2 INCLUDE LIB ) ;
# Install the products of this library
Install $SIM $INCLUDE, 'config.h'; # Necessary to compile prng
Install $SIM $INCLUDE, 'prng.h' ;
Install $SIM $LIB, 'libprng.a' ;
# Build libprng
Library $SIM 'libprng.a', 'anti.c', 'compound.c', 'cons.c', 'dicg.c',
'eicg.c',
'external.c', 'file.c', 'icg.c', 'lcg.c', 'meicg.c','mt19937.c', 'prng.c',
'qcg.
c', 'sub.c', 'support.c' ;
This calls gcc allright, but it puts things in the wrong places: in
particular it create a directory called TOP in #./sim and put everything
in bin there. (I have the following in #./Construct
# Top most directory
$TOP = '#.' ;
# Shared variables
Export qw( SIM SIM2 INCLUDE LIB BIN ) ;
# Share directory def
$INCLUDE = "$TOP/include" ;
$LIB = "$TOP/lib" ;
$BIN = "TOP/bin" ;
I can always build the library separately, but to avoid that sort of thing
is precisely why I am using cons.
Thanks!
--Sanatan
--
Sanatan Rai, | E.-mail: address@hidden
Dept. of Management Sc. & Engg. | Home: 100 N. Whisman Road 4316,
Stanford University, | Mountain View, Ca 94043.
Stanford, Ca 94305. | 'phone: (650) 964 0220 (R)
EMail: address@hidden (650) 736 2109 (O)