summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-12-23 03:45:10 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2014-12-23 13:36:38 +0100
commit89f74f5214379ca118bcb09f8f3976d6997c42da (patch)
treec6226bc6a12a32915b6d93ab75e07d977265b19e
parent1ced4ff7722282b809ed33cdb4a1f3c1bdc6e252 (diff)
downloadgnome-common-89f74f5214379ca118bcb09f8f3976d6997c42da.tar.gz
gnome-autogen: infer PKG_NAME from configure.ac
Let's not repeat ourself in autogen.sh, there are already many places with the package name. https://bugzilla.gnome.org/show_bug.cgi?id=741891
-rw-r--r--README2
-rw-r--r--macros2/gnome-autogen.sh4
2 files changed, 2 insertions, 4 deletions
diff --git a/README b/README
index 290dbe2..e141cff 100644
--- a/README
+++ b/README
@@ -13,8 +13,6 @@ script in your module that looks something like this:
srcdir=`dirname $0`
[ -z "$srcdir" ] && srcdir=.
-PKG_NAME=mypackage
-
if [ ! -f "$srcdir/configure.ac" ]; then
echo "$srcdir doesn't look like source directory for $PKG_NAME" >&2
exit 1
diff --git a/macros2/gnome-autogen.sh b/macros2/gnome-autogen.sh
index be49462..8195dfb 100644
--- a/macros2/gnome-autogen.sh
+++ b/macros2/gnome-autogen.sh
@@ -1,8 +1,6 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-#name of package
-test "$PKG_NAME" || PKG_NAME=Package
test "$srcdir" || srcdir=.
# default version requirements ...
@@ -47,6 +45,8 @@ printerr() {
echo "$@" >&2
}
+PKG_NAME=`autoconf --trace "AC_INIT:$1" "$srcdir/configure.ac"`
+
# Usage:
# compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION