librelist archives

« back to archive

programs that have explicit "gcc" calls

programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-07 @ 16:56
What is homebrew's policy on programs that have explicit "gcc", "g++", 
etc. calls? I tried making a port for reduce-algebra (a lisp oriented cas 
similar to octave and maxima) and was told I had to patch the config/make 
scripts to meet macport's expectations on passing env. variables. I have a
hard time believing this is a unique situation, and as an enduser (I'm not
a programmer) was put off by this.


Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-07 @ 21:12
On 7 Jan 2012, at 16:56, Mark Brethen wrote:

> What is homebrew's policy on programs that have explicit "gcc", "g++", 
etc. calls? I tried making a port for reduce-algebra (a lisp oriented cas 
similar to octave and maxima) and was told I had to patch the config/make 
scripts to meet macport's expectations on passing env. variables. I have a
hard time believing this is a unique situation, and as an enduser (I'm not
a programmer) was put off by this.

It's vaguely similar for Homebrew but I think much simpler to implement 
than Macports.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-07 @ 22:00
On Jan 7, 2012, at 3:12 PM, Mike McQuaid wrote:

> 
> On 7 Jan 2012, at 16:56, Mark Brethen wrote:
> 
>> What is homebrew's policy on programs that have explicit "gcc", "g++", 
etc. calls? I tried making a port for reduce-algebra (a lisp oriented cas 
similar to octave and maxima) and was told I had to patch the config/make 
scripts to meet macport's expectations on passing env. variables. I have a
hard time believing this is a unique situation, and as an enduser (I'm not
a programmer) was put off by this.
> 
> It's vaguely similar for Homebrew but I think much simpler to implement 
than Macports.
> 
> --
> Mike McQuaid
> http://mikemcquaid.com
> 

Okay, is this documented somewhere? I'd like to give it a try.

Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-07 @ 22:19
On 7 Jan 2012, at 22:00, Mark Brethen wrote:

> Okay, is this documented somewhere? I'd like to give it a try.

grep for CC in Library/Formula and you'll see the various ways it is done.
Shout if that's not clear enough.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] programs that have explicit "gcc" calls

From:
Charlie Sharpsteen
Date:
2012-01-07 @ 22:46
On Sat, Jan 7, 2012 at 2:19 PM, Mike McQuaid <mike@mikemcquaid.com> wrote:

>
> On 7 Jan 2012, at 22:00, Mark Brethen wrote:
>
> > Okay, is this documented somewhere? I'd like to give it a try.
>
> grep for CC in Library/Formula and you'll see the various ways it is done.
> Shout if that's not clear enough.


The bgrep formula looks like a pretty simple example. Try:

   brew edit bgrep

To see the details.

-Charlie

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-07 @ 23:34
On Jan 7, 2012, at 4:46 PM, Charlie Sharpsteen wrote:

> On Sat, Jan 7, 2012 at 2:19 PM, Mike McQuaid <mike@mikemcquaid.com> wrote:
> 
> On 7 Jan 2012, at 22:00, Mark Brethen wrote:
> 
> > Okay, is this documented somewhere? I'd like to give it a try.
> 
> grep for CC in Library/Formula and you'll see the various ways it is 
done. Shout if that's not clear enough.
> 
> The bgrep formula looks like a pretty simple example. Try:
> 
>    brew edit bgrep
> 
> To see the details.
> 
> -Charlie

That opens the script in textwrangler, which looks like it installs bgrep.
I assume this isn't part of the initial brew installation and I have to 
issue 'brew install bgrep'? I'll have to look at the man page and see how 
it's used. 

Looking ahead:
With macports' different phases, I had to use svn to download reduce. It 
has a script that I needed to run after the build phase to change the lisp
library paths. This file is not in the tarball. Does homebrew have a 
similar destroot phase? Maybe I won't need that script if the paths aren't
changed. But if I do, does homebrew support svn?

Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Charlie Sharpsteen
Date:
2012-01-08 @ 01:04
On Sat, Jan 7, 2012 at 3:34 PM, Mark Brethen <mark.brethen@gmail.com> wrote:

>  On Jan 7, 2012, at 4:46 PM, Charlie Sharpsteen wrote:
> > The bgrep formula looks like a pretty simple example. Try:
> >
> >    brew edit bgrep
> >
> > To see the details.
> >
> > -Charlie
>
> That opens the script in textwrangler, which looks like it installs bgrep.
> I assume this isn't part of the initial brew installation and I have to
> issue 'brew install bgrep'? I'll have to look at the man page and see how
> it's used.
>

No. I was suggesting you use `brew edit bgrep` to examine the formula for
Bgrep which demonstrates the use of the Homebrew variables `ENV.cc` and
`ENV.cflags` in a system call. This examination should answer
your original question of "What is homebrew's policy on programs that have
explicit 'gcc', 'g++', etc. calls?".

I never suggested actually installing bgrep.

-Charlie

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-08 @ 01:19
On Jan 7, 2012, at 7:04 PM, Charlie Sharpsteen wrote:

> On Sat, Jan 7, 2012 at 3:34 PM, Mark Brethen <mark.brethen@gmail.com> wrote:
> On Jan 7, 2012, at 4:46 PM, Charlie Sharpsteen wrote:
> > The bgrep formula looks like a pretty simple example. Try:
> >
> >    brew edit bgrep
> >
> > To see the details.
> >
> > -Charlie
> 
> That opens the script in textwrangler, which looks like it installs 
bgrep. I assume this isn't part of the initial brew installation and I 
have to issue 'brew install bgrep'? I'll have to look at the man page and 
see how it's used.
> 
> No. I was suggesting you use `brew edit bgrep` to examine the formula 
for Bgrep which demonstrates the use of the Homebrew variables `ENV.cc` 
and `ENV.cflags` in a system call. This examination should answer your 
original question of "What is homebrew's policy on programs that have 
explicit 'gcc', 'g++', etc. calls?".
> 
> I never suggested actually installing bgrep.
> 
> -Charlie

