cons-discuss
[Top][All Lists]
Advanced

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

Using Cons and Mingw32


From: Marcello Pietrobon
Subject: Using Cons and Mingw32
Date: Wed, 29 Nov 2000 18:52:48 -0600

Hi,
I am trying to use cons to compile with g++ of mingw32.
>From a Dos Box without Cons everything is working fine.

If  I use Cons with 'cl' (i.e. Microsoft Visual C++) everything is working fine.
I use something like:
    CCCOM => '%CC %CFLAGS %_IFLAGS /c %< /FR%>:d\\ /Fo%>:d\\ /Fp%>:b.pch 
/Fd%>:d\\
',
    LINKCOM  => '%LINK %LDFLAGS /pdb:%<:b.pdb %IMPLIB /out:%> %< %_LDIRS %LIBS 
',

But if I use g++ Cons with g++:
  CCCOM         => '%CC %CFLAGS %_IFLAGS -c %<',
  CXXCOM        => '%CXX %CXXFLAGS %_IFLAGS -c %<',
then I have the following interpretation error:
=================
g++: installation problem, cannot exec `cpp': No such file or directory
cons.pl: *** [build\hello.o] Error 1
cons.pl: errors constructing build\hello.o
=================

>From a Perl shell I can easily do (once the file  build\hello.cpp exists):
system('g++  -c build\hello.cpp');
without any errors.

The cons file is cons-2.2.0 without any changes.
I append the construct and conscript files.
As you see, under Win32 (I use WIndows 2000) I have to override all the 
defaults.
Is the first time I am using g++ with cons. If  by chance you can see any other
errors, please tell me.

Thank you

Marcello

==============================================
Construct file:

Export qw(CONS BUILD EXPORT);

##with Microsoft Visual C++
#  $CONS = new cons(
#  ENV => {
#       PATH =>
"C:\\GNU\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\system32\\WBEM;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\PROGRA~1\\MICROS~3\\Common\\msdev98\\BIN;C:\\PROGRA~1\\MICROS~3\\VC98\\BIN;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS\\WINNT;C:\\PROGRA~1\\MICROS~3\\Common\\TOOLS",

#              INCLUDE =>
"C:\\PROGRA~1\\MICROS~3\\VC98\\ATL\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\INCLUDE;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\INCLUDE",

#       LIB =>
"C:\\PROGRA~1\\MICROS~3\\VC98\\LIB;C:\\PROGRA~1\\MICROS~3\\VC98\\MFC\\LIB;",
#          },
#    CCCOM => '%CC %CFLAGS %_IFLAGS /c %< /FR%>:d\\ /Fo%>:d\\ /Fp%>:b.pch
/Fd%>:d\\ ',
#    LINKCOM  => '%LINK %LDFLAGS /pdb:%<:b.pdb %IMPLIB /out:%> %< %_LDIRS %LIBS 
',

#  CC => 'cl',
# );

##with Mingw32
  $CONS = new cons(
  CC            => 'g++',
  CFLAGS        => '',
  #CCCOM         => '%CC %CFLAGS %_IFLAGS -c %< -o %>',
  INCDIRPREFIX  => '-I',
  CXX           => '%CC',
  CXXFLAGS      => '%CFLAGS',
  #CXXCOM        => '%CXX %CXXFLAGS %_IFLAGS -c %< -o %>',
  LINK          => '%CXX',
  LINKCOM       => '%LINK %LDFLAGS -o %> %< %_LDIRS %LIBS',
  LINKMODULECOM => '%LD -r -o %> %<',
  LIBDIRPREFIX  => '-L',
  AR            => 'ar',
  ARFLAGS       => 'r',
  ARCOM         => "%AR %ARFLAGS %> %<\n%RANLIB %>",
  RANLIB        => 'ranlib',
  AS            => 'as',
  ASFLAGS       => '',
  ASCOM         => '%AS %ASFLAGS %< -o %>',
  LD            => 'ld',
  LDFLAGS       => '',
  PREFLIB       => 'lib',
  SUFEXE        => '.exe',
  SUFLIB        => '.a',
  SUFLIBS       => '.so:.a',
  SUFOBJ        => '.o',
  #$ENV           => { 'PATH' => '/bin:/usr/bin' },

  #these are some necessary changes
  #(because g++ doesn't seems to accept -c and -o together, but I will check
better after the main problem has been resolved)
  CCCOM         => '%CC %CFLAGS %_IFLAGS -c %<',
  CXXCOM        => '%CXX %CXXFLAGS %_IFLAGS -c %<',

  ENV => {
       PATH => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\bin',
       INCLUDE => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\include',
       LIB => 'C:\GNU\Gcc-2.95.2-1\lib\gcc-lib\lib',
          },
 );


 $BUILD = "build";
 $EXPORT = "export";
 Link $BUILD => ".";
  Build ("$BUILD/Conscript");
==========================================================

Conscript file:

 #Install $CONS qq(exp), qq(hello.c);       # (###)
Import qw(CONS BUILD EXPORT);

 $src = 'hello.cpp';
 $tgt = 'hello.exe';
  Program $CONS $tgt, $src;
 $EXPORT = $BUILD;
 if ($EXPORT ne $BUILD) {
  Install $CONS "#$EXPORT",  $tgt;
 }
 $path = "$EXPORT\\$tgt";
==========================================================







reply via email to

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