[vlc-commits] [Git][videolan/vlc][master] 3 commits: configure: factorize qmake makefile patching

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed May 29 11:05:21 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
883e2309 by Pierre Lamot at 2024-05-29T10:37:01+00:00
configure: factorize qmake makefile patching

- - - - -
63647d8a by Pierre Lamot at 2024-05-29T10:37:01+00:00
configure: fix library path extracted from qmake

- - - - -
2d97c56a by Pierre Lamot at 2024-05-29T10:37:01+00:00
configure: extract LDFLAGS from qmake

- - - - -


2 changed files:

- configure.ac
- modules/gui/qt/Makefile.am


Changes:

=====================================
configure.ac
=====================================
@@ -4019,29 +4019,41 @@ AS_IF([test "${enable_qt}" != "no"], [
   QT_PKG_ERRORS=$(${QMAKE} ${srcdir}/modules/gui/qt/qt6.pro -o ${ac_pwd}/modules/gui/qt/qmake-qt 2>&1)
   ac_status=$?
   AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-qt],[
-      echo "get_cflags:"                    >> ${ac_pwd}/modules/gui/qt/qmake-qt
-      echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-qt
-      echo "get_libs:"                      >> ${ac_pwd}/modules/gui/qt/qmake-qt
-      echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-qt
+      echo "get_cflags:"                    > ${ac_pwd}/modules/gui/qt/qmake-common.mk
+      echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
+      echo "get_libs:"                      >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
+      dnl transform /foo/bar/libbaz.so arguments to -L/foo/bar -lbaz
+      dnl RS: each arguments (space separated) are treated as a new line
+      dnl FS: split fields using /[^/]* to extract the file basepath ($1)
+      dnl  /lib.*\.so/ lines (arguments) will add -Lxxx if this is not the current path (p), then transform into a -lxxx argument
+      dnl other arguments are kept as-is
+      echo '	echo $(LIBS) | awk '\''BEGIN{FS="/[[^/]]*$$";RS=" ";ORS=" "}{if($$0 ~ /\/lib.*\.so/){ if(p != $$1){ print "-L" $$1; p=$$1}; sub(/.*\/lib/, "-l"); sub(/\.so.*/, "")}; print $$0}'\' >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
+      echo 'get_ldflags:'                   >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
+      echo '	echo $(LFLAGS)'             >> ${ac_pwd}/modules/gui/qt/qmake-common.mk
+
+      echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"  >> ${ac_pwd}/modules/gui/qt/qmake-qt
+
       AC_MSG_RESULT([yes])
       QT_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_libs)
       QT_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_cflags)
+      QT_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-qt get_ldflags)
       AC_SUBST([QT_LIBS])
       AC_SUBST([QT_CFLAGS])
+      AC_SUBST([QT_LDFLAGS])
 
       AC_MSG_CHECKING([for Qt6WaylandClient])
       (${QMAKE} ${srcdir}/modules/gui/qt/wayland.pro -o ${ac_pwd}/modules/gui/qt/qmake-wayland) 2>/dev/null
       ac_status=$?
       AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-wayland],[
-        echo 'get_cflags:'                     >> ${ac_pwd}/modules/gui/qt/qmake-wayland
-        echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-wayland
-        echo 'get_libs:'                       >> ${ac_pwd}/modules/gui/qt/qmake-wayland
-        echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-wayland
+        echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"  >> ${ac_pwd}/modules/gui/qt/qmake-wayland
+
         AC_MSG_RESULT([yes])
         QT_WAYLAND_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-wayland get_libs)
         QT_WAYLAND_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-wayland get_cflags)
+        QT_WAYLAND_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-wayland get_ldflags)
         AC_SUBST([QT_WAYLAND_LIBS])
         AC_SUBST([QT_WAYLAND_CFLAGS])
