File 0001-Fix-detection-of-library-for-shm-on-openSUSE.patch of Package ghc

From 235aedba6b68feecb3ec4c84dbf6a1d1e3e1965a Mon Sep 17 00:00:00 2001
From: Peter Trommler <ptrommler@acm.org>
Date: Tue, 24 Sep 2013 13:44:54 +0200
Subject: [PATCH] Fix detection of library for shm* on openSUSE.

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.
---
 configure.ac |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: ghc-7.6.3/libraries/unix/configure.ac
===================================================================
--- ghc-7.6.3.orig/libraries/unix/configure.ac
+++ ghc-7.6.3/libraries/unix/configure.ac
@@ -54,10 +54,9 @@ AC_CHECK_MEMBERS([struct stat.st_uctime]
 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])
+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