gm2
[Top][All Lists]
Advanced

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

[Gm2] Report: Building gm2-1.0.4 on FreeBSD 9.0-RELEASE i386


From: Martin Hofmann
Subject: [Gm2] Report: Building gm2-1.0.4 on FreeBSD 9.0-RELEASE i386
Date: Fri, 15 Jun 2012 22:07:36 +0200
User-agent: Mozilla/5.0 (X11; FreeBSD i386; rv:12.0) Gecko/20120506 Thunderbird/12.0.1

Hi there,

I'm new to this list, so first of all: thank you for the great work so far!

Using the tarball

    gcc-4.1.2+gm2-1.0.4.tar.gz

I have managed to build gm2 on a 32-bit FreeBSD 9.0 system, but only after some tweaking. Here is what I've done, hopefully this can help others.


1  Environment
--------------

- Make python accessible in /usr/bin: By default, the python interpreter
  is in /usr/local/bin, but some scripts in the gm2 distribution
  reference it in its first line as

    #!/usr/bin/python

  (I'd prefer this to be as follows ...)

    #!python

  This is easy to circumvent with a symlink:

    sudo ln -s /usr/local/bin/python /usr/bin/python

- Force using gmake instead of BSD make: I tried to shell-alias make,
  and to have MAKE set in the environment, but this seems not to be
  enough. So I force all Makefiles and scripts onto GNU gmake with
  yet another symlink:

    ln -s /usr/local/bin/gmake $HOME/bin/make
    PATH=$HOME/bin:$PATH


2  Nasty bug in freebsd-spec.h
------------------------------

In gcc-4.1.2+gm2-cvs-latest/gcc/config/freebsd-spec.h, there is a
missing "else" in line 58:

           if (FBSD_MAJOR == 7)      \

This line should read:

           else if (FBSD_MAJOR == 7)      \

You get all kinds of horrific errors on FreeBSD 8 or 9 with the
missing else, because the predefined __FreeBSD__ symbol will then
default to a value of 0 in tests like #if __FreeBSD__ >= 4 ...

This seems to be an old bug, but somehow it persisted:

http://lists.freebsd.org/pipermail/freebsd-questions/2007-October/160731.html


3  Use of cut(1)
----------------

Sometimes BSD cut(1) doesn't really cut it:

    cut -f1 -d' '

will *not* extract the first whitespace-delimited field of a line. I use awk(1) instead:

    awk '{ print $1 }'


So change gcc-4.1.2+gm2-cvs-latest/gcc/gm2/tools-src/makeversion line 145 from:

THEDATE=`head -n ${pos} ${SRCDIR}/gm2/ChangeLog | grep ^2 | head -1 | cut -f1 -d' ' | cut -f1`

into this:

THEDATE=`head -n ${pos} ${SRCDIR}/gm2/ChangeLog | grep ^2 | head -1 | awk '{print $1}' | cut -f1`



That's it so far (hope I've not forgotten something). The resulting gm2 seems to work (I did not "make check-gm2" yet).


Cheers
mh



reply via email to

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