From ce918b57a4c74049d5c26b91f04f912d1a2d4bbf Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Thu, 1 Dec 2005 22:56:04 +0000
Subject: [PATCH] use $ROOTSYS/bin/root-config in case root-config is not found
 in path.

git-svn-id: http://root.cern.ch/svn/root/trunk@13440 27541ba8-7e3a-0410-8455-c3a389f83636
---
 test/Makefile      |  2 +-
 test/Makefile.arch | 22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/test/Makefile b/test/Makefile
index 58f30d92ea4..a2b480f38ee 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -63,7 +63,7 @@ STRESSLO      = stressLinear.$(ObjSuf)
 STRESSLS      = stressLinear.$(SrcSuf)
 STRESSL       = stressLinear$(ExeSuf)
 
-ifeq ($(shell root-config --has-mathcore),yes)
+ifeq ($(shell $(ROOTCONFIG) --has-mathcore),yes)
 STRESSVECO   = stressVector.$(ObjSuf)
 STRESSVECS   = stressVector.$(SrcSuf)
 STRESSVEC    = stressVector$(ExeSuf)
diff --git a/test/Makefile.arch b/test/Makefile.arch
index 25243f99fdd..96923e8705f 100644
--- a/test/Makefile.arch
+++ b/test/Makefile.arch
@@ -6,8 +6,14 @@
 #
 # Author: Fons Rademakers, 29/2/2000
 
-ARCH         := $(shell root-config --arch)
-PLATFORM     := $(shell root-config --platform)
+ifeq ($(shell which root-config > /dev/null 2>&1;echo $?),0)
+ROOTCONFIG   := root-config
+else
+ROOTCONFIG   := $$ROOTSYS/bin/root-config
+endif
+
+ARCH         := $(shell $(ROOTCONFIG) --arch)
+PLATFORM     := $(shell $(ROOTCONFIG) --platform)
 
 CXX           =
 ObjSuf        = o
@@ -16,11 +22,11 @@ ExeSuf        =
 DllSuf        = so
 OutPutOpt     = -o # keep whitespace after "-o"
 
-ROOTCFLAGS   := $(shell root-config --cflags)
-ROOTLDFLAGS  := $(shell root-config --ldflags)
-ROOTLIBS     := $(shell root-config --libs)
-ROOTGLIBS    := $(shell root-config --glibs)
-HASTHREAD    := $(shell root-config --has-thread)
+ROOTCFLAGS   := $(shell $(ROOTCONFIG) --cflags)
+ROOTLDFLAGS  := $(shell $(ROOTCONFIG) --ldflags)
+ROOTLIBS     := $(shell $(ROOTCONFIG) --libs)
+ROOTGLIBS    := $(shell $(ROOTCONFIG) --glibs)
+HASTHREAD    := $(shell $(ROOTCONFIG) --has-thread)
 
 ifeq ($(ARCH),hpuxacc)
 # HP-UX 10.x with aCC
@@ -265,7 +271,7 @@ ifeq ($(ARCH),linuxkcc)
 CXX           = KCC --one_instantiation_per_object
 CXXFLAGS      = -O -fPIC +K0
 LD            = KCC
-LDFLAGS       = -O $(shell root-config --cflags)
+LDFLAGS       = -O $(shell $(ROOTCONFIG) --cflags)
 SOFLAGS       =
 endif
 
-- 
GitLab