+        AC_SUBST([QT_WAYLAND_LDFLAGS])
         have_qt_wayland="yes"
       ],[
         AC_MSG_RESULT([no])
@@ -4091,15 +4103,14 @@ AS_IF([test "${enable_qt}" != "no"], [
         --qtconf "${with_qtconf}" \
         --modules QtTest="" \
         >&AS_MESSAGE_FD ], [
-            echo 'get_cflags:'                     >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
-            echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
-            echo 'get_libs:'                       >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
-            echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
+            echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"        >> ${ac_pwd}/modules/gui/qt/qmake-quicktest
             AC_MSG_RESULT([yes])
             QT_QUICK_TEST_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_libs)
             QT_QUICK_TEST_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_cflags)
+            QT_QUICK_TEST_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-quicktest get_ldflags)
             AC_SUBST([QT_QUICK_TEST_LIBS])
             AC_SUBST([QT_QUICK_TEST_CFLAGS])
+            AC_SUBST([QT_QUICK_TEST_LDFLAGS])
             have_qt_quick_test="yes"
         ], [
             AC_MSG_RESULT([no])
@@ -4120,15 +4131,14 @@ AS_IF([test "${enable_qt}" != "no"], [
       (${QMAKE} ${srcdir}/modules/gui/qt/private-core.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-core) 2>/dev/null
       ac_status=$?
       AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-core],[
-        echo 'get_cflags:'                     >> ${ac_pwd}/modules/gui/qt/qmake-private-core
-        echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-private-core
-        echo 'get_libs:'                       >> ${ac_pwd}/modules/gui/qt/qmake-private-core
-        echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-private-core
+        echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"        >> ${ac_pwd}/modules/gui/qt/qmake-private-core
         AC_MSG_RESULT([yes])
         QT_CORE_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_libs)
         QT_CORE_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_cflags)
+        QT_CORE_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-core get_cflags)
         AC_SUBST([QT_CORE_PRIVATE_LIBS])
         AC_SUBST([QT_CORE_PRIVATE_CFLAGS])
+        AC_SUBST([QT_CORE_PRIVATE_LDFLAGS])
         have_qt_core_private="yes"
       ],[
         AC_MSG_RESULT([no])
@@ -4139,15 +4149,15 @@ AS_IF([test "${enable_qt}" != "no"], [
       (${QMAKE} ${srcdir}/modules/gui/qt/private-gui.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-gui) 2>/dev/null
       ac_status=$?
       AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-gui],[
-        echo 'get_cflags:'                     >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
-        echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
-        echo 'get_libs:'                       >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
-        echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
+        echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"        >> ${ac_pwd}/modules/gui/qt/qmake-private-gui
+
         AC_MSG_RESULT([yes])
         QT_GUI_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_libs)
         QT_GUI_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_cflags)
+        QT_GUI_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-gui get_ldflags)
         AC_SUBST([QT_GUI_PRIVATE_LIBS])
         AC_SUBST([QT_GUI_PRIVATE_CFLAGS])
