Skip to content

Commit

Permalink
Check for clang || llvm-gcc, C Blocks and check for and use libdispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
jblache committed Sep 11, 2011
1 parent a6909a3 commit 586cc8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
17 changes: 16 additions & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AC_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(forked-daapd, 0.19)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CC([clang llvm-gcc])
AM_PROG_CC_C_O
LT_INIT([disable-static])

Expand Down Expand Up @@ -216,4 +216,19 @@ dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT

dnl Check for libdispatch, C Blocks support in libdispatch and C Blocks support in the compiler
AC_CHECK_HEADER(dispatch/dispatch.h, , AC_MSG_ERROR([dispatch/dispatch.h not found]))
AC_CHECK_LIB([dispatch], [dispatch_main], [LIBDISPATCH_LIBS="-ldispatch"], AC_MSG_ERROR([libdispatch not found]))
AC_CHECK_LIB([dispatch], [dispatch_after], [LIBDISPATCH_LIBS="-ldispatch"], AC_MSG_ERROR([libdispatch built without Blocks support]))
AC_SUBST(LIBDISPATCH_LIBS)

save_LIBS="$LIBS"
DISPATCH_C_BLOCKS
if test "x$have_cblocks" != xtrue; then
AC_MSG_ERROR([C compiler doesn't support C Blocks extension])
fi
CBLOCKS_LIBS="$LIBS"
AC_SUBST(CBLOCKS_LIBS)
LIBS="$save_LIBS"

AC_OUTPUT(src/Makefile sqlext/Makefile Makefile)
5 changes: 3 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ forked_daapd_CPPFLAGS = -D_GNU_SOURCE \
-DSTATEDIR="\"$(localstatedir)\"" -DPKGLIBDIR="\"$(pkglibdir)\"" \
@OSS4CPPFLAGS@

forked_daapd_CFLAGS = \
forked_daapd_CFLAGS = @CBLOCKS_FLAGS@ \
@ZLIB_CFLAGS@ @AVAHI_CFLAGS@ @SQLITE3_CFLAGS@ @LIBAV_CFLAGS@ \
@CONFUSE_CFLAGS@ @TAGLIB_CFLAGS@ @MINIXML_CFLAGS@ @LIBPLIST_CFLAGS@ \
@LIBGCRYPT_CFLAGS@ @GPG_ERROR_CFLAGS@ @ALSA_CFLAGS@
Expand All @@ -65,7 +65,8 @@ forked_daapd_LDADD = -lrt \
@ZLIB_LIBS@ @AVAHI_LIBS@ @SQLITE3_LIBS@ @LIBAV_LIBS@ \
@CONFUSE_LIBS@ @FLAC_LIBS@ @TAGLIB_LIBS@ @LIBEVENT_LIBS@ \
@LIBAVL_LIBS@ @MINIXML_LIBS@ @ANTLR3C_LIBS@ @LIBPLIST_LIBS@ \
@LIBGCRYPT_LIBS@ @GPG_ERROR_LIBS@ @ALSA_LIBS@ @LIBUNISTRING@
@LIBGCRYPT_LIBS@ @GPG_ERROR_LIBS@ @ALSA_LIBS@ @LIBUNISTRING@ \
@LIBDISPATCH_LIBS@ @CBLOCKS_LIBS@

forked_daapd_SOURCES = main.c \
db.c db.h \
Expand Down

0 comments on commit 586cc8e

Please sign in to comment.