[PATCH 0/4] Fixes to my git-commit-in-program-messages code
I'm sorry to have to announce that the code from me which has just been integrated into official xf86-video-radeonhd contains a few bugs. This patch set should address them. Issue 1: If srcdir==builddir, git commit and branch will be in git_version.h. Solution 1: Handle directories correctly. Trivial fix. You may hit me on the head. Verified with imake build, automake srcdir==builddir build, automake srcdir!=builddir build. Issue 2: rhd_conntest requires pci/pci.h and links against -lpci and -lz. Building it by default will abort the whole build if any one of these prerequirements is not met. Solution 2, automake part: For automake builds, check for appropriate presence of pciutils and zlib. Only if both prerequirements are met, rhd_conntest is built. Solution 2, imake part: For imake builds, do not recurse into utils/conntest any more. "xmkmf -a" seems to directly read SUBDIRS, so that includes utils/conntest. However, the FooSubdirs() imake macros are only called on "src man" dirs - that avoids the default build in utils/conntest. The imake part "works for me", but as I am not that familiar with imake, I'd appreciate confirmation from someone who is. -- Hans Ulrich Niedermann -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
If either of those is not found, rhd_conntest is not built. Affects automake builds only. --- configure.ac | 9 +++++++++ utils/conntest/Makefile.am | 5 +++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 40bc1c8..47abaa9 100644 --- a/configure.ac +++ b/configure.ac @@ -48,6 +48,13 @@ sdkdir=$(pkg-config --variable=sdkdir xorg-server) # Header files checks. AC_HEADER_STDC +AC_CHECK_HEADER([pci/pci.h], + [AC_DEFINE([HAVE_PCI_PCI_H], [1], + [Define to 1 if you have <pci/pci.h>.]) + have_pci_pci_h=yes], + [AC_MSG_WARN([Caution: Will not compile rhd_conntest without pciutils headers.])]) +AM_CONDITIONAL([HAVE_PCI_PCI_H], [test "x$have_pci_pci_h" = "xyes"]) + SAVED_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $XORG_CFLAGS" @@ -113,6 +120,8 @@ AM_CONDITIONAL(ATOM_BIOS, test x$support_atombios = xyes) AM_CONDITIONAL(ATOM_BIOS_PARSER, test x$support_atombios_parser = xyes) # libraries checks. +AC_CHECK_LIB([z], [gzopen], [have_zlib=yes], [have_zlib=no]) +AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"]) # compiler flags diff --git a/utils/conntest/Makefile.am b/utils/conntest/Makefile.am index b3a3308..924625f 100644 --- a/utils/conntest/Makefile.am +++ b/utils/conntest/Makefile.am @@ -4,7 +4,12 @@ include $(top_srcdir)/RadeonHD.am EXTRA_DIST = README Imakefile +EXTRA_PROGRAMS = rhd_conntest +if HAVE_PCI_PCI_H +if HAVE_ZLIB noinst_PROGRAMS = rhd_conntest +endif +endif # Including config.h requires xorg-config.h, so we need the XORG_CFLAGS here AM_CFLAGS = @XORG_CFLAGS@ @WARN_CFLAGS@ -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
Consequent separation of source tree dir ($srcdir) and working dir ($working_dir). Fixes imake and automake in-tree builds. --- git_version.sh | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/git_version.sh b/git_version.sh index 370dc5b..daf61f1 100644 --- a/git_version.sh +++ b/git_version.sh @@ -15,8 +15,10 @@ # The caller may have found these programs for us EGREP="${EGREP-"grep -E"}" SED="${SED-sed}" -GIT_DIR="${GIT_DIR-.git}" -export GIT_DIR + +# Initialize +GIT_DIR=".git" +working_dir="$(pwd)" # Who am I? self="$(basename "$0")" @@ -81,6 +83,9 @@ else exec 1> "${outfile}.new" fi +# Done with creating output files, so we can change to source dir +cd "$srcdir" + # Write program header cat<<EOF /* @@ -102,15 +107,15 @@ if [ "x$git_tools" != "x" ]; then echo "" # Commit SHA-ID - git_shaid=`cd "$srcdir" && git-whatchanged | $SED -n '1s/^commit \(.\{8\}\).*/\1/p'` + git_shaid=`git-whatchanged | $SED -n '1s/^commit \(.\{8\}\).*/\1/p'` echo "/* Git SHA ID of last commit */" echo "#define GIT_SHAID \"${git_shaid}..\"" echo "" # Branch -- use git-status instead of git-branch - git_branch=`cd "$srcdir" && git-status | $SED -n 's/^#\ On\ branch\ \(.*\)/\1/p'` + git_branch=`git-status | $SED -n 's/^#\ On\ branch\ \(.*\)/\1/p'` if [ "x$git_branch" = "x" ]; then - git_branch=`cd "$srcdir" && git-branch | $SED -n 's/^* //p'` + git_branch=`git-branch | $SED -n 's/^* //p'` fi if [ "x$git_branch" = "x" ]; then git_branch="<<unknown/master>>" @@ -120,7 +125,7 @@ if [ "x$git_tools" != "x" ]; then echo "" # Any uncommitted changes we should know about? - git_uncommitted=`cd "$srcdir" && git-status | $EGREP "(Changed but not updated|Updated but not checked in|Changes to be committed)"` + git_uncommitted=`git-status | $EGREP "(Changed but not updated|Updated but not checked in|Changes to be committed)"` if [ "x$git_uncommitted" != "x" ]; then echo "/* Local changes might be breaking things */" echo "#define GIT_UNCOMMITTED 1" @@ -187,6 +192,9 @@ int main(int argc, char *argv[]) EOF fi +# Change back to working dir for the remaining output file manipulations. +cd "$working_dir" + # If necessary, overwrite outdated output file with new one if [ "x$outfile" != "x-" ] then -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
A normal "make" run on imake builds will not descend into utils/conntest/ any more. However, "xmkmf -a" still creates utils/conntest/Makefile from the Imakefile, so the user can "cd utils/conntest && make" to build rhd_conntest. --- Imakefile | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Imakefile b/Imakefile index 07d97e0..5cf506f 100644 --- a/Imakefile +++ b/Imakefile @@ -3,6 +3,7 @@ #define IHaveSubdirs SUBDIRS = src man utils/conntest +DEFAULT_BUILD_SUBDIRS = src man -MakeSubdirs($(SUBDIRS)) -ForceSubdirs($(SUBDIRS)) +MakeSubdirs($(DEFAULT_BUILD_SUBDIRS)) +ForceSubdirs($(DEFAULT_BUILD_SUBDIRS)) -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
--- README | 5 +++-- utils/conntest/README | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README b/README index e15a5dc..1ca757e 100644 --- a/README +++ b/README @@ -63,8 +63,9 @@ Hint: If you happen to have multiple branches in your git source tree, you can have per-branch _b-BRANCH/ build trees and _i-BRANCH/ install trees. ("... configure ... --prefix=$PWD/_i-BRANCH") -Note that none of these methods will install the rhd_conntest tool, but it -will be available as ./utils/conntest/rhd_conntest after the "make" run. +Note that none of these methods will install the rhd_conntest tool. The +"xmkmf" method always requires a separate "make" run in utils/conntest. The +other two will build rhd_conntest by default if its requirements are met. diff --git a/utils/conntest/README b/utils/conntest/README index 57fd3c9..6b73bb0 100644 --- a/utils/conntest/README +++ b/utils/conntest/README @@ -8,8 +8,9 @@ Radeon R5xx and R6xx graphics devices. Build: ------ -Descend into xf86-video-radeonhd/utils/conntest/ -Run make. + * Make sure the pciutils development files and zlib are installed. + * Descend into xf86-video-radeonhd/utils/conntest/ + * Run "make". Usage: ------ -- 1.5.3.4 -- To unsubscribe, e-mail: radeonhd+unsubscribe@opensuse.org For additional commands, e-mail: radeonhd+help@opensuse.org
participants (1)
-
Hans Ulrich Niedermann