diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ab356c84dc1392e88203fc9e15be63d1db490a..39c904dfdb627b0745f8bd66ff818aac508d9e46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,7 @@ foreach(var ${variables}) endif() endforeach() -#---Move (copy) directories to binary tree------------------------------------------------------ +#---Move (copy) the headers and other directories to binary tree--------------------------------- set(stamp_file ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/move_artifacts.stamp) add_custom_command(OUTPUT ${stamp_file} COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/etc ${CMAKE_BINARY_DIR}/etc @@ -119,7 +119,11 @@ foreach(tutorial_file ${tutorial_files}) endif() endforeach() -add_custom_target(move_artifacts DEPENDS ${stamp_file} ${tutorial_files_builddir}) +add_custom_target(move_headers DEPENDS ${stamp_file} ${tutorial_files_builddir} + COMMAND ${CMAKE_COMMAND} -DPREFIX=${CMAKE_BINARY_DIR} + -DCOMPONENTS="headers" + -P ${CMAKE_SOURCE_DIR}/cmake/scripts/local_install.cmake) +include_directories(${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) #---Recurse into the given subdirectories. This does not actually cause another cmake executable @@ -178,7 +182,7 @@ add_custom_command(OUTPUT etc/dictpch/allLinkDefs.h DEPENDS ${CMAKE_SOURCE_DIR}/build/unix/makepchinput.py ${__allFiles}) add_custom_command(OUTPUT etc/allDict.cxx.pch - COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch -I${CMAKE_BINARY_DIR}/include + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch -I${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR} DEPENDS ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/dictpch/allLinkDefs.h etc/dictpch/allHeaders.h @@ -205,28 +209,26 @@ if(cxxmodules) COMMAND echo ${__echo_args} ${__modulemap_extra_content} >> ${CMAKE_BINARY_DIR}/include/module.modulemap VERBATIM ) - add_dependencies(move_artifacts copymodulemap) + add_dependencies(move_headers copymodulemap) endif(cxxmodules) #---hsimple.root---------(use the executable for clearer dependencies and proper return code)--- -add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) -add_dependencies(hsimple onepcm) -if(WIN32) - add_custom_command(OUTPUT tutorials/hsimple.root - COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && - set ROOTIGNOREPREFIX=1 && - $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return - WORKING_DIRECTORY tutorials - DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts) -else() - add_custom_command(OUTPUT tutorials/hsimple.root - COMMAND ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} - ROOTIGNOREPREFIX=1 - $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return - WORKING_DIRECTORY tutorials - DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts) +if(NOT gnuinstall) # TODO hsimple.root for gnuinstall + add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root) + add_dependencies(hsimple onepcm) + if(WIN32) + add_custom_command(OUTPUT tutorials/hsimple.root + COMMAND set PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} && + $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return + WORKING_DIRECTORY tutorials DEPENDS root.exe Cling Hist Tree Gpad Graf HistPainter) + else() + add_custom_command(OUTPUT tutorials/hsimple.root + COMMAND ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}} + $<TARGET_FILE:root.exe> -l -q -b -n -x hsimple.C -e return + WORKING_DIRECTORY tutorials DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter) + endif() + install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) endif() -install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests) #---version-------------------------------------------------------------------------------------- add_custom_target(version COMMAND ${CMAKE_SOURCE_DIR}/build/unix/makeversion.sh ${CMAKE_BINARY_DIR} @@ -272,6 +274,9 @@ endif() #---Configure Testing using CTest---------------------------------------------------------------- configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/CTestCustom.cmake ${CMAKE_BINARY_DIR} COPYONLY) if(testing) + if(gnuinstall) + message(FATAL_ERROR "You cannot enable to run the tests in the build directory (testing=ON) and at the same time select a GNU style installation (gnuinstall=ON). This is because the code is built with the final installation location (CMAKE_INSTALL_PREFIX) for many ancillary files (tutorials, etc, icons, macros, etc.) and these are not available before installation. Tests can be run against the installation once is completed. See the instructions in the web") + endif() include(RootCTest) if(roottest) find_package(Git REQUIRED) diff --git a/Makefile b/Makefile index b59ee952282088a064e1226442707d50d7b607c0..3e3edb383dd3dbda732042ba8d8e26b6c784751a 100644 --- a/Makefile +++ b/Makefile @@ -758,9 +758,11 @@ ifneq ($(findstring map, $(MAKECMDGOALS)),) .NOTPARALLEL: endif +ifeq ($(USECONFIG),FALSE) all: tutorials/hsimple.root tutorials/hsimple.root: rootexecs postbin - @(cd tutorials; ! ROOTIGNOREPREFIX=1 ../bin/root -l -q -b -n -x hsimple.C) + @(cd tutorials; ! ../bin/root -l -q -b -n -x hsimple.C) +endif all: rootexecs postbin @echo " " @@ -1234,7 +1236,7 @@ endif $(ROOTPCH): $(MAKEPCH) $(ROOTCLINGSTAGE1DEP) $(ALLHDRS) $(CLINGETCPCH) $(ORDER_) $(ALLLIBS) @$(MAKEPCHINPUT) $(ROOT_SRCDIR) "$(MODULES)" $(CLINGETCPCH) -- $(ROOTPCHCXXFLAGS) $(SYSTEMDEF) - @ROOTIGNOREPREFIX=1 $(MAKEPCH) $@ + @$(MAKEPCH) $@ $(MAKEPCH): $(ROOT_SRCDIR)/$(MAKEPCH) @mkdir -p $(dir $@) @@ -1339,6 +1341,8 @@ install: all $(INSTALLDATA) build/misc/root-help.el $(DESTDIR)$(ELISPDIR); \ echo "Installing GDML conversion scripts in $(DESTDIR)$(LIBDIR)"; \ $(INSTALLDATA) $(ROOT_SRCDIR)/geom/gdml/*.py $(DESTDIR)$(LIBDIR); \ + (cd $(DESTDIR)$(TUTDIR); \ + ! LD_LIBRARY_PATH=$(DESTDIR)$(LIBDIR):$$LD_LIBRARY_PATH $(DESTDIR)$(BINDIR)/root -l -b -q -n -x hsimple.C); \ fi uninstall: @@ -1465,6 +1469,7 @@ runtimedirs: --exclude proofd.xinetd \ --exclude rootd.rc.d \ --exclude rootd.xinetd \ + --exclude gitinfo.txt \ $(ROOT_SRCDIR)/etc . ; \ echo "Rsync'ing $(ROOT_SRCDIR)/macros..."; \ $(RSYNC) \ diff --git a/bindings/pyroot/CMakeLists.txt b/bindings/pyroot/CMakeLists.txt index c537baed6aea3932aae86bbc1de34fbb1a8dfdff..ba30ce20a8c447ccd6eb130f816539f8659186ed 100644 --- a/bindings/pyroot/CMakeLists.txt +++ b/bindings/pyroot/CMakeLists.txt @@ -36,18 +36,18 @@ endif() file(GLOB pyfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py) foreach(pyfile ${pyfiles}) install(FILES ${pyfile} DESTINATION ${runtimedir}) - install(CODE "execute_process(COMMAND python -m py_compile \$ENV{DESTDIR}${runtimedir}/${pyfile})") - install(CODE "execute_process(COMMAND python -O -m py_compile \$ENV{DESTDIR}${runtimedir}/${pyfile})") - file(COPY ${pyfile} DESTINATION ${localruntimedir}) + install(CODE "execute_process(COMMAND python -m py_compile \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${runtimedir}/${pyfile} )") + install(CODE "execute_process(COMMAND python -O -m py_compile \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${runtimedir}/${pyfile} )") + file(COPY ${pyfile} DESTINATION ${CMAKE_BINARY_DIR}/${runtimedir}) endforeach() -set(JupyROOTDirName "JupyROOT") +set( JupyROOTDirName "JupyROOT") install (DIRECTORY ${JupyROOTDirName} DESTINATION ${runtimedir}) -file(COPY ${JupyROOTDirName} DESTINATION ${localruntimedir}) +file(COPY ${JupyROOTDirName} DESTINATION ${CMAKE_BINARY_DIR}/${runtimedir}) set( JsMVADirName "JsMVA") install (DIRECTORY ${JsMVADirName} DESTINATION ${runtimedir}) -file(COPY ${JsMVADirName} DESTINATION ${localruntimedir}) +file(COPY ${JsMVADirName} DESTINATION ${CMAKE_BINARY_DIR}/${runtimedir}) #---Install headers---------------------------------------------------------- ROOT_INSTALL_HEADERS() diff --git a/bindings/pyroot/ROOT.py b/bindings/pyroot/ROOT.py index 53e64da69b4867a27fc7c2cd9a500200b43393d6..ec385e2e84b46790debf7534290b4ff0b5b8fc33 100644 --- a/bindings/pyroot/ROOT.py +++ b/bindings/pyroot/ROOT.py @@ -540,7 +540,7 @@ class ModuleFacade( types.ModuleType ): # system logon, user logon, and local logon (skip Rint.Logon) name = '.rootlogon.C' - logons = [ os.path.join( str(self.TROOT.GetEtcDir()), 'system' + name ), + logons = [ os.path.join( str(gRootDir), 'etc', 'system' + name ), os.path.expanduser( os.path.join( '~', name ) ) ] if logons[-1] != os.path.join( os.getcwd(), name ): logons.append( name ) diff --git a/cmake/modules/RootBuildOptions.cmake b/cmake/modules/RootBuildOptions.cmake index a8eab8a9385558e850b6a0784911d49c62b272d2..42a056c26d7dab3afd31102c591c118ffc69481f 100644 --- a/cmake/modules/RootBuildOptions.cmake +++ b/cmake/modules/RootBuildOptions.cmake @@ -258,7 +258,7 @@ set(CMAKE_MACOSX_RPATH TRUE) # use RPATH for MacOSX set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # point to directories outside the build tree to the install RPATH # Check whether to add RPATH to the installation (the build tree always has the RPATH enabled) -if(rpath) +if(rpath OR gnuinstall) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) # install LIBDIR set(CMAKE_SKIP_INSTALL_RPATH FALSE) # don't skip the full RPATH for the install tree elseif(APPLE) diff --git a/cmake/modules/RootConfiguration.cmake b/cmake/modules/RootConfiguration.cmake index acc86db36ffae5dfcde7751765c9c159ce776ab2..b72a9af6bc19c33580b272a4bb332d3d8c872080 100644 --- a/cmake/modules/RootConfiguration.cmake +++ b/cmake/modules/RootConfiguration.cmake @@ -670,8 +670,8 @@ endif() #---Get the value of CMAKE_CXX_FLAGS provided by the user in the command line set(usercflags ${CMAKE_CXX_FLAGS-CACHED}) -file(REMOVE ${CMAKE_BINARY_DIR}/installtree/root-config) -configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_BINARY_DIR}/installtree/root-config @ONLY NEWLINE_STYLE UNIX) +file(REMOVE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config) +configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh @ONLY NEWLINE_STYLE UNIX) @@ -688,15 +688,6 @@ if(WIN32) configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.bat ${thisrootbat} @ONLY) endif() -#--Local root-configure -set(prefix $ROOTSYS) -set(bindir $ROOTSYS/bin) -set(libdir $ROOTSYS/lib) -set(incdir $ROOTSYS/include) -set(etcdir $ROOTSYS/etc) -set(mandir $ROOTSYS/man) -configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX) - install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/setxrd.csh @@ -708,7 +699,7 @@ install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe - ${CMAKE_BINARY_DIR}/installtree/root-config + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config ${CMAKE_SOURCE_DIR}/cmake/scripts/setenvwrap.csh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/roots ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/proofserv diff --git a/cmake/modules/RootNewMacros.cmake b/cmake/modules/RootNewMacros.cmake index 4b2c4d7d563ee7949ef7278fbcaf6cc7fa62f81e..6d128b6659bde3b59ac1e27cecb7434d8e032c74 100644 --- a/cmake/modules/RootNewMacros.cmake +++ b/cmake/modules/RootNewMacros.cmake @@ -19,7 +19,6 @@ if(WIN32) set(libprefix lib) set(ld_library_path PATH) set(libsuffix .dll) - set(localruntimedir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) set(runtimedir ${CMAKE_INSTALL_BINDIR}) elseif(APPLE) set(ld_library_path DYLD_LIBRARY_PATH) @@ -27,7 +26,6 @@ elseif(APPLE) set(scomment \#) set(libprefix lib) set(libsuffix .so) - set(localruntimedir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) set(runtimedir ${CMAKE_INSTALL_LIBDIR}) else() set(ld_library_path LD_LIBRARY_PATH) @@ -35,7 +33,6 @@ else() set(scomment \#) set(libprefix lib) set(libsuffix .so) - set(localruntimedir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) set(runtimedir ${CMAKE_INSTALL_LIBDIR}) endif() @@ -340,7 +337,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) set(pcm_name) else() if(CMAKE_PROJECT_NAME STREQUAL ROOT) - set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" "ROOTIGNOREPREFIX=1" $<TARGET_FILE:rootcling> -rootbuild) + set(command ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" ${CMAKE_BINARY_DIR}/bin/rootcling -rootbuild) set(ROOTCINTDEP rootcling) else() set(command rootcling) @@ -531,6 +528,9 @@ function(ROOT_LINKER_LIBRARY library) if(TARGET G__${library}) add_dependencies(${library} G__${library}) endif() + if(TARGET move_headers) + add_dependencies(${library} move_headers) + endif() set_property(GLOBAL APPEND PROPERTY ROOT_EXPORTED_TARGETS ${library}) set_target_properties(${library} PROPERTIES OUTPUT_NAME ${library_name}) set_target_properties(${library} PROPERTIES LINK_INTERFACE_LIBRARIES "${ARG_DEPENDENCIES}") @@ -579,6 +579,9 @@ function(ROOT_OBJECT_LIBRARY library) if(lib_srcs MATCHES "(^|/)(G__[^.]*)[.]cxx.*") add_dependencies(${library} ${CMAKE_MATCH_2}) endif() + if(TARGET move_headers) + add_dependencies(${library} move_headers) + endif() #--- Only for building shared libraries set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE 1) @@ -632,6 +635,9 @@ function(ROOT_MODULE_LIBRARY library) ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS}) include_directories(${CMAKE_BINARY_DIR}/include) add_library( ${library} SHARED ${lib_srcs}) + if(TARGET move_headers) + add_dependencies(${library} move_headers) + endif() set_target_properties(${library} PROPERTIES ${ROOT_LIBRARY_PROPERTIES}) # Do not add -Dname_EXPORTS to the command-line when building files in this # target. Doing so is actively harmful for the modules build because it @@ -722,10 +728,6 @@ function(ROOT_INSTALL_HEADERS) PATTERN ".svn" EXCLUDE REGEX "LinkDef" EXCLUDE ${ARG_OPTIONS}) - file(COPY ${d} DESTINATION ${CMAKE_BINARY_DIR}/include - PATTERN ".svn" EXCLUDE - REGEX "LinkDef" EXCLUDE - ${ARG_OPTIONS}) set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${d}) endforeach() endfunction() @@ -765,6 +767,9 @@ function(ROOT_EXECUTABLE executable) if (ARG_ADDITIONAL_COMPILE_FLAGS) set_target_properties(${executable} PROPERTIES COMPILE_FLAGS ${ARG_ADDITIONAL_COMPILE_FLAGS}) endif() + if(TARGET move_headers) + add_dependencies(${executable} move_headers) + endif() if(ARG_BUILTINS) foreach(arg1 ${ARG_BUILTINS}) if(${arg1}_TARGET) @@ -991,9 +996,6 @@ function(ROOT_ADD_TEST test) set_property(TEST ${test} PROPERTY ENVIRONMENT ROOT_DIR=${CMAKE_BINARY_DIR}) else() add_test(NAME ${test} COMMAND ${_command}) - if (gnuinstall) - set_property(TEST ${test} PROPERTY ENVIRONMENT ROOTIGNOREPREFIX=1) - endif() endif() #- Handle TIMOUT and DEPENDS arguments diff --git a/cmake/scripts/local_install.cmake b/cmake/scripts/local_install.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a75841ac5055bf99b8d33263d593728f6f92c602 --- /dev/null +++ b/cmake/scripts/local_install.cmake @@ -0,0 +1,20 @@ +# Arguments: +# PREFIX - Installation prefix +# COMPONENTS - Installation component + +set(COMPONENTS ${COMPONENTS}) +set(ENV{DESTDIR} "") +foreach(component ${COMPONENTS}) + execute_process( + COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${PREFIX} + -DCMAKE_INSTALL_COMPONENT=${component} + -P cmake_install.cmake + RESULT_VARIABLE result + OUTPUT_QUIET + ) + + if(result) + set(msg "Local installation of ${component} failed: ${result}\n") + message(FATAL_ERROR "${msg}") + endif() +endforeach() diff --git a/config/RConfigure.in b/config/RConfigure.in index c0601629cac73afa3c309763aa634b0132cb4047..5140669fee828e03ed73c764478f220059d69112 100644 --- a/config/RConfigure.in +++ b/config/RConfigure.in @@ -14,11 +14,10 @@ #define ROOTTUTDIR "@tutdir@" #define ROOTSRCDIR "@srcdir@" #define ROOTICONPATH "@iconpath@" +#define EXTRAICONPATH "@extraiconpath@" #define TTFFONTDIR "@ttffontdir@" #endif -#define EXTRAICONPATH "@extraiconpath@" - #@setresuid@ R__HAS_SETRESUID /**/ #@hasmathmore@ R__HAS_MATHMORE /**/ #@haspthread@ R__HAS_PTHREAD /**/ diff --git a/config/rootrc.in b/config/rootrc.in index 2c747e79a447234fbeb3d4115947e38c87fe426c..8fe8ed44ce315157547d64838cea9d18fd8ae5d5 100644 --- a/config/rootrc.in +++ b/config/rootrc.in @@ -9,24 +9,24 @@ # and to PATH on Windows. # Paths are different for Unix and Windows. The example shows the defaults # for all ROOT applications for either Unix or Windows. -#Unix.*.Root.DynamicPath: .:@libdir@ -#WinNT.*.Root.DynamicPath: .;@bindir@ +Unix.*.Root.DynamicPath: .:@libdir@: +WinNT.*.Root.DynamicPath: .;@bindir@; # Path used to find macros. # Paths are different for Unix and Windows. The example shows the defaults # for all ROOT applications for either Unix or Windows. -#Unix.*.Root.MacroPath: .:@macrodir@ -#WinNT.*.Root.MacroPath: .;@macrodir@ +Unix.*.Root.MacroPath: .:@macrodir@: +WinNT.*.Root.MacroPath: .;@macrodir@; # Path used to find plugin macros. # Paths are different for Unix and Windows. The example shows the defaults # for all ROOT applications for either Unix or Windows. -#Unix.*.Root.PluginPath: @plugindir@ -#WinNT.*.Root.PluginPath: @plugindir@ +Unix.*.Root.PluginPath: :@plugindir@: +WinNT.*.Root.PluginPath: ;@plugindir@; # Path where to look for TrueType fonts. Unix.*.Root.UseTTFonts: true -#*.*.Root.TTFontPath: @ttffontdir@ +*.*.Root.TTFontPath: @ttffontdir@ # Use Net* API functions. WinNT.UseNetAPI: true @@ -225,8 +225,7 @@ Gui.DocumentBackgroundColor: white Gui.DocumentForegroundColor: black Gui.TooltipBackgroundColor: LightYellow Gui.TooltipForegroundColor: black -#Unix.*.Gui.IconPath: .:$(HOME)/icons:@iconpath@:@extraiconpath@ -#WinNT.*.Gui.IconPath: .;$(HOME)/icons;@iconpath@;@extraiconpath@ +Gui.IconPath: $(HOME)/icons:@iconpath@:. Gui.MimeTypeFile: $(HOME)/.root.mimes # If above does not exists defaults to this: #Gui.MimeTypeFile: @etcdir@/root.mimes diff --git a/configure b/configure index 42cab175568ec08a372559975f2cf8bca30a0787..3acf81ebdd887b7d6f1041e7d211cc6986d03a41 100755 --- a/configure +++ b/configure @@ -8235,7 +8235,6 @@ sed -e "s|@libdir@|$libdir|" \ -e "s|@bindir@|$bindir|" \ -e "s|@etcdir@|$etcdir|" \ -e "s|@ttffontdir@|$fontdir|" \ - -e "s|@extraiconpath@|$extraiconpath|" \ -e "s|@iconpath@|$iconpath|" \ -e "s|@hasxrd@|$hasxrd|" \ -e "s|@hasnotxrd@|$hasnotxrd|" \ diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 504be6c8bed7067e2ba69e20530e08c688fc947d..d33950fdee83311931d0280522346a725ccb9d27 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -71,14 +71,14 @@ if(WIN32) COMMAND ${CMAKE_SOURCE_DIR}/build/win/gitinfo.bat ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_SOURCE_DIR}/build/win/githeader.bat RGitCommit.h.tmp COMMENT "Recording the git revision now" - DEPENDS ${dep_objects} move_artifacts + DEPENDS ${dep_objects} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) else() add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp COMMAND ${CMAKE_SOURCE_DIR}/build/unix/gitinfo.sh ${CMAKE_SOURCE_DIR} COMMAND ${CMAKE_SOURCE_DIR}/build/unix/githeader.sh RGitCommit.h.tmp COMMENT "Recording the git revision now" - DEPENDS ${dep_objects} move_artifacts + DEPENDS ${dep_objects} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) endif() add_custom_target(gitcommit ALL DEPENDS ${CMAKE_BINARY_DIR}/RGitCommit.h.tmp) diff --git a/core/base/inc/TROOT.h b/core/base/inc/TROOT.h index c1e6b4d14a0ac3fc122dd64a29f5e02f8cc102ac..73cf65142d31ccc6653f37a171c222d50dfab59b 100644 --- a/core/base/inc/TROOT.h +++ b/core/base/inc/TROOT.h @@ -350,21 +350,6 @@ public: static Int_t ConvertVersionInt2Code(Int_t v); static Int_t RootVersionCode(); static const char**&GetExtraInterpreterArgs(); - - static const TString& GetRootSys(); - static const TString& GetBinDir(); - static const TString& GetLibDir(); - static const TString& GetIncludeDir(); - static const TString& GetEtcDir(); - static const TString& GetDataDir(); - static const TString& GetDocDir(); - static const TString& GetMacroDir(); - static const TString& GetTutorialDir(); - static const TString& GetSourceDir(); - static const TString& GetIconPath(); - static const TString& GetTTFFontDir(); - - // Backward compatibility function - do not use for new code static const char *GetTutorialsDir(); ClassDef(TROOT,0) //Top level (or root) structure for all classes diff --git a/core/base/src/TApplication.cxx b/core/base/src/TApplication.cxx index fba6e6b0296f0b555ef378a04214becdde18cc7b..98bb2fbbe9cbbe7bbb5b73e9f13434b2e4510415 100644 --- a/core/base/src/TApplication.cxx +++ b/core/base/src/TApplication.cxx @@ -276,7 +276,11 @@ void TApplication::InitializeGraphics() // mode and Root.UseTTFonts is true and Root.TTFontPath exists. Abort silently // if libttf or libGX11TTF are not found in $ROOTSYS/lib or $ROOTSYS/ttf/lib. const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +#ifdef TTFFONTDIR + TTFFONTDIR); +#else + "$(ROOTSYS)/fonts"); +#endif char *ttfont = gSystem->Which(ttpath, "arialbd.ttf", kReadPermission); // Check for use of DFSG - fonts if (!ttfont) @@ -884,19 +888,29 @@ Long_t TApplication::ProcessLine(const char *line, Bool_t sync, Int_t *err) Error("ProcessLine", "Cannot show demos in batch mode!"); return 1; } - ProcessLine(".x " + TROOT::GetTutorialDir() + "/demos.C"); +#ifdef ROOTTUTDIR + ProcessLine(".x " ROOTTUTDIR "/demos.C"); +#else + ProcessLine(".x $(ROOTSYS)/tutorials/demos.C"); +#endif return 0; } if (!strncmp(line, ".license", 8)) { - return PrintFile(TROOT::GetDocDir() + "/LICENSE"); +#ifdef ROOTDOCDIR + return PrintFile(ROOTDOCDIR "/LICENSE"); +#else + return PrintFile("$(ROOTSYS)/LICENSE"); +#endif } if (!strncmp(line, ".credits", 8)) { - TString credits = TROOT::GetDocDir() + "/CREDITS"; - if (gSystem->AccessPathName(credits, kReadPermission)) - credits = TROOT::GetDocDir() + "/README/CREDITS"; - return PrintFile(credits); +#ifdef ROOTDOCDIR + return PrintFile(ROOTDOCDIR "/CREDITS"); +#else + return PrintFile("$(ROOTSYS)/README/CREDITS"); +#endif + } if (!strncmp(line, ".pwd", 4)) { diff --git a/core/base/src/TEnv.cxx b/core/base/src/TEnv.cxx index 2f698bbf30ad7bb62edd14f725b77e31585078aa..cf7057236f63dc08a8e48e56261f122ac45fdd5d 100644 --- a/core/base/src/TEnv.cxx +++ b/core/base/src/TEnv.cxx @@ -401,7 +401,21 @@ TEnv::TEnv(const char *name) TString sname = "system"; sname += name; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif +#if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) + // on iOS etc does not exist and system<name> resides in $ROOTSYS + etc = gRootDir; +#endif + char *s = gSystem->ConcatFileName(etc, sname); +#endif ReadFile(s, kEnvGlobal); delete [] s; if (!gSystem->Getenv("ROOTENV_NO_HOME")) { @@ -671,7 +685,17 @@ void TEnv::SaveLevel(EEnvLevel level) TString sname = "system"; sname += fRcName; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + char *s = gSystem->ConcatFileName(etc, sname); +#endif rootrcdir = s; delete [] s; } else if (level == kEnvUser) { diff --git a/core/base/src/TPluginManager.cxx b/core/base/src/TPluginManager.cxx index d811a338538f86f61efbdf93da33ee1583974242..0a0883e8b1a31792ebd85791039a1adbdd03bf2e 100644 --- a/core/base/src/TPluginManager.cxx +++ b/core/base/src/TPluginManager.cxx @@ -470,10 +470,6 @@ void TPluginManager::LoadHandlersFromPluginDirs(const char *base) TPH__IsReadingDirs() = kTRUE; TString plugindirs = gEnv->GetValue("Root.PluginPath", (char*)0); - if (plugindirs.Length() == 0) { - plugindirs = "plugins"; - gSystem->PrependPathName(TROOT::GetEtcDir(), plugindirs); - } #ifdef WIN32 dirs = plugindirs.Tokenize(";"); #else diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index d4624273e46be480d2f83073f3817ab295eaf5b4..461fb20a80ecafdf680fab30f9f19dca1a85614c 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -658,22 +658,6 @@ TROOT::TROOT(const char *name, const char *title, VoidFuncPtr_t *initfunc) // Initialize Operating System interface InitSystem(); - // Initialize static directory functions - GetRootSys(); - GetBinDir(); - GetLibDir(); - GetIncludeDir(); - GetEtcDir(); - GetDataDir(); - GetDocDir(); - GetMacroDir(); - GetTutorialDir(); - GetSourceDir(); - GetIconPath(); - GetTTFFontDir(); - - gRootDir = GetRootSys().Data(); - TDirectory::Build(); // Initialize interface to CINT C++ interpreter @@ -1909,9 +1893,21 @@ void TROOT::InitInterpreter() "after the call to TROOT::InitInterpreter()!"); } - char *libcling = gSystem->DynamicPathName("libCling"); + const char *libcling = 0; + char *libclingStorage = 0; +#ifdef ROOTLIBDIR + libcling = ROOTLIBDIR "/libCling." +# ifdef R__WIN32 + "dll"; +# else + "so"; +# endif +#else + libclingStorage = gSystem->DynamicPathName("libCling"); + libcling = libclingStorage; +#endif gInterpreterLib = dlopen(libcling, RTLD_LAZY|RTLD_LOCAL); - delete [] libcling; + delete [] libclingStorage; if (!gInterpreterLib) { TString err = dlerror(); @@ -2258,7 +2254,22 @@ void TROOT::ReadGitInfo() #endif TString gitinfo = "gitinfo.txt"; - char *filename = gSystem->ConcatFileName(TROOT::GetEtcDir(), gitinfo); + char *filename = 0; +#ifdef ROOTETCDIR + filename = gSystem->ConcatFileName(ROOTETCDIR, gitinfo); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif +#if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) + // on iOS etc does not exist and gitinfo resides in $ROOTSYS + etc = gRootDir; +#endif + filename = gSystem->ConcatFileName(etc, gitinfo); +#endif FILE *fp = fopen(filename, "r"); if (fp) { @@ -2576,9 +2587,17 @@ const char *TROOT::GetMacroPath() #endif if (macroPath.Length() == 0) #if !defined(R__WIN32) - macroPath = ".:" + TROOT::GetMacroDir(); + #ifdef ROOTMACRODIR + macroPath = ".:" ROOTMACRODIR; + #else + macroPath = TString(".:") + gRootDir + "/macros"; + #endif #else - macroPath = ".;" + TROOT::GetMacroDir(); + #ifdef ROOTMACRODIR + macroPath = ".;" ROOTMACRODIR; + #else + macroPath = TString(".;") + gRootDir + "/macros"; + #endif #endif } @@ -2673,261 +2692,15 @@ const char**& TROOT::GetExtraInterpreterArgs() { return extraInterpArgs; } -//////////////////////////////////////////////////////////////////////////////// - -#ifdef ROOTPREFIX -static Bool_t IgnorePrefix() { - static Bool_t ignorePrefix = gSystem->Getenv("ROOTIGNOREPREFIX"); - return ignorePrefix; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// -/// Get the rootsys directory in the installation. Static utility function. - -const TString& TROOT::GetRootSys() { -#ifdef ROOTPREFIX - if (IgnorePrefix()) { -#endif - static TString rootsys; - if (rootsys.IsNull()) - rootsys = gSystem->Getenv("ROOTSYS"); - if (rootsys.IsNull()) - rootsys = gRootDir; - return rootsys; -#ifdef ROOTPREFIX - } else { - const static TString rootsys = ROOTPREFIX; - return rootsys; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the binary directory in the installation. Static utility function. - -const TString& TROOT::GetBinDir() { -#ifdef ROOTBINDIR - if (IgnorePrefix()) { -#endif - static TString rootbindir; - if (rootbindir.IsNull()) { - rootbindir = "bin"; - gSystem->PrependPathName(GetRootSys(), rootbindir); - } - return rootbindir; -#ifdef ROOTBINDIR - } else { - const static TString rootbindir = ROOTBINDIR; - return rootbindir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the library directory in the installation. Static utility function. - -const TString& TROOT::GetLibDir() { -#ifdef ROOTLIBDIR - if (IgnorePrefix()) { -#endif - static TString rootlibdir; - if (rootlibdir.IsNull()) { - rootlibdir = "lib"; - gSystem->PrependPathName(GetRootSys(), rootlibdir); - } - return rootlibdir; -#ifdef ROOTLIBDIR - } else { - const static TString rootlibdir = ROOTLIBDIR; - return rootlibdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the include directory in the installation. Static utility function. - -const TString& TROOT::GetIncludeDir() { -#ifdef ROOTINCDIR - if (IgnorePrefix()) { -#endif - static TString rootincdir; - if (rootincdir.IsNull()) { - rootincdir = "include"; - gSystem->PrependPathName(GetRootSys(), rootincdir); - } - return rootincdir; -#ifdef ROOTINCDIR - } else { - const static TString rootincdir = ROOTINCDIR; - return rootincdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the sysconfig directory in the installation. Static utility function. - -const TString& TROOT::GetEtcDir() { -#ifdef ROOTETCDIR - if (IgnorePrefix()) { -#endif - static TString rootetcdir; - if (rootetcdir.IsNull()) { - rootetcdir = "etc"; - gSystem->PrependPathName(GetRootSys(), rootetcdir); - } - return rootetcdir; -#ifdef ROOTETCDIR - } else { - const static TString rootetcdir = ROOTETCDIR; - return rootetcdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the data directory in the installation. Static utility function. - -const TString& TROOT::GetDataDir() { -#ifdef ROOTDATADIR - if (IgnorePrefix()) { -#endif - return GetRootSys(); -#ifdef ROOTDATADIR - } else { - const static TString rootdatadir = ROOTDATADIR; - return rootdatadir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the documentation directory in the installation. Static utility function. - -const TString& TROOT::GetDocDir() { -#ifdef ROOTDOCDIR - if (IgnorePrefix()) { -#endif - return GetRootSys(); -#ifdef ROOTDOCDIR - } else { - const static TString rootdocdir = ROOTDOCDIR; - return rootdocdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the macro directory in the installation. Static utility function. - -const TString& TROOT::GetMacroDir() { -#ifdef ROOTMACRODIR - if (IgnorePrefix()) { -#endif - static TString rootmacrodir; - if (rootmacrodir.IsNull()) { - rootmacrodir = "macros"; - gSystem->PrependPathName(GetRootSys(), rootmacrodir); - } - return rootmacrodir; -#ifdef ROOTMACRODIR - } else { - const static TString rootmacrodir = ROOTMACRODIR; - return rootmacrodir; - } -#endif -} - //////////////////////////////////////////////////////////////////////////////// /// Get the tutorials directory in the installation. Static utility function. -const TString& TROOT::GetTutorialDir() { -#ifdef ROOTTUTDIR - if (IgnorePrefix()) { -#endif - static TString roottutdir; - if (roottutdir.IsNull()) { - roottutdir = "tutorials"; - gSystem->PrependPathName(GetRootSys(), roottutdir); - } - return roottutdir; +const char *TROOT::GetTutorialsDir() +{ #ifdef ROOTTUTDIR - } else { - const static TString roottutdir = ROOTTUTDIR; - return roottutdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the source directory in the installation. Static utility function. - -const TString& TROOT::GetSourceDir() { -#ifdef ROOTSRCDIR - if (IgnorePrefix()) { -#endif - static TString rootsrcdir; - if (rootsrcdir.IsNull()) { - rootsrcdir = "src"; - gSystem->PrependPathName(GetRootSys(), rootsrcdir); - } - return rootsrcdir; -#ifdef ROOTSRCDIR - } else { - const static TString rootsrcdir = ROOTSRCDIR; - return rootsrcdir; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the icon path in the installation. Static utility function. - -const TString& TROOT::GetIconPath() { -#ifdef ROOTICONPATH - if (IgnorePrefix()) { -#endif - static TString rooticonpath; - if (rooticonpath.IsNull()) { - rooticonpath = "icons"; - gSystem->PrependPathName(GetRootSys(), rooticonpath); - } - return rooticonpath; -#ifdef ROOTICONPATH - } else { - const static TString rooticonpath = ROOTICONPATH; - return rooticonpath; - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -/// Get the fonts directory in the installation. Static utility function. - -const TString& TROOT::GetTTFFontDir() { -#ifdef TTFFONTDIR - if (IgnorePrefix()) { -#endif - static TString ttffontdir; - if (ttffontdir.IsNull()) { - ttffontdir = "fonts"; - gSystem->PrependPathName(GetRootSys(), ttffontdir); - } - return ttffontdir; -#ifdef TTFFONTDIR - } else { - const static TString ttffontdir = TTFFONTDIR; - return ttffontdir; - } + return ROOTTUTDIR; +#else + static TString tutdir = TString(gRootDir) + "/tutorials"; + return tutdir; #endif } - -//////////////////////////////////////////////////////////////////////////////// -/// Get the tutorials directory in the installation. Static utility function. -/// Backward compatibility function - do not use for new code - -const char *TROOT::GetTutorialsDir() { - return GetTutorialDir(); -} diff --git a/core/base/src/TSystem.cxx b/core/base/src/TSystem.cxx index f5d2e850325f3f808fecc33288f722b9a51aa204..8538e44a77dbdce9441cd1cf103d6033533dc9ef 100644 --- a/core/base/src/TSystem.cxx +++ b/core/base/src/TSystem.cxx @@ -1911,10 +1911,22 @@ int TSystem::Load(const char *module, const char *entry, Bool_t system) if (!system) { // Mark the library in $ROOTSYS/lib as system. const char *dirname = DirName(path); - system = R__MatchFilename(TROOT::GetLibDir(), dirname); +#ifdef ROOTLIBDIR + TString rootlibdir = ROOTLIBDIR; +#else + TString rootlibdir = "lib"; + PrependPathName(gRootDir, rootlibdir); +#endif + system = R__MatchFilename(rootlibdir,dirname); if (!system) { - system = R__MatchFilename(TROOT::GetBinDir(), dirname); +#ifdef ROOTBINDIR + TString rootbindir = ROOTBINDIR; +#else + TString rootbindir = "bin"; + PrependPathName(gRootDir, rootbindir); +#endif + system = R__MatchFilename(rootbindir,dirname); } } @@ -2566,9 +2578,12 @@ static void R__WriteDependencyFile(const TString &build_loc, const TString &depf #else TString touch = "echo > "; touch += "\"" + depfilename + "\""; #endif - TString builddep = "rmkdepend"; - gSystem->PrependPathName(TROOT::GetBinDir(), builddep); - builddep += " \"-f"; +#ifdef ROOTBINDIR + TString builddep = ROOTBINDIR; +#else + TString builddep = TString(gRootDir) + "/bin"; +#endif + builddep += "/rmkdepend \"-f"; builddep += depfilename; builddep += "\" -o_" + extension + "." + gSystem->GetSoExt() + " "; if (build_loc.BeginsWith(gSystem->WorkingDirectory())) { @@ -2590,7 +2605,12 @@ static void R__WriteDependencyFile(const TString &build_loc, const TString &depf builddep += "/\" "; } builddep += " -Y -- "; - TString rootsysInclude = TROOT::GetIncludeDir(); +#ifndef ROOTINCDIR + TString rootsysInclude = gSystem->Getenv("ROOTSYS"); + rootsysInclude += "/include"; +#else + TString rootsysInclude = ROOTINCDIR; +#endif builddep += " \"-I"+rootsysInclude+"\" "; // cflags builddep += includes; builddep += defines; @@ -3421,17 +3441,27 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt, TString name = ".rootmap"; TString sname = "system.rootmap"; TString file; - AssignAndDelete(file, ConcatFileName(TROOT::GetEtcDir(), sname) ); +#ifdef ROOTETCDIR + AssignAndDelete(file, ConcatFileName(ROOTETCDIR, sname) ); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + AssignAndDelete(file, ConcatFileName(etc, sname)); if (gSystem->AccessPathName(file)) { // for backward compatibility check also $ROOTSYS/system<name> if // $ROOTSYS/etc/system<name> does not exist - AssignAndDelete(file, ConcatFileName(TROOT::GetRootSys(), sname)); + AssignAndDelete(file, ConcatFileName(gRootDir, sname)); if (gSystem->AccessPathName(file)) { // for backward compatibility check also $ROOTSYS/<name> if // $ROOTSYS/system<name> does not exist - AssignAndDelete(file, ConcatFileName(TROOT::GetRootSys(), name)); + AssignAndDelete(file, ConcatFileName(gRootDir, name)); } } +#endif mapfileStream << file << std::endl; AssignAndDelete(file, ConcatFileName(gSystem->HomeDirectory(), name) ); mapfileStream << file << std::endl; @@ -3445,9 +3475,23 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt, mapfileStream.close(); // ======= Generate the rootcling command line - TString rcling = "rootcling"; - PrependPathName(TROOT::GetBinDir(), rcling); - rcling += " -v0 \"--lib-list-prefix="; + TString rcling; +#ifndef ROOTBINDIR + rcling = gSystem->Getenv("ROOTSYS"); +#ifndef R__WIN32 + rcling += "/bin/"; +#else + rcling += "\\bin\\"; +#endif +#else + rcling = ROOTBINDIR; +#ifndef R__WIN32 + rcling += "/"; +#else + rcling += "\\"; +#endif +#endif + rcling += "rootcling -v0 \"--lib-list-prefix="; rcling += mapfile; rcling += "\" -f \""; rcling.Append(dict).Append("\" -c -p "); diff --git a/core/clingutils/res/TClingUtils.h b/core/clingutils/res/TClingUtils.h index 1207dfb793ffe5e48e1ad270d0318df032375977..f583b4978d9ca99f95c712dd135236255730b938 100644 --- a/core/clingutils/res/TClingUtils.h +++ b/core/clingutils/res/TClingUtils.h @@ -334,6 +334,10 @@ clang::QualType AddDefaultParameters(clang::QualType instanceType, //______________________________________________________________________________ llvm::StringRef DataMemberInfo__ValidArrayIndex(const clang::DeclaratorDecl &m, int *errnum = 0, llvm::StringRef *errstr = 0); +//______________________________________________________________________________ +// Return the ROOT include directory +std::string GetROOTIncludeDir(bool rootbuild); + enum class EIOCtorCategory : short {kAbsent, kDefault, kIOPtrType, kIORefType}; //______________________________________________________________________________ @@ -539,6 +543,18 @@ clang::Module* declareModuleMap(clang::CompilerInstance* CI, const char* moduleFileName, const char* headers[]); +//______________________________________________________________________________ +// Return the -I needed to find RuntimeUniverse.h +std::string GetInterpreterExtraIncludePath(bool rootbuild); + +//______________________________________________________________________________ +// Return the LLVM / clang resource directory +std::string GetLLVMResourceDir(bool rootbuild); + +//______________________________________________________________________________ +// Return the ROOT include directory +std::string GetROOTIncludeDir(bool rootbuild); + //______________________________________________________________________________ // Return (in the argument 'output') a mangled version of the C++ symbol/type (pass as 'input') // that can be used in C++ as a variable name. diff --git a/core/clingutils/src/TClingUtils.cxx b/core/clingutils/src/TClingUtils.cxx index a86a66b0c8348c6f43ce9019598d84a83a3a5226..24c1bb3ee059444541020e9a13970f529e427dfd 100644 --- a/core/clingutils/src/TClingUtils.cxx +++ b/core/clingutils/src/TClingUtils.cxx @@ -3306,6 +3306,40 @@ void ROOT::TMetaUtils::GetFullyQualifiedTypeName(std::string &typenamestr, interpreter.getCI()->getASTContext()); } +//////////////////////////////////////////////////////////////////////////////// +/// Return the -I needed to find RuntimeUniverse.h + +std::string ROOT::TMetaUtils::GetInterpreterExtraIncludePath(bool rootbuild) +{ +#ifdef ROOTETCDIR + if (rootbuild) { + // Building ROOT, ignore ROOTETCDIR! +#endif + const char* rootsys = getenv("ROOTSYS"); + if (!rootsys) { + Error(0, "Environment variable ROOTSYS not set!\n"); + return "-Ietc"; + } + return std::string("-I") + rootsys + "/etc"; +#ifdef ROOTETCDIR + } + return std::string("-I") + ROOTETCDIR; +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +/// Return the LLVM / clang resource directory + +std::string ROOT::TMetaUtils::GetLLVMResourceDir(bool rootbuild) +{ +#ifdef R__EXTERN_LLVMDIR + return R__EXTERN_LLVMDIR; +#else + return GetInterpreterExtraIncludePath(rootbuild) + .substr(2, std::string::npos) + "/cling"; +#endif +} + //////////////////////////////////////////////////////////////////////////////// /// Get the template specialisation decl and template decl behind the qualtype /// Returns true if successfully found, false otherwise @@ -3936,6 +3970,29 @@ clang::QualType ROOT::TMetaUtils::GetTypeForIO(const clang::QualType& thisType, return GetNameTypeForIO(thisType, interpreter, normCtxt, mode).second; } +//////////////////////////////////////////////////////////////////////////////// + +std::string ROOT::TMetaUtils::GetROOTIncludeDir(bool rootbuild) +{ + const std::string defaultInclude ("include"); + if (!rootbuild) { +#ifndef ROOTINCDIR + const char* rootSysContent = getenv("ROOTSYS"); + if (rootSysContent) { + std::string incl_rootsys (rootSysContent); + return incl_rootsys + "/" + defaultInclude; + } else { + Error(0,"Environment variable ROOTSYS not set\n"); + return defaultInclude; + } +#else + return ROOTINCDIR; +#endif + } + + return defaultInclude; +} + //////////////////////////////////////////////////////////////////////////////// /// Return the dictionary file name for a module diff --git a/core/dictgen/res/rootcling_impl.h b/core/dictgen/res/rootcling_impl.h index 19b2adc9b54254bc414e719c4f5879958c81434a..cbd1133cf927d70eca063e88d7ccf863d8ec0fcf 100644 --- a/core/dictgen/res/rootcling_impl.h +++ b/core/dictgen/res/rootcling_impl.h @@ -19,12 +19,11 @@ namespace Internal { namespace RootCling { struct DriverConfig { bool fBuildingROOTStage1 = false; + std::string fLLVMResourceDir; const char** fPRootDir = nullptr; // Function that might (rootcling) or might not (rootcling_stage1) be there. const char ** * (*fTROOT__GetExtraInterpreterArgs)() = nullptr; - const char *(*fTROOT__GetIncludeDir)() = nullptr; - const char *(*fTROOT__GetEtcDir)() = nullptr; cling::Interpreter *(*fTCling__GetInterpreter)() = nullptr; void (*fInitializeStreamerInfoROOTFile)(const char *filename) = nullptr; void (*fAddStreamerInfoToROOTFile)(const char *normName) = nullptr; diff --git a/core/dictgen/src/rootcling_impl.cxx b/core/dictgen/src/rootcling_impl.cxx index cb010fe00f7e0d8f21c4550f096fb6a6b8745e5b..d54dd12dc7718b632bf5dbf5261a3dac7b33d956 100644 --- a/core/dictgen/src/rootcling_impl.cxx +++ b/core/dictgen/src/rootcling_impl.cxx @@ -270,6 +270,12 @@ const std::string gPathSeparator(ROOT::TMetaUtils::GetPathSeparator()); bool gBuildingROOT = false; const ROOT::Internal::RootCling::DriverConfig* gDriverConfig = nullptr; +#ifdef R__EXTERN_LLVMDIR +# define R__LLVMDIR R__EXTERN_LLVMDIR +#else +# define R__LLVMDIR "./interpreter/llvm/inst" // only works for rootbuild for now! +#endif + namespace { // Copy-pasted from TClass.h We cannot #include TClass.h because we are compiling in -fno-rtti mode template <typename T> struct IsPointerTClassCopy { @@ -699,7 +705,7 @@ void SetRootSys() if ((s = strrchr(ep, '/'))) { // $ROOTSYS/bin/rootcling int removesubdirs = 2; - if (!strncmp(s + 1, "rootcling_stage1", 16)) { + if (!strncmp(s + 1, "rootcling_stage1", 13)) { // $ROOTSYS/core/rootcling_stage1/src/rootcling_stage1 removesubdirs = 4; gBuildingROOT = true; @@ -3928,6 +3934,14 @@ int RootClingMain(int argc, clingArgs.push_back("-DG__VECTOR_HAS_CLASS_ITERATOR"); } +#if !defined(ROOTINCDIR) + if (!gBuildingROOT) + SetRootSys(); +#else + if (gBuildingROOT) + SetRootSys(); // Ignore install prefix +#endif + if (ic < argc && !strcmp(argv[ic], "-c")) { // Simply ignore the -c options. ic++; @@ -4083,7 +4097,7 @@ int RootClingMain(int argc, } ic = nextStart; - clingArgs.push_back(std::string("-I") + gDriverConfig->fTROOT__GetIncludeDir()); + clingArgs.push_back(std::string("-I") + TMetaUtils::GetROOTIncludeDir(gBuildingROOT)); std::vector<std::string> pcmArgs; for (size_t parg = 0, n = clingArgs.size(); parg < n; ++parg) { @@ -4107,7 +4121,7 @@ int RootClingMain(int argc, } // cling-only arguments - clingArgs.push_back(std::string("-I") + gDriverConfig->fTROOT__GetEtcDir()); + clingArgs.push_back(TMetaUtils::GetInterpreterExtraIncludePath(gBuildingROOT)); // We do not want __ROOTCLING__ in the pch! if (!onepcm) { clingArgs.push_back("-D__ROOTCLING__"); @@ -4132,9 +4146,11 @@ int RootClingMain(int argc, } #ifdef R__EXTERN_LLVMDIR - std::string resourceDir = R__EXTERN_LLVMDIR; + std::string resourceDir = R__EXTERN_LLVMDIR ; #else - std::string resourceDir = std::string(gDriverConfig->fTROOT__GetEtcDir()) + "/cling"; + std::string resourceDir = gDriverConfig->fLLVMResourceDir; + if (resourceDir.empty()) + resourceDir = TMetaUtils::GetLLVMResourceDir(gBuildingROOT); #endif std::unique_ptr<cling::Interpreter> owningInterpPtr; @@ -4185,6 +4201,11 @@ int RootClingMain(int argc, interp.getOptions().ErrorOut = true; interp.enableRawInput(true); +#ifdef ROOTINCDIR + const bool useROOTINCDIR = !gBuildingROOT; +#else + const bool useROOTINCDIR = false; +#endif if (isGenreflex) { if (interp.declare("namespace std {} using namespace std;") != cling::Interpreter::kSuccess) { // There was an error. @@ -4200,10 +4221,17 @@ int RootClingMain(int argc, "#include <stddef.h>\n" "#include <string.h>\n" ) != cling::Interpreter::kSuccess - || interp.declare("#include \"Rtypes.h\"\n" - "#include \"TClingRuntime.h\"\n" - "#include \"TObject.h\"" - ) != cling::Interpreter::kSuccess + || (!useROOTINCDIR + && interp.declare("#include \"Rtypes.h\"\n" + "#include \"TClingRuntime.h\"\n" + "#include \"TObject.h\"") != cling::Interpreter::kSuccess) +#ifdef ROOTINCDIR + || (useROOTINCDIR + && interp.declare("#include \"" ROOTINCDIR "/Rtypes.h\"\n" + "#include \"" ROOTINCDIR "/TClingRuntime.h\"\n" + "#include \"" ROOTINCDIR "/TObject.h\"") != cling::Interpreter::kSuccess + ) +#endif ) { // There was an error. ROOT::TMetaUtils::Error(0, "Error loading the default header files.\n"); diff --git a/core/meta/src/TClass.cxx b/core/meta/src/TClass.cxx index 709e8139f14166a0e075758ec98f0dc6a54ae8ce..6bc024cb52bac741cf140ac831e6ce694a31fd01 100644 --- a/core/meta/src/TClass.cxx +++ b/core/meta/src/TClass.cxx @@ -1722,7 +1722,17 @@ Int_t TClass::ReadRules() { static const char *suffix = "class.rules"; TString sname = suffix; - gSystem->PrependPathName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + gSystem->PrependPathName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + gSystem->PrependPathName(etc, sname); +#endif Int_t res = -1; diff --git a/core/metacling/res/rootclingTCling.h b/core/metacling/res/rootclingTCling.h index 0623bea5e0c6dfe97ee602137ffce36d951ea9f9..80b3b731c22b6806f35b9dfe8b37c343d664f922 100644 --- a/core/metacling/res/rootclingTCling.h +++ b/core/metacling/res/rootclingTCling.h @@ -27,7 +27,5 @@ namespace cling { extern "C" { R__DLLEXPORT const char ** *TROOT__GetExtraInterpreterArgs(); - R__DLLEXPORT const char *TROOT__GetIncludeDir(); - R__DLLEXPORT const char *TROOT__GetEtcDir(); R__DLLEXPORT cling::Interpreter *TCling__GetInterpreter(); } diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index 5d7a1a15aba261b87cc4a768e3bd94b2df1b4aa6..363ed7ab259b6380eb627b939456934cc9b384df 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -1057,26 +1057,27 @@ TCling::TCling(const char *name, const char *title) std::vector<std::string> clingArgsStorage; clingArgsStorage.push_back("cling4root"); + std::string interpInclude; // rootcling sets its arguments through TROOT::GetExtraInterpreterArgs(). if (!fromRootCling) { ROOT::TMetaUtils::SetPathsForRelocatability(clingArgsStorage); // Add -I early so ASTReader can find the headers. - std::string interpInclude(TROOT::GetEtcDir()); - clingArgsStorage.push_back("-I" + interpInclude); + std::string interpInclude = ROOT::TMetaUtils::GetInterpreterExtraIncludePath(false); + clingArgsStorage.push_back(interpInclude); // Add include path to etc/cling. FIXME: This is a short term solution. The // llvm/clang header files shouldn't be there at all. We have to get rid of // that dependency and avoid copying the header files. - clingArgsStorage.push_back("-I" + interpInclude + "/cling"); + clingArgsStorage.push_back(interpInclude + "/cling"); // Add the root include directory and etc/ to list searched by default. - clingArgsStorage.push_back(std::string("-I" + TROOT::GetIncludeDir())); + clingArgsStorage.push_back(std::string("-I") + ROOT::TMetaUtils::GetROOTIncludeDir(false)); // Add the current path to the include path // TCling::AddIncludePath("."); - std::string pchFilename = interpInclude + "/allDict.cxx.pch"; + std::string pchFilename = interpInclude.substr(2) + "/allDict.cxx.pch"; if (gSystem->Getenv("ROOT_PCH")) { pchFilename = gSystem->Getenv("ROOT_PCH"); } @@ -1095,11 +1096,7 @@ TCling::TCling(const char *name, const char *title) eArg = clingArgsStorage.end(); iArg != eArg; ++iArg) interpArgs.push_back(iArg->c_str()); -#ifdef R__EXTERN_LLVMDIR - TString llvmResourceDir = R__EXTERN_LLVMDIR; -#else - TString llvmResourceDir = TROOT::GetEtcDir() + "/cling"; -#endif + std::string llvmResourceDir = ROOT::TMetaUtils::GetLLVMResourceDir(false); // Add statically injected extra arguments, usually coming from rootcling. for (const char** extraArgs = TROOT::GetExtraInterpreterArgs(); extraArgs && *extraArgs; ++extraArgs) { @@ -1113,7 +1110,7 @@ TCling::TCling(const char *name, const char *title) fInterpreter = new cling::Interpreter(interpArgs.size(), &(interpArgs[0]), - llvmResourceDir); + llvmResourceDir.c_str()); if (!fromRootCling) { fInterpreter->installLazyFunctionCreator(llvmLazyFunctionCreator); @@ -4723,7 +4720,21 @@ void TCling::InitRootmapFile(const char *name) TString sname = "system"; sname += name; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif +#if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) + // on iOS etc does not exist and system<name> resides in $ROOTSYS + etc = gRootDir; +#endif + char *s = gSystem->ConcatFileName(etc, sname); +#endif Int_t ret = ReadRootmapFile(s); if (ret == -3) // old format diff --git a/core/metacling/src/rootclingTCling.cxx b/core/metacling/src/rootclingTCling.cxx index c75912fe1743419135b562172b67ef0ca337b229..a534005be488e561b64ba33d5078998f4656d022 100644 --- a/core/metacling/src/rootclingTCling.cxx +++ b/core/metacling/src/rootclingTCling.cxx @@ -29,18 +29,6 @@ const char ** *TROOT__GetExtraInterpreterArgs() return &TROOT::GetExtraInterpreterArgs(); } -extern "C" -const char *TROOT__GetIncludeDir() -{ - return TROOT::GetIncludeDir(); -} - -extern "C" -const char *TROOT__GetEtcDir() -{ - return TROOT::GetEtcDir(); -} - extern "C" cling::Interpreter *TCling__GetInterpreter() { diff --git a/core/rint/src/TRint.cxx b/core/rint/src/TRint.cxx index a7c653bbf7f5cf2c48243fb5bb2c6279d1ccfc96..a6cfa6824da883b31ca5b2a6310ec45c0986fc27 100644 --- a/core/rint/src/TRint.cxx +++ b/core/rint/src/TRint.cxx @@ -304,7 +304,17 @@ void TRint::ExecLogon() TString name = ".rootlogon.C"; TString sname = "system"; sname += name; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + char *s = gSystem->ConcatFileName(etc, sname); +#endif if (!gSystem->AccessPathName(s, kReadPermission)) { ProcessFile(s); } diff --git a/core/rint/src/TTabCom.cxx b/core/rint/src/TTabCom.cxx index 7c57bb10ce5e16279cd2ec52388e61e02763eac8..fb4751bd643c0e66c15817575bf3e10be98411ec 100644 --- a/core/rint/src/TTabCom.cxx +++ b/core/rint/src/TTabCom.cxx @@ -1671,7 +1671,8 @@ Int_t TTabCom::Hook(char *buf, int *pLoc, std::ostream& out) case kROOT_Load: { const TString fileName = s3("[^\"]*$"); - const TString dynamicPath = DeterminePath(fileName, gSystem->GetDynamicPath()); +// const TString dynamicPath = DeterminePath( fileName, TROOT::GetDynamicPath() ); /* should use this one */ + const TString dynamicPath = DeterminePath(fileName,gEnv->GetValue("Root.DynamicPath",(char *) 0)); const TSeqCollection *pListOfFiles = GetListOfFilesInPath(dynamicPath); // pos = Complete( "[^\"/]*$", pListOfFiles, "\");", out); diff --git a/core/rootcling_stage1/CMakeLists.txt b/core/rootcling_stage1/CMakeLists.txt index eefb2a4a35b287754718d9e4bf44be899738329b..c5e32b4370c7aa33cae4b1ed544d5415df7c186f 100644 --- a/core/rootcling_stage1/CMakeLists.txt +++ b/core/rootcling_stage1/CMakeLists.txt @@ -4,20 +4,26 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../dictgen/res) +set(ROOTCLING1TMPSRC ${CMAKE_CURRENT_BINARY_DIR}/rootcling_stage1_out.cxx) + +set(R__LLVMRESOURCEDIR ${CMAKE_BINARY_DIR}/etc/cling) +configure_file(src/rootcling_stage1.cxx ${ROOTCLING1TMPSRC} @ONLY) + if(WIN32) - set_source_files_properties(src/rootcling_stage1.cxx PROPERTIES COMPILE_FLAGS "-D_WIN32 -DNOMINMAX") + set_source_files_properties(${ROOTCLING1TMPSRC} PROPERTIES COMPILE_FLAGS "-D_WIN32 -DNOMINMAX -DR__HAVE_LLVMRESOURCEDIR") else() if(CXX_HAS_fno_rtti) - set_source_files_properties(src/rootcling_stage1.cxx PROPERTIES COMPILE_FLAGS "-fno-rtti") + set_source_files_properties(${ROOTCLING1TMPSRC} PROPERTIES COMPILE_FLAGS "-DR__HAVE_LLVMRESOURCEDIR -fno-rtti") + else() + set_source_files_properties(${ROOTCLING1TMPSRC} PROPERTIES COMPILE_FLAGS "-DR__HAVE_LLVMRESOURCEDIR") endif() endif() -ROOT_EXECUTABLE(rootcling_stage1 src/rootcling_stage1.cxx +ROOT_EXECUTABLE(rootcling_stage1 ${ROOTCLING1TMPSRC} $<TARGET_OBJECTS:Clib> $<TARGET_OBJECTS:ClingUtils> $<TARGET_OBJECTS:Dictgen> $<TARGET_OBJECTS:Foundation_Stage1> LIBRARIES ${CLING_LIBRARIES} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} NOINSTALL) -set_target_properties(rootcling_stage1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY src) add_dependencies(rootcling_stage1 CLING LLVMRES) diff --git a/core/rootcling_stage1/ModuleVars.mk b/core/rootcling_stage1/ModuleVars.mk index 86dbaaf18e4c5d2ad6e140d69f59aa299fa3f0fc..5ae9a98a6417e4f784fbe783428f5de6658b9722 100644 --- a/core/rootcling_stage1/ModuleVars.mk +++ b/core/rootcling_stage1/ModuleVars.mk @@ -8,8 +8,8 @@ ifneq ($(HOST),) ROOTCLING1DIRS := $(BUILDTOOLSDIR)/core/rootcling_stage1/src ROOTCLING1S := $(ROOTCLING1DIRS)/rootcling_stage1.cxx -ROOTCLING1O := $(ROOTCLING1S:.cxx=.o) -ROOTCLING1EXE := $(UTILSDIRS)/rootcling_stage1$(EXEEXT) +ROOTCLING1O := $(call stripsrc,$(ROOTCLING1S:.cxx=.o)) +ROOTCLING1EXE := $(call stripsrc,$(UTILSDIRS)/rootcling_stage1$(EXEEXT)) ROOTCLINGSTAGE1 := $(ROOTCLING1EXE) ##### Dependencies for all dictionaries diff --git a/core/rootcling_stage1/src/rootcling_stage1.cxx b/core/rootcling_stage1/src/rootcling_stage1.cxx index 44f83c0d315563fedbb18b50842ced5584c33e12..cae40d990c3141d960e77c07005e5d16e900ac80 100644 --- a/core/rootcling_stage1/src/rootcling_stage1.cxx +++ b/core/rootcling_stage1/src/rootcling_stage1.cxx @@ -11,7 +11,6 @@ #include "rootcling_impl.h" #include "RConfigure.h" #include "RConfig.h" -#include <stdlib.h> extern "C" { R__DLLEXPORT void usedToIdentifyRootClingByDlSym() {} @@ -20,16 +19,6 @@ extern "C" { ROOT::Internal::RootCling::TROOTSYSSetter gROOTSYSSetter; -static const char *GetIncludeDir() { - static std::string incdir = std::string(getenv("ROOTSYS")) + "/include"; - return incdir.c_str(); -} - -static const char *GetEtcDir() { - static std::string etcdir = std::string(getenv("ROOTSYS")) + "/etc"; - return etcdir.c_str(); -} - int main(int argc, char **argv) { // Force the emission of the symbol - the compiler cannot know that argv @@ -40,10 +29,15 @@ int main(int argc, char **argv) } ROOT::Internal::RootCling::DriverConfig config{}; +#ifdef R__HAVE_LLVMRESOURCEDIR + // This is ignored (in rootcling_impl.cxx) if R__EXTERN_LLVMDIR is defined. + // This is not configured (i.e. R__HAVE_LLVMRESOURCEDIR is undefined) for + // configure / make; the resource directory is instead determined by + // TMetaUtils::GetLLVMResourceDir() in rootcling_impl.cxx. + config.fLLVMResourceDir= "@R__LLVMRESOURCEDIR@"; +#endif config.fBuildingROOTStage1 = true; - config.fTROOT__GetIncludeDir = &GetIncludeDir; - config.fTROOT__GetEtcDir = &GetEtcDir; return ROOT_rootcling_Driver(argc, argv, config); } diff --git a/core/unix/src/TUnixSystem.cxx b/core/unix/src/TUnixSystem.cxx index ec21121ca984b9e40c3e214b211f3042883863ca..d6d7a7668f96683e4e4902948b6e8eaa3cbc8372 100644 --- a/core/unix/src/TUnixSystem.cxx +++ b/core/unix/src/TUnixSystem.cxx @@ -458,9 +458,7 @@ static const char *GetExePath() static void SetRootSys() { -#ifdef ROOTPREFIX - if (gSystem->Getenv("ROOTIGNOREPREFIX")) { -#endif +#ifndef ROOTPREFIX void *addr = (void *)SetRootSys; Dl_info info; if (dladdr(addr, &info) && info.dli_fname && info.dli_fname[0]) { @@ -473,8 +471,8 @@ static void SetRootSys() gSystem->Setenv("ROOTSYS", gSystem->DirName(rs)); } } -#ifdef ROOTPREFIX - } +#else + return; #endif } #endif @@ -502,9 +500,7 @@ static void DylibAdded(const struct mach_header *mh, intptr_t /* vmaddr_slide */ TRegexp sovers = "libCore\\.[0-9]+\\.*[0-9]*\\.so"; TRegexp dyvers = "libCore\\.[0-9]+\\.*[0-9]*\\.dylib"; -#ifdef ROOTPREFIX - if (gSystem->Getenv("ROOTIGNOREPREFIX")) { -#endif +#ifndef ROOTPREFIX #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR // first loaded is the app so set ROOTSYS to app bundle if (i == 1) { @@ -530,8 +526,6 @@ static void DylibAdded(const struct mach_header *mh, intptr_t /* vmaddr_slide */ } } #endif -#ifdef ROOTPREFIX - } #endif // when libSystem.B.dylib is loaded we have finished loading all dylibs @@ -619,8 +613,13 @@ Bool_t TUnixSystem::Init() SetRootSys(); #endif - // This is a fallback in case TROOT::GetRootSys() can't determine ROOTSYS - gRootDir = "/usr/local/root"; +#ifndef ROOTPREFIX + gRootDir = Getenv("ROOTSYS"); + if (gRootDir == 0) + gRootDir= "/usr/local/root"; +#else + gRootDir = ROOTPREFIX; +#endif return kFALSE; } @@ -2255,17 +2254,22 @@ void TUnixSystem::StackTrace() if (AccessPathName(gdbscript, kReadPermission)) { fprintf(stderr, "Root.StacktraceScript %s does not exist\n", gdbscript.Data()); gdbscript = ""; + } else { + gdbscript += " "; } } if (gdbscript == "") { - gdbscript = "gdb-backtrace.sh"; - gSystem->PrependPathName(TROOT::GetEtcDir(), gdbscript); +#ifdef ROOTETCDIR + gdbscript.Form("%s/gdb-backtrace.sh", ROOTETCDIR); +#else + gdbscript.Form("%s/etc/gdb-backtrace.sh", Getenv("ROOTSYS")); +#endif if (AccessPathName(gdbscript, kReadPermission)) { fprintf(stderr, "Error in <TUnixSystem::StackTrace> script %s is missing\n", gdbscript.Data()); return; } + gdbscript += " "; } - gdbscript += " "; TString gdbmess = gEnv->GetValue("Root.StacktraceMessage", ""); gdbmess = gdbmess.Strip(); @@ -4612,7 +4616,11 @@ static const char *DynamicPath(const char *newpath = 0, Bool_t reset = kFALSE) TString rdynpath = gEnv->GetValue("Root.DynamicPath", (char*)0); rdynpath.ReplaceAll(": ", ":"); // in case DynamicPath was extended if (rdynpath.IsNull()) { - rdynpath = ".:"; rdynpath += TROOT::GetLibDir(); +#ifdef ROOTLIBDIR + rdynpath = ".:"; rdynpath += ROOTLIBDIR; +#else + rdynpath = ".:"; rdynpath += gRootDir; rdynpath += "/lib"; +#endif } TString ldpath; #if defined (R__AIX) @@ -4633,9 +4641,16 @@ static const char *DynamicPath(const char *newpath = 0, Bool_t reset = kFALSE) else { dynpath = ldpath; dynpath += ":"; dynpath += rdynpath; } - if (!dynpath.Contains(TROOT::GetLibDir())) { - dynpath += ":"; dynpath += TROOT::GetLibDir(); + +#ifdef ROOTLIBDIR + if (!dynpath.Contains(ROOTLIBDIR)) { + dynpath += ":"; dynpath += ROOTLIBDIR; } +#else + if (!dynpath.Contains(TString::Format("%s/lib", gRootDir))) { + dynpath += ":"; dynpath += gRootDir; dynpath += "/lib"; + } +#endif if (gCling) { dynpath += ":"; dynpath += gCling->GetSTLIncludePath(); } else diff --git a/core/winnt/src/TWinNTSystem.cxx b/core/winnt/src/TWinNTSystem.cxx index af673895494c0b5815765ba1b2a516de83c6d38d..ad36e2da8a75563a9321c6522304696c9530bc66 100644 --- a/core/winnt/src/TWinNTSystem.cxx +++ b/core/winnt/src/TWinNTSystem.cxx @@ -362,7 +362,11 @@ namespace { TString rdynpath = gEnv ? gEnv->GetValue("Root.DynamicPath", (char*)0) : ""; rdynpath.ReplaceAll("; ", ";"); // in case DynamicPath was extended if (rdynpath == "") { - rdynpath = ".;"; rdynpath += TROOT::GetBinDir(); +#ifdef ROOTBINDIR + rdynpath = ".;"; rdynpath += ROOTBINDIR; +#else + rdynpath = ".;"; rdynpath += gRootDir; rdynpath += "/bin"; +#endif } TString path = gSystem->Getenv("PATH"); if (path == "") @@ -372,10 +376,15 @@ namespace { } } - - if (!dynpath.Contains(TROOT::GetLibDir())) { - dynpath += ";"; dynpath += TROOT::GetLibDir(); +#ifdef ROOTLIBDIR + if (!dynpath.Contains(ROOTLIBDIR)) { + dynpath += ";"; dynpath += ROOTLIBDIR; + } +#else + if (!dynpath.Contains(TString::Format("%s/lib", gRootDir))) { + dynpath += ";"; dynpath += gRootDir; dynpath += "/lib"; } +#endif return dynpath; } @@ -814,8 +823,16 @@ namespace { } // determine the fileopen.C file path: - TString fileopen = "fileopen.C"; - gSystem->PrependPathName(TROOT::GetMacroDir(), fileopen); + TString fileopen; +#ifndef ROOT_PREFIX + fileopen += sys->TWinNTSystem::DriveName(buf); + fileopen += ":"; + fileopen += sys->TWinNTSystem::DirName(sys->TWinNTSystem::DirName(buf)); + fileopen += "\\macros"; +#else + fileopen += ROOTMACRODIR; +#endif + fileopen += "\\fileopen.C"; if (regROOTwrite) { // only write to registry if fileopen.C is readable @@ -990,9 +1007,7 @@ fGUIThreadHandle(0), fGUIThreadId(0) char *buf = new char[MAX_MODULE_NAME32 + 1]; -#ifdef ROOTPREFIX - if (gSystem->Getenv("ROOTIGNOREPREFIX") { -#endif +#ifndef ROOTPREFIX // set ROOTSYS HMODULE hModCore = ::GetModuleHandle("libCore.dll"); if (hModCore) { @@ -1020,8 +1035,6 @@ fGUIThreadHandle(0), fGUIThreadId(0) } } } -#ifdef ROOTPREFIX - } #endif UpdateRegistry(this, buf); @@ -1099,17 +1112,23 @@ Bool_t TWinNTSystem::Init() fSigcnt = 0; - // This is a fallback in case TROOT::GetRootSys() can't determine ROOTSYS - static char lpFilename[MAX_PATH]; - if (::GetModuleFileName( - NULL, // handle to module to find filename for - lpFilename, // pointer to buffer to receive module path - sizeof(lpFilename))) { // size of buffer, in characters - const char *dirName = DirName(DirName(lpFilename)); - gRootDir = StrDup(dirName); - } else { - gRootDir = 0; +#ifndef ROOTPREFIX + gRootDir = Getenv("ROOTSYS"); + if (gRootDir == 0) { + static char lpFilename[MAX_PATH]; + if (::GetModuleFileName(NULL, // handle to module to find filename for + lpFilename, // pointer to buffer to receive module path + sizeof(lpFilename))) // size of buffer, in characters + { + const char *dirName = DirName(DirName(lpFilename)); + gRootDir = StrDup(dirName); + } else { + gRootDir = 0; + } } +#else + gRootDir= ROOTPREFIX; +#endif // Increase the accuracy of Sleep() without needing to link to winmm.lib typedef UINT (WINAPI* LPTIMEBEGINPERIOD)( UINT uPeriod ); diff --git a/core/zip/CMakeLists.txt b/core/zip/CMakeLists.txt index 2ab3b3a669bbdf8174a68f851474cde11b6baa3e..e23ab045e1edcf8efcdafd653237fe0891df2881 100644 --- a/core/zip/CMakeLists.txt +++ b/core/zip/CMakeLists.txt @@ -22,7 +22,6 @@ set(ZLIB_SRCS ${ZipOldSource} ${CMAKE_CURRENT_SOURCE_DIR}/src/Compression.cxx ${ # Define all the header files which should be installed when # doing a "make install" install(FILES ${ZLIB_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers) -file(COPY ${ZLIB_HEADERS} DESTINATION ${CMAKE_BINARY_DIR}/include) set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/inc) ROOT_OBJECT_LIBRARY(Zip ${ZLIB_SRCS}) diff --git a/documentation/doxygen/converttonotebook.py b/documentation/doxygen/converttonotebook.py index 5e40cdb766d2847c5b7f5b4ffdaa6eb798f8d9ab..3b3f6e501e918a68f3cbb916744d1aa629b1c441 100755 --- a/documentation/doxygen/converttonotebook.py +++ b/documentation/doxygen/converttonotebook.py @@ -601,7 +601,7 @@ def declareNamespace(code): def rs401dGetFiles(code): if tutName == "rs401d_FeldmanCousins": code = code.replace( - """#if !defined(__CINT__) || defined(__MAKECINT__)\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.h"\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx" // so that it can be executed directly\n#else\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx+" // so that it can be executed directly\n#endif""" , """TString tutDir = gROOT->GetTutorialDir();\nTString headerDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.h\\\"", tutDir.Data());\nTString impDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.cxx\\\"", tutDir.Data());\ngROOT->ProcessLine(headerDir);\ngROOT->ProcessLine(impDir);""") + """#if !defined(__CINT__) || defined(__MAKECINT__)\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.h"\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx" // so that it can be executed directly\n#else\n#include "../tutorials/roostats/NuMuToNuE_Oscillation.cxx+" // so that it can be executed directly\n#endif""" , """std::string tutDir = gROOT->GetTutorialsDir();\nTString headerDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.h\\\"", tutDir.c_str());\nTString impDir = TString::Format("#include \\\"%s/roostats/NuMuToNuE_Oscillation.cxx\\\"", tutDir.c_str());\ngROOT->ProcessLine(headerDir);\ngROOT->ProcessLine(impDir);""") return code diff --git a/geom/geom/src/TGeoElement.cxx b/geom/geom/src/TGeoElement.cxx index 633328f62e0c042f31449f89fba7d84603962425..ef82ca891cc2e927a811f696a969a8317d27db79 100644 --- a/geom/geom/src/TGeoElement.cxx +++ b/geom/geom/src/TGeoElement.cxx @@ -39,7 +39,6 @@ Table of elements #include "Riostream.h" #include "TSystem.h" -#include "TROOT.h" #include "TObjArray.h" #include "TVirtualGeoPainter.h" #include "TGeoManager.h" @@ -1129,8 +1128,12 @@ void TGeoElementTable::ImportElementsRN() { if (HasRNElements()) return; TGeoElementRN *elem; - TString rnf = "RadioNuclides.txt"; - gSystem->PrependPathName(TROOT::GetEtcDir(), rnf); + TString rnf; +#ifdef ROOTETCDIR + rnf.Form("%s/RadioNuclides.txt", ROOTETCDIR); +#else + rnf.Form("%s/etc/RadioNuclides.txt", gSystem->Getenv("ROOTSYS")); +#endif FILE *fp = fopen(rnf, "r"); if (!fp) { Error("ImportElementsRN","File RadioNuclides.txt not found"); diff --git a/graf2d/asimage/src/TASImage.cxx b/graf2d/asimage/src/TASImage.cxx index 9b22b97a65cc1a92c24b0c2b335ce90c5e6fcde3..d3a4127facec5a3824a8466a786c661df636237e 100644 --- a/graf2d/asimage/src/TASImage.cxx +++ b/graf2d/asimage/src/TASImage.cxx @@ -360,33 +360,33 @@ TASImage::~TASImage() static void init_icon_paths() { - TString icon_path = gEnv->GetValue("Gui.IconPath", ""); - if (icon_path.IsNull()) { - icon_path = "icons"; - gSystem->PrependPathName(gSystem->HomeDirectory(), icon_path); -#ifndef R__WIN32 - icon_path = ".:" + icon_path + ":" + TROOT::GetIconPath() + ":" + EXTRAICONPATH; -#else - icon_path = ".;" + icon_path + ";" + TROOT::GetIconPath() + ";" + EXTRAICONPATH; + const char *icons = "/icons"; +#ifdef R__WIN32 + icons = "\\icons"; #endif - } - Int_t cnt = 0; - Ssiz_t from = 0; - TString token; -#ifndef R__WIN32 - const char *delim = "/"; -#else - const char *delim = "\\"; + TString homeIcons = gSystem->HomeDirectory(); + homeIcons += icons; + + TString rootIcons = gSystem->Getenv("ROOTSYS"); + rootIcons += icons; + + TString guiIcons = gEnv->GetValue("Gui.IconPath", ""); + + gIconPaths[0] = StrDup("."); + gIconPaths[1] = StrDup(homeIcons.Data()); + gIconPaths[2] = StrDup(rootIcons.Data()); + gIconPaths[3] = StrDup(guiIcons.Data()); + +#ifdef ROOTICONPATH + gIconPaths[4] = StrDup(ROOTICONPATH); #endif - while (icon_path.Tokenize(token, from, delim) && cnt < 6) { - char *path = gSystem->ExpandPathName(token.Data()); - if (path) { - gIconPaths[cnt] = path; - cnt++; - } - } - gIconPaths[cnt] = 0; + +#ifdef EXTRAICONPATH + gIconPaths[5] = StrDup(EXTRAICONPATH); +#endif + + gIconPaths[6] = 0; } //////////////////////////////////////////////////////////////////////////////// @@ -2595,19 +2595,14 @@ void TASImage::DrawText(Int_t x, Int_t y, const char *text, Int_t size, TString fn = font_name; fn.Strip(); - - // This is for backward compatibility... - if (fn.Last('/') == 0) fn = fn(1, fn.Length() - 1); - - const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); - char *tmpstr = gSystem->Which(ttpath, fn, kReadPermission); - fn = tmpstr; - delete [] tmpstr; + char *tmpstr = 0; if (fn.EndsWith(".pfa") || fn.EndsWith(".PFA") || fn.EndsWith(".pfb") || fn.EndsWith(".PFB") || fn.EndsWith(".ttf") || fn.EndsWith(".TTF") || fn.EndsWith(".otf") || fn.EndsWith(".OTF")) { + tmpstr = gSystem->ExpandPathName(fn.Data()); + fn = tmpstr; ttfont = kTRUE; } + delete [] tmpstr; if (color) { parse_argb_color(color, &text_color); diff --git a/graf2d/cocoa/src/QuartzWindow.mm b/graf2d/cocoa/src/QuartzWindow.mm index a44aed24ef52906175799457f52abbcaaa0a23be..9a4f6044a439e1f0f694f8aa338e86d93606bdf3 100644 --- a/graf2d/cocoa/src/QuartzWindow.mm +++ b/graf2d/cocoa/src/QuartzWindow.mm @@ -40,7 +40,6 @@ #include "TGClient.h" #include "TSystem.h" #include "TGCocoa.h" -#include "TROOT.h" namespace ROOT { @@ -808,7 +807,11 @@ NSCursor *CreateCustomCursor(ECursor currentCursor) } if (pngFileName) { - const char * const path = gSystem->Which(TROOT::GetIconPath(), pngFileName, kReadPermission); +#ifdef ROOTICONPATH + const char * const path = gSystem->Which(ROOTICONPATH, pngFileName, kReadPermission); +#else + const char * const path = gSystem->Which("$ROOTSYS/icons", pngFileName, kReadPermission); +#endif const Util::ScopedArray<const char> arrayGuard(path); if (!path || path[0] == 0) { @@ -3058,7 +3061,11 @@ void print_mask_info(ULong_t mask) } if (pngFileName) { - const char * const path = gSystem->Which(TROOT::GetIconPath(), pngFileName, kReadPermission); +#ifdef ROOTICONPATH + const char * const path = gSystem->Which(ROOTICONPATH, pngFileName, kReadPermission); +#else + const char * const path = gSystem->Which("$ROOTSYS/icons", pngFileName, kReadPermission); +#endif const Util::ScopedArray<const char> arrayGuard(path); if (!path || path[0] == 0) { diff --git a/graf2d/gpad/src/TClassTree.cxx b/graf2d/gpad/src/TClassTree.cxx index f90062f65eedde53dec654aa98fca29d2a22212b..a16d36c4d10d1aa71bcaba5d62d0171c78685a73 100644 --- a/graf2d/gpad/src/TClassTree.cxx +++ b/graf2d/gpad/src/TClassTree.cxx @@ -195,7 +195,11 @@ TClassTree::TClassTree() fNdata = 0; SetLabelDx(); SetYoffset(0); - SetSourceDir(".:src:" + TROOT::GetSourceDir()); +#ifdef ROOTSRCDIR + SetSourceDir(".:src:" ROOTSRCDIR); +#else + SetSourceDir(".:src:$ROOTSYS/src"); +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -221,7 +225,11 @@ TClassTree::TClassTree(const char *name, const char *classes) fNdata = 0; SetLabelDx(); SetYoffset(0); - SetSourceDir(".:src:" + TROOT::GetSourceDir()); +#ifdef ROOTSRCDIR + SetSourceDir(".:src:" ROOTSRCDIR); +#else + SetSourceDir(".:src:$ROOTSYS/src"); +#endif // draw list of classes (if specified) if (classes && strlen(classes)) { diff --git a/graf2d/graf/src/TTF.cxx b/graf2d/graf/src/TTF.cxx index adc614ac182e722710c64952ae5f5d888d73d30b..a6a7e02abcf8da9c674a79af4d836fa4a739032a 100644 --- a/graf2d/graf/src/TTF.cxx +++ b/graf2d/graf/src/TTF.cxx @@ -15,10 +15,12 @@ Interface to the freetype 2 library. */ +// RConfigure.h is needed for TTFFONTDIR +#include "RConfigure.h" + # include <ft2build.h> # include FT_FREETYPE_H # include FT_GLYPH_H -#include "TROOT.h" #include "TTF.h" #include "TSystem.h" #include "TEnv.h" @@ -413,7 +415,13 @@ Int_t TTF::SetTextFont(const char *fontname, Int_t italic) // try to load font (font must be in Root.TTFontPath resource) const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +# ifdef TTFFONTDIR + TTFFONTDIR +# else + "$(ROOTSYS)/fonts" +# endif + ); + char *ttfont = gSystem->Which(ttpath, fontname, kReadPermission); if (!ttfont) { @@ -535,7 +543,12 @@ void TTF::SetTextFont(Font_t fontnumber) // try to load font (font must be in Root.TTFontPath resource) // to see which fontset we have available const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +#ifdef TTFFONTDIR + TTFFONTDIR +#else + "$(ROOTSYS)/fonts" +#endif + ); char *ttfont = gSystem->Which(ttpath, gEnv->GetValue(fonttable[fontid][0], fonttable[fontid][1]), kReadPermission); if (ttfont) { delete [] ttfont; diff --git a/graf2d/postscript/src/TPostScript.cxx b/graf2d/postscript/src/TPostScript.cxx index 5de4b07e6a66d51474b66af2e0bfdb86210c1b3f..2af1ebdb516f9bd5dcbcff50ed12bf50b3095899 100644 --- a/graf2d/postscript/src/TPostScript.cxx +++ b/graf2d/postscript/src/TPostScript.cxx @@ -1568,7 +1568,12 @@ void TPostScript::FontEmbed(void) // try to load font (font must be in Root.TTFontPath resource) const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +#ifdef TTFFONTDIR + TTFFONTDIR +#else // TTFFONTDIR + "$(ROOTSYS)/fonts" +#endif // TTFFONTDIR + ); for (Int_t fontid = 1; fontid < 30; fontid++) { if (fontid != 15 && MustEmbed[fontid-1]) { diff --git a/graf2d/qt/src/TGQt.cxx b/graf2d/qt/src/TGQt.cxx index 69e149a62e1a0f59f145141e89541869533322b5..b376f8b549cf9050dbe67ed9fd381c29e002f23e 100644 --- a/graf2d/qt/src/TGQt.cxx +++ b/graf2d/qt/src/TGQt.cxx @@ -707,6 +707,13 @@ QPixmap *TGQt::MakeIcon(Int_t i) GetSystemMetrics(SM_CYSMICON)); HDC dc = tempIcon->handle(); DrawIcon (dc, 0, 0, icon); +#else +# ifdef ROOTICONPATH + gSystem->ExpandPathName(ROOTICONPATH); +# else + gSystem->ExpandPathName("$ROOTSYS/icons/"); +// tempIcon =new QPixmap (16,16), +# endif #endif return tempIcon; } @@ -796,7 +803,13 @@ TQtApplication *TGQt::CreateQtApplicationImp() static TQtApplication *app = 0; if (!app) { // app = new TQtApplication(gApplication->ApplicationName(),gApplication->Argc(),gApplication->Argv()); - static TString argvString (TROOT::GetBinDir() + "/root.exe"); + static TString argvString ( +#ifdef ROOTBINDIR + ROOTBINDIR "/root.exe" +#else + "$ROOTSYS/bin/root.exe" +#endif + ); gSystem->ExpandPathName(argvString); static char *argv[] = {(char *)argvString.Data()}; static int nArg = 1; @@ -984,8 +997,14 @@ Bool_t TGQt::Init(void* /*display*/) } if (isXdfSupport && !symbolFontFound) { - // Load the local ROOT font - QString fontdir = TROOT::GetTTFFontDir().Data(); +// Load the local ROOT font + QString fontdir = +#ifdef TTFFONTDIR + TTFFONTDIR +#else + "$ROOTSYS/fonts" +#endif + ; QString symbolFontFile = fontdir + "/" + QString(fSymbolFontFamily).toLower() + ".ttf"; symbolFontFound = QFontDatabase::addApplicationFont(symbolFontFile); } @@ -995,7 +1014,12 @@ Bool_t TGQt::Init(void* /*display*/) fontFamily = fSymbolFontFamily = "Arial"; qDebug() << " Substitute it with \""<<fontFamily <<"\""; qDebug() << " Make sure your local \"~/.fonts.conf\" or \"/etc/fonts/fonts.conf\" file points to \"" - << TROOT::GetTTFFontDir() + << +#ifdef TTFFONTDIR + TTFFONTDIR +#else + "$ROOTSYS/fonts" +#endif << "\" directory to get the proper support for ROOT TLatex class"; // create a custom codec new QSymbolCodec(); diff --git a/graf3d/gl/src/TGLFontManager.cxx b/graf3d/gl/src/TGLFontManager.cxx index 9b888353622ad32165ad3657d1da2afa3ee47385..068dcc9303262e55360e56a01a62b2ff670ebbbd 100644 --- a/graf3d/gl/src/TGLFontManager.cxx +++ b/graf3d/gl/src/TGLFontManager.cxx @@ -14,7 +14,6 @@ #include "TGLFontManager.h" -#include "TROOT.h" #include "TVirtualX.h" #include "TMath.h" #include "TSystem.h" @@ -452,7 +451,11 @@ void TGLFontManager::RegisterFont(Int_t sizeIn, Int_t fileID, TGLFont::EMode mod if (it == fFontMap.end()) { TString ttpath, file; - ttpath = gEnv->GetValue("Root.TTGLFontPath", TROOT::GetTTFFontDir()); +# ifdef TTFFONTDIR + ttpath = gEnv->GetValue("Root.TTGLFontPath", TTFFONTDIR ); +# else + ttpath = gEnv->GetValue("Root.TTGLFontPath", "$(ROOTSYS)/fonts"); +# endif { //For extenede we have both ttf and otf. char *fp = gSystem->Which(ttpath, fileID < fgExtendedFontStart ? diff --git a/graf3d/gl/src/TGLSAViewer.cxx b/graf3d/gl/src/TGLSAViewer.cxx index cc35bcc568ec0cdc50238913ed10185242df8040..ee13468ecefc554442991d3d1ce8c11c6e8e2126 100644 --- a/graf3d/gl/src/TGLSAViewer.cxx +++ b/graf3d/gl/src/TGLSAViewer.cxx @@ -669,7 +669,14 @@ Bool_t TGLSAViewer::ProcessFrameMessage(Long_t msg, Long_t parm1, Long_t) switch (parm1) { case kGLHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +#ifdef ROOTBINDIR + rootx = ROOTBINDIR; +#else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +#endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/graf3d/gl/src/TGLText.cxx b/graf3d/gl/src/TGLText.cxx index 3b3bd9941a2017627137ab7d09d8e698b6f334e0..7f2c17ab93edb05aa6190fddaa166d1944b60642 100644 --- a/graf3d/gl/src/TGLText.cxx +++ b/graf3d/gl/src/TGLText.cxx @@ -197,7 +197,13 @@ void TGLText::SetGLTextFont(Font_t fontnumber) // try to load font (font must be in Root.TTFontPath resource) const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +# ifdef TTFFONTDIR + TTFFONTDIR +# else + "$(ROOTSYS)/fonts" +# endif + ); + char *ttfont = gSystem->Which(ttpath, fontname, kReadPermission); if (fGLTextFont) delete fGLTextFont; diff --git a/gui/gui/src/TGApplication.cxx b/gui/gui/src/TGApplication.cxx index 5939d137565d8891a0abf7ed3668252c6f83a50e..b65cfad765678b6fe32a3f8380d10f79435d5cef 100644 --- a/gui/gui/src/TGApplication.cxx +++ b/gui/gui/src/TGApplication.cxx @@ -84,7 +84,12 @@ TGApplication::TGApplication(const char *appClassName, if (strcmp(appClassName, "proofserv")) { const char *ttpath = gEnv->GetValue("Root.TTFontPath", - TROOT::GetTTFFontDir()); +#ifdef TTFFONTDIR + TTFFONTDIR); +#else + "$(ROOTSYS)/fonts"); +#endif + char *ttfont = gSystem->Which(ttpath, "arialbd.ttf", kReadPermission); // Added by cholm for use of DFSG - fonts - based on fix by Kevin if (!ttfont) diff --git a/gui/gui/src/TGResourcePool.cxx b/gui/gui/src/TGResourcePool.cxx index 4057f88eb50f20c647641ebd1fc556509f658fb0..df135dbd4910de0a3762ee56a975f8208658625d 100644 --- a/gui/gui/src/TGResourcePool.cxx +++ b/gui/gui/src/TGResourcePool.cxx @@ -83,29 +83,46 @@ TGResourcePool::TGResourcePool(TGClient *client) TString framebgpixmap = gEnv->GetValue("Gui.FrameBackgroundPixmap", ""); TString docbgpixmap = gEnv->GetValue("Gui.DocumentBackgroundPixmap", ""); - TString icon_path = gEnv->GetValue("Gui.IconPath", ""); - if (icon_path.IsNull()) { - icon_path = "icons"; - gSystem->PrependPathName(gSystem->HomeDirectory(), icon_path); -#ifndef R__WIN32 - icon_path = ".:" + icon_path + ":" + TROOT::GetIconPath() + ":" + EXTRAICONPATH; -#else - icon_path = ".;" + icon_path + ";" + TROOT::GetIconPath() + ";" + EXTRAICONPATH; -#endif - } + TString icon_path; + TString mime_file; + TString line; - TString mime_file = ".root.mimes"; - gSystem->PrependPathName(gSystem->HomeDirectory(), mime_file); - mime_file = gEnv->GetValue("Gui.MimeTypeFile", mime_file.Data()); +#ifndef R__WIN32 +# ifdef ROOTICONPATH + icon_path = TString::Format("%s/icons:%s:.:", gSystem->HomeDirectory(), + ROOTICONPATH); +# ifdef EXTRAICONPATH + icon_path += gEnv->GetValue("Gui.IconPath", EXTRAICONPATH); +# else + icon_path += gEnv->GetValue("Gui.IconPath", ""); +# endif +# else + icon_path = TString::Format("%s/icons:%s/icons:.:", gSystem->HomeDirectory(), + gSystem->Getenv("ROOTSYS")); + icon_path += gEnv->GetValue("Gui.IconPath", ""); +# endif + line = TString::Format("%s/.root.mimes", gSystem->HomeDirectory()); + + mime_file = gEnv->GetValue("Gui.MimeTypeFile", line.Data()); char *mf = gSystem->ExpandPathName(mime_file.Data()); if (mf) { mime_file = mf; delete [] mf; } - if (gSystem->AccessPathName(mime_file, kReadPermission)) { - mime_file = "root.mimes"; - gSystem->PrependPathName(TROOT::GetEtcDir(), mime_file); - } + if (gSystem->AccessPathName(mime_file, kReadPermission)) +#ifdef ROOTETCDIR + mime_file = TString::Format("%s/root.mimes", ROOTETCDIR); +#else + mime_file = TString::Format("%s/etc/root.mimes", gSystem->Getenv("ROOTSYS")); +#endif +#else // R__WIN32 + icon_path = TString::Format("%s\\icons:.:\\", gSystem->Getenv("ROOTSYS")); + icon_path += gEnv->GetValue("Gui.IconPath", ""); + line = TString::Format("%s\\root.mimes", gSystem->HomeDirectory()); + mime_file = gEnv->GetValue("Gui.MimeTypeFile", line.Data()); + if (gSystem->AccessPathName(mime_file, kReadPermission)) + mime_file = TString::Format("%s\\etc\\root.mimes", gSystem->Getenv("ROOTSYS")); +#endif // Setup colors... fClient->GetColorByName("white", fWhite); // white and black always exist diff --git a/gui/gui/src/TGSpeedo.cxx b/gui/gui/src/TGSpeedo.cxx index a39dcdfe587c4782466b1f9386534ec5dab3bf70..f28993cfc6db32ac43b222b3f7e682b25d77f683 100644 --- a/gui/gui/src/TGSpeedo.cxx +++ b/gui/gui/src/TGSpeedo.cxx @@ -119,7 +119,8 @@ void TGSpeedo::Build() { TString sc; Float_t step, mark[5]; - TString ar = "arialbd.ttf"; + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString ar = fp + "/arialbd.ttf"; Int_t i, nexe, offset; const TGFont *counterFont = fClient->GetFont("-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*"); @@ -527,7 +528,8 @@ void TGSpeedo::DrawText() delete fImage2; fImage2 = (TImage*)fImage->Clone("fImage2"); if (!fImage2 || !fImage2->IsValid()) return; - TString ar = "arialbd.ttf"; + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString ar = fp + "/arialbd.ttf"; // format counter value Int_t nexe = 0; Int_t ww = fCounter; @@ -607,7 +609,8 @@ void TGSpeedo::DoRedraw() delete fImage2; fImage2 = (TImage*)fImage->Clone("fImage2"); if (!fImage2 || !fImage2->IsValid()) return; - TString ar = "arialbd.ttf"; + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString ar = fp + "/arialbd.ttf"; // format counter value Int_t nexe = 0; Int_t ww = fCounter; diff --git a/gui/gui/src/TGTextEditor.cxx b/gui/gui/src/TGTextEditor.cxx index c6abee5111dc6d3130c3f5523cada2768bf3674d..aab053f7b95659a8bf2c1866c1eb8a5a762d6e30 100644 --- a/gui/gui/src/TGTextEditor.cxx +++ b/gui/gui/src/TGTextEditor.cxx @@ -842,7 +842,14 @@ void TGTextEditor::InterruptMacro() void TGTextEditor::About() { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/gui/gui/src/TRootBrowser.cxx b/gui/gui/src/TRootBrowser.cxx index 700588f8a5568227e0a5802ae2ad9340494428f2..4d127151cbc11235aabeb2a29ff1d98295bf00bd 100644 --- a/gui/gui/src/TRootBrowser.cxx +++ b/gui/gui/src/TRootBrowser.cxx @@ -702,7 +702,14 @@ void TRootBrowser::HandleMenu(Int_t id) case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/gui/gui/src/TRootBrowserLite.cxx b/gui/gui/src/TRootBrowserLite.cxx index f934b806066f8f05e9046bf466e82aa4d02abd0f..da2a188469876ee867e2800cf1dbaa79792b126f 100644 --- a/gui/gui/src/TRootBrowserLite.cxx +++ b/gui/gui/src/TRootBrowserLite.cxx @@ -1962,7 +1962,14 @@ Bool_t TRootBrowserLite::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/gui/gui/src/TRootCanvas.cxx b/gui/gui/src/TRootCanvas.cxx index fe9ca9bff5f2f3838b5111482e3a4002919aba75..d6832d4484559d2a105f49261547866ba849e892 100644 --- a/gui/gui/src/TRootCanvas.cxx +++ b/gui/gui/src/TRootCanvas.cxx @@ -1192,7 +1192,14 @@ again: case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/gui/guihtml/src/TGHtmlBrowser.cxx b/gui/guihtml/src/TGHtmlBrowser.cxx index 3eafaeddeea1f323836c467e77da72b4b9d58648..912fbcbf269048411f568e865660d2a2319548d4 100644 --- a/gui/guihtml/src/TGHtmlBrowser.cxx +++ b/gui/guihtml/src/TGHtmlBrowser.cxx @@ -629,7 +629,14 @@ Bool_t TGHtmlBrowser::ProcessMessage(Long_t msg, Long_t parm1, Long_t) case kM_HELP_ABOUT: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/gui/sessionviewer/src/TSessionViewer.cxx b/gui/sessionviewer/src/TSessionViewer.cxx index 569757ecc60f7dd204d1084eaccb7d54e58c6e6c..42aa22869b2386b775463b1929422c7894c29443 100644 --- a/gui/sessionviewer/src/TSessionViewer.cxx +++ b/gui/sessionviewer/src/TSessionViewer.cxx @@ -5812,7 +5812,14 @@ Bool_t TSessionViewer::ProcessMessage(Long_t msg, Long_t parm1, Long_t) case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/html/src/THtml.cxx b/html/src/THtml.cxx index 61f4c370824cae13da55d7131738c96a10729cd2..1b602236ba1a8f8ea0df694b8799b506dcc646f3 100644 --- a/html/src/THtml.cxx +++ b/html/src/THtml.cxx @@ -1349,7 +1349,18 @@ const char* THtml::GetEtcDir() const R__LOCKGUARD(GetMakeClassMutex()); fPathInfo.fEtcDir = "html"; - gSystem->PrependPathName(TROOT::GetEtcDir(), fPathInfo.fEtcDir); + +#ifdef ROOTETCDIR + gSystem->PrependPathName(ROOTETCDIR, fPathInfo.fEtcDir); +#else + gSystem->PrependPathName("etc", fPathInfo.fEtcDir); +# ifdef ROOTPREFIX + gSystem->PrependPathName(ROOTPREFIX, fPathInfo.fEtcDir); +# else + if (getenv("ROOTSYS")) + gSystem->PrependPathName(getenv("ROOTSYS"), fPathInfo.fEtcDir); +# endif +#endif return fPathInfo.fEtcDir; } @@ -1660,7 +1671,12 @@ void THtml::CreateListOfClasses(const char* filter) if (posSpace != std::string::npos) lib.erase(posSpace); if (rootLibs.find(lib) == rootLibs.end()) { - TString rootlibdir = TROOT::GetLibDir(); +#ifdef ROOTLIBDIR + TString rootlibdir = ROOTLIBDIR; +#else + TString rootlibdir = "lib"; + gSystem->PrependPathName(gRootDir, rootlibdir); +#endif TString sLib(lib); if (sLib.Index('.') == -1) { sLib += "."; diff --git a/io/io/src/TFile.cxx b/io/io/src/TFile.cxx index e58a7bfb24e01882e9a4127286d33e71a7b1cbf6..759835db0196283c3ca9bfe2bd7fecf445a47230 100644 --- a/io/io/src/TFile.cxx +++ b/io/io/src/TFile.cxx @@ -3102,7 +3102,11 @@ void TFile::MakeProject(const char *dirname, const char * /*classes*/, return; } // Get Makefile.arch - TString mkarchsrc = TString::Format("%s/Makefile.arch", TROOT::GetEtcDir().Data()); +#ifdef ROOTETCDIR + TString mkarchsrc = TString::Format("%s/Makefile.arch", ROOTETCDIR); +#else + TString mkarchsrc("$(ROOTSYS)/etc/Makefile.arch"); +#endif if (gSystem->ExpandPathName(mkarchsrc)) Warning("MakeProject", "problems expanding '%s'", mkarchsrc.Data()); TString mkarchdst = TString::Format("%s/Makefile.arch", clean_dirname.Data()); diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 2af4e8f4ec32c3a4c713605414ed2e2bba9e6b7d..b1b51f8b1548f95b230bb5c350728a46ee4024ba 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -43,9 +43,9 @@ if(python) endforeach() install(FILES python/cmdLineUtils.py DESTINATION ${runtimedir}) - install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}${runtimedir}/cmdLineUtils.py)") - install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile \$ENV{DESTDIR}${runtimedir}/cmdLineUtils.py)") - configure_file(python/cmdLineUtils.py ${localruntimedir}/cmdLineUtils.py @ONLY) + install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${runtimedir}/cmdLineUtils.py )") + install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${runtimedir}/cmdLineUtils.py )") + configure_file(python/cmdLineUtils.py ${CMAKE_BINARY_DIR}/${runtimedir}/cmdLineUtils.py @ONLY) endif() diff --git a/main/ModuleVars.mk b/main/ModuleVars.mk index eaf5d69931afe160d4fecb8945ac02de6b2c204b..22af989ef87dab9ba1c4e777f9d1244ec5a3bb02 100644 --- a/main/ModuleVars.mk +++ b/main/ModuleVars.mk @@ -5,7 +5,7 @@ ##### rootcling ##### ROOTCLINGEXE := bin/rootcling$(EXEEXT) -ROOTCLINGSTAGE2 := ROOTIGNOREPREFIX=1 $(ROOTCLINGEXE) -rootbuild +ROOTCLINGSTAGE2 := $(ROOTCLINGEXE) -rootbuild # Dependencies for all dictionaries ROOTCLINGSTAGE2DEP := $(ROOTCLINGEXE) diff --git a/main/src/nbmain.cxx b/main/src/nbmain.cxx index 55d4f2f3aa238f84d2e023d275478a1547d946d0..c183628f867fcc2a9c573046c114cfd242482cf2 100644 --- a/main/src/nbmain.cxx +++ b/main/src/nbmain.cxx @@ -173,9 +173,15 @@ static bool CreateStamp(string dest) int main() { - string rootbin(TROOT::GetBinDir()); - string rootlib(TROOT::GetLibDir()); - string rootetc(TROOT::GetEtcDir()); +#ifdef ROOTPREFIX + string rootbin(ROOTBINDIR); + string rootlib(ROOTLIBDIR); + string rootetc(ROOTETCDIR); +#else + string rootbin(getenv("ROOTSYS") + pathsep + "bin"); + string rootlib(getenv("ROOTSYS") + pathsep + "lib"); + string rootetc(getenv("ROOTSYS") + pathsep + "etc"); +#endif // If needed, install ROOT notebook files in the user's home directory #ifdef WIN32 diff --git a/main/src/rootcling.cxx b/main/src/rootcling.cxx index d06fdb32dc81453950a5b2f532d5ef03d27dae4d..77ce093963e233be630fd71f39ac8f2cc3bce03c 100644 --- a/main/src/rootcling.cxx +++ b/main/src/rootcling.cxx @@ -29,12 +29,13 @@ int main(int argc, char **argv) } ROOT::Internal::RootCling::DriverConfig config{}; +#ifdef R__HAVE_LLVMRESOURCEDIR + config.fLLVMResourceDir= "@R__LLVMRESOURCEDIR@"; +#endif config.fBuildingROOTStage1 = false; config.fPRootDir = &gRootDir; config.fTROOT__GetExtraInterpreterArgs = &TROOT__GetExtraInterpreterArgs; - config.fTROOT__GetIncludeDir = &TROOT__GetIncludeDir; - config.fTROOT__GetEtcDir = &TROOT__GetEtcDir; config.fTCling__GetInterpreter = &TCling__GetInterpreter; config.fInitializeStreamerInfoROOTFile = &InitializeStreamerInfoROOTFile; config.fAddStreamerInfoToROOTFile = &AddStreamerInfoToROOTFile; diff --git a/math/mathcore/src/Integrator.cxx b/math/mathcore/src/Integrator.cxx index 3bb538daa593eb645434755a25fe5a76286b97a3..9b23f2e3ed4b32f95f1acac1855adfff63a60043 100644 --- a/math/mathcore/src/Integrator.cxx +++ b/math/mathcore/src/Integrator.cxx @@ -22,6 +22,9 @@ #include "RConfigure.h" +// #ifndef ROOTINCDIR +// #define MATH_NO_PLUGIN_MANAGER +// #endif #include <algorithm> #include <functional> diff --git a/montecarlo/eg/src/TDatabasePDG.cxx b/montecarlo/eg/src/TDatabasePDG.cxx index 5d2da973cf11cc48e6711a32c5f0d049e13eacea..5f7f220964e62d9d80b25225b6108a35d7efbe37 100644 --- a/montecarlo/eg/src/TDatabasePDG.cxx +++ b/montecarlo/eg/src/TDatabasePDG.cxx @@ -564,8 +564,11 @@ void TDatabasePDG::ReadPDGTable(const char *FileName) const char *fn; if (!FileName[0]) { - default_name = "pdg_table.txt"; - gSystem->PrependPathName(TROOT::GetEtcDir(), default_name); +#ifdef ROOTETCDIR + default_name.Form("%s/pdg_table.txt", ROOTETCDIR); +#else + default_name.Form("%s/etc/pdg_table.txt", gSystem->Getenv("ROOTSYS")); +#endif fn = gEnv->GetValue("Root.DatabasePDG", default_name.Data()); } else { fn = FileName; diff --git a/net/auth/CMakeLists.txt b/net/auth/CMakeLists.txt index be301ee02f5189789b138dfc53d251a73e0bd169..965c484a3bdd3597a5f00bf890e3ce7bdbc75c32 100644 --- a/net/auth/CMakeLists.txt +++ b/net/auth/CMakeLists.txt @@ -25,6 +25,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/res) add_library(rsa STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/rsaaux.cxx ${CMAKE_CURRENT_SOURCE_DIR}/src/rsalib.cxx ${CMAKE_CURRENT_SOURCE_DIR}/src/rsafun.cxx) +add_dependencies(rsa move_headers) if(ssl) include_directories(${OPENSSL_INCLUDE_DIR}) diff --git a/net/auth/src/DaemonUtils.cxx b/net/auth/src/DaemonUtils.cxx index 21128e3d6e974182b0345b52dab3a032f74f49e0..08fc40172aba940d5495622d58f83324a936a611 100644 --- a/net/auth/src/DaemonUtils.cxx +++ b/net/auth/src/DaemonUtils.cxx @@ -95,8 +95,18 @@ static Int_t SrvSetVars(string /*confdir*/) { // Executables and conf dirs - // Make rootbindir available to all the session via env - string execdir = TROOT::GetBinDir().Data(); + string execdir, etcdir; +#ifdef ROOTBINDIR + execdir = string(ROOTBINDIR); +#endif +#ifdef ROOTETCDIR + etcdir = string(ROOTETCDIR); +#endif + + // Define rootbindir if not done already + if (!execdir.length()) + execdir = string(confdir).append("/bin"); + // Make it available to all the session via env if (execdir.length()) { int len = 15 + execdir.length(); char *tmp = new char[len+1]; @@ -107,8 +117,10 @@ static Int_t SrvSetVars(string /*confdir*/) return -1; } - // Make rootetcdir available to all the session via env - string etcdir = TROOT::GetEtcDir().Data(); + // Define rootetcdir if not done already + if (!etcdir.length()) + etcdir = string(confdir).append("/etc"); + // Make it available to all the session via env if (etcdir.length()) { int len = 15 + etcdir.length(); char *tmp = new char[len+1]; diff --git a/net/auth/src/TAuthenticate.cxx b/net/auth/src/TAuthenticate.cxx index 9b3ef202c936776eabe0b5e9748e83288e422cb9..b7a2f37cfd7dc7c2276377e7559192604f386663 100644 --- a/net/auth/src/TAuthenticate.cxx +++ b/net/auth/src/TAuthenticate.cxx @@ -4114,9 +4114,19 @@ Int_t TAuthenticate::ReadRootAuthrc() ::Info("TAuthenticate::ReadRootAuthrc", "file %s cannot be read (errno: %d)", authrc, errno); delete [] authrc; - authrc = gSystem->ConcatFileName(TROOT::GetEtcDir(), "system.rootauthrc"); +#ifdef ROOTETCDIR + authrc = gSystem->ConcatFileName(ROOTETCDIR,"system.rootauthrc"); +#else + char etc[1024]; +#ifdef WIN32 + snprintf(etc, 1024, "%s\\etc", gRootDir); +#else + snprintf(etc, 1024, "%s/etc", gRootDir); +#endif + authrc = gSystem->ConcatFileName(etc,"system.rootauthrc"); +#endif if (gDebug > 2) - ::Info("TAuthenticate::ReadRootAuthrc", "Checking system file: %s", authrc); + ::Info("TAuthenticate::ReadRootAuthrc", "Checking system file:%s",authrc); if (gSystem->AccessPathName(authrc, kReadPermission)) { if (gDebug > 1) ::Info("TAuthenticate::ReadRootAuthrc", diff --git a/net/http/src/THttpServer.cxx b/net/http/src/THttpServer.cxx index a612721ca13d08b6e4b89c4b6bdef3c75103caf3..c72565743ed62cf77a84e4fab713f51fbcb71fbb 100644 --- a/net/http/src/THttpServer.cxx +++ b/net/http/src/THttpServer.cxx @@ -148,7 +148,11 @@ THttpServer::THttpServer(const char *engine) : if (jsrootsys != 0) fJSROOTSYS = jsrootsys; if (fJSROOTSYS.Length() == 0) { - TString jsdir = TString::Format("%s/http", TROOT::GetEtcDir().Data()); +#ifdef ROOTETCDIR + TString jsdir = TString::Format("%s/http", ROOTETCDIR); +#else + TString jsdir("$(ROOTSYS)/etc/http"); +#endif if (gSystem->ExpandPathName(jsdir)) { Warning("THttpServer", "problems resolving '%s', use JSROOTSYS to specify $ROOTSYS/etc/http location", jsdir.Data()); fJSROOTSYS = "."; @@ -159,7 +163,18 @@ THttpServer::THttpServer(const char *engine) : AddLocation("currentdir/", "."); AddLocation("jsrootsys/", fJSROOTSYS); - AddLocation("rootsys/", TROOT::GetRootSys()); + + const char *rootsys = gSystem->Getenv("ROOTSYS"); + if (rootsys != 0) { + AddLocation("rootsys/", rootsys); + } else { +#ifdef ROOTPREFIX + TString sysdir = ROOTPREFIX; +#else + TString sysdir = "$(ROOTSYS)"; +#endif + if (!gSystem->ExpandPathName(sysdir)) AddLocation("rootsys/", sysdir); + } fDefaultPage = fJSROOTSYS + "/files/online.htm"; fDrawPage = fJSROOTSYS + "/files/draw.htm"; diff --git a/net/net/src/TApplicationServer.cxx b/net/net/src/TApplicationServer.cxx index cb058f07a564b94a23d3eac74eeafba0b6454bde..55bef5601871ceb7dd6233c63979f7e16d5b59d3 100644 --- a/net/net/src/TApplicationServer.cxx +++ b/net/net/src/TApplicationServer.cxx @@ -1275,7 +1275,17 @@ void TApplicationServer::ExecLogon() TString name = ".rootlogon.C"; TString sname = "system"; sname += name; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + char *s = gSystem->ConcatFileName(etc, sname); +#endif if (!gSystem->AccessPathName(s, kReadPermission)) { ProcessFile(s); } diff --git a/net/net/src/TServerSocket.cxx b/net/net/src/TServerSocket.cxx index da7129be5e5f24941a755022187c961519142683..dc1cd5ed7911fe0e239f96c7b643804e3453b925 100644 --- a/net/net/src/TServerSocket.cxx +++ b/net/net/src/TServerSocket.cxx @@ -335,7 +335,22 @@ Bool_t TServerSocket::Authenticate(TSocket *sock) } } - TString confdir = TROOT::GetRootSys(); + TString confdir; +#ifndef ROOTPREFIX + // try to guess the config directory... + if (gSystem->Getenv("ROOTSYS")) { + confdir = TString(gSystem->Getenv("ROOTSYS")); + } else { + // Try to guess it from 'root.exe' path + char *rootexe = gSystem->Which(gSystem->Getenv("PATH"), + "root.exe", kExecutePermission); + confdir = rootexe; + confdir.Resize(confdir.Last('/')); + delete [] rootexe; + } +#else + confdir = TString(ROOTPREFIX); +#endif if (!confdir.Length()) { Error("Authenticate", "config dir undefined"); return kFALSE; diff --git a/net/rootd/src/rootd.cxx b/net/rootd/src/rootd.cxx index 14e185cc8e649c78bd198b1fccb5bfd9e0a28c61..4bb8f21c3a26c96e24d109c791797d812c3e19f3 100644 --- a/net/rootd/src/rootd.cxx +++ b/net/rootd/src/rootd.cxx @@ -2524,13 +2524,10 @@ int main(int argc, char **argv) if (argc > 0) { confdir = std::string(*argv); - } - -#ifdef ROOTPREFIX - if (getenv("IGNOREROOTPREFIX")) { -#endif + } else { + // try to guess the config directory... +#ifndef ROOTPREFIX if (!confdir.length()) { - // try to guess the config directory... if (getenv("ROOTSYS")) { confdir = getenv("ROOTSYS"); if (gDebug > 0) @@ -2541,26 +2538,31 @@ int main(int argc, char **argv) ErrorInfo("main: no config directory specified"); } } - rootbindir = std::string(confdir).append("/bin"); - rootetcdir = std::string(confdir).append("/etc"); -#ifdef ROOTPREFIX - } - else { - if (!confdir.length()) - confdir = ROOTPREFIX; - rootbindir = ROOTBINDIR; - rootetcdir = ROOTETCDIR; +#else + confdir = ROOTPREFIX; +#endif } +#ifdef ROOTBINDIR + rootbindir= ROOTBINDIR; +#endif +#ifdef ROOTETCDIR + rootetcdir= ROOTETCDIR; #endif - // Make rootbindir available to all the session via env + // Define rootbindir if not done already + if (!rootbindir.length()) + rootbindir = std::string(confdir).append("/bin"); + // Make it available to all the session via env if (rootbindir.length()) { char *tmp1 = new char[15 + rootbindir.length()]; sprintf(tmp1, "ROOTBINDIR=%s", rootbindir.c_str()); putenv(tmp1); } - // Make rootetcdir available to all the session via env + // Define rootetcdir if not done already + if (!rootetcdir.length()) + rootetcdir = std::string(confdir).append("/etc"); + // Make it available to all the session via env if (rootetcdir.length()) { char *tmp1 = new char[15 + rootetcdir.length()]; sprintf(tmp1, "ROOTETCDIR=%s", rootetcdir.c_str()); diff --git a/net/rpdutils/CMakeLists.txt b/net/rpdutils/CMakeLists.txt index c5edfd48efe006ce1acba5cb8d1240fd9dcd09da..90fda2fc3a553edf11e575e1307e2481250ee1aa 100644 --- a/net/rpdutils/CMakeLists.txt +++ b/net/rpdutils/CMakeLists.txt @@ -35,6 +35,7 @@ endif() #---static library needed for rootd and proofd -------------------------------------------- add_library(rpdutil STATIC ${rpdutilsrcs}) +add_dependencies(rpdutil move_headers) ROOT_LINKER_LIBRARY(SrvAuth rpdutils.cxx ssh.cxx LIBRARIES rpdutil rsa ${CRYPTLIBS} ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES} DEPENDENCIES Net BUILTINS OPENSSL) diff --git a/proof/proof/src/TProofLite.cxx b/proof/proof/src/TProofLite.cxx index 5f473c3bd32ce3010df7280a89fc6a0c4c519cfa..4a5666580fbf026acaab5c235754236e54de3bdf 100644 --- a/proof/proof/src/TProofLite.cxx +++ b/proof/proof/src/TProofLite.cxx @@ -409,7 +409,17 @@ Int_t TProofLite::GetNumberOfWorkers(const char *url) if (fgWrksMax == -2) { // Find the max number of workers, if any TString sysname = "system.rootrc"; - char *s = gSystem->ConcatFileName(TROOT::GetEtcDir(), sysname); +#ifdef ROOTETCDIR + char *s = gSystem->ConcatFileName(ROOTETCDIR, sysname); +#else + TString etc = gRootDir; +#ifdef WIN32 + etc += "\\etc"; +#else + etc += "/etc"; +#endif + char *s = gSystem->ConcatFileName(etc, sysname); +#endif TEnv sysenv(0); sysenv.ReadFile(s, kEnvGlobal); fgWrksMax = sysenv.GetValue("ProofLite.MaxWorkers", -1); @@ -755,9 +765,17 @@ Int_t TProofLite::SetProofServEnv(const char *ord) return -1; } // ROOTSYS - fprintf(fenv, "export ROOTSYS=%s\n", TROOT::GetRootSys().Data()); +#ifdef R__HAVE_CONFIG + fprintf(fenv, "export ROOTSYS=%s\n", ROOTPREFIX); +#else + fprintf(fenv, "export ROOTSYS=%s\n", gSystem->Getenv("ROOTSYS")); +#endif // Conf dir - fprintf(fenv, "export ROOTCONFDIR=%s\n", TROOT::GetRootSys().Data()); +#ifdef R__HAVE_CONFIG + fprintf(fenv, "export ROOTCONFDIR=%s\n", ROOTETCDIR); +#else + fprintf(fenv, "export ROOTCONFDIR=%s\n", gSystem->Getenv("ROOTSYS")); +#endif // TMPDIR fprintf(fenv, "export TMPDIR=%s\n", gSystem->TempDirectory()); // Log file in the log dir diff --git a/proof/proof/src/TProofServ.cxx b/proof/proof/src/TProofServ.cxx index fcf64400bd4020be689f0f0c3afaa3c15859bee2..73bf0d3d1dbf06c109ef112f7f519bcda2e6e7a6 100644 --- a/proof/proof/src/TProofServ.cxx +++ b/proof/proof/src/TProofServ.cxx @@ -2964,7 +2964,13 @@ Int_t TProofServ::SetupCommon() #ifdef R__UNIX // Add bindir to PATH TString path(gSystem->Getenv("PATH")); - TString bindir(TROOT::GetBinDir()); + TString bindir; +# ifdef ROOTBINDIR + bindir = ROOTBINDIR; +# else + bindir = gSystem->Getenv("ROOTSYS"); + if (!bindir.IsNull()) bindir += "/bin"; +# endif // Augment PATH, if required // ^<compiler>, <compiler>, ^<sysbin>, <sysbin> TString paths = gEnv->GetValue("ProofServ.BinPaths", ""); diff --git a/proof/proof/src/TSlaveLite.cxx b/proof/proof/src/TSlaveLite.cxx index 2cc26bee8c18adef2062ed82ccb1bd767d64bb2c..76adef2b6fb2971e2efece6de9801f02f6e94f92 100644 --- a/proof/proof/src/TSlaveLite.cxx +++ b/proof/proof/src/TSlaveLite.cxx @@ -88,8 +88,13 @@ void TSlaveLite::Init() { // Command to be executed TString cmd; +#ifdef R__HAVE_CONFIG cmd.Form(". %s/worker-%s.env; export ROOTBINDIR=\"%s\"; %s/proofserv proofslave lite %d %d 0&", - fWorkDir.Data(), fOrdinal.Data(), TROOT::GetBinDir().Data(), TROOT::GetBinDir().Data(), + fWorkDir.Data(), fOrdinal.Data(), ROOTBINDIR, ROOTBINDIR, +#else + cmd.Form(". %s/worker-%s.env; export ROOTBINDIR=\"%s/bin\"; %s/bin/proofserv proofslave lite %d %d 0&", + fWorkDir.Data(), fOrdinal.Data(), gSystem->Getenv("ROOTSYS"), gSystem->Getenv("ROOTSYS"), +#endif gSystem->GetPid(), gDebug); // Execute if (gSystem->Exec(cmd) != 0) { diff --git a/proof/proofbench/CMakeLists.txt b/proof/proofbench/CMakeLists.txt index 839e50753138b658b14f121de6b3427836f8926d..aa2d4b24fc0167061d00f7d07eb45317991fcf92 100644 --- a/proof/proofbench/CMakeLists.txt +++ b/proof/proofbench/CMakeLists.txt @@ -14,7 +14,7 @@ ROOT_INSTALL_HEADERS(OPTIONS REGEX "TSel" EXCLUDE) # Generation and installation of the PAR files required by the benchmark add_custom_target(ProofBenchPARFiles ALL DEPENDS ${CMAKE_BINARY_DIR}/etc/proof/proofbench/ProofBenchCPUSel.par ${CMAKE_BINARY_DIR}/etc/proof/proofbench/ProofBenchDataSel.par) -add_dependencies(ProofBenchPARFiles move_artifacts) +add_dependencies(ProofBenchPARFiles move_headers) # The /etc directory from sources is copied when moving the headers add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/etc/proof/proofbench/ProofBenchCPUSel.par ${CMAKE_BINARY_DIR}/etc/proof/proofbench/ProofBenchDataSel.par COMMAND etc/proof/utils/makepbenchpars.sh ARGS ProofBenchCPUSel ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} diff --git a/proof/proofbench/src/TProofBench.cxx b/proof/proofbench/src/TProofBench.cxx index 21333d3433b20b1567b748f1e1cb4e67b7d73ff3..39426ef638516816d5afbdeada781e6f5e73d12c 100644 --- a/proof/proofbench/src/TProofBench.cxx +++ b/proof/proofbench/src/TProofBench.cxx @@ -1338,7 +1338,11 @@ Int_t TProofBench::MakeDataSet(const char *dset, Long64_t nevt, const char *fnro // Is it the default selector? if (fDataGenSel == kPROOF_BenchSelDataGenDef) { // Load the parfile - TString par = TString::Format("%s/%s%s.par", TROOT::GetEtcDir().Data(), kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#ifdef R__HAVE_CONFIG + TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#else + TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#endif Info("MakeDataSet", "uploading '%s' ...", par.Data()); if (fProof->UploadPackage(par) != 0) { Error("MakeDataSet", "problems uploading '%s' - cannot continue", par.Data()); diff --git a/proof/proofbench/src/TProofBenchDataSet.cxx b/proof/proofbench/src/TProofBenchDataSet.cxx index 4e71937cb762f490d55f71a789ab2ef83358d2e5..3951c2d72c8b706db654d18493b3d07c429e1ece 100644 --- a/proof/proofbench/src/TProofBenchDataSet.cxx +++ b/proof/proofbench/src/TProofBenchDataSet.cxx @@ -25,7 +25,6 @@ Handle operations on datasets used by ProofBench #include "TMap.h" #include "TProof.h" #include "TProofBenchTypes.h" -#include "TROOT.h" ClassImp(TProofBenchDataSet) @@ -145,7 +144,11 @@ Int_t TProofBenchDataSet::Handle(const char *dset, TObject *type) TString selName("TSelHandleDataSet"); if (!TClass::GetClass(selName)) { // Load the parfile - TString par = TString::Format("%s/%s%s.par", TROOT::GetEtcDir().Data(), kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#ifdef R__HAVE_CONFIG + TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#else + TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#endif Info("Handle", "Uploading '%s' ...", par.Data()); if (fProof->UploadPackage(par) != 0) { Error("Handle", "problems uploading '%s' - cannot continue", par.Data()); diff --git a/proof/proofbench/src/TProofBenchRunCPU.cxx b/proof/proofbench/src/TProofBenchRunCPU.cxx index a2a10a8bc793375086d84aed4dfb3e4dee13b496..c355cd07ddf2cd3609ca6e1a68f5482b8bf382b2 100644 --- a/proof/proofbench/src/TProofBenchRunCPU.cxx +++ b/proof/proofbench/src/TProofBenchRunCPU.cxx @@ -274,7 +274,11 @@ void TProofBenchRunCPU::Run(Long64_t nevents, Int_t start, Int_t stop, // Is it the default selector? if (fSelName == kPROOF_BenchSelCPUDef) { // Load the parfile - TString par = TString::Format("%s/%s%s.par", TROOT::GetEtcDir().Data(), kPROOF_BenchParDir, kPROOF_BenchCPUSelPar); +#ifdef R__HAVE_CONFIG + TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchCPUSelPar); +#else + TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchCPUSelPar); +#endif Info("Run", "Uploading '%s' ...", par.Data()); if (fProof->UploadPackage(par) != 0) { Error("Run", "problems uploading '%s' - cannot continue", par.Data()); diff --git a/proof/proofbench/src/TProofBenchRunDataRead.cxx b/proof/proofbench/src/TProofBenchRunDataRead.cxx index 6eedc89deb5b25b0afa7cf1bfaefc1b2e4269e01..c5d0bd966cf31819942f43a640203a057bb3da57 100644 --- a/proof/proofbench/src/TProofBenchRunDataRead.cxx +++ b/proof/proofbench/src/TProofBenchRunDataRead.cxx @@ -162,7 +162,11 @@ void TProofBenchRunDataRead::Run(const char *dset, Int_t start, Int_t stop, // Is it the default selector? if (fSelName == kPROOF_BenchSelDataDef) { // Load the parfile - TString par = TString::Format("%s/%s%s.par", TROOT::GetEtcDir().Data(), kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#ifdef R__HAVE_CONFIG + TString par = TString::Format("%s/%s%s.par", ROOTETCDIR, kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#else + TString par = TString::Format("$ROOTSYS/etc/%s%s.par", kPROOF_BenchParDir, kPROOF_BenchDataSelPar); +#endif Info("Run", "Uploading '%s' ...", par.Data()); if (fProof->UploadPackage(par) != 0) { Error("Run", "problems uploading '%s' - cannot continue", par.Data()); diff --git a/proof/proofd/src/XrdROOT.cxx b/proof/proofd/src/XrdROOT.cxx index 9b6ff1293bce5a19d67eda2114fee59fa9bd75fa..53ecdb61be44ecb50205df52747a7c9d30ac6214 100644 --- a/proof/proofd/src/XrdROOT.cxx +++ b/proof/proofd/src/XrdROOT.cxx @@ -384,19 +384,11 @@ int XrdROOTMgr::Config(bool rcf) } else { // Check the ROOT dirs if (fROOT.size() <= 0) { - XrdOucString dir, bd, ld, id, dd; #ifdef R__HAVE_CONFIG - if (getenv("ROOTIGNOREPREFIX")) -#endif - dir = getenv("ROOTSYS"); -#ifdef R__HAVE_CONFIG - else { - dir = ROOTPREFIX; - bd = ROOTBINDIR; - ld = ROOTLIBDIR; - id = ROOTINCDIR; - dd = ROOTDATADIR; - } + XrdOucString dir(ROOTPREFIX), bd(ROOTBINDIR), ld(ROOTLIBDIR), + id(ROOTINCDIR), dd(ROOTDATADIR); +#else + XrdOucString dir(getenv("ROOTSYS")), bd, ld, id, dd; #endif // None defined: use ROOTSYS as default, if any; otherwise we fail if (dir.length() > 0) { diff --git a/proof/proofd/src/proofd.cxx b/proof/proofd/src/proofd.cxx index 80aac3e581e24628bb648afbc46b4000e5f1f6ef..18841b1c81fca6a022d0e1b70f1eb7eb88cd0197 100644 --- a/proof/proofd/src/proofd.cxx +++ b/proof/proofd/src/proofd.cxx @@ -1001,48 +1001,49 @@ int main(int argc, char **argv) if (argc > 0) { gConfDir = std::string(*argv); - } - -#ifdef ROOTPREFIX - if (getenv("IGNOREROOTPREFIX")) { -#endif - if (!gConfDir.length()) { - // try to guess the config directory... - if (getenv("ROOTSYS")) { - gConfDir = getenv("ROOTSYS"); - if (gDebug > 0) - ErrorInfo("main: no config directory specified using" - " ROOTSYS (%s)", gConfDir.c_str()); - } else { - Error(ErrFatal, -1, "main: no config directory specified"); - } + } else { + // try to guess the config directory... +#ifndef ROOTDATADIR + if (getenv("ROOTSYS")) { + gConfDir = getenv("ROOTSYS"); + if (gDebug > 0) + ErrorInfo("main: no config directory specified using ROOTSYS (%s)", + gConfDir.c_str()); + } else { + Error(ErrFatal, -1, "main: no config directory specified"); } - gRootBinDir = std::string(gConfDir).append("/bin"); - rootetcdir = std::string(gConfDir).append("/etc"); -#ifdef ROOTPREFIX - } - else { - if (!gConfDir.length()) - gConfDir = ROOTPREFIX; - gRootBinDir = ROOTBINDIR; - rootetcdir = ROOTETCDIR; +#else + gConfDir = ROOTDATADIR; +#endif } +#ifdef ROOTBINDIR + gRootBinDir= ROOTBINDIR; +#endif +#ifdef ROOTETCDIR + rootetcdir= ROOTETCDIR; #endif - // make sure gRootBinDir contains the executable we want to run + // Define gRootBinDir if not done already + if (!gRootBinDir.length()) + gRootBinDir = std::string(gConfDir).append("/bin"); + + // make sure it contains the executable we want to run std::string arg0 = std::string(gRootBinDir).append("/proofserv"); if (access(arg0.c_str(), X_OK) == -1) { Error(ErrFatal,-1,"main: incorrect config directory specified (%s)", gConfDir.c_str()); } - // Make gRootBinDir available to all the session via env + // Make it available to all the session via env if (gRootBinDir.length()) { char *tmp = new char[15 + gRootBinDir.length()]; snprintf(tmp, 15 + gRootBinDir.length(), "ROOTBINDIR=%s", gRootBinDir.c_str()); putenv(tmp); } - // Make rootetcdir available to all the session via env + // Define rootetcdir if not done already + if (!rootetcdir.length()) + rootetcdir = std::string(gConfDir).append("/etc"); + // Make it available to all the session via env if (rootetcdir.length()) { char *tmp = new char[15 + rootetcdir.length()]; snprintf(tmp, 15 + rootetcdir.length(), "ROOTETCDIR=%s", rootetcdir.c_str()); diff --git a/roofit/histfactory/CMakeLists.txt b/roofit/histfactory/CMakeLists.txt index fd89151190993c3378ff22818abe0646de3af29d..7a81cee2cb9ec67866ff64d5d4e2a900987ef245 100644 --- a/roofit/histfactory/CMakeLists.txt +++ b/roofit/histfactory/CMakeLists.txt @@ -22,4 +22,10 @@ install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/prepareHistFactory WORLD_EXECUTE WORLD_READ DESTINATION ${CMAKE_INSTALL_BINDIR}) -ROOT_INSTALL_HEADERS() + +#ROOT_INSTALL_HEADERS() +install(DIRECTORY inc/RooStats/HistFactory/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RooStats/HistFactory + COMPONENT headers + PATTERN ".svn" EXCLUDE + REGEX "LinkDef" EXCLUDE ) +set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/inc) diff --git a/roofit/histfactory/config/prepareHistFactory b/roofit/histfactory/config/prepareHistFactory index e4c3fa6a6115115fa9781e1dcdc259f80cbf553b..727125420883d27c11f5d65964a8ae996321811b 100755 --- a/roofit/histfactory/config/prepareHistFactory +++ b/roofit/histfactory/config/prepareHistFactory @@ -2,10 +2,16 @@ # HistFactory workplace setup script -ROOTETCDIR=`root -b -q -l -n -e "std::cout << TROOT::GetEtcDir() << std::endl;" | tail -1` +ROOTPREFDIR=`root-config --prefix` +ROOTETCDIR=`root-config --etcdir` echo "Using etcdir "$ROOTETCDIR -ROOTTUTDIR=`root -b -q -l -n -e "std::cout << TROOT::GetTutorialDir() << std::endl;" | tail -1` -echo "Using tutorials dir" $ROOTTUTDIR +ROOTTUTDIR=$ROOTPREFDIR/tutorials +if test -e $ROOTTUTDIR; then + echo "Using tutorials dir" $ROOTTUTDIR +else + ROOTTUTDIR=${ROOTPREFDIR}/share/doc/root/tutorials + echo "Using tutorials dir" $ROOTTUTDIR +fi if [ $# -eq 1 ] then diff --git a/roofit/roostats/CMakeLists.txt b/roofit/roostats/CMakeLists.txt index 2434418a1bcea1f842a25c336fe2d5c7d9190cc2..8f432460138a3d407e44b8b86161b790f8e506f8 100644 --- a/roofit/roostats/CMakeLists.txt +++ b/roofit/roostats/CMakeLists.txt @@ -8,4 +8,9 @@ ROOT_GENERATE_DICTIONARY(G__RooStats RooStats/*.h MODULE RooStats LINKDEF LinkDe ROOT_LINKER_LIBRARY(RooStats *.cxx G__RooStats.cxx LIBRARIES Core DEPENDENCIES RooFit RooFitCore Tree RIO Hist Matrix MathCore Minuit Foam Graf Gpad ) -ROOT_INSTALL_HEADERS() +#ROOT_INSTALL_HEADERS() +install(DIRECTORY inc/RooStats/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/RooStats + COMPONENT headers + PATTERN ".svn" EXCLUDE + REGEX "LinkDef" EXCLUDE ) +set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/inc) diff --git a/rootx/src/rootx.cxx b/rootx/src/rootx.cxx index 1e63cf7f3c8d70b51ee7920876ea115520e0cd2f..76817cc682749ad954686e6da993abfe4b48e9ad 100644 --- a/rootx/src/rootx.cxx +++ b/rootx/src/rootx.cxx @@ -218,6 +218,7 @@ static STRUCT_UTMP *SearchEntry(int n, const char *tty) return 0; } +#ifndef ROOTPREFIX static const char *GetExePath() { static std::string exepath; @@ -264,6 +265,7 @@ static void SetRootSys() delete [] ep; } } +#endif static void SetDisplay() { @@ -312,9 +314,7 @@ static void SetDisplay() static void SetLibraryPath() { -#ifdef ROOTPREFIX - if (getenv("ROOTIGNOREPREFIX")) { -#endif +#ifndef ROOTLIBDIR // Set library path for the different platforms. char *msg; @@ -361,8 +361,6 @@ static void SetLibraryPath() } # endif putenv(msg); -#ifdef ROOTPREFIX - } #endif } @@ -460,9 +458,7 @@ int main(int argc, char **argv) char **argvv; char arg0[kMAXPATHLEN]; -#ifdef ROOTPREFIX - if (getenv("ROOTIGNOREPREFIX")) { -#endif +#ifndef ROOTPREFIX // Try to set ROOTSYS depending on pathname of the executable SetRootSys(); @@ -471,8 +467,6 @@ int main(int argc, char **argv) argv[0], argv[0]); return 1; } -#ifdef ROOTPREFIX - } #endif // In batch mode don't show splash screen, idem for no logo mode, @@ -497,20 +491,23 @@ int main(int argc, char **argv) if (notebook) { // Build command #ifdef ROOTBINDIR - if (getenv("ROOTIGNOREPREFIX")) -#endif - snprintf(arg0, sizeof(arg0), "%s/bin/%s", getenv("ROOTSYS"), ROOTNBBINARY); -#ifdef ROOTBINDIR - else - snprintf(arg0, sizeof(arg0), "%s/%s", ROOTBINDIR, ROOTNBBINARY); + snprintf(arg0, sizeof(arg0), "%s/%s", ROOTBINDIR, ROOTNBBINARY); +#else + snprintf(arg0, sizeof(arg0), "%s/bin/%s", getenv("ROOTSYS"), ROOTNBBINARY); #endif // Execute ROOT notebook binary execl(arg0, arg0, NULL); - + // Exec failed - fprintf(stderr, "%s: can't start ROOT notebook -- this option is only available when building with CMake, please check that %s exists\n", - argv[0], arg0); +#ifndef ROOTBINDIR + fprintf(stderr, + "%s: can't start ROOT notebook -- this option is only available when building with CMake, please check that %s/bin/%s exists\n", + argv[0], getenv("ROOTSYS"), ROOTNBBINARY); +#else + fprintf(stderr, "%s: can't start ROOT notebook -- this option is only available when building with CMake, please check that %s/%s exists\n", + argv[0], ROOTBINDIR, ROOTNBBINARY); +#endif return 1; } @@ -607,12 +604,9 @@ int main(int argc, char **argv) // Build argv vector argvv = new char* [argc+2]; #ifdef ROOTBINDIR - if (getenv("ROOTIGNOREPREFIX")) -#endif - snprintf(arg0, sizeof(arg0), "%s/bin/%s", getenv("ROOTSYS"), ROOTBINARY); -#ifdef ROOTBINDIR - else - snprintf(arg0, sizeof(arg0), "%s/%s", ROOTBINDIR, ROOTBINARY); + snprintf(arg0, sizeof(arg0), "%s/%s", ROOTBINDIR, ROOTBINARY); +#else + snprintf(arg0, sizeof(arg0), "%s/bin/%s", getenv("ROOTSYS"), ROOTBINARY); #endif argvv[0] = arg0; argvv[1] = (char *) "-splash"; @@ -628,8 +622,14 @@ int main(int argc, char **argv) execv(arg0, argvv); // Exec failed - fprintf(stderr, "%s: can't start ROOT -- check that %s exists!\n", - argv[0], arg0); +#ifndef ROOTBINDIR + fprintf(stderr, + "%s: can't start ROOT -- check that %s/bin/%s exists!\n", + argv[0], getenv("ROOTSYS"), ROOTBINARY); +#else + fprintf(stderr, "%s: can't start ROOT -- check that %s/%s exists!\n", + argv[0], ROOTBINDIR, ROOTBINARY); +#endif return 1; } diff --git a/test/RootIDE/TGRootIDE.cxx b/test/RootIDE/TGRootIDE.cxx index ad6a8bfd1ddfa5880f4dc1cc4e758937c0fcf778..66a06f3ce195d5077b80883568d4655b76923b47 100644 --- a/test/RootIDE/TGRootIDE.cxx +++ b/test/RootIDE/TGRootIDE.cxx @@ -1270,7 +1270,14 @@ void TGRootIDE::InterruptMacro() void TGRootIDE::About() { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/test/rhtml/rhtml.cxx b/test/rhtml/rhtml.cxx index 002c4e531b2cd1b8e2c65d9be26ff1166d21d013..354d2b65995bf544a1a1d3ecb263d3cce3f84533 100644 --- a/test/rhtml/rhtml.cxx +++ b/test/rhtml/rhtml.cxx @@ -476,7 +476,14 @@ Bool_t TGHtmlBrowser::ProcessMessage(Long_t msg, Long_t parm1, Long_t) case M_HELP_ABOUT: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/tmva/tmva/CMakeLists.txt b/tmva/tmva/CMakeLists.txt index 921ff91e7716f9c6469cb00c10fded9fb5d2d62e..aba77cd35ad73ffa7959fe0f0630a1f9edf08eba 100644 --- a/tmva/tmva/CMakeLists.txt +++ b/tmva/tmva/CMakeLists.txt @@ -59,6 +59,7 @@ if(CUDA_FOUND) CUDA_ADD_LIBRARY(dnn_cuda ${DNN_CUDA_FILES}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDNNCUDA") set(DNN_CUDA_LIBRARIES dnn_cuda ${CUDA_CUBLAS_LIBRARIES}) + add_dependencies(dnn_cuda move_headers) else() set(DNN_CUDA_LIBRARIES) set(installoptions ${installoptions} OPTIONS REGEX "Cuda" EXCLUDE) @@ -83,6 +84,8 @@ ROOT_LINKER_LIBRARY(TMVA *.cxx G__TMVA.cxx ${DNN_FILES} ${DNN_CPU_FILES} ROOT_INSTALL_HEADERS(${installoptions}) +set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/inc) + if(NOT gnuinstall) install(DIRECTORY test DESTINATION tmva FILES_MATCHING PATTERN "*.C" diff --git a/tmva/tmva/Module.mk b/tmva/tmva/Module.mk index 74c443a0c461f1d1266e072b74e236541ea3b1ef..d03c5a4843a207b84eecb4cf5159d37dcd2d42ed 100644 --- a/tmva/tmva/Module.mk +++ b/tmva/tmva/Module.mk @@ -116,12 +116,12 @@ $(TMVALIB): $(TMVAO) $(TMVADO) $(ORDER_) $(MAINLIBS) $(TMVALIBDEP) $(call pcmrule,TMVA) $(noop) -$(TMVADS): $(TMVA_NOICC_REL) $(TMVAL0) $(TMVALS) $(ROOTCLINGEXE) $(call pcmdep,TMVA) +$(TMVADS): $(TMVA_REL) $(TMVAL0) $(TMVALS) $(ROOTCLINGEXE) $(call pcmdep,TMVA) $(MAKEDIR) @echo "Generating dictionary $@..." $(ROOTCLINGSTAGE2) -f $@ $(call dictModule,TMVA) -c -writeEmptyRootPCM $(patsubst include/%,%,$(TMVA_NOICC_REL)) -I$(ROOT_SRCDIR) $(TMVAL0) -$(TMVAMAP): $(TMVA_NOICC_REL) $(TMVAL0) $(TMVALS) $(ROOTCLINGEXE) $(call pcmdep,TMVA) +$(TMVAMAP): $(TMVA_REL) $(TMVAL0) $(TMVALS) $(ROOTCLINGEXE) $(call pcmdep,TMVA) $(MAKEDIR) @echo "Generating rootmap $@..." $(ROOTCLINGSTAGE2) -r $(TMVADS) $(call dictModule,TMVA) -c -I$(ROOT_SRCDIR) $(TMVA_NOICC_REL) $(TMVAL0) diff --git a/tmva/tmvagui/CMakeLists.txt b/tmva/tmvagui/CMakeLists.txt index fd1b3f1a428bb8f3b9895eea5a92d55648694843..1feb86df6486ffe987babf5156bed6694206df58 100644 --- a/tmva/tmvagui/CMakeLists.txt +++ b/tmva/tmvagui/CMakeLists.txt @@ -31,7 +31,11 @@ ROOT_GENERATE_DICTIONARY(G__TMVAGui ${theaders1} MODULE TMVAGui LINKDEF LinkDe ROOT_LINKER_LIBRARY(TMVAGui *.cxx G__TMVAGui.cxx LIBRARIES Core DEPENDENCIES RIO Hist Tree TreeViewer MLP Minuit XMLIO TMVA Gui) -ROOT_INSTALL_HEADERS() +install(DIRECTORY inc/TMVA/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/TMVA + COMPONENT headers + PATTERN ".svn" EXCLUDE + REGEX "LinkDef" EXCLUDE ) +set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/inc) if(NOT gnuinstall) install(DIRECTORY test DESTINATION tmva diff --git a/tree/treeviewer/src/TTreeViewer.cxx b/tree/treeviewer/src/TTreeViewer.cxx index 9eaf83acd1badee2d261f15ebd989edee9ad82fe..9e26fc985186c3d8b9da7096d731aa598902a5ed 100644 --- a/tree/treeviewer/src/TTreeViewer.cxx +++ b/tree/treeviewer/src/TTreeViewer.cxx @@ -2048,7 +2048,14 @@ Bool_t TTreeViewer::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/tutorials/eve/SplitGLView.C b/tutorials/eve/SplitGLView.C index 268ffd16927e2738bad9a0b60ecd9b2f556c1ed9..c4cfe5ed496948268ab9e2393babc8049a94d4f2 100644 --- a/tutorials/eve/SplitGLView.C +++ b/tutorials/eve/SplitGLView.C @@ -291,7 +291,8 @@ void TGShapedToolTip::Refresh() const char *str = fText.Data(); char *string = strdup(str); Int_t nlines = 0, size = fTextH; - TString ar = "arial.ttf"; + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString ar = fp + "/arial.ttf"; char *s = strtok((char *)string, "\n"); TImage *img = (TImage*)fImage->Clone("img"); img->DrawText(fTextX, fTextY+(nlines*size), s, size, fTextCol, ar); @@ -1019,7 +1020,14 @@ void SplitGLView::HandleMenu(Int_t id) case kHelpAbout: { #ifdef R__UNIX - TString rootx = TROOT::GetBinDir() + "/root -a &"; + TString rootx; +# ifdef ROOTBINDIR + rootx = ROOTBINDIR; +# else + rootx = gSystem->Getenv("ROOTSYS"); + if (!rootx.IsNull()) rootx += "/bin"; +# endif + rootx += "/root -a &"; gSystem->Exec(rootx); #else #ifdef WIN32 diff --git a/tutorials/fit/fit1.C b/tutorials/fit/fit1.C index 4c6fe2472ce9863621d1976b626c378f4393c6c1..17a6322af4b4d35f8fed736cbf73e1a38fa6dd93 100644 --- a/tutorials/fit/fit1.C +++ b/tutorials/fit/fit1.C @@ -35,7 +35,7 @@ void fit1() { // We connect the ROOT file generated in a previous tutorial // (see <a href="fillrandom.C.nbconvert.ipynb">Filling histograms with random numbers from a function</a>) // - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/fit/"); TFile *file = TFile::Open("fillrandom.root"); if (!file) { diff --git a/tutorials/fit/fitslicesy.C b/tutorials/fit/fitslicesy.C index b48c27a2e0b62a6c59dd8c9e62f259325927ab47..ba694cb0b66970c5385ba91d4ab938807abe1562 100644 --- a/tutorials/fit/fitslicesy.C +++ b/tutorials/fit/fitslicesy.C @@ -23,7 +23,7 @@ void fitslicesy() { gStyle->SetTitleH(0.1); // Connect the input file and get the 2-d histogram in memory - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/hsimple.C"); dir.ReplaceAll("/./","/"); if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data()); diff --git a/tutorials/fit/myfit.C b/tutorials/fit/myfit.C index 70f5aa16142b77656237c23b39d7c6e51698aa42..c707edc127724c72aaedab6a929ec494b219cecf 100644 --- a/tutorials/fit/myfit.C +++ b/tutorials/fit/myfit.C @@ -25,7 +25,7 @@ Double_t fitf(Double_t *x, Double_t *par) } void myfit() { - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/hsimple.C"); dir.ReplaceAll("/./","/"); if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data()); diff --git a/tutorials/foam/foam_demopers.C b/tutorials/foam/foam_demopers.C index 7e7be9a1442c1212001d6248f1224d30cce92c6f..1e4a024819ea2d5bbb82400b70333707abd9ee9a 100644 --- a/tutorials/foam/foam_demopers.C +++ b/tutorials/foam/foam_demopers.C @@ -24,7 +24,7 @@ Int_t foam_demopers() gSystem->Load("libFoam"); // need to load the foam_demo tutorial for the definition of the function - TString macroName = gROOT->GetTutorialDir(); + TString macroName = gROOT->GetTutorialsDir(); macroName.Append("/foam/foam_demo.C"); gROOT->ProcessLine(TString::Format(".L %s+",macroName.Data())); diff --git a/tutorials/geom/runplugin.C b/tutorials/geom/runplugin.C index f3694fa40677bcc6f52979b08068770081bf25de..9fbff154fb91a8ca373cebff734611466f8ca78a 100644 --- a/tutorials/geom/runplugin.C +++ b/tutorials/geom/runplugin.C @@ -27,7 +27,7 @@ void runplugin() { - TString tutdir = gROOT->GetTutorialDir(); + TString tutdir = gROOT->GetTutorialsDir(); gROOT->ProcessLine(".x " + tutdir + "/geom/rootgeom.C"); plugin = new iterplugin(); gGeoManager->GetGeomPainter()->SetIteratorPlugin(plugin); diff --git a/tutorials/graphics/earth.C b/tutorials/graphics/earth.C index e33a8fe9df7db7749284d0154f9dbb1086298b77..85889ab49f2ff488767adc89475d7f2fec720c43 100644 --- a/tutorials/graphics/earth.C +++ b/tutorials/graphics/earth.C @@ -26,7 +26,7 @@ TCanvas *earth(){ TH2F *hs = new TH2F("hs","Sinusoidal",180, -180, 180, 181, -90.5, 90.5); TH2F *hp = new TH2F("hp","Parabolic", 180, -180, 180, 181, -90.5, 90.5); - TString dat = gROOT->GetTutorialDir(); + TString dat = gROOT->GetTutorialsDir(); dat.Append("/graphics/earth.dat"); dat.ReplaceAll("/./","/"); diff --git a/tutorials/graphics/psview.C b/tutorials/graphics/psview.C index 205a8b81c971ffeed29caa0b6d2275fcfca1661f..63a42ec91b62707ab76568412f1c46fa5ea75137 100644 --- a/tutorials/graphics/psview.C +++ b/tutorials/graphics/psview.C @@ -32,7 +32,7 @@ void psview() gROOT->SetBatch(1); // create a PostScript file - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/graphics/feynman.C"); gROOT->Macro(dir); gPad->Print("feynman.eps"); diff --git a/tutorials/graphs/motorcycle.C b/tutorials/graphs/motorcycle.C index 294c83d4a01c66e5a7f65e21f03080203da1aac4..8c12977bf528dd88ebe1c718572a71e4ec72ba7f 100644 --- a/tutorials/graphs/motorcycle.C +++ b/tutorials/graphs/motorcycle.C @@ -43,7 +43,7 @@ void DrawSmooth(Int_t pad, const char *title, const char *xt, const char *yt) void motorcycle() { // data taken from R library MASS: mcycle.txt - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/graphs/"); dir.ReplaceAll("/./","/"); diff --git a/tutorials/hist/FirstContour.C b/tutorials/hist/FirstContour.C index 4368f21644127d0212e063997accc2b13ea9e686..f06f551040f35fed54d0fcf3e7d363fe12a41a26 100644 --- a/tutorials/hist/FirstContour.C +++ b/tutorials/hist/FirstContour.C @@ -13,7 +13,7 @@ void FirstContour() { - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/hsimple.C"); dir.ReplaceAll("/./","/"); if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data()); diff --git a/tutorials/hist/h1draw.C b/tutorials/hist/h1draw.C index b8e9065e62831438d52c1650ba8e0313d8a4ea19..f8c15d0e85a02c7aa8f7ffee726898d1edee3d4d 100644 --- a/tutorials/hist/h1draw.C +++ b/tutorials/hist/h1draw.C @@ -25,7 +25,7 @@ void h1draw() { - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/hsimple.C"); dir.ReplaceAll("/./","/"); if (gBenchmark->GetBench("hsimple") < 0) gInterpreter->LoadMacro(dir.Data()); diff --git a/tutorials/hist/hbars.C b/tutorials/hist/hbars.C index 534af10d156c35294c3a01556b4a1b9ec14dba06..778d2d4a92d00cdc8afff6217d1abc60c8f7ad77 100644 --- a/tutorials/hist/hbars.C +++ b/tutorials/hist/hbars.C @@ -10,7 +10,7 @@ TCanvas *hbars() { // Try to open first the file cernstaff.root in tutorials/tree directory - TString filedir = gROOT->GetTutorialDir(); + TString filedir = gROOT->GetTutorialsDir(); filedir += TString("/tree/"); TString filename = "cernstaff.root"; bool fileNotFound = gSystem->AccessPathName(filename); // note opposite return code diff --git a/tutorials/hsimple.C b/tutorials/hsimple.C index cf91cf03810d251bbc825cf3380a269148f60ebe..e98ebccc56b01353bfdd141f6d504f3beead743f 100644 --- a/tutorials/hsimple.C +++ b/tutorials/hsimple.C @@ -34,7 +34,7 @@ TFile *hsimple(Int_t getFile=0) { TString filename = "hsimple.root"; - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.ReplaceAll("/./","/"); TFile *hfile = 0; if (getFile) { diff --git a/tutorials/image/rose_image.C b/tutorials/image/rose_image.C index 529dd87a0861d97f7840e4f6d930b54557bcd538..10554d7ae507ea6c7710ddcfb3fc64e646194cd6 100644 --- a/tutorials/image/rose_image.C +++ b/tutorials/image/rose_image.C @@ -20,7 +20,7 @@ TCanvas *c1; void rose_image() { - TString dir = TROOT::GetTutorialDir(); + TString dir = TROOT::GetTutorialsDir(); TImage *img = TImage::Open(dir + "/image/rose512.jpg"); @@ -32,8 +32,9 @@ void rose_image() img->SetConstRatio(0); img->SetImageQuality(TAttImage::kImgBest); - TString bc = "BlackChancery.ttf"; - TString ar = "arial.ttf"; + TString fp = gEnv->GetValue("Root.TTFontPath", ""); + TString bc = fp + "/BlackChancery.ttf"; + TString ar = fp + "/arial.ttf"; // draw text over image with funny font img->DrawText(120, 160, "Hello World!", 32, diff --git a/tutorials/io/importCode.C b/tutorials/io/importCode.C index e850c5b6363d8264a885d1cb760660755503ae43..9799610d8615fb786824e971d6e185902e3778af 100644 --- a/tutorials/io/importCode.C +++ b/tutorials/io/importCode.C @@ -54,7 +54,7 @@ void importdir(const char *dirname) { } void importCode() { TFile *f = new TFile("code.root","recreate"); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); importdir(dir); //change the directory as you like delete f; } diff --git a/tutorials/io/mergeSelective.C b/tutorials/io/mergeSelective.C index b3dcf46146ca0a2ed2b207fab61e5d3d0b0df697..9daff2808e37be49200f3a9145a1f2ccdf13de3f 100644 --- a/tutorials/io/mergeSelective.C +++ b/tutorials/io/mergeSelective.C @@ -49,7 +49,7 @@ void mergeSelective(Int_t nfiles=5) // Create the files to be merged TStopwatch timer; timer.Start(); - TString tutdir = gROOT->GetTutorialDir(); + TString tutdir = gROOT->GetTutorialsDir(); if (gROOT->LoadMacro(tutdir + "/hsimple.C")) return; Int_t i; for (i=0; i<nfiles; i++) CreateFile(Form("tomerge%03d.root",i)); diff --git a/tutorials/io/testMergeCont.C b/tutorials/io/testMergeCont.C index 98cb1ead741becfc2e9bb22a2d700c63ee3c62e6..96f2cbef85dcfa58e4f35d12228c1b397b9abc33 100644 --- a/tutorials/io/testMergeCont.C +++ b/tutorials/io/testMergeCont.C @@ -39,7 +39,7 @@ TSeqCollection *GetCollection() void testMergeCont() { - TString tutdir = gROOT->GetTutorialDir(); + TString tutdir = gROOT->GetTutorialsDir(); gROOT->LoadMacro(tutdir+"/hsimple.C"); TList *list1 = (TList *)GetCollection(); TList *inputs = new TList(); diff --git a/tutorials/multicore/mp103_processSelector.C b/tutorials/multicore/mp103_processSelector.C index 3272f4142785ea2d64307bb9498242e33231f5c8..a564c390a7fe82a3e89f4b43f025ff3332cdaa6c 100644 --- a/tutorials/multicore/mp103_processSelector.C +++ b/tutorials/multicore/mp103_processSelector.C @@ -26,7 +26,7 @@ int mp103_processSelector(){ // MacOSX may generate connection to WindowServer errors gROOT->SetBatch(kTRUE); - TString selectorPath = gROOT->GetTutorialDir(); + TString selectorPath = gROOT->GetTutorialsDir(); selectorPath += "/tree/h1analysis.C+"; std::cout << "selector used is: "<< selectorPath<<"\n"; TSelector *sel = TSelector::GetSelector(selectorPath); diff --git a/tutorials/pyroot/benchmarks.py b/tutorials/pyroot/benchmarks.py index 0de6d4d97163e6a7d96433267df71970ea7e1350..108cadd5aba92527e530e6c2d34d51608364d513 100644 --- a/tutorials/pyroot/benchmarks.py +++ b/tutorials/pyroot/benchmarks.py @@ -45,7 +45,7 @@ def bexec( dir, macro, bench ): ## -------------------------------------------------------------------------- if __name__ == '__main__': - macrodir = os.path.join(str(ROOT.gROOT.GetTutorialDir()), 'pyroot') + macrodir = os.path.join(ROOT.gROOT.GetTutorialsDir(), 'pyroot') # window for keeping track of bench marks that are run bench = ROOT.TCanvas( 'bench','Benchmarks Summary', -1000, 50, 200, 500 ) diff --git a/tutorials/pyroot/fit1.py b/tutorials/pyroot/fit1.py index 6f1eda7d11c2243660566d0de874aeac46137f15..4f939bbb46278dcf57294ac752b357702c34f885 100644 --- a/tutorials/pyroot/fit1.py +++ b/tutorials/pyroot/fit1.py @@ -51,7 +51,7 @@ h1f.Fit( 'sqroot' ) fitlabel = TPaveText( 0.6, 0.3, 0.9, 0.80, 'NDC' ) fitlabel.SetTextAlign( 12 ) fitlabel.SetFillColor( 42 ) -fitlabel.ReadFile(path.join(str(gROOT.GetTutorialDir()), 'pyroot', 'fit1_py.py')) +fitlabel.ReadFile(path.join(gROOT.GetTutorialsDir(), 'pyroot', 'fit1_py.py')) fitlabel.Draw() c1.Update() gBenchmark.Show( 'fit1' ) diff --git a/tutorials/pyroot/geometry.py b/tutorials/pyroot/geometry.py index 7d14c4e3631d5ef31de21b9b47921cc5482cd1fe..45a18cd96b0dd99fb8149580b50a9b5fcd802ebc 100644 --- a/tutorials/pyroot/geometry.py +++ b/tutorials/pyroot/geometry.py @@ -10,7 +10,7 @@ import os import ROOT -macrodir = os.path.join(str(ROOT.gROOT.GetTutorialDir()), 'pyroot') +macrodir = os.path.join(ROOT.gROOT.GetTutorialsDir(), 'pyroot') # the na49.C file was generated, so no python conversion is provided ROOT.gROOT.Macro( ROOT.gSystem.UnixPathName( os.path.join( macrodir, os.pardir, 'geom', 'na49.C' ) ) ) diff --git a/tutorials/pyroot/rootmarks.py b/tutorials/pyroot/rootmarks.py index 63367d0b2e25ba50e69d74ddb35ac2798c44857a..2fdc756aa452eabcb3fd1f618e49b3f45ccaa994 100644 --- a/tutorials/pyroot/rootmarks.py +++ b/tutorials/pyroot/rootmarks.py @@ -13,7 +13,7 @@ import os import ROOT -macrodir = os.path.join(str(ROOT.gROOT.GetTutorialDir()), 'pyroot') +macrodir = os.path.join(ROOT.gROOT.GetTutorialsDir(), 'pyroot') # use ROOT macro to make sure that bench numbers get updated in one place ROOT.gROOT.Macro( ROOT.gSystem.UnixPathName( os.path.join( macrodir, os.pardir, 'rootmarks.C' ) ) ) diff --git a/tutorials/pyroot/staff.py b/tutorials/pyroot/staff.py index 274607557f45d668612ad8bf9cfce5a09b769cb7..55dc83053b9172340ee2fc2126aa01d0c8d298f5 100644 --- a/tutorials/pyroot/staff.py +++ b/tutorials/pyroot/staff.py @@ -47,7 +47,7 @@ def staff(): tree.Branch( 'Nation', AddressOf( staff, 'Nation' ), 'Nation/C' ) # note that the branches Division and Nation cannot be on the first branch - fname = os.path.join(str(ROOT.gROOT.GetTutorialDir()), 'tree', 'cernstaff.dat') + fname = os.path.join(ROOT.gROOT.GetTutorialsDir(), 'tree', 'cernstaff.dat') for line in open(fname).readlines(): t = list(filter( lambda x: x, re.split( '\s+', line ) ) ) staff.Category = int(t[0]) # assign as integers diff --git a/tutorials/roofit/rf505_asciicfg.C b/tutorials/roofit/rf505_asciicfg.C index 1b60124d4eedae38a109272e0425cef317ceeb80..9e149a0a6956673202873f34c6f166710ab74c1f 100644 --- a/tutorials/roofit/rf505_asciicfg.C +++ b/tutorials/roofit/rf505_asciicfg.C @@ -60,9 +60,9 @@ void rf505_asciicfg() params->writeToFile("rf505_asciicfg_example.txt") ; - TString dir1 = gROOT->GetTutorialDir() ; + TString dir1 = gROOT->GetTutorialsDir() ; dir1.Append("/roofit/rf505_asciicfg.txt") ; - TString dir2 = gROOT->GetTutorialDir() ; + TString dir2 = gROOT->GetTutorialsDir() ; dir2.Append("/roofit/rf505_asciicfg_example.txt") ; // R e a d p a r a m e t e r s f r o m a s c i i f i l e // ---------------------------------------------------------------- diff --git a/tutorials/spectrum/Background_compton.C b/tutorials/spectrum/Background_compton.C index d5ffb8c9138e5e9be9cdd3d586c8f73b62979359..34192cf9b8f7de71364c1b5d7efbf232a80b08f0 100644 --- a/tutorials/spectrum/Background_compton.C +++ b/tutorials/spectrum/Background_compton.C @@ -19,7 +19,7 @@ void Background_compton() { TH1F *d1 = new TH1F("d1","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back3"); diff --git a/tutorials/spectrum/Background_decr.C b/tutorials/spectrum/Background_decr.C index 4e14f7e2b68f89e3eab1d2b6c6659105a0817159..08fa60a302355b4bb0bd7baeae00f30bf632082d 100644 --- a/tutorials/spectrum/Background_decr.C +++ b/tutorials/spectrum/Background_decr.C @@ -18,7 +18,7 @@ void Background_decr() { TH1F *d = new TH1F("d","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back1"); diff --git a/tutorials/spectrum/Background_incr.C b/tutorials/spectrum/Background_incr.C index 580791a366b2c81719c7c2e4da9fe7424603fa95..4dc63ce404e3e179a554c80468259c1b3192e2c0 100644 --- a/tutorials/spectrum/Background_incr.C +++ b/tutorials/spectrum/Background_incr.C @@ -18,7 +18,7 @@ void Background_incr() { TH1F *d = new TH1F("d","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back1"); diff --git a/tutorials/spectrum/Background_order.C b/tutorials/spectrum/Background_order.C index 0e7be3bd4ad8c216bcd08b8cb3323af508827684..465ae17e7fe6d8540e716b90079ad066cbcbde8d 100644 --- a/tutorials/spectrum/Background_order.C +++ b/tutorials/spectrum/Background_order.C @@ -22,7 +22,7 @@ void Background_order() { TH1F *d3 = new TH1F("d3","",nbins,xmin,xmax); TH1F *d4 = new TH1F("d4","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back2"); diff --git a/tutorials/spectrum/Background_smooth.C b/tutorials/spectrum/Background_smooth.C index a3e82578a4c0730f4f0387cb3dce1977430baec3..5b30df09b15b1a69bd7abde56fa850a5d47c8860 100644 --- a/tutorials/spectrum/Background_smooth.C +++ b/tutorials/spectrum/Background_smooth.C @@ -20,7 +20,7 @@ void Background_smooth() { TH1F *d1 = new TH1F("d1","",nbins,xmin,xmax); TH1F *d2 = new TH1F("d2","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back1"); diff --git a/tutorials/spectrum/Background_width.C b/tutorials/spectrum/Background_width.C index 24f5c443ac0bf247982e177c312cb299a798efec..29bd4bd6f2cc8a937f92ddd7dc04cd81903e8669 100644 --- a/tutorials/spectrum/Background_width.C +++ b/tutorials/spectrum/Background_width.C @@ -17,7 +17,7 @@ void Background_width() { Double_t source[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back1"); diff --git a/tutorials/spectrum/Background_width2.C b/tutorials/spectrum/Background_width2.C index 62046dd4b2a08602bc70b4389ce0b7d2be5c54df..db8c67330eef5d7dc8609e42236302e3134241d6 100644 --- a/tutorials/spectrum/Background_width2.C +++ b/tutorials/spectrum/Background_width2.C @@ -22,7 +22,7 @@ void Background_width2() { TH1F *d3 = new TH1F("d3","",nbins,xmin,xmax); TH1F *d4 = new TH1F("d4","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *back = (TH1F*) f->Get("back2"); diff --git a/tutorials/spectrum/Deconvolution.C b/tutorials/spectrum/Deconvolution.C index da07f76583adc3a17f10085e9f78099be64bbd4d..f5283a671220fb2ff5139ca4d7f0cf9ed01c4104 100644 --- a/tutorials/spectrum/Deconvolution.C +++ b/tutorials/spectrum/Deconvolution.C @@ -17,7 +17,7 @@ void Deconvolution() { Double_t response[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *h = (TH1F*) f->Get("decon1"); diff --git a/tutorials/spectrum/DeconvolutionRL_wide.C b/tutorials/spectrum/DeconvolutionRL_wide.C index d7a19d123e481c683f8f9738fb3236c4b6a3d6e3..f292c5e0279fb8bae51600b969e811cde3ca6365 100644 --- a/tutorials/spectrum/DeconvolutionRL_wide.C +++ b/tutorials/spectrum/DeconvolutionRL_wide.C @@ -17,7 +17,7 @@ void DeconvolutionRL_wide() { Double_t response[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F* h = (TH1F*) f->Get("decon3"); diff --git a/tutorials/spectrum/DeconvolutionRL_wide_boost.C b/tutorials/spectrum/DeconvolutionRL_wide_boost.C index 81765044441cf41868305780b0ee23eb120f105e..0cdeb1904c8d97ce6a0574b999758ad5fcff8510 100644 --- a/tutorials/spectrum/DeconvolutionRL_wide_boost.C +++ b/tutorials/spectrum/DeconvolutionRL_wide_boost.C @@ -17,7 +17,7 @@ void DeconvolutionRL_wide_boost() { Double_t response[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F* h = (TH1F*) f->Get("decon3"); diff --git a/tutorials/spectrum/Deconvolution_wide.C b/tutorials/spectrum/Deconvolution_wide.C index 7257d8dcd4305106bb281bfb3330ed4c05331dd8..e4bb70db7aa88e09f048fefeefd7fbf688876752 100644 --- a/tutorials/spectrum/Deconvolution_wide.C +++ b/tutorials/spectrum/Deconvolution_wide.C @@ -17,7 +17,7 @@ void Deconvolution_wide() { Double_t response[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *h = (TH1F*) f->Get("decon3"); diff --git a/tutorials/spectrum/Deconvolution_wide_boost.C b/tutorials/spectrum/Deconvolution_wide_boost.C index 8f3fd455894f30a1d70892f743c8ebf42435e2b3..8aa1adf5d62a033741faf248047ecd6b8681be51 100644 --- a/tutorials/spectrum/Deconvolution_wide_boost.C +++ b/tutorials/spectrum/Deconvolution_wide_boost.C @@ -20,7 +20,7 @@ void Deconvolution_wide_boost() { TH1F *h = new TH1F("h","Deconvolution",nbins,xmin,xmax); TH1F *d = new TH1F("d","",nbins,xmin,xmax); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); h = (TH1F*) f->Get("decon3"); diff --git a/tutorials/spectrum/SearchHR1.C b/tutorials/spectrum/SearchHR1.C index c2a7ca3f2f2782d04112302a24d7eb9acc6bd56b..7117ce75dae79a3dd40214ea8892402c77845248 100644 --- a/tutorials/spectrum/SearchHR1.C +++ b/tutorials/spectrum/SearchHR1.C @@ -21,7 +21,7 @@ void SearchHR1() { Double_t source[nbins], dest[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *h = (TH1F*) f->Get("back2"); diff --git a/tutorials/spectrum/SearchHR3.C b/tutorials/spectrum/SearchHR3.C index 8778ae64e5306e1d704f4c598160695e85a060ef..553449f47c2748d84bfaf776ba85920a64f69aa0 100644 --- a/tutorials/spectrum/SearchHR3.C +++ b/tutorials/spectrum/SearchHR3.C @@ -22,7 +22,7 @@ void SearchHR3() { Double_t source[nbins], dest[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *h = (TH1F*) f->Get("back2"); diff --git a/tutorials/spectrum/Smoothing.C b/tutorials/spectrum/Smoothing.C index 1892444e27275596c2310cd5f12a55aa753106dd..9e99fb210c079f892cac3eaba943aacbae29b903 100644 --- a/tutorials/spectrum/Smoothing.C +++ b/tutorials/spectrum/Smoothing.C @@ -16,7 +16,7 @@ void Smoothing() { Double_t source[nbins]; gROOT->ForceStyle(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); TString file = dir+"/spectrum/TSpectrum.root"; TFile *f = new TFile(file.Data()); TH1F *h = (TH1F*) f->Get("back1"); diff --git a/tutorials/tmva/TMVAClassificationCategory.C b/tutorials/tmva/TMVAClassificationCategory.C index 66cfc3224a070c9306ae39d1c5241a514e379af4..2577c156bbc63cc08415f2bd2a44aafecfa6f67e 100644 --- a/tutorials/tmva/TMVAClassificationCategory.C +++ b/tutorials/tmva/TMVAClassificationCategory.C @@ -89,7 +89,7 @@ void TMVAClassificationCategory() TString fname = TString(gSystem->DirName(__FILE__) ) + "/data/"; if (gSystem->AccessPathName( fname + "toy_sigbkg_categ_offset.root")) { // if directory data not found try using tutorials dir - fname = gROOT->GetTutorialDir() + "/tmva/data/"; + fname = TString(gROOT->GetTutorialsDir()) + "/tmva/data/"; } if (UseOffsetMethod) fname += "toy_sigbkg_categ_offset.root"; else fname += "toy_sigbkg_categ_varoff.root"; diff --git a/tutorials/tmva/TMVAClassificationCategoryApplication.C b/tutorials/tmva/TMVAClassificationCategoryApplication.C index 7cc2e00428cf78a2a261878b2d3b509941aaad7f..8dd2bf237128e3863bdacf70c1e7278b62f67167 100644 --- a/tutorials/tmva/TMVAClassificationCategoryApplication.C +++ b/tutorials/tmva/TMVAClassificationCategoryApplication.C @@ -85,7 +85,7 @@ void TMVAClassificationCategoryApplication() TString fname = TString(gSystem->DirName(__FILE__) ) + "/data/"; // if directory data not found try using tutorials dir if (gSystem->AccessPathName( fname + "toy_sigbkg_categ_offset.root" )) { - fname = gROOT->GetTutorialDir() + "/tmva/data/"; + fname = TString(gROOT->GetTutorialsDir()) + "/tmva/data/"; } if (UseOffsetMethod) fname += "toy_sigbkg_categ_offset.root"; else fname += "toy_sigbkg_categ_varoff.root"; diff --git a/tutorials/tmva/TMVAMulticlass.C b/tutorials/tmva/TMVAMulticlass.C index 76efd1d2fc019d8f1577e1d07939302488cb16c4..129723834f97521841a6785001b4de026f33377a 100644 --- a/tutorials/tmva/TMVAMulticlass.C +++ b/tutorials/tmva/TMVAMulticlass.C @@ -98,7 +98,7 @@ void TMVAMulticlass( TString myMethodList = "" ) } else { std::cout << "Creating testdata...." << std::endl; - TString createDataMacro = gROOT->GetTutorialDir() + "/tmva/createData.C"; + TString createDataMacro = TString(gROOT->GetTutorialsDir()) + "/tmva/createData.C"; gROOT->ProcessLine(TString::Format(".L %s",createDataMacro.Data())); gROOT->ProcessLine("create_MultipleBackground(2000)"); std::cout << " created tmva_example_multiple_background.root for tests of the multiclass features"<<std::endl; diff --git a/tutorials/tmva/TMVAMultipleBackgroundExample.C b/tutorials/tmva/TMVAMultipleBackgroundExample.C index 66db511fc6a4ee42996783b1c3d899be0a71c641..1185f796a6e464933cdfe7fafc904d7819a776de 100644 --- a/tutorials/tmva/TMVAMultipleBackgroundExample.C +++ b/tutorials/tmva/TMVAMultipleBackgroundExample.C @@ -476,7 +476,7 @@ void TMVAMultipleBackgroundExample() << "========================" << endl << endl; - TString createDataMacro = gROOT->GetTutorialDir() + "/tmva/createData.C"; + TString createDataMacro = TString(gROOT->GetTutorialsDir()) + "/tmva/createData.C"; gROOT->ProcessLine(TString::Format(".L %s",createDataMacro.Data())); gROOT->ProcessLine("create_MultipleBackground(2000)"); diff --git a/tutorials/tmva/keras/MulticlassKeras.py b/tutorials/tmva/keras/MulticlassKeras.py index 417472d1e73099f1a8069a7d27b32b40360ba6f4..34da4fa3c44be78f8ad866b7cc4eee5c391cf13c 100755 --- a/tutorials/tmva/keras/MulticlassKeras.py +++ b/tutorials/tmva/keras/MulticlassKeras.py @@ -19,7 +19,7 @@ factory = TMVA.Factory('TMVAClassification', output, # Load data if not isfile('tmva_example_multiple_background.root'): - createDataMacro = str(gROOT.GetTutorialDir()) + '/tmva/createData.C' + createDataMacro = gROOT.GetTutorialsDir() + '/tmva/createData.C' print(createDataMacro) gROOT.ProcessLine('.L {}'.format(createDataMacro)) gROOT.ProcessLine('create_MultipleBackground(4000)') diff --git a/tutorials/tree/basic.C b/tutorials/tree/basic.C index 2c52265c20370ebfee37d65a32405a5662e66e9c..328645b2e660ad0c98e2acf67c0e3ceb917c2184 100644 --- a/tutorials/tree/basic.C +++ b/tutorials/tree/basic.C @@ -12,7 +12,7 @@ void basic() { // read file $ROOTSYS/tutorials/tree/basic.dat // this file has 3 columns of float data - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/tree/"); dir.ReplaceAll("/./","/"); ifstream in; diff --git a/tutorials/tree/basic2.C b/tutorials/tree/basic2.C index 2a4abbd1bf0408cd2cab7bf6211cbc8d8595c55b..f88e22cd6216dc5056c51faa8864086f25147678 100644 --- a/tutorials/tree/basic2.C +++ b/tutorials/tree/basic2.C @@ -10,7 +10,7 @@ /// \author Rene Brun void basic2() { - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/tree/"); dir.ReplaceAll("/./","/"); diff --git a/tutorials/tree/cernbuild.C b/tutorials/tree/cernbuild.C index 69d68f448034451418a2a5f4451e0f9629d36480..1159c539d9dbd1490cc964efd189b460767659a5 100644 --- a/tutorials/tree/cernbuild.C +++ b/tutorials/tree/cernbuild.C @@ -25,7 +25,7 @@ TFile *cernbuild(Int_t getFile=0, Int_t print=1) { //The input file cern.dat is a copy of the CERN staff data base //from 1988 TString filename = "cernstaff.root"; - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/tree/"); dir.ReplaceAll("/./","/"); FILE *fp = fopen(Form("%scernstaff.dat",dir.Data()),"r"); diff --git a/tutorials/tree/cernstaff.C b/tutorials/tree/cernstaff.C index 013a7c2495241e5dc0edef50f0ab4ebb615a13a4..4006b2622c55007e48d5f43c39203d79b1466fa7 100644 --- a/tutorials/tree/cernstaff.C +++ b/tutorials/tree/cernstaff.C @@ -9,7 +9,7 @@ /// \author Rene Brun void cernstaff () { - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/tree/cernstaff.C"); if (gSystem->AccessPathName("cernstaff.root")) { gROOT->SetMacroPath(dir); diff --git a/tutorials/tree/jets.C b/tutorials/tree/jets.C index 795702ae76650ed7105579fcdcd91460635dea0c..70a9687c5d5579ce0dd67c6e41201055e78bb4c2 100644 --- a/tutorials/tree/jets.C +++ b/tutorials/tree/jets.C @@ -99,7 +99,7 @@ void jets(Int_t nev=100, Int_t npileup=200, Bool_t secondrun = true) { //void jets(Int_t nev=100, Int_t npileup=200, Bool_t secondrun); void jets(Int_t nev=100, Int_t npileup=200) { gSystem->Load("libPhysics"); - TString tutdir = gROOT->GetTutorialDir(); + TString tutdir = gROOT->GetTutorialsDir(); gROOT->ProcessLine(".L " + tutdir + "/tree/JetEvent.cxx+"); gROOT->ProcessLine("#define JETS_SECOND_RUN yes"); gROOT->ProcessLine("#include \"" __FILE__ "\""); diff --git a/tutorials/tree/ntuple1.C b/tutorials/tree/ntuple1.C index f416bb06188335160f18e945c57e2722a28fcedb..2a9248b4a767fdb8c54d64ac584883c035fc3297 100644 --- a/tutorials/tree/ntuple1.C +++ b/tutorials/tree/ntuple1.C @@ -31,7 +31,7 @@ void ntuple1() { // // Connect ROOT histogram/ntuple demonstration file // generated by example $ROOTSYS/tutorials/hsimple.C. - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); dir.Append("/hsimple.C"); dir.ReplaceAll("/./","/"); if (gBenchmark->GetBench("hsimple") < 0) gInterpreter->LoadMacro(dir.Data()); diff --git a/tutorials/xml/DOMParsePerson.C b/tutorials/xml/DOMParsePerson.C index cd56ae8d208aa6642c7bfe1c7ccc3e1d169561b7..c8b17d2ed24d5aec24f88c61c174f84da9bb23c7 100644 --- a/tutorials/xml/DOMParsePerson.C +++ b/tutorials/xml/DOMParsePerson.C @@ -234,7 +234,7 @@ void DOMParsePerson() { PersonList personlist; gROOT->ProcessLine(".O 0"); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); if (personlist.ParseFile(dir+"/xml/person.xml") == 0) cout << personlist << endl; } diff --git a/tutorials/xml/DOMRecursive.C b/tutorials/xml/DOMRecursive.C index 717c940e58566a0a81b7882e109679ec29790899..36a2f53cd188cc2f6800f8cd9f3c72d6a7e92e4f 100644 --- a/tutorials/xml/DOMRecursive.C +++ b/tutorials/xml/DOMRecursive.C @@ -54,7 +54,7 @@ void ParseContext(TXMLNode *node) void DOMRecursive() { TDOMParser *domParser = new TDOMParser(); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); domParser->SetValidate(false); // do not validate with DTD domParser->ParseFile(dir+"/xml/person.xml"); diff --git a/tutorials/xml/SAXHandler.C b/tutorials/xml/SAXHandler.C index 639a31dbeea130c1517767d29b307e2b2dee6f88..694b653728bc8d737f9b00fb32fdcc04b4e73130 100644 --- a/tutorials/xml/SAXHandler.C +++ b/tutorials/xml/SAXHandler.C @@ -104,6 +104,6 @@ void SAXHandler() SaxHandler *saxHandler = new SaxHandler(); saxParser->ConnectToHandler("SaxHandler", saxHandler); - TString dir = gROOT->GetTutorialDir(); + TString dir = gROOT->GetTutorialsDir(); saxParser->ParseFile(dir+"/xml/saxexample.xml"); }