[Mesa-dev] [PATCH 3/4] autoconf: add $(TOP_SRCDIR) substitution

nobled nobled at dreamwidth.org
Thu Jul 19 15:40:30 PDT 2012


Useful while the static Makefiles are still alive.
---
 configs/current.in |    4 +++-
 configure.ac       |   15 ++++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/configs/current.in b/configs/current.in
index dc0dea8..ea926d5 100644
--- a/configs/current.in
+++ b/configs/current.in
@@ -1,7 +1,9 @@
 # Autoconf configuration

+TOP_SRCDIR = @TOP_SRCDIR@
+
 # Pull in the defaults
-include $(TOP)/configs/default
+include $(TOP_SRCDIR)/configs/default

 # This is generated by configure
 CONFIG_NAME = autoconf
diff --git a/configure.ac b/configure.ac
index 1d60957..344d054 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,9 +13,22 @@ AC_CANONICAL_HOST
 AM_INIT_AUTOMAKE([foreign])

 dnl http://people.gnome.org/~walters/docs/build-api.txt
-dnl We don't support srcdir != builddir.
+dnl We don't support srcdir != builddir yet.
 echo \#buildapi-variable-no-builddir >/dev/null

+dnl This is for the sake of the static Makefiles until they're
+dnl finally gone for good.
+TOP_SRCDIR="$srcdir"
+case $TOP_SRCDIR in
+[\\/]*)
+    dnl Path is already absolute.
+    ;;
+*)
+    TOP_SRCDIR=$ac_pwd/$TOP_SRCDIR
+    ;;
+esac
+AC_SUBST(TOP_SRCDIR)
+
 # Support silent build rules, requires at least automake-1.11. Disable
 # by either passing --disable-silent-rules to configure or passing V=1
 # to make
-- 
1.7.9.5


More information about the mesa-dev mailing list