build: Fix missing -lrt for clock_gettime()
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Tue, 2 Oct 2012 14:57:54 +0000 (11:57 -0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 3 Oct 2012 08:22:52 +0000 (11:22 +0300)
librt is needed for using clock_gettime():

/usr/bin/ld: src/ntp.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5'
/usr/bin/ld: note: 'clock_gettime@@GLIBC_2.2.5' is defined in DSO /usr/lib/librt.so.1 so try adding it to the linker command line
/usr/lib/librt.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

Makefile.am

index 8693752..b05d4f0 100644 (file)
@@ -88,7 +88,7 @@ src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) $(gweb_sources) \
                        src/ippool.c src/bridge.c src/nat.c
 
 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
-                               @XTABLES_LIBS@ @GNUTLS_LIBS@ -lresolv -ldl
+                               @XTABLES_LIBS@ @GNUTLS_LIBS@ -lresolv -ldl -lrt
 
 src_connmand_LDFLAGS = -Wl,--export-dynamic \
                                -Wl,--version-script=$(srcdir)/src/connman.ver