Scott,

I've done what you suggested with PLATFORM_OPTIONS, but I've removed PIC entirely (libtool takes care of that).

In fact the problem with the -mt flag was the acx_pthreads macro (used as of 1.3.1 and taken from the autoconf-macros project). It's a really small bug with ordering of tests of flags on the Solaris platform. Because the Sun workshop compiler simply passes flags it doesn't understand to ld, -pthread gets accepted as the correct flag, even though it isn't (generates warnings). Simply reordering and putting the -mt test first works on my systems, but it would be good if you could check on yours!

Cheers,
        Berin


Scott Cantor wrote:

The gist of the Solaris problem I'm finding is the use of this approach to
setting build flags:

    if test "x${ac_cv_cxx_compiler_gnu}" != "xyes"; then
      # Assume SunCC
      PIC=["-KPIC"]
      PLATFORM_OPTIONS=["-mt"]
      # Flags for warnings as errors
      cxxflags_warnerror="-xwe -errtags"
      # Flags for Optimise
      cxxflags_optimise="-xO2"
      # Flags for debug
      cxxflags_debug="-g"
    fi

Later on, this:

CC1=["${CXX} ${CXXFLAGS} ${PLATFORM_OPTIONS}"]

I'm not clear on what CC1 is, but it's not used by the make process later at
all. It's in Makefile, but is never referenced. When libtool runs the C++
compiler, it just runs it with whatever is in CPPFLAGS and CXXFLAGS, but not
PLATFORM_OPTIONS. So the SunCC flags are omitted from the build, in this
case no -mt for thread safety.

My suggestion is that you should append the PLATFORM_OPTIONS bits to CFLAGS
and CXXFLAGS directly. I think that will result in the right behavior. If
there's a more "correct" way, that's fine too, but I've never seen one
discussed.

-- Scott



Reply via email to