diff options
author | Peter Trommler <ptrommler@acm.org> | 2013-09-24 13:44:54 +0200 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2013-09-29 09:51:33 -0500 |
commit | 996bd23fe75ec7be9533a040abf3d5e6035e8e0c (patch) | |
tree | 78fa1040b910e27e4161baf8c41fb5a6f2c8fa63 | |
parent | 0d91c0a0a07fa40ec7911bf1833062786093dea3 (diff) |
Fix library detection of shm* on openSUSE (#8350)
Use the new AC_SERACH_LIBS to check if rt is needed for shm_open
and shm_unlink. This sets LIBS and so the shm_* functions
can be found if librt is indeed required. Passing -lrt through
CFLAGS is not portable.
Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r-- | configure.ac | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index e5c2c07..f295061 100644 --- a/configure.ac +++ b/configure.ac @@ -62,10 +62,9 @@ AC_CHECK_FUNCS([lutimes futimes]) AC_CHECK_FUNCS([mkstemps mkdtemp]) # Avoid adding rt if absent or unneeded -AC_CHECK_LIB(rt, shm_open, [EXTRA_LIBS="$EXTRA_LIBS rt" CFLAGS="$CFLAGS -lrt"]) - -# needs -lrt on linux -AC_CHECK_FUNCS([shm_open shm_unlink]) +# shm_open needs -lrt on linux +AC_SEARCH_LIBS(shm_open, rt, [AC_CHECK_FUNCS([shm_open shm_unlink])]) +AS_IF([test "x$ac_cv_search_shm_open" = x-lrt], [EXTRA_LIBS="$EXTRA_LIBS rt"]) FP_CHECK_CONSTS([SIGABRT SIGALRM SIGBUS SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIGPOLL SIGPROF SIGSYS SIGTRAP SIGURG SIGVTALRM SIGXCPU SIGXFSZ SIG_BLOCK SIG_SETMASK SIG_UNBLOCK], [ #if HAVE_SIGNAL_H |