I'm not I understand this system call.

If the configure file for reduce has this line:

  if gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch ix86_64 conftest.c
-o conftest > /dev/null 2>&1

how does that system call replace "gcc" with the correct compiler on my mac? 


Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-08 @ 14:21
On 8 Jan 2012, at 01:19, Mark Brethen wrote:

> I'm not I understand this system call.
> 
> If the configure file for reduce has this line:
> 
>  if gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch ix86_64 
conftest.c -o conftest > /dev/null 2>&1
> 
> how does that system call replace "gcc" with the correct compiler on my mac? 

Where is that from? There is no replacement done. Either the Makefile is 
edited by Homebrew or the CC environment variable is set so it uses the 
correct compiler.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-08 @ 14:56
On Jan 8, 2012, at 8:21 AM, Mike McQuaid wrote:

> 
> On 8 Jan 2012, at 01:19, Mark Brethen wrote:
> 
>> I'm not I understand this system call.
>> 
>> If the configure file for reduce has this line:
>> 
>> if gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch ix86_64 
conftest.c -o conftest > /dev/null 2>&1
>> 
>> how does that system call replace "gcc" with the correct compiler on my mac? 
> 
> Where is that from? There is no replacement done. Either the Makefile is
edited by Homebrew or the CC environment variable is set so it uses the 
correct compiler.
> 
> --
> Mike McQuaid
> http://mikemcquaid.com
> 

This is in a configure.ac file in .../trunk/csl/fox:

*darwin*)
  AC_MSG_NOTICE([Building for Macintosh/Darwin with X11])
  darwin_build="yes"
  AC_DEFINE(MACINTOSH, [1], [True if we are running on Macintosh])
  CFLAGS="$CFLAGS -fno-common -no-cpp-precomp"
  CXXFLAGS="$CXXFLAGS -fno-common -no-cpp-precomp"
  CPPFLAGS="$CPPFLAGS -fno-common -no-cpp-precomp -flat_namespace 
-I/usr/X11R6/include"
  AC_DEFINE(UNIX,[1],[True if we are running on Unix, Linux, BSD etc])
  LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -flat_namespace"
  XLIBS="-lXext -lX11"
  macintosh_build="yes"
  darwin_build="yes"
  LDFLAGS="$LDFLAGS -framework Carbon -framework CoreServices -framework 
ApplicationServices"
  AC_LANG_CONFTEST(
    [AC_LANG_PROGRAM([], [])])
  if gcc -isysroot /Developer/SDKs/MacOSX10.7.sdk -arch ix86_64 conftest.c
-o conftest > /dev/null 2>&1
  then
    AC_MSG_NOTICE([x96_64 binary creation will probably be possible using 10.7])
    else
      AC_MSG_ERROR([Need MACOSX SDK version 10.6 or 10.7])
    fi
  fi

Macports is telling me to patch all config/make files and replace any 
explicit "gcc" calls. Which brings me back to my original question: does 
homebrew have similar policy?

Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-08 @ 15:08
On 8 Jan 2012, at 14:56, Mark Brethen wrote:

> Macports is telling me to patch all config/make files and replace any 
explicit "gcc" calls. Which brings me back to my original question: does 
homebrew have similar policy?

Yes.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-08 @ 15:24
On Jan 8, 2012, at 9:08 AM, Mike McQuaid wrote:

> 
> On 8 Jan 2012, at 14:56, Mark Brethen wrote:
> 
>> Macports is telling me to patch all config/make files and replace any 
explicit "gcc" calls. Which brings me back to my original question: does 
homebrew have similar policy?
> 
> Yes.
> 
> --
> Mike McQuaid
> http://mikemcquaid.com
> 

Okay, so I need to search all the config/make files and replace those 
explicit calls. How would this be implemented in a formula?

Mark



Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-08 @ 15:36
On 8 Jan 2012, at 15:24, Mark Brethen wrote:

> Okay, so I need to search all the config/make files and replace those 
explicit calls. How would this be implemented in a formula?

Either a patch, an inline replacement or an environment variable. These 
should all be eventually upstreamed.

--
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mark Brethen
Date:
2012-01-08 @ 16:09
If by 'upstreamed' you mean forwarded to the developer, I'm actively 
working with the developer on this.

###

-Mark

On Jan 8, 2012, at 9:36 AM, Mike McQuaid <mike@mikemcquaid.com> wrote:

> 
> On 8 Jan 2012, at 15:24, Mark Brethen wrote:
> 
>> Okay, so I need to search all the config/make files and replace those 
explicit calls. How would this be implemented in a formula?
> 
> Either a patch, an inline replacement or an environment variable. These 
should all be eventually upstreamed.
> 
> --
> Mike McQuaid
> http://mikemcquaid.com
> 

Re: [homebrew] programs that have explicit "gcc" calls

From:
Mike McQuaid
Date:
2012-01-08 @ 18:01
On 8 Jan 2012, at 16:09, Mark Brethen wrote:

> If by 'upstreamed' you mean forwarded to the developer, I'm actively 
working with the developer on this.

Cool. In that case just tell them they should check and use the CC/CXX 
environment variables and set gcc as a default if they are unset.

--
Mike McQuaid
http://mikemcquaid.com