diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/Makefile | 8 | ||||
-rw-r--r-- | scripts/setlocalversion | 68 |
2 files changed, 21 insertions, 55 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 3d7f1ac..5760e05 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -133,8 +133,8 @@ HOSTCFLAGS_zconf.tab.o := -I$(src) HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK -HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` -HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ +HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` +HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \ -D LKC_DIRECT_LINK $(obj)/qconf.o: $(obj)/.tmp_qtcheck @@ -193,8 +193,8 @@ ifeq ($(gconf-target),1) # GTK needs some extra effort, too... $(obj)/.tmp_gtkcheck: - @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \ - if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \ + @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \ + if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \ touch $@; \ else \ echo "*"; \ diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 7c805c8..f54dac8 100644 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -1,56 +1,22 @@ -#!/usr/bin/perl -# Copyright 2004 - Ryan Anderson <ryan@michonline.com> GPL v2 +#!/bin/sh +# Print additional version information for non-release trees. -use strict; -use warnings; -use Digest::MD5; -require 5.006; - -if (@ARGV != 1) { - print <<EOT; -Usage: setlocalversion <srctree> -EOT - exit(1); +usage() { + echo "Usage: $0 [srctree]" >&2 + exit 1 } -my ($srctree) = @ARGV; -chdir($srctree); - -my @LOCALVERSIONS = (); - -# We are going to use the following commands to try and determine if this -# repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches) We -# currently assume that all meaningful version boundaries are marked by a tag. -# We don't care what the tag is, just that something exists. - -# Git/Cogito store the top-of-tree "commit" in .git/HEAD -# A list of known tags sits in .git/refs/tags/ -# -# The simple trick here is to just compare the two of these, and if we get a -# match, return nothing, otherwise, return a subset of the SHA-1 hash in -# .git/HEAD - -sub do_git_checks { - open(H,"<.git/HEAD") or return; - my $head = <H>; - chomp $head; - close(H); +cd "${1:-.}" || usage - opendir(D,".git/refs/tags") or return; - foreach my $tagfile (grep !/^\.{1,2}$/, readdir(D)) { - open(F,"<.git/refs/tags/" . $tagfile) or return; - my $tag = <F>; - chomp $tag; - close(F); - return if ($tag eq $head); - } - closedir(D); - - push @LOCALVERSIONS, "g" . substr($head,0,8); -} - -if ( -d ".git") { - do_git_checks(); -} +# Check for git and a git repo. +if head=`git rev-parse --verify HEAD 2>/dev/null`; then + # Do we have an untagged version? + if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then + printf '%s%s' -g `echo "$head" | cut -c1-8` + fi -printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0); + # Are there uncommitted changes? + if git diff-files | read dummy; then + printf '%s' -git_dirty + fi +fi |