Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Aug 2014 23:52:56 +0000 (UTC)
From:      Juergen Lock <nox@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r364486 - in head/multimedia/vdr-plugin-softhddevice: . files
Message-ID:  <53e6b458.2a2e.589fec9d@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nox
Date: Sat Aug  9 23:52:55 2014
New Revision: 364486
URL: http://svnweb.freebsd.org/changeset/ports/364486
QAT: https://qat.redports.org/buildarchive/r364486/

Log:
  Bandaid fix after alsa update until I get to update the vdr ports properly.
  
  Reported by:	antoine

Added:
  head/multimedia/vdr-plugin-softhddevice/files/iatomic.h   (contents, props changed)
Modified:
  head/multimedia/vdr-plugin-softhddevice/Makefile

Modified: head/multimedia/vdr-plugin-softhddevice/Makefile
==============================================================================
--- head/multimedia/vdr-plugin-softhddevice/Makefile	Sat Aug  9 23:32:46 2014	(r364485)
+++ head/multimedia/vdr-plugin-softhddevice/Makefile	Sat Aug  9 23:52:55 2014	(r364486)
@@ -16,7 +16,7 @@ LIB_DEPENDS+=	libavcodec0.so:${PORTSDIR}
 		libxcb-keysyms.so:${PORTSDIR}/x11/xcb-util-keysyms \
 		libasound.so:${PORTSDIR}/audio/alsa-lib
 
-USES=		pkgconfig tar:tgz
+USES=		compiler:features pkgconfig tar:tgz
 USE_XORG+=	xv x11 xcb xinerama
 USE_GL+=	gl glu
 PATCH_STRIP=	-p1
@@ -33,17 +33,25 @@ WRKSRC=		${WRKDIR}/${PLUGIN}-${PORTVERSI
 OPTIONS_DEFINE=	VAAPI DOCS NLS
 VAAPI_DESC=	Enable vaapi support (experimental)
 
-.include <bsd.port.options.mk>
+.include <bsd.port.pre.mk>
 
 .if ${PORT_OPTIONS:MVAAPI}
 LIB_DEPENDS+=	libva.so:${PORTSDIR}/multimedia/libva
 CONFIG+= 	-DUSE_VAAPI
 .endif
 
+.if !(${COMPILER_TYPE} == clang)
+USE_GCC=	yes
+.endif
+
 post-patch: post-patch-plugin
 	@${REINPLACE_CMD} \
 		-e 's,libavcodec,libavcodec0,g' \
 		${WRKSRC}/Makefile
+	@${CP} ${FILESDIR}/iatomic.h ${WRKSRC}
+	@${REINPLACE_CMD} \
+		-e 's,<alsa/iatomic.h>,"iatomic.h",' \
+		${WRKSRC}/*.c ${WRKSRC}/*.cpp
 
 pre-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/lib/vdr
@@ -54,4 +62,4 @@ post-install: post-install-pluginlocales
 	(cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Added: head/multimedia/vdr-plugin-softhddevice/files/iatomic.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/vdr-plugin-softhddevice/files/iatomic.h	Sat Aug  9 23:52:55 2014	(r364486)
@@ -0,0 +1,97 @@
+///
+///	@file iatomic.h @brief Misc function header file
+///
+///	Copyright (c) 2014 by Johns.  All Rights Reserved.
+///
+///	Contributor(s):
+///
+///	License: AGPLv3
+///
+///	This program is free software: you can redistribute it and/or modify
+///	it under the terms of the GNU Affero General Public License as
+///	published by the Free Software Foundation, either version 3 of the
+///	License.
+///
+///	This program is distributed in the hope that it will be useful,
+///	but WITHOUT ANY WARRANTY; without even the implied warranty of
+///	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+///	GNU Affero General Public License for more details.
+///
+///	$Id$
+//////////////////////////////////////////////////////////////////////////////
+
+/// @addtogroup iatomic
+/// @{
+
+#define GCC_VERSION (__GNUC__ * 10000 \
+	+ __GNUC_MINOR__ * 100 \
+	+ __GNUC_PATCHLEVEL__)
+
+//	gcc before 4.7 didn't support atomic builtins,
+//	use alsa atomic functions.
+#if 0 // GCC_VERSION < 40700
+
+#include <alsa/iatomic.h>
+
+#else
+
+//////////////////////////////////////////////////////////////////////////////
+//	Defines
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//	Declares
+//////////////////////////////////////////////////////////////////////////////
+
+///
+///	atomic type, 24 bit useable,
+///
+typedef volatile int atomic_t;
+
+//////////////////////////////////////////////////////////////////////////////
+//	Prototypes
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+//	Inlines
+//////////////////////////////////////////////////////////////////////////////
+
+///
+///	Set atomic value.
+///
+#define atomic_set(ptr, val) \
+    __atomic_store_n(ptr, val, __ATOMIC_SEQ_CST)
+
+///
+///	Read atomic value.
+///
+#define atomic_read(ptr) \
+    __atomic_load_n(ptr, __ATOMIC_SEQ_CST)
+
+///
+///	Increment atomic value.
+///
+#define atomic_inc(ptr) \
+    __atomic_add_fetch(ptr, 1, __ATOMIC_SEQ_CST)
+
+///
+///	Decrement atomic value.
+///
+#define atomic_dec(ptr) \
+    __atomic_sub_fetch(ptr, 1, __ATOMIC_SEQ_CST)
+
+///
+///	Add to atomic value.
+///
+#define atomic_add(val, ptr) \
+    __atomic_add_fetch(ptr, val, __ATOMIC_SEQ_CST)
+
+///
+///	Subtract from atomic value.
+///
+#define atomic_sub(val, ptr) \
+    __atomic_sub_fetch(ptr, val, __ATOMIC_SEQ_CST)
+
+#endif
+
+/// @}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53e6b458.2a2e.589fec9d>