[gnome-common] gnome-autogen: infer PKG_NAME from configure.ac



commit 89f74f5214379ca118bcb09f8f3976d6997c42da
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Tue Dec 23 03:45:10 2014 +0100

    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

 README                   |    2 --
 macros2/gnome-autogen.sh |    4 ++--
 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]