Rafael, thanks!
Updated diff attached.

On 04/15, Rafael Sadowski wrote:
> PLIST update is required!
> 
> $ ls -la /usr/local/lib/qt4/mkspecs/
> lrwxr-xr-x    1 root  wheel    13 Apr 15 12:56 default -> openbsd-clang
> 
> Otherwise Qt4 builds fine with clang6

-- 
With best regards,
Pavel Korovin
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/qt4/Makefile,v
retrieving revision 1.151
diff -u -p -r1.151 Makefile
--- Makefile    20 Jan 2018 14:03:39 -0000      1.151
+++ Makefile    15 Apr 2018 12:55:23 -0000
@@ -25,13 +25,13 @@ PKGNAME-main =              qt4-${PKGVERSION}
 PKGNAME-debug =                qt4-debug-${PKGVERSION}
 FULLPKGNAME-html =     qt4-html-${PKGVERSION}
 FULLPKGPATH-html =     ${BASE_PKGPATH},-html
-REVISION-main =                14
-REVISION-mysql =       2
-REVISION-postgresql =  2
-REVISION-sqlite2 =     2
-REVISION-tds =         2
-REVISION-debug =       1
-REVISION-examples =    3
+REVISION-main =                15
+REVISION-mysql =       3
+REVISION-postgresql =  3
+REVISION-sqlite2 =     3
+REVISION-tds =         3
+REVISION-debug =       2
+REVISION-examples =    4
 REVISION-html =                0
 
 # XXX qmake include parser is bogus
@@ -119,7 +119,6 @@ CONFIGURE_ARGS +=   -I${LOCALBASE}/include
 CONFIGURE_ARGS +=      -I${LOCALBASE}/include/postgresql \
                        -I${LOCALBASE}/include/postgresql/server \
                        -plugin-sql-psql
-CONFIGURE_ARGS +=      -platform openbsd-g++4
 
 # XXX make sure those libraries gets written to libQtGui.la
 QMAKE_LIBS_GUI =       freetype SM ICE Xi Xrender Xinerama fontconfig Xext X11
@@ -242,8 +241,16 @@ MAKE_FLAGS +=      LIB$l_VERSION=$v
 
 DESTDIRNAME =  INSTALL_ROOT
 
+.include <bsd.port.arch.mk>
+.if ${PROPERTIES:Mclang}
+CONFIGURE_ARGS +=      -platform openbsd-clang
+.else
+CONFIGURE_ARGS +=      -platform openbsd-g++4
+.endif
+
 pre-patch:
        cd ${WRKDIST} && cp -R mkspecs/openbsd-g++ mkspecs/openbsd-g++4
+       cd ${WRKDIST} && cp -R mkspecs/openbsd-g++ mkspecs/openbsd-clang
 
 post-build:
 .for l v in ${SHARED_LIBS}
