Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2023 11:41:04 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 967c8049e17b - main - multimedia/smpeg: fix build with clang 16
Message-ID:  <202305181141.34IBf43h086757@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=967c8049e17b6612c53b0232c8f19358ddd6a272

commit 967c8049e17b6612c53b0232c8f19358ddd6a272
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-10 19:02:32 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 11:34:31 +0000

    multimedia/smpeg: fix build with clang 16
    
    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because multimedia/smpeg's configure scripts and Makefiles do not
    explicitly set the C++ standard, this leads to several errors:
    
      In file included from MPEGaudio.cpp:24:
      ../MPEGaudio.h:129:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
            register int r=(buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
            ^~~~~~~~~
      ../MPEGaudio.h:135:7: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
            register unsigned short a;
            ^~~~~~~~~
      MPEGaudio.cpp:317:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register int r=(_buffer[bitindex>>3]>>(7-(bitindex&7)))&1;
        ^~~~~~~~~
      MPEGaudio.cpp:326:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register unsigned short a;
        ^~~~~~~~~
      MPEGaudio.cpp:339:3: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
        register unsigned short a;
        ^~~~~~~~~
    
    Because smpeg uses a rather strange configure script, it does not
    process CXXFLAGS correctly, so set CXX to include -std=gnu++98.
    
    Also remove the REAL_CC patch which is no longer necessary.
    
    PR:             271353
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2
---
 multimedia/smpeg/Makefile              | 4 ++--
 multimedia/smpeg/files/patch-configure | 8 --------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/multimedia/smpeg/Makefile b/multimedia/smpeg/Makefile
index c6652510a7cb..5a031bcebe42 100644
--- a/multimedia/smpeg/Makefile
+++ b/multimedia/smpeg/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	smpeg
 PORTVERSION=	0.4.4
-PORTREVISION=	16
+PORTREVISION=	17
 CATEGORIES=	multimedia
 MASTER_SITES=	GENTOO
 
@@ -17,7 +17,7 @@ USE_LDCONFIG=	yes
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	GLBASE="${LOCALBASE}" \
-		CC="${CXX}" REAL_CC="${CC}" \
+		CC="${CC}" CXX="${CXX} -std=gnu++98" \
 		SDL_CONFIG="${SDL_CONFIG}"
 #If you want to try the opengl/gtk player (which doesn't seem to work)
 #comment out the following line.
diff --git a/multimedia/smpeg/files/patch-configure b/multimedia/smpeg/files/patch-configure
index d50e0a35b262..a433c14ea052 100644
--- a/multimedia/smpeg/files/patch-configure
+++ b/multimedia/smpeg/files/patch-configure
@@ -9,11 +9,3 @@
  EOF
  if { (eval echo configure:1061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    ac_cv_prog_cc_works=yes
-@@ -2335,6 +2332,7 @@ rm -f conftest*
- 
- CFLAGS="$CFLAGS $SDL_CFLAGS"
- LIBS="$LIBS $SDL_LIBS"
-+CC="$REAL_CC"
- 
- echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
- echo "configure:2341: checking for sqrt in -lm" >&5



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305181141.34IBf43h086757>