From 908d5033fe98b6ba7944eb62879f9627a96e25d2 Mon Sep 17 00:00:00 2001 From: Xuewen Wang Date: Thu, 4 May 2023 20:56:46 +0800 Subject: [PATCH] Fix configure error in other folder than the top src dir If I run the generated configure in a sub-directory, such as the directory named "build", it reports the following errors: checking POSIX threads usability... cat: config/pthread.c: No such file or directory this patch fixes this error by add $srcdir in configure.in --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index bb525b6..ff4c68d 100644 --- a/configure.in +++ b/configure.in @@ -387,7 +387,7 @@ for flag in "" -mt -pthread -thread ; do CFLAGS="$oldCFLAGS $flag" for lib in "" -lpthread "-lpthread -lposix4" ; do LIBS="$oldLIBS $lib" - AC_LINK_IFELSE(AC_LANG_SOURCE([`cat config/pthread.c`]), [ + AC_LINK_IFELSE(AC_LANG_SOURCE([`cat $srcdir/config/pthread.c`]), [ foundthrlib=$lib foundthrflag=$flag thrfail=0 @@ -407,7 +407,7 @@ fi AC_MSG_RESULT([CFLAGS=$foundthrflag and LIBS=$foundthrlib]) AC_MSG_CHECKING([POSIX threads usability]) -AC_RUN_IFELSE([`cat config/pthread.c`], +AC_RUN_IFELSE([`cat $srcdir/config/pthread.c`], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR( [it fails. We probably guessed the wrong CFLAGS.])],