[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Small change to pkg.m?
From: |
David Bateman |
Subject: |
Re: Small change to pkg.m? |
Date: |
Mon, 29 Oct 2007 17:08:29 +0100 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Thomas Treichl wrote:
> Hi,
>
> I already reported that fort77 works fine to compile Octave and all
> it's dependencies but I had another problem that I'd like to address
> here. I cannot pass all my CFLAGS through the fort77 script (because
> there are some Apple-specific flags that cannot be handled by the
> fort77 script and I don't want to create my own script). Eg.
>
> CFLAGS='-arch ppc <other opt flags> <-I and so on>'
>
> where I get an error from fort77 'rch is not valid' or something like
> that because it misinterprets '-a' instead of '-arch'. Quoting and all
> these -Wc, things and so on didn't help but my workaround was to move
> all architecture dependent flags and all optimization flags directly
> to CC before calling ./configure. So my CC and CFLAGS now look like
>
> CFLAGS='<-I and so on>'
> CC='gcc -arch ppc <other opt flags>'
>
> <...hours later after Octave.app is running> I'm trying to install any
> of the packages from OF that need to call ./configure before
> installation - it fails because of these lines in pkg.m (1023ff)
>
> [status, output] = shell (strcat ("cd ", src, "; ./configure
> --prefix=\"",
> desc.dir, "\"",
> " CC=", octave_config_info ("CC"),
> " CXX=", octave_config_info ("CXX"),
> " AR=", octave_config_info ("AR"),
> " RANLIB=", octave_config_info ("RANLIB")));
>
> that do not allow spaces in CC and CXX. So I decided to change these
> lines in a first step into this
>
> [status, output] = shell (strcat ("cd ", src, "; ./configure
> --prefix=\"",
> desc.dir, "\"",
> " CC=\"", octave_config_info ("CC"), "\"",
> " CXX=\"", octave_config_info ("CXX"), "\"",
> " AR=\"", octave_config_info ("AR"), "\"",
> " RANLIB=\"", octave_config_info ("RANLIB"), "\""));
>
> This already worked but then I thought about it and found out that I
> modify the CC flags in my local mkoctfile-2.9.15 file before building
> Octave.app (remove the archictecture flags and other things that are
> not wanted because a PPC machine does know that it is a PPC and the
> same for i386). My output in Octave.app then looks like
>
> octave-2.9.15:1> mkoctfile ("-p", "CC")
> gcc <other opt flags>
> octave-2.9.15:2> octave_config_info ("CC")
> gcc -arch ppc <other opt flags>
>
> So a better solution I was thinking about would be
>
> [status, output] = shell (strcat ("cd ", src, "; ./configure
> --prefix=\"",
> desc.dir, "\"",
> " CC=\"", mkoctfile ("-p", "CC"), "\"",
> " CXX=\"", mkoctfile ("-p", "CXX"), "\"",
> " AR=\"", octave_config_info ("AR"), "\"",
> " RANLIB=\"", octave_config_info ("RANLIB"), "\""));
>
> Don't know if this is wanted or if this does break any other platform
> and that's why I didn't sent a patch for this?
>
> Thomas
>
I don't see how this might break things, and seems the right thing to
do.. I might also suggest respecting any variables from the environment
so that your original trick would also work.. Something like
flags = "";
if (isempty (getenv ("CC")))
flags = strcat (flags,
" CC =\"", mkoctfile ("-p", "CC"), "\"");
endif
if (isempty (getenv ("CXX")))
flags = strcat (flags,
" CXX =\"", mkoctfile ("-p", "CXX"), "\"");
endif
if (isempty (getenv ("AR")))
flags = strcat (flags,
" AR =\"", mkoctfile ("-p", "AR"), "\"");
endif
if (isempty (getenv ("RANLIB")))
flags = strcat (flags,
" RANLIB =\"", mkoctfile ("-p", "RANLIB"), "\"");
endif
[status, output] = shell (strcat ("cd ", src, "; ./configure --prefix=\"",
desc.dir, "\"", flags, "\""));
Want to supply a patch?
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary