[commit: packages/unix] master: Fix library detection of shm* on openSUSE (#8350) (996bd23)

git at git.haskell.org git at git.haskell.org
Mon Sep 30 00:24:48 CEST 2013


Repository : ssh://git@git.haskell.org/unix

On branch  : master
Link       : http://git.haskell.org/packages/unix.git/commitdiff/996bd23fe75ec7be9533a040abf3d5e6035e8e0c

>---------------------------------------------------------------

commit 996bd23fe75ec7be9533a040abf3d5e6035e8e0c
Author: Peter Trommler <ptrommler at acm.org>
Date:   Tue Sep 24 13:44:54 2013 +0200

    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 at well-typed.com>


>---------------------------------------------------------------

996bd23fe75ec7be9533a040abf3d5e6035e8e0c
 configure.ac |    7 +++----
 1 file 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




More information about the ghc-commits mailing list