aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/Makefile8
-rw-r--r--scripts/setlocalversion68
2 files changed, 21 insertions, 55 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3d7f1ac9e00c..5760e057ecba 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -133,8 +133,8 @@ HOSTCFLAGS_zconf.tab.o := -I$(src)
133HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl 133HOSTLOADLIBES_qconf = $(KC_QT_LIBS) -ldl
134HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK 134HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
135 135
136HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` 136HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
137HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ 137HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
138 -D LKC_DIRECT_LINK 138 -D LKC_DIRECT_LINK
139 139
140$(obj)/qconf.o: $(obj)/.tmp_qtcheck 140$(obj)/qconf.o: $(obj)/.tmp_qtcheck
@@ -193,8 +193,8 @@ ifeq ($(gconf-target),1)
193 193
194# GTK needs some extra effort, too... 194# GTK needs some extra effort, too...
195$(obj)/.tmp_gtkcheck: 195$(obj)/.tmp_gtkcheck:
196 @if `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --exists`; then \ 196 @if `pkg-config --exists gtk+-2.0 gmodule-2.0 libglade-2.0`; then \
197 if `pkg-config gtk+-2.0 --atleast-version=2.0.0`; then \ 197 if `pkg-config --atleast-version=2.0.0 gtk+-2.0`; then \
198 touch $@; \ 198 touch $@; \
199 else \ 199 else \
200 echo "*"; \ 200 echo "*"; \
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 7c805c8fccd2..f54dac88cfd1 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -1,56 +1,22 @@
1#!/usr/bin/perl 1#!/bin/sh
2# Copyright 2004 - Ryan Anderson <ryan@michonline.com> GPL v2 2# Print additional version information for non-release trees.
3 3
4use strict; 4usage() {
5use warnings; 5 echo "Usage: $0 [srctree]" >&2
6use Digest::MD5; 6 exit 1
7require 5.006;
8
9if (@ARGV != 1) {
10 print <<EOT;
11Usage: setlocalversion <srctree>
12EOT
13 exit(1);
14} 7}
15 8
16my ($srctree) = @ARGV; 9cd "${1:-.}" || usage
17chdir($srctree);
18
19my @LOCALVERSIONS = ();
20
21# We are going to use the following commands to try and determine if this
22# repository is at a Version boundary (i.e, 2.6.10 vs 2.6.10 + some patches) We
23# currently assume that all meaningful version boundaries are marked by a tag.
24# We don't care what the tag is, just that something exists.
25
26# Git/Cogito store the top-of-tree "commit" in .git/HEAD
27# A list of known tags sits in .git/refs/tags/
28#
29# The simple trick here is to just compare the two of these, and if we get a
30# match, return nothing, otherwise, return a subset of the SHA-1 hash in
31# .git/HEAD
32
33sub do_git_checks {
34 open(H,"<.git/HEAD") or return;
35 my $head = <H>;
36 chomp $head;
37 close(H);
38 10
39 opendir(D,".git/refs/tags") or return; 11# Check for git and a git repo.
40 foreach my $tagfile (grep !/^\.{1,2}$/, readdir(D)) { 12if head=`git rev-parse --verify HEAD 2>/dev/null`; then
41 open(F,"<.git/refs/tags/" . $tagfile) or return; 13 # Do we have an untagged version?
42 my $tag = <F>; 14 if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then
43 chomp $tag; 15 printf '%s%s' -g `echo "$head" | cut -c1-8`
44 close(F); 16 fi
45 return if ($tag eq $head);
46 }
47 closedir(D);
48
49 push @LOCALVERSIONS, "g" . substr($head,0,8);
50}
51
52if ( -d ".git") {
53 do_git_checks();
54}
55 17
56printf "-%s\n", join("-",@LOCALVERSIONS) if (scalar @LOCALVERSIONS > 0); 18 # Are there uncommitted changes?
19 if git diff-files | read dummy; then
20 printf '%s' -git_dirty
21 fi
22fi