From ee801e6c388c8ea641691ac6580cce7ef767728b Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 23 Jun 2021 14:03:18 +0200 Subject: [PATCH] Out-of-tree build fixes - fixed when the build dir is not even in the tree (git) - the path to QT worked only if $(srcdir) is relative (configure was invoked with relative path) --- Makefile.in | 2 +- configure.ac | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 59bfcb8fc..c7f4ce51f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -459,7 +459,7 @@ src/capture_filter/preview.o: src/capture_filter/preview.cpp $(ALL_INCLUDES) $(GUI_TARGET): $(wildcard $(srcdir)/gui/QT/*.cpp $(srcdir)/gui/QT/*.hpp) $(srcdir)/src/shared_mem_frame.cpp $(srcdir)/tools/astat.h $(MKDIR_P) $(dir $@) if test -z "$(QMAKE)"; then echo "Reconfigure with '--enable-qt'"; exit 1; fi - cd gui/QT && $(QMAKE) "DESTDIR+=./" $(srcdir)/../../gui/QT && make -j 4 + QT_SRC=$$(realpath $(srcdir))/gui/QT; cd gui/QT && $(QMAKE) "DESTDIR+=./" $$QT_SRC && make -j 4 # ------------------------------------------------------------------------------------------------- TEST_OBJS = $(COMMON_OBJS) \ diff --git a/configure.ac b/configure.ac index 2a8d616dd..4a69a6abf 100644 --- a/configure.ac +++ b/configure.ac @@ -89,7 +89,7 @@ AC_MSG_CHECKING([GIT presence]) if which git then AC_MSG_CHECKING([checking GIT branch ]) - git_branch=`git name-rev --name-only HEAD` + git_branch=`SRC=$(dirname "$0"); git -C "$SRC" name-rev --name-only HEAD` if test "$git_branch"; then AC_DEFINE_UNQUOTED([GIT_BRANCH], "$git_branch", [Current GIT branch]) AC_MSG_RESULT($git_branch); @@ -97,7 +97,7 @@ then AC_MSG_RESULT(no); fi AC_MSG_CHECKING([checking GIT revision ]) - git_rev=`git rev-parse --short HEAD` + git_rev=`SRC=$(dirname "$0"); git -C "$SRC" rev-parse --short HEAD` if test "$git_rev"; then AC_DEFINE_UNQUOTED([GIT_REV], "$git_rev", [Current GIT revision]) AC_MSG_RESULT($git_rev);