[squid-dev] [PATCH] Fix libatomic detection

Amos Jeffries squid3 at treenet.co.nz
Tue Jan 5 09:01:16 UTC 2016


On 5/01/2016 9:24 p.m., Kinkie wrote:
> Hi,
>   I haven't checked, but it should.
> MacOS builds for me right now; probably as a result of the LIBS
> side-effect (although I get a "none required" result).
> Attached patch fixes, build still failes due to shm not working at
> runtime (thus testRock failing), but for me it's a fix candidate.

This one matches the way AC_SEARCH_LIBS sets LIBS internally to cut off
a few more lines of logic.

Amos
-------------- next part --------------
=== modified file 'configure.ac'
--- configure.ac	2016-01-04 14:39:06 +0000
+++ configure.ac	2016-01-05 08:53:43 +0000
@@ -458,10 +458,11 @@
 fi
 
 ## check for atomics library before anything that might need it
-AC_SEARCH_LIBS([__atomic_load_8],[atomic])
-if test "x$ac_cv_search___atomic_load_8" = "-latomic"; then
-  ATOMICLIB="-latomic"
-fi
+# AC_SEARCH_LIBS pollutes LIBS
+SQUID_STATE_SAVE(LIBATOMIC)
+AC_SEARCH_LIBS([__atomic_load_8],[atomic],[
+  test "$ac_res" = "none required" || ATOMICLIB=$ac_res],[])
+SQUID_STATE_ROLLBACK(LIBATOMIC)
 AC_SUBST(ATOMICLIB)
 
 AC_SEARCH_LIBS([shm_open], [rt])



More information about the squid-dev mailing list