+        AC_SUBST([QT_GUI_PRIVATE_LDFLAGS])
         have_qt_gui_private="yes"
       ],[
         AC_MSG_RESULT([no])
@@ -4158,15 +4168,14 @@ AS_IF([test "${enable_qt}" != "no"], [
       (${QMAKE} ${srcdir}/modules/gui/qt/private-quick.pro -o ${ac_pwd}/modules/gui/qt/qmake-private-quick) 2>/dev/null
       ac_status=$?
       AS_IF([test $ac_status = 0 && test -f ${ac_pwd}/modules/gui/qt/qmake-private-quick],[
-        echo 'get_cflags:'                     >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
-        echo '	$(info $(DEFINES) $(INCPATH))' >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
-        echo 'get_libs:'                       >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
-        echo '	echo $(LIBS) | sed -e "s@/[[^ ]]*/lib\([[^ ]]*\)\.so at -l\1 at g"' >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
+        echo "include ${ac_pwd}/modules/gui/qt/qmake-common.mk"        >> ${ac_pwd}/modules/gui/qt/qmake-private-quick
         AC_MSG_RESULT([yes])
         QT_QUICK_PRIVATE_LIBS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_libs)
         QT_QUICK_PRIVATE_CFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_cflags)
+        QT_QUICK_PRIVATE_LDFLAGS=$(cd ${ac_pwd}/modules/gui/qt && make -s -f qmake-private-quick get_ldflags)
         AC_SUBST([QT_QUICK_PRIVATE_LIBS])
         AC_SUBST([QT_QUICK_PRIVATE_CFLAGS])
+        AC_SUBST([QT_QUICK_PRIVATE_LDFLAGS])
         have_qt_declarative_private="yes"
       ],[
         AC_MSG_RESULT([no])
@@ -4182,6 +4191,7 @@ AS_IF([test "${enable_qt}" != "no"], [
       have_qt="no"
     ])
   ])
+  rm -f ${ac_pwd}/modules/gui/qt/qmake-common.mk
   rm -f ${ac_pwd}/modules/gui/qt/qmake-qt
   rm -f ${ac_pwd}/modules/gui/qt/.qmake.stash
     AS_IF([test "${have_qt}" = "no"],[


=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -24,6 +24,7 @@ vlc_qt_check_SOURCES = vlc-qt-check.cpp plugins.hpp
 vlc_qt_check_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) -fPIC $(CXXFLAGS_qt)
 vlc_qt_check_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_qt)
 vlc_qt_check_LDADD = $(vlc_qt_libs)
+vlc_qt_check_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
 
 libqt_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_qt) \
 	-DQT_STRICT_ITERATORS \
@@ -41,7 +42,7 @@ libqt_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_qt) \
 
 libqt_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt)
 libqt_plugin_la_LIBADD = $(vlc_qt_libs)
-libqt_plugin_la_LDFLAGS = $(AM_LDFLAGS)
+libqt_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
 if HAVE_DARWIN
 libqt_plugin_la_LDFLAGS += -Wl,-framework,Cocoa
 endif
@@ -57,8 +58,10 @@ endif
 if HAVE_QT_WAYLAND
 libqt_plugin_la_CPPFLAGS += $(QT_WAYLAND_CFLAGS)
 libqt_plugin_la_LIBADD += $(QT_WAYLAND_LIBS)
+libqt_plugin_la_LDFLAGS += $(QT_WAYLAND_LDFLAGS)
 vlc_qt_check_CPPFLAGS += $(QT_WAYLAND_CFLAGS) -DQT_HAS_WAYLAND
 vlc_qt_check_LDADD += $(QT_WAYLAND_LIBS)
+vlc_qt_check_LDFLAGS += $(QT_WAYLAND_LDFLAGS)
 endif
 
 if HAVE_WIN32
@@ -1250,6 +1253,7 @@ nodist_base_model_test_SOURCES = util/base_model.moc.cpp \
 
 base_model_test_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) -fPIC $(CXXFLAGS_qt)
 base_model_test_LDADD = $(QT_LIBS) $(LIBS_qt)
+base_model_test_LDFLAGS = $(AM_LDFLAGS) $(QT_LDFLAGS)
 check_PROGRAMS = base_model_test
 TESTS = base_model_test
 
@@ -1264,6 +1268,7 @@ nodist_qml_test_SOURCES += qmlcache_loader.cpp $(libqt_plugin_la_QML)
 endif
 qml_test_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) -fPIC $(CXXFLAGS_qt) ${QT_QUICK_TEST_CFLAGS} -DQUICK_TEST_SOURCE_DIR="\"${srcdir}/tests\""
 qml_test_LDADD = $(QT_INDIRECT_LIBS) ${QT_QUICK_TEST_LIBS} $(QT_LIBS) $(LIBS_qt)
+qml_test_LDFLAGS = $(AM_LDFLAGS) $(QT_QUICK_TEST_LDFLAGS)
 check_PROGRAMS += qml_test
 EXTRA_DIST += tests/tst_FSM.qml
 TESTS += tests/tst_FSM.qml



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/241fed315be92f4a12ced2afdffd79f5fd638ff4...2d97c56afa67b54249d958096ef4ebce96ceaf62

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/241fed315be92f4a12ced2afdffd79f5fd638ff4...2d97c56afa67b54249d958096ef4ebce96ceaf62
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list