From: Ivan Maidanski Date: Mon, 16 Oct 2017 08:00:53 +0000 (+0300) Subject: Allow PKG_CHECK_MODULES in configure.ac to be commented out easily X-Git-Tag: v8.0.0~548 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d343355edd93994bacd523364186ffe50b95b43;p=platform%2Fupstream%2Flibgc.git Allow PKG_CHECK_MODULES in configure.ac to be commented out easily (code refactoring) * configure.ac [$with_libatomic_ops!=no && $with_libatomic_ops!=none] (missing_libatomic_ops): Set to true (before PKG_CHECK_MODULES). * configure.ac [$missing_libatomic_ops] (PKG_CHECK_MODULES): Set missing_libatomic_ops back to false if atomic_ops module is not found; add comment (about pkg-config and the possibility to comment out PKG_CHECK_MODULES). --- diff --git a/configure.ac b/configure.ac index 5826eeb..d56a020 100644 --- a/configure.ac +++ b/configure.ac @@ -997,12 +997,19 @@ fi # Check for an external libatomic_ops if the above answer is "yes" or "check". # If not found, fail on "yes", and convert "check" to "no". -# Note: "syntax error near unexpected token ATOMIC_OPS" reported by configure -# means Autotools pkg.m4 file was not found during aclocal.m4 generation. +# First, check that libatomic_ops usage is not disabled explicitly. missing_libatomic_ops=false AS_IF([test x"$with_libatomic_ops" != xno -a x"$with_libatomic_ops" != xnone], - [ PKG_CHECK_MODULES([ATOMIC_OPS], [atomic_ops], [], - [ missing_libatomic_ops=true ]) ]) + [ missing_libatomic_ops=true ]) + +# Note: "syntax error near unexpected token ATOMIC_OPS" reported by configure +# means Autotools pkg.m4 file was not found during aclocal.m4 generation; +# in this case, most probably, you should run pkg-config once before running +# autogen.sh (autoreconf); alternatively, comment out the following 3 lines. +AS_IF([test x$missing_libatomic_ops = xtrue], + [ PKG_CHECK_MODULES([ATOMIC_OPS], [atomic_ops], + [ missing_libatomic_ops=false ]) ]) + # Retry with AC_CHECK_HEADER if PKG_CHECK_MODULES failed. AS_IF([test x$missing_libatomic_ops = xtrue], [ AC_CHECK_HEADER([atomic_ops.h], [missing_libatomic_ops=false]) ])