From 2a0c411c4487176d2bed03fc58ec79324ae6ea21 Mon Sep 17 00:00:00 2001 From: Akira Date: Sat, 14 Dec 2013 20:41:59 +0900 Subject: [PATCH] Change build settings for glic prior to version 2.17. --- Makefile | 2 +- configure | 45 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34098b9..ea9aaaf 100644 --- a/Makefile +++ b/Makefile @@ -94,7 +94,7 @@ srcdir = . CC = gcc DEFS = -DHAVE_CONFIG_H -LIBS = -lz -lssl -lsqlite3 -lpthread -lncursesw -lm -lgdbm_compat -ldl -lcrypto +LIBS = -lrt -lz -lssl -lsqlite3 -lpthread -lncursesw -lm -lgdbm_compat -ldl -lcrypto INCLUDES = -I/usr/include/gdbm -I${INC_DIR} OBJ_DIR = ./obj GEN_DIR = ./gen diff --git a/configure b/configure index 65fc8aa..d0f18fa 100755 --- a/configure +++ b/configure @@ -3512,6 +3512,51 @@ _ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +$as_echo_n "checking for clock_gettime in -lrt... " >&6; } +if ${ac_cv_lib_rt_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_clock_gettime=yes +else + ac_cv_lib_rt_clock_gettime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBRT 1 +_ACEOF + + LIBS="-lrt $LIBS" + +fi + # Checks for header files. ac_ext=c diff --git a/configure.ac b/configure.ac index 501bcb4..5e77e16 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,7 @@ AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([sqlite3], [sqlite3_initialize]) AC_CHECK_LIB([ssl], [SSL_library_init]) AC_CHECK_LIB([z], [inflate]) +AC_CHECK_LIB([rt], [clock_gettime]) # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h locale.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h wchar.h ndbm.h gdbm-ndbm.h]) -- 2.11.0