Commit c85a196b authored by Stezowski Olivier's avatar Stezowski Olivier
Browse files

new facilities to set up the gammaware environment

git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@219 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent 27b7d25d
#
# This file keeps an history of the different
# Gw versions and the prefered ROOT versions
#
# Gw version Root version
#
0.1 5.10/00
0.2 5.10/00
0.4 5.10/00
0.5 5.10/00
......@@ -140,7 +140,8 @@ install: modules rmap installdirs installinc installdata
@{ for dir in $(SUBDIRS); do \
cd $(TOPDIR); cd $$dir; $(MAKE) install; \
done }
$(INSTALL_DATA) $(GWROOTMAP) @libdir@
@$(INSTALL_DATA) $(GWROOTMAP) @libdir@
@$(INSTALL_DATA) .GWVERSIONS @prefix@
@echo " "
# to use only during the development phase
......
......@@ -275,7 +275,7 @@ PACKAGE_BUGREPORT='agata(AT)ipnl.in2p3.fr'
ac_unique_file="./config/Makefile.root"
ac_default_prefix='/usr/local'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBPROJETS SET_MAKE ROOTCINT_FOUND ROOTCONF_FOUND INSTALL_PROGRAM INSTALL_DATA LIB@&t@OBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBPROJETS SET_MAKE ROOTCINT_FOUND ROOTCONF_FOUND ROOTMAP_FOUND INSTALL_PROGRAM INSTALL_DATA LIB@&t@OBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
......@@ -1258,14 +1258,15 @@ bindir=$prefix/bin/gw$PACKAGE_VERSION
datadir=$prefix/share
# Check whether --enable-ganil or --disable-ganil was given.
if test "${enable_ganil+set}" = set; then
enableval="$enable_ganil"
SUBPROJETS='src/root/core src/root/physics src/root/gem src/root/tools src/system src/root/ganil'
SUBPROJETS='src/root/core src/root/physics src/root/tools src/system src/root/gem src/root/ganil'
\
else
SUBPROJETS='src/root/core src/root/physics src/root/gem src/system src/root/tools '
SUBPROJETS='src/root/core src/root/physics src/system src/root/tools src/root/gem'
fi;
......@@ -1381,6 +1382,47 @@ echo "${ECHO_T}no" >&6
fi
# Extract the first word of "rlibmap", so it can be a program name with args.
set dummy rlibmap; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_ROOTMAP_FOUND+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $ROOTMAP_FOUND in
[\\/]* | ?:[\\/]*)
ac_cv_path_ROOTMAP_FOUND="$ROOTMAP_FOUND" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ROOTMAP_FOUND="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
test -z "$ac_cv_path_ROOTMAP_FOUND" && ac_cv_path_ROOTMAP_FOUND="no"
;;
esac
fi
ROOTMAP_FOUND=$ac_cv_path_ROOTMAP_FOUND
if test -n "$ROOTMAP_FOUND"; then
echo "$as_me:$LINENO: result: $ROOTMAP_FOUND" >&5
echo "${ECHO_T}$ROOTMAP_FOUND" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
INSTALL_PROGRAM='cp'
INSTALL_DATA='cp -R -p'
......@@ -2069,6 +2111,7 @@ s,@SUBPROJETS@,$SUBPROJETS,;t t
s,@SET_MAKE@,$SET_MAKE,;t t
s,@ROOTCINT_FOUND@,$ROOTCINT_FOUND,;t t
s,@ROOTCONF_FOUND@,$ROOTCONF_FOUND,;t t
s,@ROOTMAP_FOUND@,$ROOTMAP_FOUND,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t
......@@ -2356,6 +2399,19 @@ if test "$ROOTCONF_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ROOTMAP_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "The rlibmap script is missing !"
echo "rlibmap is mandatory to build this package. "
echo "If the root version installed is < 5.14, it might be missing because"
echo "when the ROOT system was configured for your machine a prefix was used."
echo "In this case, rlibmap is not copied properly."
echo "(BUG report to ROOT, see ROOT bugtracker bug#22386 [now corrected])"
echo "It is however compiled and available in the source directory in the"
echo "bin subdirectory. Just move it to where the root exec is located. "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ok_conf" = "true"; then
echo "---------------------------------------------------------------------"
echo " Check the installation parameters with:"
......
......@@ -56,27 +56,28 @@ m4trace:configure.in:31: -1- AC_SUBST([includedir], [$prefix/include/gw$PACKAGE_
m4trace:configure.in:32: -1- AC_SUBST([libdir], [$prefix/lib/gw$PACKAGE_VERSION])
m4trace:configure.in:33: -1- AC_SUBST([bindir], [$prefix/bin/gw$PACKAGE_VERSION])
m4trace:configure.in:34: -1- AC_SUBST([datadir], [$prefix/share])
m4trace:configure.in:37: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
m4trace:configure.in:38: -2- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete.
You should run autoupdate.], [autoconf/general.m4:219: AC_HELP_STRING is expanded from...
configure.in:37: the top level])
m4trace:configure.in:39: -1- AC_SUBST([SUBPROJETS], ['src/root/core src/root/physics src/root/gem src/root/tools src/system src/root/ganil'])
m4trace:configure.in:39: -1- AC_SUBST([SUBPROJETS], ['src/root/core src/root/physics src/root/gem src/system src/root/tools '])
m4trace:configure.in:43: -1- AC_PROG_MAKE_SET([gmake])
m4trace:configure.in:43: -1- AC_SUBST([SET_MAKE])
m4trace:configure.in:49: -1- AC_SUBST([ROOTCINT_FOUND], [$ac_cv_path_ROOTCINT_FOUND])
m4trace:configure.in:52: -1- AC_SUBST([ROOTCONF_FOUND], [$ac_cv_path_ROOTCONF_FOUND])
m4trace:configure.in:57: -1- AC_SUBST([INSTALL_PROGRAM], ['cp'])
m4trace:configure.in:58: -1- AC_SUBST([INSTALL_DATA], ['cp -R -p'])
m4trace:configure.in:126: -1- AC_CONFIG_FILES([ Makefile ])
m4trace:configure.in:127: -1- AC_CONFIG_FILES([ Doxyfile ])
m4trace:configure.in:128: -1- AC_CONFIG_FILES([ src/root/core/Makefile ])
m4trace:configure.in:129: -1- AC_CONFIG_FILES([ src/root/physics/Makefile ])
m4trace:configure.in:130: -1- AC_CONFIG_FILES([ src/root/gem/Makefile ])
m4trace:configure.in:131: -1- AC_CONFIG_FILES([ src/root/tools/Makefile ])
m4trace:configure.in:132: -1- AC_CONFIG_FILES([ src/system/Makefile ])
m4trace:configure.in:133: -1- AC_CONFIG_FILES([ src/root/ganil/Makefile ])
m4trace:configure.in:134: -1- AC_CONFIG_FILES([ demos/gem/rootlogon.C ])
m4trace:configure.in:135: -1- AC_CONFIG_FILES([ demos/tools/rootlogon.C ])
m4trace:configure.in:136: -1- AC_CONFIG_FILES([ src/root/core/GwConfig.h])
m4trace:configure.in:138: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.in:138: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
configure.in:38: the top level])
m4trace:configure.in:40: -1- AC_SUBST([SUBPROJETS], ['src/root/core src/root/physics src/root/tools src/system src/root/gem src/root/ganil'])
m4trace:configure.in:40: -1- AC_SUBST([SUBPROJETS], ['src/root/core src/root/physics src/system src/root/tools src/root/gem'])
m4trace:configure.in:44: -1- AC_PROG_MAKE_SET([gmake])
m4trace:configure.in:44: -1- AC_SUBST([SET_MAKE])
m4trace:configure.in:50: -1- AC_SUBST([ROOTCINT_FOUND], [$ac_cv_path_ROOTCINT_FOUND])
m4trace:configure.in:53: -1- AC_SUBST([ROOTCONF_FOUND], [$ac_cv_path_ROOTCONF_FOUND])
m4trace:configure.in:56: -1- AC_SUBST([ROOTMAP_FOUND], [$ac_cv_path_ROOTMAP_FOUND])
m4trace:configure.in:61: -1- AC_SUBST([INSTALL_PROGRAM], ['cp'])
m4trace:configure.in:62: -1- AC_SUBST([INSTALL_DATA], ['cp -R -p'])
m4trace:configure.in:130: -1- AC_CONFIG_FILES([ Makefile ])
m4trace:configure.in:131: -1- AC_CONFIG_FILES([ Doxyfile ])
m4trace:configure.in:132: -1- AC_CONFIG_FILES([ src/root/core/Makefile ])
m4trace:configure.in:133: -1- AC_CONFIG_FILES([ src/root/physics/Makefile ])
m4trace:configure.in:134: -1- AC_CONFIG_FILES([ src/root/gem/Makefile ])
m4trace:configure.in:135: -1- AC_CONFIG_FILES([ src/root/tools/Makefile ])
m4trace:configure.in:136: -1- AC_CONFIG_FILES([ src/system/Makefile ])
m4trace:configure.in:137: -1- AC_CONFIG_FILES([ src/root/ganil/Makefile ])
m4trace:configure.in:138: -1- AC_CONFIG_FILES([ demos/gem/rootlogon.C ])
m4trace:configure.in:139: -1- AC_CONFIG_FILES([ demos/tools/rootlogon.C ])
m4trace:configure.in:140: -1- AC_CONFIG_FILES([ src/root/core/GwConfig.h])
m4trace:configure.in:142: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.in:142: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
......@@ -275,7 +275,7 @@ PACKAGE_BUGREPORT='agata(AT)ipnl.in2p3.fr'
ac_unique_file="./config/Makefile.root"
ac_default_prefix='/usr/local'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBPROJETS SET_MAKE ROOTCINT_FOUND ROOTCONF_FOUND INSTALL_PROGRAM INSTALL_DATA LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBPROJETS SET_MAKE ROOTCINT_FOUND ROOTCONF_FOUND ROOTMAP_FOUND INSTALL_PROGRAM INSTALL_DATA LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
......@@ -1258,14 +1258,15 @@ bindir=$prefix/bin/gw$PACKAGE_VERSION
datadir=$prefix/share
# Check whether --enable-ganil or --disable-ganil was given.
if test "${enable_ganil+set}" = set; then
enableval="$enable_ganil"
SUBPROJETS='src/root/core src/root/physics src/root/gem src/root/tools src/system src/root/ganil'
SUBPROJETS='src/root/core src/root/physics src/root/tools src/system src/root/gem src/root/ganil'
\
else
SUBPROJETS='src/root/core src/root/physics src/root/gem src/system src/root/tools '
SUBPROJETS='src/root/core src/root/physics src/system src/root/tools src/root/gem'
fi;
......@@ -1381,6 +1382,47 @@ echo "${ECHO_T}no" >&6
fi
# Extract the first word of "rlibmap", so it can be a program name with args.
set dummy rlibmap; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_path_ROOTMAP_FOUND+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
case $ROOTMAP_FOUND in
[\\/]* | ?:[\\/]*)
ac_cv_path_ROOTMAP_FOUND="$ROOTMAP_FOUND" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_ROOTMAP_FOUND="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
test -z "$ac_cv_path_ROOTMAP_FOUND" && ac_cv_path_ROOTMAP_FOUND="no"
;;
esac
fi
ROOTMAP_FOUND=$ac_cv_path_ROOTMAP_FOUND
if test -n "$ROOTMAP_FOUND"; then
echo "$as_me:$LINENO: result: $ROOTMAP_FOUND" >&5
echo "${ECHO_T}$ROOTMAP_FOUND" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
INSTALL_PROGRAM='cp'
INSTALL_DATA='cp -R -p'
......@@ -2069,6 +2111,7 @@ s,@SUBPROJETS@,$SUBPROJETS,;t t
s,@SET_MAKE@,$SET_MAKE,;t t
s,@ROOTCINT_FOUND@,$ROOTCINT_FOUND,;t t
s,@ROOTCONF_FOUND@,$ROOTCONF_FOUND,;t t
s,@ROOTMAP_FOUND@,$ROOTMAP_FOUND,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
......@@ -2356,6 +2399,19 @@ if test "$ROOTCONF_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ROOTMAP_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "The rlibmap script is missing !"
echo "rlibmap is mandatory to build this package. "
echo "If the root version installed is < 5.14, it might be missing because"
echo "when the ROOT system was configured for your machine a prefix was used."
echo "In this case, rlibmap is not copied properly."
echo "(BUG report to ROOT, see ROOT bugtracker bug#22386 [now corrected])"
echo "It is however compiled and available in the source directory in the"
echo "bin subdirectory. Just move it to where the root exec is located. "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ok_conf" = "true"; then
echo "---------------------------------------------------------------------"
echo " Check the installation parameters with:"
......
......@@ -36,8 +36,8 @@ AC_SUBST(datadir,[$prefix/share])
dnl configuration option for building with or without ganil
AC_ARG_ENABLE(ganil,AC_HELP_STRING([--enable-ganil],[enable to build the GANIL library])
,[AC_SUBST(SUBPROJETS,['src/root/core src/root/physics src/root/gem src/root/tools src/system src/root/ganil'])] \
,[AC_SUBST(SUBPROJETS,['src/root/core src/root/physics src/root/gem src/system src/root/tools '])])
,[AC_SUBST(SUBPROJETS,['src/root/core src/root/physics src/root/tools src/system src/root/gem src/root/ganil'])] \
,[AC_SUBST(SUBPROJETS,['src/root/core src/root/physics src/system src/root/tools src/root/gem'])])
dnl to set the correct makefile
dnl any makefile that call MAKE should starts with
......@@ -52,6 +52,9 @@ AC_PATH_PROG(ROOTCINT_FOUND, rootcint, no)
dnl check for root-config
AC_PATH_PROG(ROOTCONF_FOUND, root-config, no)
dnl check for root-config
AC_PATH_PROG(ROOTMAP_FOUND, rlibmap, no)
dnl install program is just a copy ...
dnl I do not uderstand how works bsd install or install-sh ..
dnl INSTALL_PROGRAM for single files and INSTALL_DATA for multiple files or directory
......@@ -157,6 +160,19 @@ if test "$ROOTCONF_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ROOTMAP_FOUND" = "no"; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "The rlibmap script is missing !"
echo "rlibmap is mandatory to build this package. "
echo "If the root version installed is < 5.14, it might be missing because"
echo "when the ROOT system was configured for your machine a prefix was used."
echo "In this case, rlibmap is not copied properly."
echo "(BUG report to ROOT, see ROOT bugtracker bug#22386 [now corrected])"
echo "It is however compiled and available in the source directory in the"
echo "bin subdirectory. Just move it to where the root exec is located. "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
ok_conf=false
fi
if test "$ok_conf" = "true"; then
echo "---------------------------------------------------------------------"
echo " Check the installation parameters with:"
......
const char *DoScript(const Char_t *ver, const Char_t *pref)
{
TString tmpf, shell = gSystem->Getenv("SHELL");
tmpf = gSystem->TempDirectory(); tmpf += "/GwEnv.";
// guess the shell
if ( shell.EndsWith("tcsh") ) { //
tmpf += "csh";
ofstream script(tmpf.Data());
script << "#" << endl;
script << "# Source this file to set up the environment to work with Gammaware Version " << ver << endl;
script << "#" << endl << endl;
script << "if ($?LD_LIBRARY_PATH) then" << endl;
script << " setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:" << pref << "lib/gw" << ver << " # Linux, ELF HP-UX" << endl;
script << "endif" << endl << endl;
script << "if ($?DYLD_LIBRARY_PATH) then" << endl;
script << " setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:" << pref << "lib/gw" << ver << " # Mac OS X" << endl;
script << "endif" << endl << endl;
script << "if ($?SHLIB_PATH) then" << endl;
script << " setenv SHLIB_PATH ${SHLIB_PATH}:" << pref << "lib/gw" << ver << " # legacy HP-UX" << endl;
script << "endif" << endl << endl;
script << "if ($?LIBPATH) then" << endl;
script << " setenv LIBPATH ${LIBPATH}:" << pref << "lib/gw" << ver << " # AIX" << endl;
script << "endif" << endl << endl;
script << "" << endl;
script << "echo ' ---> You are working now with gammaware version' " << ver << endl;
script << "" << endl;
script.close();
}
return tmpf.Data();
}
/*!
Usage: root -b -q 'GwEnv.C()'
*/
void GwEnv(const Char_t *ver = "last", const Char_t *pref = "./")
{
const Int_t LINESIZE = 80;
TString prefix = pref, version = ver, tmp; if ( prefix.EndsWith("/") == kFALSE ) prefix += "/";
// check if the gammaware 'exists' at this location
Long_t id, size, flag, modtime;
cout << "-------------------------------------------------------------------------------" << endl;
cout << " You are running ROOT version " << gROOT->GetVersion() << endl ;
cout << "-------------------------------------------------------------------------------" << endl;
tmp = prefix; tmp += ".GWVERSIONS";
if ( gSystem->GetPathInfo(gSystem->UnixPathName(tmp.Data()),&id,&size,&flag,&modtime) == 1 ) { // file does not exist
cout << " Cannot find " << tmp.Data() << endl;
cout << " Check if the gammaware has been properly installed " << endl; return;
}
// read this file and keeps what version is installed (only a guess base on
// rootmap in the library directory)
ifstream gwv(tmp.Data()); Char_t aline[LINESIZE]; TString tmpgw, tmproot, finalv; Bool_t doscript = kFALSE;
cout << " List of detected gammaware versions: " << endl;
while ( gwv.good() ) {
// next line
gwv.getline(aline,LINESIZE); if ( !gwv.good() ) break; if ( aline[0] == '#' ) continue;
// decode the line and store informations about the available versions
istringstream str(aline); str >> tmpgw >> tmproot ;
tmp = prefix; tmp += "lib/gw"; tmp += tmpgw; tmp += "/rootmap";
if ( gSystem->GetPathInfo(gSystem->UnixPathName(tmp.Data()),&id,&size,&flag,&modtime) == 0 ) { // this version exists
cout << " Gammaware version " << tmpgw
<< " [root recommanded " << tmproot <<"] seems available " << endl;
if ( tmpgw == version || version == "last" ) { finalv = tmpgw; doscript = kTRUE; }
}
}
cout << "-------------------------------------------------------------------------------" << endl;
if ( doscript ) {
TString tt; tt = DoScript(finalv.Data(),prefix.Data());
cout << " If your installation looks all right: " << " source " << tt << endl;
}
else { cout << " It cannot be configured the way you want !" << endl; }
cout << "-------------------------------------------------------------------------------" << endl;
}
......@@ -20,13 +20,6 @@
/** \file BaseNucleus.cpp compiled in libGWPHYSICS.so */
#ifndef GW_BASENUCLEUS_H
#include "BaseNucleus.h"
#endif
#include <iostream>
#include <cstdlib>
#ifndef ROOT_TNamed
#include <TNamed.h>
#endif
......@@ -43,10 +36,17 @@
#include <TXMLAttr.h>
#endif
#ifndef GW_CONFIG_H
#include <GwConfig.h>
#ifndef GW_ENV_H
#include "Env.h"
#endif
#ifndef GW_BASENUCLEUS_H
#include "BaseNucleus.h"
#endif
#include <iostream>
#include <cstdlib>
using namespace std;
using namespace Gw;
......@@ -215,7 +215,8 @@ bool BaseNucleus::LoadTable(const char *xmlfile)
TString strxml = xmlfile;
if (xmlfile == "") { //Set the default xml file
strxml = Gw::NdbPath; strxml+="/TableNucleus.xml";
strxml = Gw::Env::GetPath("NdbPath"); if ( strxml.EndsWith("/") == kFALSE ) strxml += "/";
strxml += "TableNucleus.xml";
}
TDOMParser *domParser = new TDOMParser();
Int_t parsecode = domParser->ParseFile(strxml.Data()); //Check validity of the xmlfile respect to the corresponding .dtd file
......
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* agata(AT)ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** \file Env.cpp compiled in libGWCORE.so */
#ifndef ROOT_TString
#include <TString.h>
#endif
#ifndef GW_CONFIG_H
#include "GwConfig.h"
#endif
#ifndef GW_ENV_H
#include "Env.h"
#endif
using namespace Gw;
ClassImp(Env);
const char *Env::GetVersion() { return GW_Version;}
const char *Env::GetPath(const char *whichpath)
{
TString which = whichpath;
if ( which.Contains("Version",TString::kIgnoreCase) ) return GW_Version;
if ( which.Contains("LibraryPath",TString::kIgnoreCase) ) return GW_LibraryPath;
if ( which.Contains("BinaryPath",TString::kIgnoreCase) ) return GW_BinaryPath;
if ( which.Contains("IncludePath",TString::kIgnoreCase) ) return GW_IncludePath;
if ( which.Contains("IconsPath",TString::kIgnoreCase) ) return GW_IconsPath;
if ( which.Contains("NdbPath",TString::kIgnoreCase) ) return GW_NdbPath;
if ( which.Contains("MacrosPath",TString::kIgnoreCase) ) return GW_MacrosPath;
return "NOT_DEFINED";
}
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* agata(AT)ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** \file Env.h to get information about the gammaware configuration
*
* Available are (const char *):
* - Gw::Version
* - Gw::LibraryPath
* - Gw::BinaryPath
* - Gw::IncludePath
* - Gw::IconsPath
* - Gw::NdbPath
* - Gw::MacrosPath
*
*/
#ifndef GW_ENV_H
#define GW_ENV_H
#ifndef ROOT_Rtypes
#include <Rtypes.h>
#endif
//! Gammaware namespace
/*!
All gammaware classes are protected by the Gw namespace
*/
namespace Gw {
class Env
{
public:
Env() {;}
virtual ~Env(){;}
//! to get a particular GW environment variable
/*!
Currently, the following path are defined:
- Version
- LibraryPath
- BinaryPath
- IncludePath
- IconsPath
- NdbPath
- MacrosPath
*/
static const char *GetPath(const char *);
//! to get the current gammaware version
static const char *GetVersion();
//! Root dictionary related
ClassDef(Env,0); // Gammaware environment
};
} // namespace
#endif
#ifdef __CINT__
#pragma link C++ class Gw::Env;
#endif
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* agata@ipnl.in2p3.fr *
* agata(AT)ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -18,36 +18,27 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** \file GwConfig.h to get information about the gammaware configuration
/** \file GwConfig.h to set informations about the gammaware configuration
*
* Available are (const char *):
* - Gw::Version
* - Gw::LibraryPath
* - Gw::BinaryPath
* - Gw::IncludePath
* - Gw::IconsPath
* - Gw::NdbPath
* - Gw::MacrosPath
* - Gw_Version
* - Gw_LibraryPath
* - Gw_BinaryPath
* - Gw_IncludePath
* - Gw_IconsPath
* - Gw_NdbPath
* - Gw_MacrosPath
*
*/
#ifndef GW_CONFIG_H
#define GW_CONFIG_H