51 #include "compiledata.h" 52 #include "RConfigure.h" 73 gROOT->SetInterrupt(kFALSE);
107 if (gSystem &&
name[0] !=
'-' && strcmp(
name,
"Generic"))
108 Error(
"TSystem",
"only one instance of TSystem allowed");
113 fStdExceptionHandler = 0;
146 fOnExitList->Delete();
150 if (fSignalHandler) {
151 fSignalHandler->Delete();
156 fFileHandler->Delete();
160 if (fStdExceptionHandler) {
161 fStdExceptionHandler->Delete();
201 fBuildArch = BUILD_ARCH;
202 fBuildCompiler = COMPILER;
203 fBuildCompilerVersion = COMPILERVERS;
204 fBuildNode = BUILD_NODE;
205 fFlagsDebug = CXXDEBUG;
207 fIncludePath = INCLUDEPATH;
208 fLinkedLibs = LINKEDLIBS;
212 fMakeSharedLib = MAKESHAREDLIB;
216 if (
gEnv && fBeepDuration == 0 && fBeepFreq == 0) {
217 fBeepDuration =
gEnv->
GetValue(
"Root.System.BeepDuration", 100);
218 fBeepFreq =
gEnv->
GetValue(
"Root.System.BeepFreq", 440);
220 if (!fName.CompareTo(
"Generic"))
return kTRUE;
249 GetLastErrorString() = errstr;
257 if (
GetErrno() == 0 && GetLastErrorString() !=
"")
258 return GetLastErrorString();
270 #ifdef R__SOLARIS_CC50 286 #ifdef R__SOLARIS_CC50 299 if (fOnExitList == 0)
301 if (fOnExitList->FindObject(obj) == 0)
302 fOnExitList->
Add(obj);
334 fBeepDuration = duration;
337 if (fBeepDuration < 0 || fBeepFreq < 0)
return;
338 if (freq < 0) freq = fBeepFreq;
339 if (duration < 0) duration = fBeepDuration;
340 DoBeep(freq, duration);
363 catch (std::exception& exc) {
364 TIter next(fStdExceptionHandler);
375 Warning(
"Run",
"instructed to abort");
382 catch (
const char *str) {
387 Warning(
"Run",
"handle uncaugth exception, terminating");
426 DispatchOneEvent(
kTRUE);
428 return gROOT->IsInterrupted();
478 if (ti && fTimers && (fTimers->FindObject(ti) == 0))
501 if (!fTimers)
return -1;
509 if (t->
IsSync() == mode) {
523 if (to && to->
IsAsync() && timeout > 0) {
525 SigAlarmInterruptsSyscalls(
kTRUE);
527 SigAlarmInterruptsSyscalls(
kFALSE);
539 if (h && fSignalHandler && (fSignalHandler->FindObject(h) == 0))
540 fSignalHandler->Add(h);
561 if (h && fFileHandler && (fFileHandler->FindObject(h) == 0))
562 fFileHandler->Add(h);
618 if (eh && fStdExceptionHandler && (fStdExceptionHandler->FindObject(eh) == 0))
619 fStdExceptionHandler->Add(eh);
628 if (fStdExceptionHandler)
689 FILE *pipe = OpenPipe(command,
"r");
691 SysError(
"GetFromPipe",
"cannot run command \"%s\"", command);
696 while (line.
Gets(pipe)) {
702 Int_t r = ClosePipe(pipe);
704 Error(
"GetFromPipe",
"command \"%s\" returned %d", command, r);
765 TIter next(fHelpers);
766 while ((helper = (
TSystem*) next()))
778 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
783 }
else if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
790 fHelpers->Add(helper);
811 if (GetDirPtr() && GetDirPtr() == dirptr)
814 return (checkproto || checkdir);
876 return std::string();
892 return std::string();
906 TString dirname = DirName(safeName);
913 int res = mkdir(dirname,
kTRUE);
921 return MakeDirectory(name);
932 if (name[0] ==
'/' && name[1] ==
'\0')
935 if ((cp = (
char*)strrchr(name,
'/')))
939 Error(
"BaseName",
"name = 0");
949 return dir[0] ==
'/';
963 if (!name || !name[0])
return kFALSE;
968 TString realname = SplitAclicMode(name, aclicMode, arguments, io);
970 TString fileLocation = DirName(realname);
975 while ( incPath.
Index(
" :") != -1 ) {
978 incPath.
Prepend(fileLocation+
":.:");
980 char *actual = Which(incPath,realname);
999 if (pathname && strchr(pathname,
'/')) {
1003 static char *buf = 0;
1004 int pathlen = strlen(pathname);
1005 if (pathlen > len) {
1008 buf =
new char [len+1];
1010 strcpy(buf, pathname);
1012 char *
r = buf+pathlen-1;
1014 while ( r>buf && *(r)==
'/') { --
r; }
1016 while ( r>buf && *(r)!=
'/') { --
r; }
1019 while ( r>buf && *(r)==
'/') { --
r; }
1022 if (r==buf && *(r)!=
'/') {
1048 PrependPathName(dir, nameString);
1075 TTHREAD_TLS_ARRAY(
char, kBufSize, xname);
1077 Bool_t res = ExpandFileName(fname, xname, kBufSize);
1093 char xname[kBufSize];
1095 Bool_t res = ExpandFileName(fname.
Data(), xname, kBufSize);
1108 int n, ier, iter, lx, ncopy;
1109 char *inp, *out, *
x, *t, buff[kBufSize*4];
1110 const char *
b, *
c, *
e;
1113 iter = 0; xname[0] = 0; inp = buff + kBufSize; out = inp + kBufSize;
1114 inp[-1] =
' '; inp[0] = 0; out[-1] =
' ';
1115 c = fname + strspn(fname,
" \t\f\r");
1118 strlcat(inp, c, kBufSize);
1121 iter++; c = inp; ier = 0;
1125 if (c[0] ==
'~' && c[1] ==
'/') {
1126 std::string hd = GetHomeDirectory();
1130 strlcpy(x, p, kBufSize);
1137 }
else if (c[0] ==
'~' && c[1] !=
'/') {
1138 n = strcspn(c+1,
"/ ");
1140 strncat(buff, c+1, n);
1141 std::string hd = GetHomeDirectory(buff);
1145 strlcpy(x, p, kBufSize);
1154 for ( ; c[0]; c++) {
1158 if (c[0] ==
'.' && c[1] ==
'/' && c[-1] ==
' ') {
1159 std::string wd = GetWorkingDirectory();
1160 strlcpy(buff, wd.c_str(), kBufSize);
1165 strlcpy(x, p, kBufSize); x += strlen(p); c = e-1;
continue;
1172 if (c[1] ==
'(') b++;
1173 if (c[1] ==
'{') b++;
1177 for (e = b; isalnum(e[0]) || e[0] ==
'_'; e++) ;
1178 buff[0] = 0; strncat(buff, b, e-b);
1181 for (t = buff; (t[0] = toupper(t[0])); t++) ;
1185 for (t = buff; (t[0] = tolower(t[0])); t++) ;
1188 if (!p && !strcmp(buff,
"cwd")) {
1189 std::string wd = GetWorkingDirectory();
1190 strlcpy(buff, wd.c_str(), kBufSize);
1193 if (!p && !strcmp(buff,
"$")) {
1194 snprintf(buff,kBufSize*4,
"%d", GetPid());
1202 if (c[1] && c[1]!=
'\\' && c[1]!=
';' && c[1]!=
'/')
1210 if (lp >= kBufSize) {
1212 strlcpy(x, p, kBufSize);
1218 c = (b==c+1) ? e-1 : e;
1223 x[0] = 0; lx = x - out;
1224 if (ier && iter < 3) { strlcpy(inp, out, kBufSize);
goto again; }
1225 ncopy = (lx >= kBufSize) ? kBufSize-1 : lx;
1226 xname[0] = 0; strncat(xname, out, ncopy);
1228 if (ier || ncopy != lx) {
1229 ::Error(
"TSystem::ExpandFileName",
"input: %s, output: %s", fname, xname);
1279 if (strlen(url.
GetHost()) > 0) {
1289 if (strlen(url.
GetUser()) > 0) {
1368 int res = GetPathInfo(path,
id, &lsize, flags, modtime);
1370 if (res == 0 && size) {
1372 Error(
"GetPathInfo",
"file %s > 2 GB, use GetPathInfo() with Long64_t size", path);
1398 int res = GetPathInfo(path, buf);
1514 FindFile(search, wfilString, mode);
1515 if (wfilString.
IsNull())
return 0;
1691 Error(
"ShowOutput",
"handle not specified");
1697 Error(
"ShowOutput",
"file '%s' cannot be read", h->
fFile.
Data());
1703 if (!(f = fopen(h->
fFile.
Data(),
"r"))) {
1704 Error(
"ShowOutput",
"file '%s' cannot be open", h->
fFile.
Data());
1709 off_t ltot = lseek(fileno(f), (off_t) 0, SEEK_END);
1711 lseek(fileno(f), (off_t) begin, SEEK_SET);
1712 Int_t left = ltot - begin;
1715 const Int_t kMAXBUF = 16384;
1717 Int_t wanted = (left > kMAXBUF-1) ? kMAXBUF-1 : left;
1720 while ((len =
read(fileno(f), buf, wanted)) < 0 &&
1725 SysError(
"ShowOutput",
"error reading log file");
1731 fprintf(stderr,
"%s", buf);
1735 wanted = (left > kMAXBUF) ? kMAXBUF : left;
1737 }
while (len > 0 && left > 0);
1780 if (left == right)
return kTRUE;
1782 if (left==0 || right==0)
return kFALSE;
1784 if ( (strcmp(right,left)==0) ) {
1790 char leftname[_MAX_PATH];
1791 char rightname[_MAX_PATH];
1792 _fullpath( leftname, left, _MAX_PATH );
1793 _fullpath( rightname, right, _MAX_PATH );
1794 return ((stricmp(leftname, rightname)==0));
1796 struct stat rightBuf;
1797 struct stat leftBuf;
1798 return ( ( 0 == stat( left, & leftBuf ) )
1799 && ( 0 == stat( right, & rightBuf ) )
1800 && ( leftBuf.st_dev == rightBuf.st_dev )
1801 && ( leftBuf.st_ino == rightBuf.st_ino )
1802 && ( leftBuf.st_size == rightBuf.st_size )
1803 && ( leftBuf.st_mtime == rightBuf.st_mtime )
1821 TString libs( GetLibraries() );
1822 TString moduleBasename( BaseName(module) );
1832 if (idx == 0 || libs[idx-1] ==
'/' || libs[idx-1] ==
'\\') {
1835 if (!l.
EndsWith(
".") && libs[idx]==
'.')
1838 while (idx < len && isdigit(libs[idx])) {
1841 if (libs[idx] ==
'.') {
1845 while (idx < len && libs[idx] !=
'.') {
1846 if (libs[idx] ==
' ' || idx+1 == len) {
1853 if (l[l.
Length()-1] ==
'.') {
1859 if ((idx == 0 || libs[idx-1] ==
' ') &&
1860 (libs[idx+l.
Length()] ==
' ' || libs[idx+l.
Length()] == 0)) {
1866 char *path = DynamicPathName(module);
1874 libmapfilename = path;
1875 idx = libmapfilename.
Last(
'.');
1877 libmapfilename.
Remove(idx);
1879 libmapfilename +=
".rootmap";
1881 if (
gDebug > 0)
Info(
"Load",
"loading %s", libmapfilename.
Data());
1883 deplibs =
gInterpreter->GetSharedLibDeps(moduleBasename);
1890 if (strcmp(module,deplib)==0) {
1894 Info(
"Load",
"loading dependent library %s for library %s",
1896 if ((ret = Load(deplib,
"", system)) < 0) {
1906 const char *dirname = DirName(path);
1908 TString rootlibdir = ROOTLIBDIR;
1911 PrependPathName(
gRootDir, rootlibdir);
1917 TString rootbindir = ROOTBINDIR;
1920 PrependPathName(
gRootDir, rootbindir);
1932 if (ret < 0) ret = -1;
1934 Info(
"Load",
"loaded library %s, status %d", path, ret);
1937 Error(
"Load",
"version mismatch, %s = %d, ROOT = %d",
1938 path, v,
gROOT->GetVersionInt());
1942 gLibraryVersionIdx--;
1946 if (!entry || !entry[0] || ret < 0)
return ret;
1948 Func_t
f = DynFindSymbol(module, entry);
1961 if (FindDynamicLibrary(sLib, quiet))
1993 if ((path = DynamicPathName(module))) {
2013 TString libs = GetLibraries(regexp);
2016 Ssiz_t start = 0, index = 0, end = 0;
2020 Printf(
"Loaded shared libraries");
2021 Printf(
"=======================");
2023 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2024 index = libs.
Index(separator, &end, start);
2026 s = libs(index, end);
2040 Printf(
"-----------------------");
2041 Printf(
"%d libraries loaded", i);
2042 Printf(
"=======================");
2050 TTHREAD_TLS_DECL(
TString, gLastErrorString);
2051 return gLastErrorString;
2059 return const_cast<TSystem*
>(
this)->GetLastErrorString();
2105 if ((linked = GetLinkedLibraries())) {
2106 if (fLinkedLibs != LINKEDLIBS) {
2110 if (custom == fLinkedLibs) {
2120 slinked.
Append(fLinkedLibs);
2125 if (libs.
Length() == 0) {
2131 static TString lastAddMissing;
2132 if ( lastLinked != slinked ) {
2135 lastLinked = slinked;
2136 lastAddMissing.
Clear();
2138 Ssiz_t start, index, end;
2139 start = index = end = 0;
2141 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2142 index = slinked.
Index(separator,&end,start);
2144 TString sub = slinked(index,end);
2145 if (sub[0]==
'-' && sub[1]==
'L') {
2160 }
else if (libs.
Length() != 0) {
2164 Ssiz_t start, index, end;
2165 start = index = end = 0;
2167 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2168 index = slinked.
Index(separator,&end,start);
2170 TString sub = slinked(index,end);
2171 if (sub[0]!=
'-' && sub[1]!=
'L') {
2181 if (regexp && *regexp) {
2185 Ssiz_t start, index, end;
2186 start = index = end = 0;
2188 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2189 index = libs.
Index(separator,&end,start);
2191 s = libs(index,end);
2192 if ((isRegexp && s.
Index(user_re) !=
kNPOS) ||
2194 if (!fListLibs.IsNull())
2195 fListLibs.Append(
" ");
2196 fListLibs.Append(s);
2204 #if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5) 2210 static TRegexp user_so(
"\\.so$");
2212 Ssiz_t start, index, end;
2213 start = index = end = 0;
2215 while ((start < libs2.
Length()) && (index !=
kNPOS)) {
2216 index = libs2.
Index(separator, &end, start);
2220 TString s = libs2(index, end);
2223 if ( GetPathInfo( s, 0, (
Long_t*)0, 0, 0 ) != 0 ) {
2233 fListLibs = maclibs;
2455 target = tobedeleted;
2456 delete [] tobedeleted;
2461 static TString R__Exec(
const char *cmd)
2472 while ((x = fgetc(f))!=EOF ) {
2473 if (x==
'\n' || x==
'\r')
break;
2481 static void R__FixLink(
TString &cmd)
2487 TString res = R__Exec(
"link 2>&1");
2489 if (res.
Contains(
"Microsoft (R) Incremental Linker"))
2493 res = R__Exec(
"cygpath . 2>&1");
2499 res = R__Exec(
"which cl.exe 2>&1|grep cl|sed 's,cl\\.exe$,link\\.exe,' 2>&1");
2501 res = R__Exec(
Form(
"cygpath -w '%s' 2>&1",res.
Data()));
2515 if (path.
Length() > 2 && path[1]==
':') {
2535 const char * stderrfile =
"/dev/null";
2540 TString bakdepfilename = depfilename +
".bak";
2543 TString touch =
"echo # > "; touch +=
"\"" + depfilename +
"\"";
2545 TString touch =
"echo > "; touch +=
"\"" + depfilename +
"\"";
2548 TString builddep = ROOTBINDIR;
2552 builddep +=
"/rmkdepend \"-f";
2553 builddep += depfilename;
2554 builddep +=
"\" -o_" + extension +
"." + gSystem->
GetSoExt() +
" ";
2557 if ( build_loc.
Length() > (len+1) ) {
2558 builddep +=
" \"-p";
2559 if (build_loc[len] ==
'/' || build_loc[len+1] !=
'\\' ) {
2569 builddep +=
" \"-p";
2573 builddep +=
" -Y -- ";
2576 rootsysInclude +=
"/include";
2578 TString rootsysInclude = ROOTINCDIR;
2580 builddep +=
" \"-I"+rootsysInclude+
"\" ";
2581 builddep += includes;
2582 builddep += defines;
2583 builddep +=
" -- \"";
2584 builddep += filename;
2589 if ( library.
Length() > (len+1) ) {
2590 if (library[len] ==
'/' || library[len+1] !=
'\\' ) {
2591 targetname = library.
Data() + len + 1;
2593 targetname = library.
Data() + len + 2;
2596 targetname = library;
2599 targetname = library;
2604 builddep +=
"\" > ";
2605 builddep += stderrfile;
2606 builddep +=
" 2>&1 ";
2611 #if defined(R__HAS_CLING_DICTVERSION) 2613 char *clingdictversion = gSystem->
Which(incPath,
"clingdictversion.h");
2614 if (clingdictversion) {
2617 delete [] clingdictversion;
2619 R__AddPath(adddictdep,rootsysInclude+
"/clingdictversion.h ");
2624 const char *dictHeaders[] = {
"RVersion.h",
"RConfig.h",
"TClass.h",
2625 "TDictAttributeMap.h",
"TInterpreter.h",
"TROOT.h",
"TBuffer.h",
2626 "TMemberInspector.h",
"TError.h",
"RtypesImp.h",
"TIsAProxy.h",
2627 "TFileMergeInfo.h",
"TCollectionProxyInfo.h"};
2629 for (
unsigned int h=0;
h <
sizeof(dictHeaders)/
sizeof(dictHeaders[0]); ++
h)
2631 char *rootVersion = gSystem->
Which(incPath,dictHeaders[
h]);
2635 delete [] rootVersion;
2637 R__AddPath(adddictdep,rootsysInclude +
"/" + dictHeaders[h]);
2643 char *rootCling = gSystem->
Which(gSystem->
Getenv(
"PATH"),
"rootcling");
2647 delete [] rootCling;
2650 adddictdep +=
" >> \""+depfilename+
"\"";
2652 TString addversiondep(
"echo ");
2653 addversiondep += libname + version_var_prefix +
" \"" +
ROOT_RELEASE +
"\" >> \""+depfilename+
"\"";
2662 if (depbuilt) depbuilt = !gSystem->
Exec(builddep);
2663 if (depbuilt) depbuilt = !gSystem->
Exec(adddictdep);
2664 if (depbuilt) depbuilt = !gSystem->
Exec(addversiondep);
2667 ::Warning(
"ACLiC",
"Failed to generate the dependency file for %s",
2671 gSystem->
Unlink(stderrfile);
2673 gSystem->
Unlink(bakdepfilename);
2798 const char *library_specified,
2799 const char *build_dir,
2802 static const char *version_var_prefix =
"__ROOTBUILDVERSION=";
2813 keep = (strchr(opt,
'k')!=0);
2814 recompile = (strchr(opt,
'f')!=0);
2815 if (strchr(opt,
'O')!=0) {
2818 if (strchr(opt,
'g')!=0) {
2821 if (strchr(opt,
'c')!=0) {
2824 withInfo = strchr(opt,
's') == 0;
2825 verbose = strchr(opt,
'v') != 0;
2826 internalDebug = strchr(opt,
'd') != 0;
2829 TString rootbuild = ROOTBUILD;
2837 Bool_t flatBuildDir = (fAclicProperties & kFlatBuildDir) || (strchr(opt,
'-')!=0);
2840 TString build_loc = ExpandFileName(GetBuildDir());
2841 if (build_dir && strlen(build_dir)) build_loc = build_dir;
2842 if (build_loc ==
".") {
2843 build_loc = WorkingDirectory();
2844 }
else if (build_loc.
Length() && (!IsAbsoluteFileName(build_loc)) ) {
2845 AssignAndDelete( build_loc , ConcatFileName( WorkingDirectory(), build_loc ) );
2851 TString incPath = GetIncludePath();
2855 incPath.
Append(fromConfig);
2858 while ( incPath.
Index(
" :") != -1 ) {
2862 incPath.
Prepend(WorkingDirectory());
2865 TString expFileName(filename);
2866 ExpandPathName( expFileName );
2867 TString library = expFileName;
2868 if (! IsAbsoluteFileName(library) )
2870 const char *whichlibrary = Which(incPath,library);
2872 library = whichlibrary;
2873 delete [] whichlibrary;
2875 ::Error(
"ACLiC",
"The file %s can not be found in the include path: %s",filename,incPath.
Data());
2880 ::Error(
"ACLiC",
"The file %s can not be found.",filename);
2890 TString filename_fullpath = library;
2892 TString file_dirname = DirName( filename_fullpath );
2897 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
2898 file_dirname.
Prepend(library(0,2));
2900 TString file_location( file_dirname );
2901 incPath.
Prepend( file_location +
":" );
2905 extension.
Replace( 0, dot_pos+1, 0 , 0);
2906 TString libname_noext = library;
2907 if (dot_pos>=0) libname_noext.
Remove( dot_pos );
2911 TString(
"_") + extension +
"." + fSoExt );
2913 TString libname ( BaseName( libname_noext ) );
2916 if (library_specified && strlen(library_specified) ) {
2918 libname = BaseName( library_specified );
2919 library = library_specified;
2920 ExpandPathName( library );
2921 if (! IsAbsoluteFileName(library) ) {
2922 AssignAndDelete( library , ConcatFileName( WorkingDirectory(), library ) );
2924 library =
TString(library) +
"." + fSoExt;
2927 TString libname_ext ( libname );
2928 libname_ext +=
"." + fSoExt;
2930 TString lib_dirname = DirName( library );
2935 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
2936 lib_dirname.
Prepend(library(0,2));
2939 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"/.", 2) == 0 ) {
2942 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"\\.", 2) == 0 ) {
2945 TString lib_location( lib_dirname );
2948 if (build_loc.
Length()==0) {
2949 build_loc = lib_location;
2952 TRegexp disk_finder (
"[A-z]:");
2954 if (pos==0) library.
Remove(pos,3);
2955 pos = lib_location.
Index( disk_finder );
2956 if (pos==0) lib_location.
Remove(pos,3);
2965 TString build_loc_store( build_loc );
2966 if (!flatBuildDir) {
2967 AssignAndDelete( build_loc, ConcatFileName( build_loc, lib_location) );
2971 mkdirFailed = (0 != mkdir(build_loc,
true));
2972 if (mkdirFailed && !canWriteBuild_loc) {
2975 build_loc = build_loc_store;
2977 }
else if (!mkdirFailed && dirmode!=0) {
2978 Chmod(build_loc,dirmode);
2990 ::Info(
"ACLiC",
"script has already been loaded in interpreted mode");
2991 ::Info(
"ACLiC",
"unloading %s and compiling it", filename);
3001 TString includes = GetIncludePath();
3006 TRegexp rel_inc(
" -I[^\"/\\$%-][^:-]+");
3008 pos = rel_inc.
Index(includes,&len);
3010 TString sub = includes(pos,len);
3016 includes.
Replace(pos,len,sub);
3017 pos = rel_inc.
Index(includes,&len);
3022 TRegexp rel_inc(
" -I\"[^/\\$%-][^:-]+");
3024 pos = rel_inc.
Index(includes,&len);
3026 TString sub = includes(pos,len);
3030 includes.
Replace(pos,len,sub);
3031 pos = rel_inc.
Index(includes,&len);
3051 TString cmd = GetMakeSharedLib();
3052 TRegexp rel_def(
"-D[^\\s\\t\\n\\r]*");
3054 pos = rel_def.
Index(cmd,&len);
3056 defines += cmd(pos,len);
3058 pos = rel_def.
Index(cmd,&len,pos+1);
3070 emergency_loc = TempDirectory();
3081 AssignAndDelete( depfilename, ConcatFileName(depdir, BaseName(libname_noext)) );
3082 depfilename +=
"_" + extension +
".d";
3086 Long_t lib_time, file_time;
3090 (lib_time < file_time))) {
3100 depdir = emergency_loc;
3101 AssignAndDelete( depfilename, ConcatFileName(depdir, BaseName(libname_noext)) );
3102 depfilename +=
"_" + extension +
".d";
3104 R__WriteDependencyFile(build_loc, depfilename, filename_fullpath, library, libname, extension, version_var_prefix, includes, defines, incPath);
3111 FILE * depfile = fopen(depfilename.
Data(),
"r");
3120 TString version_var = libname + version_var_prefix;
3123 char *
line =
new char[sz];
3129 Bool_t hasversion =
false;
3131 while ((c = fgetc(depfile)) != EOF) {
3134 while ((c = fgetc(depfile)) != EOF) {
3141 if (current && line[current-1]==
'=' && strncmp(version_var.
Data(),
line,current)==0) {
3147 }
else if (isspace(c) && !nested) {
3149 if (line[current-1]!=
':') {
3158 modified |= ( lib_time <= filetime );
3165 if (current==sz-1) {
3167 char *newline =
new char[sz];
3168 strcpy(newline,line);
3172 if (c==
'"') nested = !nested;
3181 recompile = modified;
3189 || strlen(GetLibraries(library,
"D",
kFALSE)) != 0 ) {
3198 && (lib_time>load_time)) {
3203 if ( !recompile && reload ) {
3206 ::Info(
"ACLiC",
"%s has been modified and will be reloaded",
3214 fCompiled->Remove(libinfo);
3225 return !gSystem->
Load(library);
3229 ::Info(
"ACLiC",
"%s script has already been compiled and loaded",
3230 modified ?
"modified" :
"unmodified");
3237 ::Info(
"ACLiC",
"it will be regenerated and reloaded!");
3244 fCompiled->Remove(libinfo);
3254 AssignAndDelete( libmapfilename, ConcatFileName( build_loc, libname ) );
3255 libmapfilename +=
".rootmap";
3256 #if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) || defined(R__WIN32) 3261 Bool_t linkDepLibraries = !produceRootmap;
3263 #if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) 3265 #elif defined(R__WIN32) 3270 produceRootmap = linkLibs & 0x2;
3271 linkDepLibraries = linkLibs & 0x1;
3288 return !gSystem->
Load(library);
3293 if (!canWrite && recompile) {
3296 ::Warning(
"ACLiC",
"Could not create the directory: %s",
3299 ::Warning(
"ACLiC",
"%s is not writable!",
3302 if (emergency_loc == build_dir ) {
3303 ::Error(
"ACLiC",
"%s is the last resort location (i.e. temp location)",build_loc.
Data());
3306 ::Warning(
"ACLiC",
"Output will be written to %s",
3307 emergency_loc.
Data());
3308 return CompileMacro(expFileName, opt, library_specified, emergency_loc, dirmode);
3312 Info(
"ACLiC",
"creating shared library %s",library.
Data());
3315 R__WriteDependencyFile(build_loc, depfilename, filename_fullpath, library, libname, extension, version_var_prefix, includes, defines, incPath);
3318 TString dict = libname +
"_ACLiC_dict";
3322 static const int maxforbidden = 27;
3323 static const char *forbidden_chars[maxforbidden] =
3324 {
"+",
"-",
"*",
"/",
"&",
"%",
"|",
"^",
">",
"<",
3325 "=",
"~",
".",
"(",
")",
"[",
"]",
"!",
",",
"$",
3326 " ",
":",
"'",
"#",
"@",
"\\",
"\"" };
3327 for(
int ic = 0; ic < maxforbidden; ic++ ) {
3342 linkdef +=
"_ACLiC_linkdef.h";
3343 std::ofstream linkdefFile( linkdef, std::ios::out );
3344 linkdefFile <<
"// File Automatically generated by the ROOT Script Compiler " 3346 linkdefFile << std::endl;
3347 linkdefFile <<
"#ifdef __CINT__" << std::endl;
3348 linkdefFile << std::endl;
3349 linkdefFile <<
"#pragma link C++ nestedclasses;" << std::endl;
3350 linkdefFile <<
"#pragma link C++ nestedtypedefs;" << std::endl;
3351 linkdefFile << std::endl;
3355 const char * extensions[] = {
".h",
".hh",
".hpp",
".hxx",
".hPP",
".hXX" };
3358 for (i = 0; i < 6; i++ ) {
3360 TString extra_linkdef = BaseName( libname_noext );
3361 extra_linkdef.
Append(GetLinkdefSuffix());
3362 extra_linkdef.
Append(extensions[i]);
3363 name = Which(incPath,extra_linkdef);
3365 if (verboseLevel>4 && withInfo) {
3366 Info(
"ACLiC",
"including extra linkdef file: %s",name);
3368 linkdefFile <<
"#include \"" << name <<
"\"" << std::endl;
3373 if (verboseLevel>5 && withInfo) {
3374 Info(
"ACLiC",
"looking for header in: %s",incPath.
Data());
3376 for (i = 0; i < 6; i++ ) {
3378 TString lookup = BaseName( libname_noext );
3379 lookup.
Append(extensions[i]);
3380 name = Which(incPath,lookup);
3382 linkdefFile <<
"#pragma link C++ defined_in "<<name<<
";"<< std::endl;
3386 linkdefFile <<
"#pragma link C++ defined_in \""<<filename_fullpath <<
"\";" << std::endl;
3387 linkdefFile << std::endl;
3388 linkdefFile <<
"#endif" << std::endl;
3389 linkdefFile.close();
3395 mapfile +=
"_ACLiC_map";
3396 TString mapfilein = mapfile +
".in";
3397 TString mapfileout = mapfile +
".out";
3402 needLoadMap =
kTRUE;
3405 std::ofstream mapfileStream( mapfilein, std::ios::out );
3431 mapfileStream << file << std::endl;
3433 mapfileStream << file << std::endl;
3434 mapfileStream << name << std::endl;
3436 for (i = 0; i <
gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
3441 mapfileStream.close();
3446 rcling = gSystem->
Getenv(
"ROOTSYS");
3450 rcling +=
"\\bin\\";
3453 rcling = ROOTBINDIR;
3460 rcling +=
"rootcling -v0 \"--lib-list-prefix=";
3462 rcling +=
"\" -f \"";
3464 if (produceRootmap) {
3465 rcling +=
" -rml " + libname +
" -rmf \"" + libmapfilename +
"\" ";
3467 rcling.
Append(GetIncludePath()).
Append(
" -D__ACLIC__ ");
3468 if (produceRootmap) {
3469 rcling.
Append(
"-DR__ACLIC_ROOTMAP ");
3479 if (verboseLevel>3) {
3480 ::Info(
"ACLiC",
"creating the dictionary files");
3481 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", rcling.
Data());
3485 Int_t dictResult = gSystem->
Exec(rcling);
3487 if (dictResult==139)
::Error(
"ACLiC",
"Dictionary generation failed with a core dump!");
3496 TString linkedlibs = GetLibraries(
"",
"S");
3499 std::ifstream liblist(mapfileout);
3501 while ( liblist >> libtoload ) {
3503 if (libtoload ==
"#") {
3505 std::string toskipcomment;
3506 std::getline(liblist,toskipcomment);
3509 if (libtoload != library && libtoload != libname && libtoload != libname_ext) {
3510 if (produceRootmap) {
3511 if (loadLib || linkDepLibraries ) {
3512 result =
gROOT->LoadClass(
"", libtoload) >= 0;
3518 if (!linkedlibs.
Contains(libtoload)) {
3520 depLibraries.
Append(
" ");
3521 depLibraries.
Append(GetLibraries(libtoload,
"DSL",
kFALSE));
3522 depLibraries = depLibraries.
Strip();
3525 gROOT->LoadClass(
"", libtoload);
3528 unsigned char c = liblist.peek();
3529 if (c==
'\n' || c==
'\r') {
3550 TString linkLibrariesNoQuotes(GetLibraries(
"",
"SDL"));
3555 for (
auto tokenObj : *linkLibrariesNoQuotes.
Tokenize(
" ")) {
3556 singleLibrary = ((
TObjString*)tokenObj)->GetString();
3557 if (!AccessPathName(singleLibrary) || singleLibrary[0]==
'-') {
3558 if (collectingSingleLibraryNameTokens) {
3559 librariesWithQuotes.
Chop();
3560 librariesWithQuotes +=
"\" \"" + singleLibrary +
"\"";
3561 collectingSingleLibraryNameTokens =
kFALSE;
3563 librariesWithQuotes +=
" \"" + singleLibrary +
"\"";
3566 if (collectingSingleLibraryNameTokens) {
3567 librariesWithQuotes += singleLibrary +
" ";
3569 collectingSingleLibraryNameTokens =
kTRUE;
3570 librariesWithQuotes +=
" \"" + singleLibrary +
" ";
3575 linkLibraries.
Prepend(librariesWithQuotes);
3581 cmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3583 cmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3586 cmd.
ReplaceAll(
"$SharedLib",
"\"$SharedLib\"");
3588 if (linkDepLibraries) {
3589 if (produceRootmap) {
3612 fakeMain +=
"_ACLiC_main";
3614 std::ofstream fakeMainFile( fakeMain, std::ios::out );
3615 fakeMainFile <<
"// File Automatically generated by the ROOT Script Compiler " 3617 fakeMainFile <<
"int main(char*argc,char**argvv) {};" << std::endl;
3618 fakeMainFile.close();
3629 exec +=
"_ACLiC_exec";
3630 testcmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3632 testcmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3636 testcmd.
ReplaceAll(
"$LinkedLibs",linkLibraries);
3644 R__FixLink(testcmd);
3649 if (verboseLevel>3 && withInfo) {
3650 ::Info(
"ACLiC",
"compiling the dictionary and script files");
3651 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", cmd.
Data());
3653 Int_t compilationResult = gSystem->
Exec( cmd );
3654 if (compilationResult) {
3655 if (compilationResult==139)
::Error(
"ACLiC",
"Compilation failed with a core dump!");
3657 if (produceRootmap) {
3658 gSystem->
Unlink(libmapfilename);
3661 result = !compilationResult;
3676 if (verboseLevel>3 && withInfo)
::Info(
"ACLiC",
"loading the shared library");
3677 if (loadLib) result = !gSystem->
Load(library);
3678 else result =
kTRUE;
3681 if (verboseLevel>3 && withInfo) {
3682 ::Info(
"ACLiC",
"testing for missing symbols:");
3683 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", testcmd.
Data());
3685 gSystem->
Exec(testcmd);
3691 if (verboseLevel<=5 && !internalDebug) {
3693 gSystem->
Unlink( dicth );
3694 gSystem->
Unlink( dictObj );
3695 gSystem->
Unlink( linkdef );
3696 gSystem->
Unlink( mapfilein );
3697 gSystem->
Unlink( mapfileout );
3698 gSystem->
Unlink( fakeMain );
3701 if (verboseLevel>6) {
3705 gSystem->
Exec(rcling);
3706 gSystem->
Exec( cmd );
3707 gSystem->
Exec(testcmd);
3719 return fAclicProperties;
3735 return fBuildCompiler;
3743 return fBuildCompilerVersion;
3759 if (fBuildDir.Length()==0) {
3760 if (!
gEnv)
return "";
3800 return fMakeSharedLib;
3817 fListPaths = fIncludePath;
3818 fListPaths.Append(
" ").Append(
gInterpreter->GetIncludePath());
3837 if (fLinkdefSuffix.Length()==0) {
3838 if (!
gEnv)
return "_linkdef";
3841 return fLinkdefSuffix;
3875 fBuildDir = build_dir;
3876 if (isflat) fAclicProperties |= (kFlatBuildDir &
kBitMask);
3877 else fAclicProperties &= ~(kFlatBuildDir &
kBitMask);
3886 fFlagsDebug = flags;
3923 fMakeExe = directives;
3975 fMakeSharedLib = directives;
3985 fIncludePath +=
" ";
3986 fIncludePath += includePath;
3997 fLinkedLibs += linkedLib;
4019 fIncludePath = includePath;
4030 fLinkedLibs = linkedLibs;
4052 fLinkdefSuffix = suffix;
4084 char *fname =
Strip(filename);
4086 char *arg = strchr(fname,
'(');
4088 while (arg && *arg && (arg > fname && *(arg-1) ==
'$') && *(arg+1))
4089 arg = strchr(arg+1,
'(');
4090 if (arg && arg > fname) {
4103 s2 = strstr(fname,
">>");
4104 if (!s2) s2 = strstr(fname,
"2>");
4105 if (!s2) s2 = strchr(fname,
'>');
4106 s3 = strchr(fname,
'<');
4107 if (s2 && s3) s2 = s2<s3 ? s2 : s3;
4108 if (s3 && !s2) s2 = s3;
4117 while (s2 && *s2 ==
' ') s2--;
4127 int len = strlen(fname);
4130 if (strchr(
"kfgOcsdv-", fname[len - 1])) {
4131 mode += fname[len - 1];
4137 Bool_t compile = len && fname[len - 1] ==
'+';
4138 Bool_t remove = compile && len > 1 && fname[len - 2] ==
'+';
4144 fname[strlen(fname)-2] = 0;
4147 fname[strlen(fname)-1] = 0;
4156 if (arg) arguments += arg;
4157 else arguments =
"";
4168 TIter next(fCompiled);
4170 while ((lib = (
TNamed*)next())) {
const char * GetHost() const
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void Add(TObject *obj)
double read(const std::string &file_name)
reading
Ssiz_t Last(char c) const
Find last occurrence of a character c.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form: ~~~ {.cpp} [path/]macro.C[+|++[k|f|g|O|c|s|d|v|-]][(args)]...
virtual int GetPid()
Get process id.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Syslog(ELogLevel level, const char *mess)
Send mess to syslog daemon.
int GetErrno()
return errno
const char * GetHostName() const
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
Bool_t ProcessEvents()
Process events if timer did time out.
virtual const char * WorkingDirectory()
Return working directory.
virtual void StackTrace()
Print a stack trace.
void Reset()
Reset the timer.
virtual const char * GetBuildCompiler() const
Return the build compiler.
virtual void SetFlagsDebug(const char *)
FlagsDebug should contain the options to pass to the C++ compiler in order to compile the library in ...
virtual void NotifyApplicationCreated()
Hook to tell TSystem that the TApplication object has been created.
Collectable string class.
virtual const char * GetLinkdefSuffix() const
Return the linkdef suffix chosen by the user for ACLiC.
virtual int Link(const char *from, const char *to)
Create a link from file1 to file2.
virtual const char * GetBuildArch() const
Return the build architecture.
virtual void SetFlagsOpt(const char *)
FlagsOpt should contain the options to pass to the C++ compiler in order to compile the library in op...
virtual const char * GetLinkedLibraries()
Get list of shared libraries loaded at the start of the executable.
void RemoveOnExit(TObject *obj)
Objects that should be deleted on exit of the OS interface.
virtual Int_t SetFPEMask(Int_t mask=kDefaultMask)
Set which conditions trigger a floating point exception.
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
const char * GetProtocol() const
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This class represents an Internet Protocol (IP) address.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket connection.
Regular expression class.
This class implements a mutex interface.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
TVersionCheck(int versionCode)
Register version of plugin library.
virtual UserGroup_t * GetGroupInfo(Int_t gid)
Returns all group info in the UserGroup_t structure.
virtual int GetFsInfo(const char *path, Long_t *id, Long_t *bsize, Long_t *blocks, Long_t *bfree)
Get info about a file system: fs type, block size, number of blocks, number of free blocks...
virtual void SetMakeExe(const char *directives)
Directives has the same syntax as the argument of SetMakeSharedLib but is used to create an executabl...
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual void Remove()
Remove std::exception handler from system handler list.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual void AddStdExceptionHandler(TStdExceptionHandler *eh)
Add an exception handler to list of system exception handlers.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
virtual void ResetSignal(ESignals sig, Bool_t reset=kTRUE)
If reset is true reset the signal handler for the specified signal to the default handler...
static void R__AddPath(TString &target, const TString &path)
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual void SetMakeSharedLib(const char *directives)
Directives should contain the description on how to compile and link a shared lib.
virtual int AnnounceUdpService(int port, int backlog)
Announce UDP service.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
Int_t GetEntriesFast() const
TString & Prepend(const char *cs)
R__EXTERN TApplication * gApplication
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
virtual void IgnoreInterrupt(Bool_t ignore=kTRUE)
If ignore is true ignore the interrupt signal, else restore previous behaviour.
Basic time type with millisecond precision.
static bool R__MatchFilename(const char *left, const char *right)
Figure out if left and right points to the same object in the file system.
Long_t ExecPlugin(int nargs, const T &...params)
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual EAclicMode GetAclicMode() const
AclicMode indicates whether the library should be built in debug mode or optimized.
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
virtual int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
virtual TFileHandler * RemoveFileHandler(TFileHandler *fh)
Remove a file handler from the list of file handlers.
Bool_t R_ISREG(Int_t mode)
virtual char * GetServiceByPort(int port)
Get name of internet service.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
TVirtualMutex * gSystemMutex
virtual const char * FindFile(const char *search, TString &file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
static Int_t GetErrno()
Static function returning system error number.
virtual int Rename(const char *from, const char *to)
Rename a file.
const char * Data() const
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
virtual FILE * TempFileName(TString &base, const char *dir=0)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Bool_t IsInterruptingSyscalls() const
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetLinkedLibs() const
Return the list of library linked to this executable.
TObject * Next()
Return next object in collection.
virtual const char * GetDynamicPath()
Return the dynamic path (used to find shared libraries).
void Clear()
Clear string without changing its capacity.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void ListLibraries(const char *regexp="")
List all loaded shared libraries.
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
virtual void SetDisplay()
Set DISPLAY environment variable based on utmp entry. Only for UNIX.
TString & Append(const char *cs)
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual void ExitLoop()
Exit from event loop.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
virtual int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
virtual ~TSystem()
Delete the OS interface.
virtual void Unload(const char *module)
Unload a shared library.
static Int_t gLibraryVersionMax
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Bool_t ConsistentWith(const char *path, void *dirptr=0)
Check consistency of this helper with the one required by 'path' or 'dirptr'.
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
void Error(const char *location, const char *msgfmt,...)
virtual void Closelog()
Close connection to system log daemon.
virtual const char * GetFlagsDebug() const
Return the debug flags.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
TString & GetLastErrorString()
Return the thread local storage for the custom last error message.
static Int_t * gLibraryVersion
virtual EStatus Handle(std::exception &exc)=0
virtual const char * GetSoExt() const
Get the shared library extension.
virtual void AddDynamicPath(const char *pathname)
Add a new directory to the dynamic path.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
virtual TStdExceptionHandler * RemoveStdExceptionHandler(TStdExceptionHandler *eh)
Remove an exception handler from list of exception handlers.
void ResetErrno()
reset errno
static void R__WriteDependencyFile(const TString &build_loc, const TString &depfilename, const TString &filename, const TString &library, const TString &libname, const TString &extension, const char *version_var_prefix, const TString &includes, const TString &defines, const TString &incPath)
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
virtual Bool_t Init()
Initialize the OS interface.
virtual const char * GetBuildNode() const
Return the build node name.
if object ctor succeeded but object should not be used
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual int AcceptConnection(int sock)
Accept a connection.
Bool_t Gets(FILE *fp, Bool_t chop=kTRUE)
Read one line from the stream, including the , or until EOF.
void AssignAndDelete(TString &target, char *tobedeleted)
char * Strip(const char *str, char c= ' ')
Strip leading and trailing c (blanks by default) from a string.
virtual void SetDynamicPath(const char *pathname)
Set the dynamic path to a new value.
virtual int AnnounceTcpService(int port, Bool_t reuse, int backlog, int tcpwindowsize=-1)
Announce TCP/IP service.
virtual Long_t NextTimeOut(Bool_t mode)
Time when next timer of mode (synchronous=kTRUE or asynchronous=kFALSE) will time-out (in ms)...
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
Bool_t TestBit(UInt_t f) const
char * Form(const char *fmt,...)
virtual int Umask(Int_t mask)
Set the process file creation mode mask.
virtual void SetBuildDir(const char *build_dir, Bool_t isflat=kFALSE)
Set the location where ACLiC will create libraries and use as a scratch area.
virtual int SendBuf(int sock, const void *buffer, int length)
Send a buffer headed by a length indicator.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual std::string GetWorkingDirectory() const
Return working directory.
Handles synchronous and a-synchronous timer events.
virtual const char * GetBuildDir() const
Return the path of the build directory.
virtual void ListSymbols(const char *module, const char *re="")
List symbols in a shared library.
virtual const char * GetMakeExe() const
Return the command line use to make an executable.
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual void StopIdleing()
Called when system stops idleing.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual void Abort(int code=0)
Abort the application.
virtual void InnerLoop()
Inner event loop.
virtual void SetSoExt(const char *soExt)
Set shared library extension, should be either .so, .sl, .a, .dll, etc.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
virtual void Unsetenv(const char *name)
Unset environment variable.
if object destructor must call RecursiveRemove()
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual void Run()
System event loop.
char * StrDup(const char *str)
Duplicate the string str.
#define R__LOCKGUARD2(mutex)
virtual int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to another host.
virtual int SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
virtual const char * FindDynamicLibrary(TString &lib, Bool_t quiet=kFALSE)
Find a dynamic library using the system search paths.
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
TString & Remove(Ssiz_t pos)
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual void StartIdleing()
Called when system starts idleing.
virtual Int_t GetEffectiveUid()
Returns the effective user id.
virtual const char * GetIncludePath()
Get the list of include path.
virtual const char * GetFlagsOpt() const
Return the optimization flags.
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
virtual const char * GetName() const
Returns name of object.
virtual const char * HostName()
Return the system's host name.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
virtual void Remove()
Remove signal handler from system signal handler list.
virtual const char * ExpandFileName(const char *fname)
Expand a pathname getting rid of special shell characters like ~.
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual Int_t GetGid(const char *group=0)
Returns the group's id. If group = 0, returns current user's group.
void Beep(Int_t freq=-1, Int_t duration=-1, Bool_t setDefault=kFALSE)
Beep for duration milliseconds with a tone of frequency freq.
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function.
virtual TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
virtual Int_t GetUid(const char *user=0)
Returns the user's id. If user = 0, returns current user's id.
virtual void Remove()
Remove file event handler from system file handler list.
virtual void AddLinkedLibs(const char *linkedLib)
Add linkedLib to already set linked libs.
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void SetAclicMode(EAclicMode mode)
AclicMode indicates whether the library should be built in debug mode or optimized.
Mother of all ROOT objects.
virtual void SetObjExt(const char *objExt)
Set object files extension, should be either .o, .obj, etc.
virtual Bool_t IsFileInIncludePath(const char *name, char **fullpath=0)
Return true if 'name' is a file that can be found in the ROOT include path or the current directory...
virtual Int_t GetAclicProperties() const
Return the ACLiC properties field.
virtual std::string GetHomeDirectory(const char *userName=0) const
Return the user's home directory.
virtual int RecvBuf(int sock, void *buffer, int length)
Receive a buffer headed by a length indicator.
virtual void Openlog(const char *name, Int_t options, ELogFacility facility)
Open connection to system log daemon.
Bool_t R_ISDIR(Int_t mode)
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual int AnnounceUnixService(int port, int backlog)
Announce unix domain service.
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'...
virtual void SetLinkedLibs(const char *linkedLibs)
LinkedLibs should contain the library directory and list of libraries needed to recreate the current ...
virtual Int_t GetEffectiveGid()
Returns the effective group id.
virtual void Exit(int code, Bool_t mode=kTRUE)
Exit the application.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual const char * GetObjExt() const
Get the object file extension.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Iterator of ordered collection.
virtual void AddIncludePath(const char *includePath)
Add includePath to the already set include path.
TSystem * FindHelper(const char *path, void *dirptr=0)
Create helper TSystem to handle file and directory operations that might be special for remote file a...
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
static void ResetErrno()
Static function resetting system error number.
virtual int GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
TObject * At(Int_t idx) const
void SetErrorStr(const char *errstr)
Set the system error string.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual int GetSockOpt(int sock, int kind, int *val)
Get socket option.
Abstract base class defining a generic interface to the underlying Operating System.
virtual const char * GetTitle() const
Returns title of object.
virtual void SetLinkdefSuffix(const char *suffix)
The 'suffix' will be appended to the name of a script loaded by ACLiC and used to locate any eventual...
virtual Int_t GetFPEMask()
Return the bitmap of conditions that trigger a floating point exception.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
static Int_t gLibraryVersionIdx
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
const char * GetUser() const
virtual const char * GetError()
Return system error string.
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
static Int_t * ReAllocInt(Int_t *vp, size_t size, size_t oldsize)
Reallocate (i.e.
virtual void SetIncludePath(const char *includePath)
IncludePath should contain the list of compiler flags to indicate where to find user defined header f...
if(line.BeginsWith("/*"))
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.
const char * GetHostAddress() const
Returns the IP address string "%d.%d.%d.%d".
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.