From d54ff264f78f5b237c4cc514a99596d4cabfb0e1 Mon Sep 17 00:00:00 2001 From: caro Date: Thu, 10 Nov 2011 18:14:48 +0000 Subject: [PATCH] Evas: use -pthread instead of -lpthread git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@65030 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- m4/evas_check_engine.m4 | 66 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/m4/evas_check_engine.m4 b/m4/evas_check_engine.m4 index a3f3b21..8c9fb59 100644 --- a/m4/evas_check_engine.m4 +++ b/m4/evas_check_engine.m4 @@ -91,9 +91,27 @@ AC_CHECK_HEADER([GL/gl.h], gl_pt_lib=""; have_gl_pt="no" -AC_CHECK_LIB([pthread], [pthread_create], [have_gl_pt="yes"], [have_gl_pt="no"]) + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + if test "x$have_gl_pt" = "xyes" ; then - gl_pt_lib=" -lpthread" + gl_pt_lib=" -pthread" fi if test "x${have_dep}" = "xyes" ; then @@ -236,9 +254,27 @@ AC_CHECK_HEADER([GL/gl.h], gl_pt_lib=""; have_gl_pt="no" -AC_CHECK_LIB([pthread], [pthread_create], [have_gl_pt="yes"], [have_gl_pt="no"]) + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + if test "x$have_gl_pt" = "xyes" ; then - gl_pt_lib=" -lpthread" + gl_pt_lib=" -pthread" fi if test "x${have_dep}" = "xyes" ; then @@ -555,9 +591,27 @@ PKG_CHECK_MODULES([SDL], gl_pt_lib=""; have_gl_pt="no" -AC_CHECK_LIB([pthread], [pthread_create], [have_gl_pt="yes"], [have_gl_pt="no"]) + +AC_MSG_CHECKING([whether pthread_create() is supported]) +CFLAGS_save="${CFLAGS}" +CFLAGS="${CFLAGS} -pthread" +LIBS_save="${LIBS}" +LIBS="${LIBS} -pthread" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ +#include + ]], + [[ +pthread_create(NULL, NULL, NULL, NULL); + ]])], + [have_gl_pt="yes"], + [have_gl_pt="no"]) +CFLAGS=${CFLAGS_save} +LIBS=${LIBS_save} +AC_MSG_RESULT([${have_gl_pt}]) + if test "x$have_gl_pt" = "xyes" ; then - gl_pt_lib=" -lpthread" + gl_pt_lib=" -pthread" fi AC_CHECK_HEADER([GL/gl.h], -- 2.7.4