Hello Vasil, * Vasil Dimov wrote on Fri, Feb 27, 2009 at 07:47:49AM CET: > > I am trying to create an autoconf script that does check the size of pthread_t, > but I am experiencing some troubles in the way. > > To be precise, what I need is a macro like SIZEOF_PTHREAD_T, similar to > SIZEOF_LONG. The problem is that pthread.h must be included in the test program > and it must be linked with the OS-dependent -pthread or -lpthread or > whatever flag > the OS is using to link against the POSIX threads library. > > Can anyone send me a quick snippet of autoconf magic how to achieve this? Completely untested: grab the ACX_PTHREAD macro from the Autoconf Macro Archive, then use something like this: ACX_PTHREAD LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CC="$PTHREAD_CC" AC_CHECK_SIZEOF([pthread_t], [], [AC_INCLUDES_DEFAULT #include <pthread.h> ]) If you don't want LIBS, CFLAGS, and CC mangled, then save and restore their values before resp. afterwards. Hope that helps (otherwise please report back). Cheers, Ralf _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf