From 90b969c2ede4bd5ba3722d0f2a71a77d8380bf80 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 11 Apr 2012 14:14:11 +0100 Subject: tools: Correct PTHREAD options in config/StdGNU.mk It is not correct to say -lpthread. The correct option is -pthread, which may have sundry other effects on code generation etc. It needs to be passed both to compilation and linking. Fix the configure test to test -pthread, and plumb the resulting flag through to PTHREAD_{CFLAGS,LDFLAGS} in Tools.mk; also substitute PTHREAD_LIBS (although this will currently always be empty). Remove PTHREAD_LIBS setting from StdGNU.mk. Fix the one user (libxc) to use PTHREAD_{CFLAGS,LDFLAGS} too. There are still some other users in tree which pass -pthread or -lpthread by adding it as a literal to their own compiler options. These will be fixed in a later patch. Signed-off-by: Ian Jackson Cc: Roger Pau Monne Acked-by: Roger Pau Monne Committed-by: Ian Jackson --- tools/configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/configure.ac') diff --git a/tools/configure.ac b/tools/configure.ac index 0204e36449..250dffdf47 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -23,6 +23,7 @@ AC_USE_SYSTEM_EXTENSIONS AC_CANONICAL_HOST # M4 Macro includes +m4_include([m4/savevar.m4]) m4_include([m4/features.m4]) m4_include([m4/path_or_fail.m4]) m4_include([m4/python_version.m4]) @@ -33,6 +34,7 @@ m4_include([m4/set_cflags_ldflags.m4]) m4_include([m4/uuid.m4]) m4_include([m4/pkg.m4]) m4_include([m4/curses.m4]) +m4_include([m4/pthread.m4]) # Enable/disable options AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP]) @@ -129,8 +131,7 @@ AC_CHECK_LIB([ext2fs], [ext2fs_open2], [libext2fs="y"], [libext2fs="n"]) AC_SUBST(libext2fs) AC_CHECK_LIB([gcrypt], [gcry_md_hash_buffer], [libgcrypt="y"], [libgcrypt="n"]) AC_SUBST(libgcrypt) -AC_CHECK_LIB([pthread], [pthread_create], [] , - [AC_MSG_ERROR([Could not find libpthread])]) +AX_CHECK_PTHREAD AC_CHECK_LIB([rt], [clock_gettime]) AC_CHECK_LIB([yajl], [yajl_alloc], [], [AC_MSG_ERROR([Could not find yajl])]) -- cgit v1.2.3