Index: audio/alsa-lib/Makefile =================================================================== --- audio/alsa-lib/Makefile +++ audio/alsa-lib/Makefile @@ -22,6 +22,7 @@ TEST_ENV= ${MAKE_ENV} ALSA_CONFIG_PATH="${FILESDIR}/asound.conf.sample" TEST_TARGET= check CPPFLAGS+= -I${FILESDIR} +CPPFLAGS+= -D_WANT_SEMUN OPTIONS_DEFINE= PYTHON OPTIONS_SUB= yes Index: audio/gramofile/Makefile =================================================================== --- audio/gramofile/Makefile +++ audio/gramofile/Makefile @@ -22,6 +22,7 @@ MAKE_ARGS= CC="${CC}" \ CXX="${CXX}" \ PERLCOREDIR=${PERLCOREDIR} +CFLAGS+= -D_WANT_SEMUN PERLCOREDIR= ${LOCALBASE}/lib/perl5/${PERL_VER}/${PERL_ARCH}/CORE Index: audio/wavplay/Makefile =================================================================== --- audio/wavplay/Makefile +++ audio/wavplay/Makefile @@ -13,6 +13,8 @@ LICENSE= GPLv2 # only LICENSE_FILE= ${WRKSRC}/COPYING +CFLAGS+= -D_WANT_SEMUN + ONLY_FOR_ARCHS= amd64 armv6 armv7 i386 INSTALL_TARGET= install PREFIX="${STAGEDIR}${PREFIX}" Index: audio/xmcd/Makefile =================================================================== --- audio/xmcd/Makefile +++ audio/xmcd/Makefile @@ -20,6 +20,8 @@ SUB_FILES= pkg-message PKGMESSAGE= ${WRKDIR}/pkg-message +CFLAGS+= -D_WANT_SEMUN + LIBBINDIR= ${STAGEDIR}${PREFIX}/lib/X11/xmcd/bin-${OPSYS}_${OSREL:R:R}-${ARCH} BROKEN_aarch64= Fails to compile: many undefined symbols in xorg.cf Index: audio/zinf/Makefile =================================================================== --- audio/zinf/Makefile +++ audio/zinf/Makefile @@ -20,6 +20,7 @@ --disable-arts CPPFLAGS+= -I${LOCALBASE}/include +CPPFLAGS+= -D_WANT_SEMUN LDFLAGS+= -lpthread -L${LOCALBASE}/lib OPTIONS_DEFINE= ESOUND VORBIS Index: benchmarks/super-smack/Makefile =================================================================== --- benchmarks/super-smack/Makefile +++ benchmarks/super-smack/Makefile @@ -15,6 +15,7 @@ GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-smacks-dir=${DATADIR} MAKE_JOBS_UNSAFE= yes +CPPFLAGS+= -D_WANT_SEMUN PORTDOCS= CHANGES README MANUAL TUTORIAL Index: databases/fastdb/Makefile =================================================================== --- databases/fastdb/Makefile +++ databases/fastdb/Makefile @@ -22,6 +22,7 @@ MAKEFILE= makefile USE_LDCONFIG= yes DOS2UNIX_FILES= ${MAKEFILE} +CXXFLAGS+= -D_WANT_SEMUN PORTDOCS= FastDB.htm Index: devel/ace/Makefile =================================================================== --- devel/ace/Makefile +++ devel/ace/Makefile @@ -27,6 +27,7 @@ USE_LDCONFIG= yes CPPFLAGS+= -I${LOCALBASE}/include +CPPFLAGS+= -D_WANT_SEMUN LDFLAGS+= -L${LOCALBASE}/lib PLIST_SUB= VERSION="${PORTVERSION}" Index: devel/libmba/Makefile =================================================================== --- devel/libmba/Makefile +++ devel/libmba/Makefile @@ -14,6 +14,7 @@ MAKE_JOBS_UNSAFE= yes USE_LDCONFIG= yes MAKE_ARGS= prefix="${STAGEDIR}${PREFIX}" +CFLAGS+= -D_WANT_SEMUN post-patch: @${REINPLACE_CMD} -e 's,-g,$$(CFLAGS),' \ Index: devel/libshbuf/Makefile =================================================================== --- devel/libshbuf/Makefile +++ devel/libshbuf/Makefile @@ -16,5 +16,6 @@ GNU_CONFIGURE= yes CONFIGURE_ARGS+=--disable-lynx --disable-doxygen INSTALL_TARGET= install-strip +CFLAGS+= -D_WANT_SEMUN .include Index: devel/nspr/Makefile =================================================================== --- devel/nspr/Makefile +++ devel/nspr/Makefile @@ -18,6 +18,7 @@ WRKSRC_SUBDIR= nspr GNU_CONFIGURE= yes USE_LDCONFIG= yes +CFLAGS+= -D_WANT_SEMUN OPTIONS_DEFINE= DEBUG TEST Index: devel/poco-ssl/Makefile =================================================================== --- devel/poco-ssl/Makefile +++ devel/poco-ssl/Makefile @@ -22,6 +22,7 @@ HAS_CONFIGURE= yes CONFIGURE_ARGS= --prefix=${PREFIX} --config=FreeBSD USE_LDCONFIG= yes +CXXFLAGS+= -D_WANT_SEMUN OPTIONS_DEFINE= TEST SAMPLES MYSQL SQLITE ODBC OPTIONS_DEFAULT=MYSQL SQLITE Index: devel/shmap/Makefile =================================================================== --- devel/shmap/Makefile +++ devel/shmap/Makefile @@ -17,6 +17,7 @@ CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib USE_LDCONFIG= yes +CPPFLAGS+= -D_WANT_SEMUN post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libshmap.so Index: emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c =================================================================== --- /dev/null +++ emulators/virtualbox-ose/files/patch-src_libs_xpcom18a4_nsprpub_pr_src_pthreads_ptsynch.c @@ -0,0 +1,22 @@ +--- src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c.orig ++++ src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c +@@ -49,6 +49,9 @@ + #include + #include + #include ++#ifdef FREEBSD ++#include ++#endif + + static pthread_mutexattr_t _pt_mattr; + static pthread_condattr_t _pt_cvar_attr; +@@ -798,7 +801,8 @@ + * From the semctl(2) man page in glibc 2.0 + */ + #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \ +- || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) ++ || (defined(FREEBSD) && __FreeBSD_version < 1200056) \ ++ || defined(OPENBSD) || defined(BSDI) + /* union semun is defined by including */ + #else + /* according to X/OPEN we have to define it ourselves */ Index: ftp/gftp/Makefile =================================================================== --- ftp/gftp/Makefile +++ ftp/gftp/Makefile @@ -15,6 +15,7 @@ USES= pathfix pkgconfig tar:bzip2 ssl GNU_CONFIGURE= yes USE_GNOME= glib20 gtk20 +CFLAGS+= -D_WANT_SEMUN OPTIONS_DEFINE= NLS OPTIONS_SUB= yes Index: lang/cint/files/patch-cint_lib_ipc_ipcif.h =================================================================== --- /dev/null +++ lang/cint/files/patch-cint_lib_ipc_ipcif.h @@ -0,0 +1,20 @@ +--- cint/lib/ipc/ipcif.h.orig ++++ cint/lib/ipc/ipcif.h +@@ -28,13 +28,16 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #if defined(G__APPLE) || defined(__APPLE__) + /* union semun is defined by including */ + #elif defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) + /* union semun is defined by including */ + #else + /* according to X/OPEN we have to define it ourselves */ +-#if !defined(__FreeBSD__) && !defined(__KCC) && !defined(__sgi) ++#if (!defined(__FreeBSD__) || __FreeBSD_version >= 1200056) && !defined(__KCC) && !defined(__sgi) + union semun { + int val; /* value for SETVAL */ + struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */ Index: lang/ferite/Makefile =================================================================== --- lang/ferite/Makefile +++ lang/ferite/Makefile @@ -23,6 +23,7 @@ USE_LDCONFIG= yes PLIST_SUB= MACHINE_ARCH=${MACHINE_ARCH} INSTALL_TARGET= install-strip +CFLAGS+= -D_WANT_SEMUN PORTDOCS= * Index: lang/rexx-regutil/Makefile =================================================================== --- lang/rexx-regutil/Makefile +++ lang/rexx-regutil/Makefile @@ -24,6 +24,7 @@ LLD_UNSAFE= yes # lld lacks built-in search paths MAKEFILE= Makefile.bsd MAKE_ARGS+= PLIBS="${LDFLAGS:M-L*} -lncurses" +CFLAGS+= -D_WANT_SEMUN SUB_FILES= regutil.1 Index: mail/batv-milter/Makefile =================================================================== --- mail/batv-milter/Makefile +++ mail/batv-milter/Makefile @@ -18,6 +18,7 @@ USE_RC_SUBR= milter-batv MAKE_ARGS= UBINOWN=${UID} UBINGRP=${GID} +CFLAGS+= -D_WANT_SEMUN WCONF= ${WRKSRC}/devtools/Site PLIST_FILES= bin/batv-filter man/man8/batv-filter.8.gz Index: mail/batv-milter/files/patch-include_sm_os_sm__os__freebsd.h =================================================================== --- /dev/null +++ mail/batv-milter/files/patch-include_sm_os_sm__os__freebsd.h @@ -0,0 +1,14 @@ +--- include/sm/os/sm_os_freebsd.h.orig ++++ include/sm/os/sm_os_freebsd.h +@@ -34,7 +34,11 @@ + # define SM_CONF_SHM 1 + #endif /* SM_CONF_SHM */ + #ifndef SM_CONF_SEM ++#if __FreeBSD_version < 1200056 + # define SM_CONF_SEM 1 ++#else ++# define SM_CONF_SEM 2 ++#endif + #endif /* SM_CONF_SEM */ + #ifndef SM_CONF_MSG + # define SM_CONF_MSG 1 Index: mail/dk-milter/files/patch-include_sm_os_sm__os__freebsd.h =================================================================== --- /dev/null +++ mail/dk-milter/files/patch-include_sm_os_sm__os__freebsd.h @@ -0,0 +1,14 @@ +--- include/sm/os/sm_os_freebsd.h.orig ++++ include/sm/os/sm_os_freebsd.h +@@ -34,7 +34,11 @@ + # define SM_CONF_SHM 1 + #endif /* SM_CONF_SHM */ + #ifndef SM_CONF_SEM ++#if __FreeBSD_version < 1200056 + # define SM_CONF_SEM 1 ++#else ++# define SM_CONF_SEM 2 ++#endif + #endif /* SM_CONF_SEM */ + #ifndef SM_CONF_MSG + # define SM_CONF_MSG 1 Index: mail/sendmail/files/patch-include_sm_os_sm__os__freebsd.h =================================================================== --- /dev/null +++ mail/sendmail/files/patch-include_sm_os_sm__os__freebsd.h @@ -0,0 +1,14 @@ +--- include/sm/os/sm_os_freebsd.h.orig ++++ include/sm/os/sm_os_freebsd.h +@@ -34,7 +34,11 @@ + # define SM_CONF_SHM 1 + #endif /* SM_CONF_SHM */ + #ifndef SM_CONF_SEM ++#if __FreeBSD_version < 1200056 + # define SM_CONF_SEM 1 ++#else ++# define SM_CONF_SEM 2 ++#endif + #endif /* SM_CONF_SEM */ + #ifndef SM_CONF_MSG + # define SM_CONF_MSG 1 Index: mail/sid-milter/files/patch-include_sm_os_sm__os__freebsd.h =================================================================== --- /dev/null +++ mail/sid-milter/files/patch-include_sm_os_sm__os__freebsd.h @@ -0,0 +1,14 @@ +--- include/sm/os/sm_os_freebsd.h.orig ++++ include/sm/os/sm_os_freebsd.h +@@ -34,7 +34,11 @@ + # define SM_CONF_SHM 1 + #endif /* SM_CONF_SHM */ + #ifndef SM_CONF_SEM ++#if __FreeBSD_version < 1200056 + # define SM_CONF_SEM 1 ++#else ++# define SM_CONF_SEM 2 ++#endif + #endif /* SM_CONF_SEM */ + #ifndef SM_CONF_MSG + # define SM_CONF_MSG 1 Index: misc/buffer/Makefile =================================================================== --- misc/buffer/Makefile +++ misc/buffer/Makefile @@ -13,6 +13,7 @@ USES= tar:tgz PLIST_FILES= bin/buffer \ man/man1/buffer.1.gz +CFLAGS+= -D_WANT_SEMUN post-patch: @${REINPLACE_CMD} -E \ Index: multimedia/py-kaa-base/Makefile =================================================================== --- multimedia/py-kaa-base/Makefile +++ multimedia/py-kaa-base/Makefile @@ -18,5 +18,6 @@ USES= python:2.7 USE_GNOME= glib20 USE_PYTHON= distutils autoplist +CFLAGS+= -D_WANT_SEMUN .include Index: net-mgmt/sdig/Makefile =================================================================== --- net-mgmt/sdig/Makefile +++ net-mgmt/sdig/Makefile @@ -15,6 +15,7 @@ USES= gmake GNU_CONFIGURE= yes +CFLAGS+= -D_WANT_SEMUN PLIST_FILES= bin/sdig etc/sdig.conf etc/mactable man/man5/sdig.conf.5.gz \ man/man8/sdig.8.gz Index: net-p2p/monero-cli/Makefile =================================================================== --- net-p2p/monero-cli/Makefile +++ net-p2p/monero-cli/Makefile @@ -30,6 +30,7 @@ USE_GITHUB= yes GH_ACCOUNT= monero-project GH_PROJECT= monero +CFLAGS+= -D_WANT_SEMUN OPTIONS_DEFINE= DOXYGEN DOXYGEN_BUILD_DEPENDS= dot:graphics/graphviz \ Index: sysutils/freeipmi/Makefile =================================================================== --- sysutils/freeipmi/Makefile +++ sysutils/freeipmi/Makefile @@ -36,6 +36,7 @@ GNU_CONFIGURE= yes USE_LDCONFIG= yes USES= gmake libtool localbase shebangfix +CFLAGS+= -D_WANT_SEMUN INFO= freeipmi-faq PLIST_SUB= CACHE_DIR=${CACHE_DIR} Index: sysutils/symon/Makefile =================================================================== --- sysutils/symon/Makefile +++ sysutils/symon/Makefile @@ -16,6 +16,7 @@ SHEBANG_FILES= client/getsymonitem.pl USE_PERL5= build MAKE_JOBS_UNSAFE= yes +CFLAGS+= -D_WANT_SEMUN USERS= _symon GROUPS= _symon Index: www/mod_cband/files/patch-src_mod__cband.c =================================================================== --- /dev/null +++ www/mod_cband/files/patch-src_mod__cband.c @@ -0,0 +1,27 @@ +--- src/mod_cband.c.orig ++++ src/mod_cband.c +@@ -56,6 +56,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #include + + #include "mod_cband.h" +@@ -74,6 +77,14 @@ + } + #endif + ++#if defined(__FreeBSD__) && __FreeBSD_version >= 1200056 ++union semun { ++ int val; /* value for SETVAL */ ++ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ ++ u_short *array; /* array for GETALL & SETALL */ ++}; ++#endif ++ + static mod_cband_config_header *config = NULL; + static const char mod_cband_filter_name[] = "CBAND_FILTER"; + ap_filter_rec_t *mod_cband_output_filter_handle;