Index: patches/patch-mkspecs_openbsd-clang_qmake_conf
===================================================================
RCS file: patches/patch-mkspecs_openbsd-clang_qmake_conf
diff -N patches/patch-mkspecs_openbsd-clang_qmake_conf
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mkspecs_openbsd-clang_qmake_conf      15 Apr 2018 12:55:23 
-0000
@@ -0,0 +1,77 @@
+$OpenBSD$
+
+Index: mkspecs/openbsd-clang/qmake.conf
+--- mkspecs/openbsd-clang/qmake.conf.orig
++++ mkspecs/openbsd-clang/qmake.conf
+@@ -8,47 +8,48 @@ TEMPLATE             = app
+ CONFIG                        += qt warn_on release link_prl gdb_dwarf_index
+ QT                    += core gui
+ 
+-QMAKE_CC              = gcc
++QMAKE_OPENBSD_SHLIBS    = 1
++QMAKE_CC              = cc
+ QMAKE_LEX             = flex
+ QMAKE_LEXFLAGS                =
+ QMAKE_YACC            = yacc
+ QMAKE_YACCFLAGS               = -d
+-QMAKE_CFLAGS          = -pipe
++QMAKE_CFLAGS          = -pipe -O2 -fno-wrapv $(COPTS)
+ QMAKE_CFLAGS_DEPS     = -M
+ QMAKE_CFLAGS_WARN_ON  = -Wall -W
+ QMAKE_CFLAGS_WARN_OFF = -w
+-QMAKE_CFLAGS_RELEASE  = -O2
++QMAKE_CFLAGS_RELEASE  = -O2 -fno-wrapv $(COPTS)
+ QMAKE_CFLAGS_DEBUG    = -g
+ QMAKE_CFLAGS_SHLIB    = -fPIC
+ QMAKE_CFLAGS_STATIC_LIB       = $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CFLAGS_YACC     = -Wno-unused -Wno-parentheses
+ QMAKE_CFLAGS_THREAD   = -pthread
+ 
+-QMAKE_CXX             = g++
+-QMAKE_CXXFLAGS                = $$QMAKE_CFLAGS
++QMAKE_CXX             = c++
++QMAKE_CXXFLAGS                = -std=c++03 $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS   = $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON        = $$QMAKE_CFLAGS_WARN_ON
+ QMAKE_CXXFLAGS_WARN_OFF       = $$QMAKE_CFLAGS_WARN_OFF
+-QMAKE_CXXFLAGS_RELEASE        = $$QMAKE_CFLAGS_RELEASE
++QMAKE_CXXFLAGS_RELEASE        = -std=c++03 $$QMAKE_CFLAGS_RELEASE
+ QMAKE_CXXFLAGS_DEBUG  = $$QMAKE_CFLAGS_DEBUG
+ QMAKE_CXXFLAGS_SHLIB  = $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB
+ QMAKE_CXXFLAGS_YACC   = $$QMAKE_CFLAGS_YACC
+ QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+ 
+-QMAKE_INCDIR          = /usr/local/include
+-QMAKE_LIBDIR          = /usr/local/lib
+-QMAKE_INCDIR_X11      = /usr/X11R6/include
+-QMAKE_LIBDIR_X11      = /usr/X11R6/lib
++QMAKE_INCDIR          = $(LOCALBASE)/include
++QMAKE_LIBDIR          = $(LOCALBASE)/lib
++QMAKE_INCDIR_X11      = $(X11BASE)/include
++QMAKE_LIBDIR_X11      = $(X11BASE)/lib
+ QMAKE_INCDIR_QT               = $$[QT_INSTALL_HEADERS]
+ QMAKE_LIBDIR_QT               = $$[QT_INSTALL_LIBS]
+ QMAKE_INCDIR_OPENGL   = /usr/X11R6/include
+ QMAKE_LIBDIR_OPENGL   = /usr/X11R6/lib
+ 
+-QMAKE_LINK            = g++
+-QMAKE_LINK_SHLIB      = g++
+-QMAKE_LINK_C          = gcc
+-QMAKE_LINK_C_SHLIB    = gcc
++QMAKE_LINK            = c++
++QMAKE_LINK_SHLIB      = c++
++QMAKE_LINK_C          = cc
++QMAKE_LINK_C_SHLIB    = cc
+ QMAKE_LINK_SHLIB_CMD  = $$QMAKE_LINK_SHLIB $(LFLAGS) \
+       $$QMAKE_CFLAGS_SHLIB $$QMAKE_LFLAGS \
+       -o $(TARGETD) $(OBJECTS) $(OBJMOC) $(LIBS)
+@@ -57,7 +58,7 @@ QMAKE_LFLAGS_RELEASE =
+ QMAKE_LFLAGS_DEBUG    =
+ QMAKE_LFLAGS_SHLIB    = -shared
+ QMAKE_LFLAGS_PLUGIN   = $$QMAKE_LFLAGS_SHLIB
+-QMAKE_LFLAGS_SONAME   = -Wl,-soname,
++QMAKE_LFLAGS_SONAME   = 
+ QMAKE_LFLAGS_THREAD   = -pthread
+ QMAKE_LFLAGS_NOUNDEF  = -Wl,-no_unresolved
+ 
Index: patches/patch-mkspecs_openbsd-clang_qplatformdefs_h
===================================================================
RCS file: patches/patch-mkspecs_openbsd-clang_qplatformdefs_h
diff -N patches/patch-mkspecs_openbsd-clang_qplatformdefs_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-mkspecs_openbsd-clang_qplatformdefs_h 15 Apr 2018 12:55:23 
-0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+
+Index: mkspecs/openbsd-clang/qplatformdefs.h
+--- mkspecs/openbsd-clang/qplatformdefs.h.orig
++++ mkspecs/openbsd-clang/qplatformdefs.h
+@@ -108,4 +108,5 @@
+ #define QT_AOUT_UNDERSCORE
+ #endif
+ 
++#define QT_GCC4_ATOMICS
+ #endif // QPLATFORMDEFS_H
Index: pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/x11/qt4/pkg/PLIST-main,v
retrieving revision 1.35
diff -u -p -r1.35 PLIST-main
--- pkg/PLIST-main      16 Sep 2015 07:13:02 -0000      1.35
+++ pkg/PLIST-main      15 Apr 2018 12:55:24 -0000
@@ -3621,6 +3621,11 @@ lib/qt4/mkspecs/modules/qt_webkit_versio
 lib/qt4/mkspecs/netbsd-g++/
 lib/qt4/mkspecs/netbsd-g++/qmake.conf
 lib/qt4/mkspecs/netbsd-g++/qplatformdefs.h
+lib/qt4/mkspecs/openbsd-clang/
+lib/qt4/mkspecs/openbsd-clang/qmake.conf
+@comment lib/qt4/mkspecs/openbsd-clang/qmake.conf.orig
+lib/qt4/mkspecs/openbsd-clang/qplatformdefs.h
+@comment lib/qt4/mkspecs/openbsd-clang/qplatformdefs.h.orig
 lib/qt4/mkspecs/openbsd-g++/
 lib/qt4/mkspecs/openbsd-g++/qmake.conf
 @comment lib/qt4/mkspecs/openbsd-g++/qmake.conf.orig

Reply via email to