[patch] fix thread test cases for solaris.

Paolo Carlini paolo.carlini@oracle.com
Mon Jan 12 16:40:00 GMT 2009


Hi,
> Preliminary patch attached.
>
> Take a look at acinclude.m4, besides the documentation updates, I'm
> wondering what to do about setting GLIBCXX_LIBS after running the
> AC_SEARCH_LIBS. Also, I'm not sure libstdcxx-librt is the right name
> since these facilities can also be in posix4.
>   
Let's have these three options for libstdcxx-librt:  no, auto, yes.  In
the first case no additional libraries, ever; in the second case only
posix4 (it's safe), if it helps; in the third case rt too, if it helps.
The default is auto. Seems consistent to me.
> You'll notice I was trying to do something like:
>
> +#    if test x"$ac_cv_search_clock_gettime" = x"-lposix4"
> +#      || test x"$ac_cv_search_nanosleep" = x"-lposix4"
> +#      || test x"$ac_cv_search_sched_yield" = x"-lposix4"; then
> +#      GLIBCXX_LIBS="-lposix4"
> +#    fi
>
> which doesn't work (i really hate this syntax, whatever excuse for a
> language this is ;) )
>
> and similar for -lrt where there was a single case statement before:
>      case "$ac_cv_search_clock_gettime" in
>        -l*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime
>      esac
>
> basically, I just want the union of "-l*"'s that come out of those
> search lib tests (and presumably a platform could need both rt and
> posix4 no?).
>   
I'm not sure to understand your problem: can't you just do three
separate searches, as in the draft, basically, but each time use the
current GLIBCXX_LIBS? Like, the second time:

    case "$ac_cv_search_nanosleep" in
      -l*) GLIBCXX_LIBS="$GLIBCXX_LIBS $ac_cv_search_nanosleep"

something like this should work.

Eventually, remember to update doc/xml/manual/configure.xml too.

Paolo.



More information about the Libstdc++ mailing list