[Top][All Lists]

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

Re: [Mingw-cross-env-list] Solving the Pthreads issue

From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Solving the Pthreads issue
Date: Sun, 9 May 2010 19:06:57 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Tony Theodore <address@hidden> schrieb:
> Attached is what I had in mind. It's basically the previous libgomp
> build steps with some unrecognised options removed.

That build file looks great. I especially like your idea to reuse
the gcc_XXX variables:

    PKG             := libgomp
    $(PKG)_IGNORE   :=
    $(PKG)_VERSION  := $(gcc_VERSION)
    $(PKG)_CHECKSUM := $(gcc_CHECKSUM)
    $(PKG)_SUBDIR   := $(gcc_SUBDIR)

However, it contains two subtle bugs. First, you should also mirror
the $(PKG)_IGNORE variable, because you can't assume it will be
always empty. Second, you shouldn't assume that "gcc.mk" is included
before "libgomp.mk", although that might be true on most system due
to lexical ordering of the files to be included.

Let demonstrate the second issue on a simplified example. The following
Makefile will produce the output "4.5.0", as expected:

    gcc_VERSION     := 4.5.0
    libgomp_VERSION := $(gcc_VERSION)

            @echo $(libgomp_VERSION)

However, if the variables are defined in a different order, the output
will be empty:

    libgomp_VERSION := $(gcc_VERSION)
    gcc_VERSION     := 4.5.0

This issue is easy to fix by making the term "$(gcc_VERSION)" being
evaluated on demand rather at the definition of libgomp_VERSION. This
is achieved by using the "=" assignment instead of the ":=" assignment.
So in our example, the following code would again produce "4.5.0":

    libgomp_VERSION  = $(gcc_VERSION)
    gcc_VERSION     := 4.5.0

I fixed both issues in your build script, simplified it a bit, and
included it. I also fixed some GCC options:


In addition, I adjusted all other build scripts to which your idea
was applicable:


> I notice that both host and target are specified and the prefix
> is just usr. Should these be:
>         --host='$(TARGET)'
>         --prefix='$(PREFIX)/$(TARGET)'
> like other cross builds?

That's a good question. I simply took exactly the options that
were passed by GCC's main configure/make. Those cause libgomp to
be installed to:


But your options are sensible, too, and would certainly work,
too. These would install libgomp to a more usual location.

However, since libgomp is a subpackage of GCC, I think we should
install it to the place designated by GCC. That is, we should
install it to the same position to which it would be installed
if it had been built directly in the GCC build.



Volker Grabsch
NotJustHosting GbR

reply via email to

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