build: link against libatomic if necessary

refs #5100

Change-Id: Ida51c0830d3f0ce5ea949745b879a65b3e446111
diff --git a/wscript b/wscript
index b1b0129..f8c818e 100644
--- a/wscript
+++ b/wscript
@@ -82,6 +82,8 @@
 
     conf.find_program('sh', var='SH')
 
+    conf.check_cxx(lib='atomic', uselib_store='ATOMIC', define_name='HAVE_ATOMIC', mandatory=False)
+
     conf.check_cxx(lib='pthread', uselib_store='PTHREAD', define_name='HAVE_PTHREAD', mandatory=False)
     conf.check_cxx(lib='rt', uselib_store='RT', define_name='HAVE_RT', mandatory=False)
     conf.check_cxx(msg='Checking for function getpass', define_name='HAVE_GETPASS', mandatory=False,
@@ -189,7 +191,7 @@
                                        'ndn-cxx/**/*-sqlite3.cpp']),
         features='pch',
         headers='ndn-cxx/impl/common-pch.hpp',
-        use='ndn-cxx-mm-objects version BOOST OPENSSL SQLITE3 RT PTHREAD',
+        use='ndn-cxx-mm-objects version BOOST OPENSSL SQLITE3 ATOMIC RT PTHREAD',
         includes='.',
         export_includes='.',
         install_path='${LIBDIR}')