[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gm2] Report: Building gm2-1.0.4 on FreeBSD 9.0-RELEASE i386
From: |
Gaius Mulley |
Subject: |
Re: [Gm2] Report: Building gm2-1.0.4 on FreeBSD 9.0-RELEASE i386 |
Date: |
Sat, 16 Jun 2012 19:04:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Martin Hofmann <address@hidden> writes:
> 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
Hi,
thanks for the feedback and fixes. I wonder whether:
#!/usr/bin/env python
might be slightly better. But sure all the #!/usr/bin/python
need to be changed.
> 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
ok probably this can be fixed by using $(MAKE) in all the Makefiles
and then setting the environment.
> 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) \
ouch - ok I'll add a patch to gcc-4.1.2 - thanks!
> 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).
also thank you for the awk fix - will change these as well. It will be
interesting to hear how the make check-gm2 progresses,
regards,
Gaius