1
1

fix some misuses of various environment variables when running pthread checks

reported by Ake Sandgren on the users list a couple months ago...

This commit was SVN r13773.
Этот коммит содержится в:
Brian Barrett 2007-02-24 21:22:55 +00:00
родитель db1c2a58c4
Коммит 7ce72af158
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -33,6 +33,8 @@ AH_TEMPLATE([OMPI_THREADS_HAVE_DIFFERENT_PIDS],
[Do threads have different pids (pthreads on linux)])
AC_MSG_CHECKING([if threads have different pids (pthreads on linux)])
CFLAGS_save="$CFLAGS"
CFLAGS="$CFLAGS $THREAD_CFLAGS"
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
LDFLAGS_save="$LDFLAGS"
@ -46,20 +48,20 @@ AC_TRY_RUN([#include <pthread.h>
void *checkpid(void *arg);
int main() {
pthread_t thr;
int pid, retval;
int pid, *retval;
pid = getpid();
pthread_create(&thr, NULL, checkpid, &pid);
pthread_join(thr, (void **) &retval);
exit(retval);
exit(*retval);
}
static int ret;
void *checkpid(void *arg) {
int ret;
int ppid = *((int *) arg);
if (ppid == getpid())
ret = 0;
else
ret = 1;
pthread_exit((void *) ret);
pthread_exit((void *) &ret);
}],
[MSG=no OMPI_THREADS_HAVE_DIFFERENT_PIDS=0],
[MSG=yes OMPI_THREADS_HAVE_DIFFERENT_PIDS=1],
@ -75,6 +77,7 @@ void *checkpid(void *arg) {
esac
])
CFLAGS="$CFLAGS_save"
CPPFLAGS="$CPPFLAGS_save"
LDFLAGS="$LDFLAGS_save"
LIBS="$LIBS_save"

Просмотреть файл

@ -480,7 +480,6 @@ if test "$ompi_pthread_cxx_success" = "0"; then
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
else
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
@ -515,6 +514,7 @@ if test "$ompi_pthread_cxx_success" = "0"; then
else
PTHREAD_CXXCPPFLAGS=
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
fi
done
@ -535,7 +535,6 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
LIBS="$orig_LIBS"
if test "$ompi_pthread_f77_success" = "1"; then
AC_MSG_RESULT([yes])
else
@ -550,12 +549,12 @@ if test "$ompi_pthread_f77_success" = "0" -a "$OMPI_WANT_F77_BINDINGS" = "1"; th
OMPI_INTL_PTHREAD_TRY_LINK_F77(ompi_pthread_f77_success=1,
ompi_pthread_f77_success=0)
AC_LANG_POP(C)
LIBS="$orig_LIBS"
if test "$ompi_pthread_f77_success" = "1"; then
PTHREAD_LIBS="$pl"
AC_MSG_RESULT([yes])
break
else
LIBS="$orig_LIBS"
AC_MSG_RESULT([no])
fi
done