[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Problems with pthread detection under HPUX 11.0 (ITS#14)
One possible solution is to do it all in one HPUX 11 test. Basically,
modify your pthread_create test such that it fails under anything but
HPUX 11. (replace the test as appropriate)
#ifndef HP_UX_11
chokeme /* This test only passes under HPUX 11 */
#endif
Then, if this test passes, define the appropriate $ac_cv_, $ol_ variables.
Something like (I'm just winging this...) :
if test $ol_link_threads = no ; then
dnl use try_link to deal with HP stuff
save_LIBS="$LIBS"
LIBS="$LIBS -lpthread"
AC_MSG_CHECKING([for pthread_create() in HP-UX -lpthread])
ol_try_pthread_hp_ux_11=no
AC_CACHE_VAL(ol_cv_pthread_hp_ux_11,[
AC_TRY_LINK([#include <pthread.h>
#ifndef HP_UX_11_SPECIFIC_DEFINE
choke me! /* this only passes under HP-UX 11 */
#endif
], [pthread_create(NULL,NULL,NULL,NULL);],
ol_try_pthread_hp_ux_11=yes
ol_cv_pthread_hp_ux_11=yes,
ol_cv_pthread_hp_ux_11=no)))
AC_MSG_RESULT(yes)
LIBS="$save_LIBS"
if test $ol_cv_pthread_hp_ux_11=yes ; then
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
if test $ol_try_pthread_hp_ux_11 = yes ; then
dnl some tests below may fail because pthread.h must be included
dnl for now, force results we need.
ac_cv_func_pthread_attr_init=yes
fi
fi
fi
Josh Tiefenbach wrote:
>
> On Mon, Dec 21, 1998 at 05:27:25PM -0500, Josh Tiefenbach wrote:
> > > >The problem is that configure, when executing the AC_CHECK_LIB macro, does
> > > not
> > > >include the pthread.h header file. This is required to avoid undefined symbol
> > > >link
> > > >errors.
>
> Upon further review, it would appear that the same problem torpedo's the
> checks for the pthread_attr_init function. I'm not entirely sure how to solve
> the general problem tho - can you specify an include file to be checked when
> using AC_CHECK_FUNC or AC_CHECK_LIB?
>
> (config.log scrap)
> configure:4053: checking for pthread_attr_init
> configure:4081: cc -o conftest -g conftest.c -lpthread -lV3 1>&5
> /usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (conftest.o) was
> detected. The linked output may not run on a PA 1.x system.
> /usr/ccs/bin/ld: Unsatisfied symbols:
> pthread_attr_init (code)
>
> josh
>
> --
> Josh Tiefenbach - Member - ACC Corps of Internet Engineers - josh@ican.net