50 #include "compiledata.h" 51 #include "RConfigure.h" 72 gROOT->SetInterrupt(kFALSE);
106 if (gSystem && name[0] !=
'-' && strcmp(name,
"Generic"))
107 Error(
"TSystem",
"only one instance of TSystem allowed");
112 fStdExceptionHandler = 0;
133 if (!gLibraryVersion) {
135 memset(gLibraryVersion, 0, gLibraryVersionMax*
sizeof(
Int_t));
145 fOnExitList->Delete();
149 if (fSignalHandler) {
150 fSignalHandler->Delete();
155 fFileHandler->Delete();
159 if (fStdExceptionHandler) {
160 fStdExceptionHandler->Delete();
200 fBuildArch = BUILD_ARCH;
201 fBuildCompiler = COMPILER;
202 fBuildCompilerVersion = COMPILERVERS;
203 fBuildNode = BUILD_NODE;
204 fFlagsDebug = CXXDEBUG;
206 fIncludePath = INCLUDEPATH;
207 fLinkedLibs = LINKEDLIBS;
211 fMakeSharedLib = MAKESHAREDLIB;
215 if (
gEnv && fBeepDuration == 0 && fBeepFreq == 0) {
216 fBeepDuration =
gEnv->
GetValue(
"Root.System.BeepDuration", 100);
217 fBeepFreq =
gEnv->
GetValue(
"Root.System.BeepFreq", 440);
219 if (!fName.CompareTo(
"Generic"))
return kTRUE;
248 GetLastErrorString() = errstr;
256 if (
GetErrno() == 0 && GetLastErrorString() !=
"")
257 return GetLastErrorString();
269 #ifdef R__SOLARIS_CC50 285 #ifdef R__SOLARIS_CC50 298 if (fOnExitList == 0)
300 if (fOnExitList->FindObject(obj) == 0)
301 fOnExitList->
Add(obj);
333 fBeepDuration = duration;
336 if (fBeepDuration < 0 || fBeepFreq < 0)
return;
337 if (freq < 0) freq = fBeepFreq;
338 if (duration < 0) duration = fBeepDuration;
339 DoBeep(freq, duration);
362 catch (std::exception& exc) {
363 TIter next(fStdExceptionHandler);
374 Warning(
"Run",
"instructed to abort");
381 catch (
const char *str) {
386 Warning(
"Run",
"handle uncaugth exception, terminating");
425 DispatchOneEvent(
kTRUE);
427 return gROOT->IsInterrupted();
477 if (ti && fTimers && (fTimers->FindObject(ti) == 0))
500 if (!fTimers)
return -1;
508 if (t->
IsSync() == mode) {
522 if (to && to->
IsAsync() && timeout > 0) {
524 SigAlarmInterruptsSyscalls(
kTRUE);
526 SigAlarmInterruptsSyscalls(
kFALSE);
538 if (h && fSignalHandler && (fSignalHandler->FindObject(h) == 0))
539 fSignalHandler->Add(h);
560 if (h && fFileHandler && (fFileHandler->FindObject(h) == 0))
561 fFileHandler->Add(h);
617 if (eh && fStdExceptionHandler && (fStdExceptionHandler->FindObject(eh) == 0))
618 fStdExceptionHandler->Add(eh);
627 if (fStdExceptionHandler)
688 FILE *pipe = OpenPipe(command,
"r");
690 SysError(
"GetFromPipe",
"cannot run command \"%s\"", command);
695 while (line.
Gets(pipe)) {
701 Int_t r = ClosePipe(pipe);
703 Error(
"GetFromPipe",
"command \"%s\" returned %d", command, r);
764 TIter next(fHelpers);
765 while ((helper = (
TSystem*) next()))
777 if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
782 }
else if ((h =
gROOT->GetPluginManager()->FindHandler(
"TSystem", path))) {
789 fHelpers->Add(helper);
810 if (GetDirPtr() && GetDirPtr() == dirptr)
813 return (checkproto || checkdir);
875 return std::string();
891 return std::string();
905 TString dirname = DirName(safeName);
912 int res = mkdir(dirname,
kTRUE);
920 return MakeDirectory(name);
931 if (name[0] ==
'/' && name[1] ==
'\0')
934 if ((cp = (
char*)strrchr(name,
'/')))
938 Error(
"BaseName",
"name = 0");
948 return dir[0] ==
'/';
962 if (!name || !name[0])
return kFALSE;
967 TString realname = SplitAclicMode(name, aclicMode, arguments, io);
969 TString fileLocation = DirName(realname);
974 while ( incPath.
Index(
" :") != -1 ) {
977 incPath.
Prepend(fileLocation+
":.:");
979 char *actual = Which(incPath,realname);
998 if (pathname && strchr(pathname,
'/')) {
1002 static char *buf = 0;
1003 int pathlen = strlen(pathname);
1004 if (pathlen > len) {
1007 buf =
new char [len+1];
1009 strcpy(buf, pathname);
1011 char *
r = buf+pathlen-1;
1013 while ( r>buf && *(r)==
'/') { --
r; }
1015 while ( r>buf && *(r)!=
'/') { --
r; }
1018 while ( r>buf && *(r)==
'/') { --
r; }
1021 if (r==buf && *(r)!=
'/') {
1047 PrependPathName(dir, nameString);
1074 TTHREAD_TLS_ARRAY(
char, kBufSize, xname);
1076 Bool_t res = ExpandFileName(fname, xname, kBufSize);
1092 char xname[kBufSize];
1094 Bool_t res = ExpandFileName(fname.
Data(), xname, kBufSize);
1107 int n, ier, iter, lx, ncopy;
1108 char *inp, *out, *
x, *t, buff[kBufSize*4];
1109 const char *b, *
c, *e;
1112 iter = 0; xname[0] = 0; inp = buff + kBufSize; out = inp + kBufSize;
1113 inp[-1] =
' '; inp[0] = 0; out[-1] =
' ';
1114 c = fname + strspn(fname,
" \t\f\r");
1117 strlcat(inp, c, kBufSize);
1120 iter++; c = inp; ier = 0;
1124 if (c[0] ==
'~' && c[1] ==
'/') {
1125 std::string hd = GetHomeDirectory();
1129 strlcpy(x, p, kBufSize);
1136 }
else if (c[0] ==
'~' && c[1] !=
'/') {
1137 n = strcspn(c+1,
"/ ");
1139 strncat(buff, c+1, n);
1140 std::string hd = GetHomeDirectory(buff);
1144 strlcpy(x, p, kBufSize);
1153 for ( ; c[0]; c++) {
1157 if (c[0] ==
'.' && c[1] ==
'/' && c[-1] ==
' ') {
1158 std::string wd = GetWorkingDirectory();
1159 strlcpy(buff, wd.c_str(), kBufSize);
1164 strlcpy(x, p, kBufSize); x += strlen(p); c = e-1;
continue;
1171 if (c[1] ==
'(') b++;
1172 if (c[1] ==
'{') b++;
1176 for (e = b; isalnum(e[0]) || e[0] ==
'_'; e++) ;
1177 buff[0] = 0; strncat(buff, b, e-b);
1180 for (t = buff; (t[0] = toupper(t[0])); t++) ;
1184 for (t = buff; (t[0] = tolower(t[0])); t++) ;
1187 if (!p && !strcmp(buff,
"cwd")) {
1188 std::string wd = GetWorkingDirectory();
1189 strlcpy(buff, wd.c_str(), kBufSize);
1192 if (!p && !strcmp(buff,
"$")) {
1193 snprintf(buff,kBufSize*4,
"%d", GetPid());
1201 if (c[1] && c[1]!=
'\\' && c[1]!=
';' && c[1]!=
'/')
1209 if (lp >= kBufSize) {
1211 strlcpy(x, p, kBufSize);
1217 c = (b==c+1) ? e-1 : e;
1222 x[0] = 0; lx = x - out;
1223 if (ier && iter < 3) { strlcpy(inp, out, kBufSize);
goto again; }
1224 ncopy = (lx >= kBufSize) ? kBufSize-1 : lx;
1225 xname[0] = 0; strncat(xname, out, ncopy);
1227 if (ier || ncopy != lx) {
1228 ::Error(
"TSystem::ExpandFileName",
"input: %s, output: %s", fname, xname);
1278 if (strlen(url.
GetHost()) > 0) {
1288 if (strlen(url.
GetUser()) > 0) {
1367 int res = GetPathInfo(path,
id, &lsize, flags, modtime);
1369 if (res == 0 && size) {
1371 Error(
"GetPathInfo",
"file %s > 2 GB, use GetPathInfo() with Long64_t size", path);
1397 int res = GetPathInfo(path, buf);
1513 FindFile(search, wfilString, mode);
1514 if (wfilString.
IsNull())
return 0;
1690 Error(
"ShowOutput",
"handle not specified");
1696 Error(
"ShowOutput",
"file '%s' cannot be read", h->
fFile.
Data());
1702 if (!(f = fopen(h->
fFile.
Data(),
"r"))) {
1703 Error(
"ShowOutput",
"file '%s' cannot be open", h->
fFile.
Data());
1708 off_t ltot = lseek(fileno(f), (off_t) 0, SEEK_END);
1710 lseek(fileno(f), (off_t) begin, SEEK_SET);
1711 Int_t left = ltot - begin;
1714 const Int_t kMAXBUF = 16384;
1716 Int_t wanted = (left > kMAXBUF-1) ? kMAXBUF-1 : left;
1719 while ((len =
read(fileno(f), buf, wanted)) < 0 &&
1724 SysError(
"ShowOutput",
"error reading log file");
1730 fprintf(stderr,
"%s", buf);
1734 wanted = (left > kMAXBUF) ? kMAXBUF : left;
1736 }
while (len > 0 && left > 0);
1779 if (left == right)
return kTRUE;
1781 if (left==0 || right==0)
return kFALSE;
1783 if ( (strcmp(right,left)==0) ) {
1789 char leftname[_MAX_PATH];
1790 char rightname[_MAX_PATH];
1791 _fullpath( leftname, left, _MAX_PATH );
1792 _fullpath( rightname, right, _MAX_PATH );
1793 return ((stricmp(leftname, rightname)==0));
1795 struct stat rightBuf;
1796 struct stat leftBuf;
1797 return ( ( 0 == stat( left, & leftBuf ) )
1798 && ( 0 == stat( right, & rightBuf ) )
1799 && ( leftBuf.st_dev == rightBuf.st_dev )
1800 && ( leftBuf.st_ino == rightBuf.st_ino )
1801 && ( leftBuf.st_size == rightBuf.st_size )
1802 && ( leftBuf.st_mtime == rightBuf.st_mtime )
1820 TString libs( GetLibraries() );
1821 TString moduleBasename( BaseName(module) );
1831 if (idx == 0 || libs[idx-1] ==
'/' || libs[idx-1] ==
'\\') {
1834 if (!l.
EndsWith(
".") && libs[idx]==
'.')
1837 while (idx < len && isdigit(libs[idx])) {
1840 if (libs[idx] ==
'.') {
1844 while (idx < len && libs[idx] !=
'.') {
1845 if (libs[idx] ==
' ' || idx+1 == len) {
1852 if (l[l.
Length()-1] ==
'.') {
1858 if ((idx == 0 || libs[idx-1] ==
' ') &&
1859 (libs[idx+l.
Length()] ==
' ' || libs[idx+l.
Length()] == 0)) {
1865 char *path = DynamicPathName(module);
1873 libmapfilename = path;
1874 idx = libmapfilename.
Last(
'.');
1876 libmapfilename.
Remove(idx);
1878 libmapfilename +=
".rootmap";
1880 if (
gDebug > 0)
Info(
"Load",
"loading %s", libmapfilename.
Data());
1882 deplibs =
gInterpreter->GetSharedLibDeps(moduleBasename);
1889 if (strcmp(module,deplib)==0) {
1893 Info(
"Load",
"loading dependent library %s for library %s",
1895 if ((ret = Load(deplib,
"", system)) < 0) {
1905 const char *dirname = DirName(path);
1919 if (ret < 0) ret = -1;
1921 Info(
"Load",
"loaded library %s, status %d", path, ret);
1924 Error(
"Load",
"version mismatch, %s = %d, ROOT = %d",
1925 path, v,
gROOT->GetVersionInt());
1929 gLibraryVersionIdx--;
1933 if (!entry || !entry[0] || ret < 0)
return ret;
1935 Func_t
f = DynFindSymbol(module, entry);
1948 if (FindDynamicLibrary(sLib, quiet))
1980 if ((path = DynamicPathName(module))) {
2000 TString libs = GetLibraries(regexp);
2003 Ssiz_t start = 0, index = 0, end = 0;
2007 Printf(
"Loaded shared libraries");
2008 Printf(
"=======================");
2010 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2011 index = libs.
Index(separator, &end, start);
2013 s = libs(index, end);
2027 Printf(
"-----------------------");
2028 Printf(
"%d libraries loaded", i);
2029 Printf(
"=======================");
2037 TTHREAD_TLS_DECL(
TString, gLastErrorString);
2038 return gLastErrorString;
2046 return const_cast<TSystem*
>(
this)->GetLastErrorString();
2092 if ((linked = GetLinkedLibraries())) {
2093 if (fLinkedLibs != LINKEDLIBS) {
2097 if (custom == fLinkedLibs) {
2107 slinked.
Append(fLinkedLibs);
2112 if (libs.
Length() == 0) {
2118 static TString lastAddMissing;
2119 if ( lastLinked != slinked ) {
2122 lastLinked = slinked;
2123 lastAddMissing.
Clear();
2125 Ssiz_t start, index, end;
2126 start = index = end = 0;
2128 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2129 index = slinked.
Index(separator,&end,start);
2131 TString sub = slinked(index,end);
2132 if (sub[0]==
'-' && sub[1]==
'L') {
2147 }
else if (libs.
Length() != 0) {
2151 Ssiz_t start, index, end;
2152 start = index = end = 0;
2154 while ((start < slinked.
Length()) && (index !=
kNPOS)) {
2155 index = slinked.
Index(separator,&end,start);
2157 TString sub = slinked(index,end);
2158 if (sub[0]!=
'-' && sub[1]!=
'L') {
2168 if (regexp && *regexp) {
2172 Ssiz_t start, index, end;
2173 start = index = end = 0;
2175 while ((start < libs.
Length()) && (index !=
kNPOS)) {
2176 index = libs.
Index(separator,&end,start);
2178 s = libs(index,end);
2179 if ((isRegexp && s.
Index(user_re) !=
kNPOS) ||
2181 if (!fListLibs.IsNull())
2182 fListLibs.Append(
" ");
2183 fListLibs.Append(s);
2191 #if defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5) 2197 static TRegexp user_so(
"\\.so$");
2199 Ssiz_t start, index, end;
2200 start = index = end = 0;
2202 while ((start < libs2.
Length()) && (index !=
kNPOS)) {
2203 index = libs2.
Index(separator, &end, start);
2207 TString s = libs2(index, end);
2210 if ( GetPathInfo( s, 0, (
Long_t*)0, 0, 0 ) != 0 ) {
2220 fListLibs = maclibs;
2442 target = tobedeleted;
2443 delete [] tobedeleted;
2448 static TString R__Exec(
const char *cmd)
2459 while ((x = fgetc(f))!=EOF ) {
2460 if (x==
'\n' || x==
'\r')
break;
2468 static void R__FixLink(
TString &cmd)
2474 TString res = R__Exec(
"link 2>&1");
2476 if (res.
Contains(
"Microsoft (R) Incremental Linker"))
2480 res = R__Exec(
"cygpath . 2>&1");
2486 res = R__Exec(
"which cl.exe 2>&1|grep cl|sed 's,cl\\.exe$,link\\.exe,' 2>&1");
2488 res = R__Exec(
Form(
"cygpath -w '%s' 2>&1",res.
Data()));
2502 if (path.
Length() > 2 && path[1]==
':') {
2522 const char * stderrfile =
"/dev/null";
2527 TString bakdepfilename = depfilename +
".bak";
2530 TString touch =
"echo # > "; touch +=
"\"" + depfilename +
"\"";
2532 TString touch =
"echo > "; touch +=
"\"" + depfilename +
"\"";
2534 TString builddep =
"rmkdepend";
2536 builddep +=
" \"-f";
2537 builddep += depfilename;
2538 builddep +=
"\" -o_" + extension +
"." + gSystem->
GetSoExt() +
" ";
2541 if ( build_loc.
Length() > (len+1) ) {
2542 builddep +=
" \"-p";
2543 if (build_loc[len] ==
'/' || build_loc[len+1] !=
'\\' ) {
2553 builddep +=
" \"-p";
2557 builddep +=
" -Y -- ";
2559 builddep +=
" \"-I"+rootsysInclude+
"\" ";
2560 builddep += includes;
2561 builddep += defines;
2562 builddep +=
" -- \"";
2568 if ( library.
Length() > (len+1) ) {
2569 if (library[len] ==
'/' || library[len+1] !=
'\\' ) {
2570 targetname = library.
Data() + len + 1;
2572 targetname = library.
Data() + len + 2;
2575 targetname = library;
2578 targetname = library;
2583 builddep +=
"\" > ";
2584 builddep += stderrfile;
2585 builddep +=
" 2>&1 ";
2590 #if defined(R__HAS_CLING_DICTVERSION) 2592 char *clingdictversion = gSystem->
Which(incPath,
"clingdictversion.h");
2593 if (clingdictversion) {
2596 delete [] clingdictversion;
2598 R__AddPath(adddictdep,rootsysInclude+
"/clingdictversion.h ");
2603 const char *dictHeaders[] = {
"RVersion.h",
"RConfig.h",
"TClass.h",
2604 "TDictAttributeMap.h",
"TInterpreter.h",
"TROOT.h",
"TBuffer.h",
2605 "TMemberInspector.h",
"TError.h",
"RtypesImp.h",
"TIsAProxy.h",
2606 "TFileMergeInfo.h",
"TCollectionProxyInfo.h"};
2608 for (
unsigned int h=0;
h <
sizeof(dictHeaders)/
sizeof(dictHeaders[0]); ++
h)
2610 char *rootVersion = gSystem->
Which(incPath,dictHeaders[
h]);
2614 delete [] rootVersion;
2616 R__AddPath(adddictdep,rootsysInclude +
"/" + dictHeaders[h]);
2620 adddictdep +=
" >> \""+depfilename+
"\"";
2622 TString addversiondep(
"echo ");
2623 addversiondep += libname + version_var_prefix +
" \"" +
ROOT_RELEASE +
"\" >> \""+depfilename+
"\"";
2632 if (depbuilt) depbuilt = !gSystem->
Exec(builddep);
2633 if (depbuilt) depbuilt = !gSystem->
Exec(adddictdep);
2634 if (depbuilt) depbuilt = !gSystem->
Exec(addversiondep);
2637 ::Warning(
"ACLiC",
"Failed to generate the dependency file for %s",
2641 gSystem->
Unlink(stderrfile);
2643 gSystem->
Unlink(bakdepfilename);
2768 const char *library_specified,
2769 const char *build_dir,
2772 static const char *version_var_prefix =
"__ROOTBUILDVERSION=";
2783 keep = (strchr(opt,
'k')!=0);
2784 recompile = (strchr(opt,
'f')!=0);
2785 if (strchr(opt,
'O')!=0) {
2788 if (strchr(opt,
'g')!=0) {
2791 if (strchr(opt,
'c')!=0) {
2794 withInfo = strchr(opt,
's') == 0;
2795 verbose = strchr(opt,
'v') != 0;
2796 internalDebug = strchr(opt,
'd') != 0;
2799 TString rootbuild = ROOTBUILD;
2807 Bool_t flatBuildDir = (fAclicProperties & kFlatBuildDir) || (strchr(opt,
'-')!=0);
2810 TString build_loc = ExpandFileName(GetBuildDir());
2811 if (build_dir && strlen(build_dir)) build_loc = build_dir;
2812 if (build_loc ==
".") {
2813 build_loc = WorkingDirectory();
2814 }
else if (build_loc.
Length() && (!IsAbsoluteFileName(build_loc)) ) {
2815 AssignAndDelete( build_loc , ConcatFileName( WorkingDirectory(), build_loc ) );
2821 TString incPath = GetIncludePath();
2825 incPath.
Append(fromConfig);
2828 while ( incPath.
Index(
" :") != -1 ) {
2832 incPath.
Prepend(WorkingDirectory());
2835 TString expFileName(filename);
2836 ExpandPathName( expFileName );
2837 TString library = expFileName;
2838 if (! IsAbsoluteFileName(library) )
2840 const char *whichlibrary = Which(incPath,library);
2842 library = whichlibrary;
2843 delete [] whichlibrary;
2845 ::Error(
"ACLiC",
"The file %s can not be found in the include path: %s",filename,incPath.
Data());
2850 ::Error(
"ACLiC",
"The file %s can not be found.",filename);
2860 TString filename_fullpath = library;
2862 TString file_dirname = DirName( filename_fullpath );
2867 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
2868 file_dirname.
Prepend(library(0,2));
2870 TString file_location( file_dirname );
2871 incPath.
Prepend( file_location +
":" );
2875 extension.
Replace( 0, dot_pos+1, 0 , 0);
2876 TString libname_noext = library;
2877 if (dot_pos>=0) libname_noext.
Remove( dot_pos );
2881 TString(
"_") + extension +
"." + fSoExt );
2883 TString libname ( BaseName( libname_noext ) );
2886 if (library_specified && strlen(library_specified) ) {
2888 libname = BaseName( library_specified );
2889 library = library_specified;
2890 ExpandPathName( library );
2891 if (! IsAbsoluteFileName(library) ) {
2892 AssignAndDelete( library , ConcatFileName( WorkingDirectory(), library ) );
2894 library =
TString(library) +
"." + fSoExt;
2897 TString libname_ext ( libname );
2898 libname_ext +=
"." + fSoExt;
2900 TString lib_dirname = DirName( library );
2905 if (library.
Length()>1 && isalpha(library[0]) && library[1]==
':') {
2906 lib_dirname.
Prepend(library(0,2));
2909 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"/.", 2) == 0 ) {
2912 if ( strncmp( &(lib_dirname[lib_dirname.
Length()-2]),
"\\.", 2) == 0 ) {
2915 TString lib_location( lib_dirname );
2918 if (build_loc.
Length()==0) {
2919 build_loc = lib_location;
2922 TRegexp disk_finder (
"[A-z]:");
2924 if (pos==0) library.
Remove(pos,3);
2925 pos = lib_location.
Index( disk_finder );
2926 if (pos==0) lib_location.
Remove(pos,3);
2935 TString build_loc_store( build_loc );
2936 if (!flatBuildDir) {
2937 AssignAndDelete( build_loc, ConcatFileName( build_loc, lib_location) );
2941 mkdirFailed = (0 != mkdir(build_loc,
true));
2942 if (mkdirFailed && !canWriteBuild_loc) {
2945 build_loc = build_loc_store;
2947 }
else if (!mkdirFailed && dirmode!=0) {
2948 Chmod(build_loc,dirmode);
2960 ::Info(
"ACLiC",
"script has already been loaded in interpreted mode");
2961 ::Info(
"ACLiC",
"unloading %s and compiling it", filename);
2971 TString includes = GetIncludePath();
2976 TRegexp rel_inc(
" -I[^\"/\\$%-][^:-]+");
2978 pos = rel_inc.
Index(includes,&len);
2980 TString sub = includes(pos,len);
2985 includes.
Replace(pos,len,sub);
2986 pos = rel_inc.
Index(includes,&len);
2991 TRegexp rel_inc(
" -I\"[^/\\$%-][^:-]+");
2993 pos = rel_inc.
Index(includes,&len);
2995 TString sub = includes(pos,len);
2999 includes.
Replace(pos,len,sub);
3000 pos = rel_inc.
Index(includes,&len);
3020 TString cmd = GetMakeSharedLib();
3021 TRegexp rel_def(
"-D[^\\s\\t\\n\\r]*");
3023 pos = rel_def.
Index(cmd,&len);
3025 defines += cmd(pos,len);
3027 pos = rel_def.
Index(cmd,&len,pos+1);
3039 emergency_loc = TempDirectory();
3050 AssignAndDelete( depfilename, ConcatFileName(depdir, BaseName(libname_noext)) );
3051 depfilename +=
"_" + extension +
".d";
3055 Long_t lib_time, file_time;
3059 (lib_time < file_time))) {
3069 depdir = emergency_loc;
3070 AssignAndDelete( depfilename, ConcatFileName(depdir, BaseName(libname_noext)) );
3071 depfilename +=
"_" + extension +
".d";
3073 R__WriteDependencyFile(build_loc, depfilename, filename_fullpath, library, libname, extension, version_var_prefix, includes, defines, incPath);
3080 FILE * depfile = fopen(depfilename.
Data(),
"r");
3089 TString version_var = libname + version_var_prefix;
3092 char *
line =
new char[sz];
3098 Bool_t hasversion =
false;
3100 while ((c = fgetc(depfile)) != EOF) {
3103 while ((c = fgetc(depfile)) != EOF) {
3110 if (current && line[current-1]==
'=' && strncmp(version_var.
Data(),
line,current)==0) {
3116 }
else if (isspace(c) && !nested) {
3118 if (line[current-1]!=
':') {
3127 modified |= ( lib_time <= filetime );
3134 if (current==sz-1) {
3136 char *newline =
new char[sz];
3137 strcpy(newline,line);
3141 if (c==
'"') nested = !nested;
3150 recompile = modified;
3158 || strlen(GetLibraries(library,
"D",
kFALSE)) != 0 ) {
3167 && (lib_time>load_time)) {
3172 if ( !recompile && reload ) {
3175 ::Info(
"ACLiC",
"%s has been modified and will be reloaded",
3183 fCompiled->Remove(libinfo);
3194 return !gSystem->
Load(library);
3198 ::Info(
"ACLiC",
"%s script has already been compiled and loaded",
3199 modified ?
"modified" :
"unmodified");
3206 ::Info(
"ACLiC",
"it will be regenerated and reloaded!");
3213 fCompiled->Remove(libinfo);
3223 AssignAndDelete( libmapfilename, ConcatFileName( build_loc, libname ) );
3224 libmapfilename +=
".rootmap";
3225 #if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) || defined(R__WIN32) 3230 Bool_t linkDepLibraries = !produceRootmap;
3232 #if (defined(R__MACOSX) && !defined(MAC_OS_X_VERSION_10_5)) 3234 #elif defined(R__WIN32) 3239 produceRootmap = linkLibs & 0x2;
3240 linkDepLibraries = linkLibs & 0x1;
3257 return !gSystem->
Load(library);
3262 if (!canWrite && recompile) {
3265 ::Warning(
"ACLiC",
"Could not create the directory: %s",
3268 ::Warning(
"ACLiC",
"%s is not writable!",
3271 if (emergency_loc == build_dir ) {
3272 ::Error(
"ACLiC",
"%s is the last resort location (i.e. temp location)",build_loc.
Data());
3275 ::Warning(
"ACLiC",
"Output will be written to %s",
3276 emergency_loc.
Data());
3277 return CompileMacro(expFileName, opt, library_specified, emergency_loc, dirmode);
3281 Info(
"ACLiC",
"creating shared library %s",library.
Data());
3284 R__WriteDependencyFile(build_loc, depfilename, filename_fullpath, library, libname, extension, version_var_prefix, includes, defines, incPath);
3287 TString dict = libname +
"_ACLiC_dict";
3291 static const int maxforbidden = 27;
3292 static const char *forbidden_chars[maxforbidden] =
3293 {
"+",
"-",
"*",
"/",
"&",
"%",
"|",
"^",
">",
"<",
3294 "=",
"~",
".",
"(",
")",
"[",
"]",
"!",
",",
"$",
3295 " ",
":",
"'",
"#",
"@",
"\\",
"\"" };
3296 for(
int ic = 0; ic < maxforbidden; ic++ ) {
3311 linkdef +=
"_ACLiC_linkdef.h";
3312 std::ofstream linkdefFile( linkdef, std::ios::out );
3313 linkdefFile <<
"// File Automatically generated by the ROOT Script Compiler " 3315 linkdefFile << std::endl;
3316 linkdefFile <<
"#ifdef __CINT__" << std::endl;
3317 linkdefFile << std::endl;
3318 linkdefFile <<
"#pragma link C++ nestedclasses;" << std::endl;
3319 linkdefFile <<
"#pragma link C++ nestedtypedefs;" << std::endl;
3320 linkdefFile << std::endl;
3324 const char * extensions[] = {
".h",
".hh",
".hpp",
".hxx",
".hPP",
".hXX" };
3327 for (i = 0; i < 6; i++ ) {
3329 TString extra_linkdef = BaseName( libname_noext );
3330 extra_linkdef.
Append(GetLinkdefSuffix());
3331 extra_linkdef.
Append(extensions[i]);
3332 name = Which(incPath,extra_linkdef);
3334 if (verboseLevel>4 && withInfo) {
3335 Info(
"ACLiC",
"including extra linkdef file: %s",name);
3337 linkdefFile <<
"#include \"" << name <<
"\"" << std::endl;
3342 if (verboseLevel>5 && withInfo) {
3343 Info(
"ACLiC",
"looking for header in: %s",incPath.
Data());
3345 for (i = 0; i < 6; i++ ) {
3347 TString lookup = BaseName( libname_noext );
3348 lookup.
Append(extensions[i]);
3349 name = Which(incPath,lookup);
3351 linkdefFile <<
"#pragma link C++ defined_in "<<name<<
";"<< std::endl;
3355 linkdefFile <<
"#pragma link C++ defined_in \""<<filename_fullpath <<
"\";" << std::endl;
3356 linkdefFile << std::endl;
3357 linkdefFile <<
"#endif" << std::endl;
3358 linkdefFile.close();
3364 mapfile +=
"_ACLiC_map";
3365 TString mapfilein = mapfile +
".in";
3366 TString mapfileout = mapfile +
".out";
3371 needLoadMap =
kTRUE;
3374 std::ofstream mapfileStream( mapfilein, std::ios::out );
3390 mapfileStream << file << std::endl;
3392 mapfileStream << file << std::endl;
3393 mapfileStream << name << std::endl;
3395 for (i = 0; i <
gInterpreter->GetRootMapFiles()->GetEntriesFast(); i++) {
3400 mapfileStream.close();
3405 rcling +=
" -v0 \"--lib-list-prefix=";
3407 rcling +=
"\" -f \"";
3409 if (produceRootmap) {
3410 rcling +=
" -rml " + libname +
" -rmf \"" + libmapfilename +
"\" ";
3412 rcling.
Append(GetIncludePath()).
Append(
" -D__ACLIC__ ");
3413 if (produceRootmap) {
3414 rcling.
Append(
"-DR__ACLIC_ROOTMAP ");
3424 if (verboseLevel>3) {
3425 ::Info(
"ACLiC",
"creating the dictionary files");
3426 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", rcling.
Data());
3430 Int_t dictResult = gSystem->
Exec(rcling);
3432 if (dictResult==139)
::Error(
"ACLiC",
"Dictionary generation failed with a core dump!");
3441 TString linkedlibs = GetLibraries(
"",
"S");
3444 std::ifstream liblist(mapfileout);
3446 while ( liblist >> libtoload ) {
3448 if (libtoload ==
"#") {
3450 std::string toskipcomment;
3451 std::getline(liblist,toskipcomment);
3454 if (libtoload != library && libtoload != libname && libtoload != libname_ext) {
3455 if (produceRootmap) {
3456 if (loadLib || linkDepLibraries ) {
3457 result =
gROOT->LoadClass(
"", libtoload) >= 0;
3463 if (!linkedlibs.
Contains(libtoload)) {
3465 depLibraries.
Append(
" ");
3466 depLibraries.
Append(GetLibraries(libtoload,
"DSL",
kFALSE));
3467 depLibraries = depLibraries.
Strip();
3470 gROOT->LoadClass(
"", libtoload);
3473 unsigned char c = liblist.peek();
3474 if (c==
'\n' || c==
'\r') {
3495 TString linkLibrariesNoQuotes(GetLibraries(
"",
"SDL"));
3500 for (
auto tokenObj : *linkLibrariesNoQuotes.
Tokenize(
" ")) {
3501 singleLibrary = ((
TObjString*)tokenObj)->GetString();
3502 if (!AccessPathName(singleLibrary)) {
3503 if (collectingSingleLibraryNameTokens) {
3504 librariesWithQuotes.
Chop();
3505 librariesWithQuotes +=
"\" \"" + singleLibrary +
"\"";
3506 collectingSingleLibraryNameTokens =
kFALSE;
3508 librariesWithQuotes +=
" \"" + singleLibrary +
"\"";
3511 if (collectingSingleLibraryNameTokens) {
3512 librariesWithQuotes += singleLibrary +
" ";
3514 collectingSingleLibraryNameTokens =
kTRUE;
3515 librariesWithQuotes +=
" \"" + singleLibrary +
" ";
3520 linkLibraries.
Prepend(librariesWithQuotes);
3526 cmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3528 cmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3531 cmd.
ReplaceAll(
"$SharedLib",
"\"$SharedLib\"");
3533 if (linkDepLibraries) {
3534 if (produceRootmap) {
3557 fakeMain +=
"_ACLiC_main";
3559 std::ofstream fakeMainFile( fakeMain, std::ios::out );
3560 fakeMainFile <<
"// File Automatically generated by the ROOT Script Compiler " 3562 fakeMainFile <<
"int main(char*argc,char**argvv) {};" << std::endl;
3563 fakeMainFile.close();
3574 exec +=
"_ACLiC_exec";
3575 testcmd.
ReplaceAll(
"$SourceFiles",
"-D__ACLIC__ \"$SourceFiles\"");
3577 testcmd.
ReplaceAll(
"$ObjectFiles",
"\"$ObjectFiles\"");
3581 testcmd.
ReplaceAll(
"$LinkedLibs",linkLibraries);
3589 R__FixLink(testcmd);
3594 if (verboseLevel>3 && withInfo) {
3595 ::Info(
"ACLiC",
"compiling the dictionary and script files");
3596 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", cmd.
Data());
3598 Int_t compilationResult = gSystem->
Exec( cmd );
3599 if (compilationResult) {
3600 if (compilationResult==139)
::Error(
"ACLiC",
"Compilation failed with a core dump!");
3602 if (produceRootmap) {
3603 gSystem->
Unlink(libmapfilename);
3606 result = !compilationResult;
3621 if (verboseLevel>3 && withInfo)
::Info(
"ACLiC",
"loading the shared library");
3622 if (loadLib) result = !gSystem->
Load(library);
3623 else result =
kTRUE;
3626 if (verboseLevel>3 && withInfo) {
3627 ::Info(
"ACLiC",
"testing for missing symbols:");
3628 if (verboseLevel>4)
::Info(
"ACLiC",
"%s", testcmd.
Data());
3630 gSystem->
Exec(testcmd);
3636 if (verboseLevel<=5 && !internalDebug) {
3638 gSystem->
Unlink( dicth );
3639 gSystem->
Unlink( dictObj );
3640 gSystem->
Unlink( linkdef );
3641 gSystem->
Unlink( mapfilein );
3642 gSystem->
Unlink( mapfileout );
3643 gSystem->
Unlink( fakeMain );
3646 if (verboseLevel>6) {
3650 gSystem->
Exec(rcling);
3651 gSystem->
Exec( cmd );
3652 gSystem->
Exec(testcmd);
3664 return fAclicProperties;
3680 return fBuildCompiler;
3688 return fBuildCompilerVersion;
3704 if (fBuildDir.Length()==0) {
3705 if (!
gEnv)
return "";
3745 return fMakeSharedLib;
3762 fListPaths = fIncludePath;
3763 fListPaths.Append(
" ").Append(
gInterpreter->GetIncludePath());
3782 if (fLinkdefSuffix.Length()==0) {
3783 if (!
gEnv)
return "_linkdef";
3786 return fLinkdefSuffix;
3820 fBuildDir = build_dir;
3821 if (isflat) fAclicProperties |= (kFlatBuildDir &
kBitMask);
3822 else fAclicProperties &= ~(kFlatBuildDir &
kBitMask);
3831 fFlagsDebug = flags;
3868 fMakeExe = directives;
3920 fMakeSharedLib = directives;
3930 fIncludePath +=
" ";
3931 fIncludePath += includePath;
3942 fLinkedLibs += linkedLib;
3964 fIncludePath = includePath;
3975 fLinkedLibs = linkedLibs;
3997 fLinkdefSuffix = suffix;
4029 char *fname =
Strip(filename);
4031 char *arg = strchr(fname,
'(');
4033 while (arg && *arg && (arg > fname && *(arg-1) ==
'$') && *(arg+1))
4034 arg = strchr(arg+1,
'(');
4035 if (arg && arg > fname) {
4048 s2 = strstr(fname,
">>");
4049 if (!s2) s2 = strstr(fname,
"2>");
4050 if (!s2) s2 = strchr(fname,
'>');
4051 s3 = strchr(fname,
'<');
4052 if (s2 && s3) s2 = s2<s3 ? s2 : s3;
4053 if (s3 && !s2) s2 = s3;
4062 while (s2 && *s2 ==
' ') s2--;
4072 int len = strlen(fname);
4075 if (strchr(
"kfgOcsdv-", fname[len - 1])) {
4076 mode += fname[len - 1];
4082 Bool_t compile = len && fname[len - 1] ==
'+';
4083 Bool_t remove = compile && len > 1 && fname[len - 2] ==
'+';
4089 fname[strlen(fname)-2] = 0;
4092 fname[strlen(fname)-1] = 0;
4101 if (arg) arguments += arg;
4102 else arguments =
"";
4113 TIter next(fCompiled);
4115 while ((lib = (
TNamed*)next())) {
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
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)
virtual UInt_t GetUniqueID() const
Return the unique object id.
double read(const std::string &file_name)
reading
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual int GetPid()
Get process id.
virtual int GetCpuInfo(CpuInfo_t *info, Int_t sampleTime=1000) const
Returns cpu load average and load info into the CpuInfo_t structure.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
virtual void Syslog(ELogLevel level, const char *mess)
Send mess to syslog daemon.
virtual const char * GetFlagsOpt() const
Return the optimization flags.
int GetErrno()
return errno
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
virtual Bool_t IsPathLocal(const char *path)
Returns TRUE if the url in 'path' points to the local file system.
const char * GetHostAddress() const
Returns the IP address string "%d.%d.%d.%d".
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 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 * GetLinkedLibs() const
Return the list of library linked to this executable.
const char * GetHostName() const
virtual int Link(const char *from, const char *to)
Create a link from file1 to file2.
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 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)
virtual const char * GetBuildNode() const
Return the build node name.
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.
Bool_t TestBit(UInt_t f) const
const char * GetProtocol() const
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
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.
static const char * filename()
TVersionCheck(int versionCode)
Register version of plugin library.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
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 void ResetSignal(ESignals sig, Bool_t reset=kTRUE)
If reset is true reset the signal handler for the specified signal to the default handler...
virtual int GetMemInfo(MemInfo_t *info) const
Returns ram and swap memory usage info into the MemInfo_t structure.
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.
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
virtual const char * GetSoExt() const
Get the shared library extension.
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.
virtual const char * GetFlagsDebug() const
Return the debug flags.
TString & Prepend(const char *cs)
R__EXTERN TApplication * gApplication
TObject * At(Int_t idx) const
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.
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
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.
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.
Bool_t IsInterruptingSyscalls() const
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual const char * GetLinkdefSuffix() const
Return the linkdef suffix chosen by the user for ACLiC.
const char * GetHost() 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.
virtual std::string GetHomeDirectory(const char *userName=0) const
Return the user's home directory.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
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...
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.
The TNamed class is the base class for all named ROOT classes.
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 * GetMakeExe() const
Return the command line use to make an executable.
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.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
virtual EAclicMode GetAclicMode() const
AclicMode indicates whether the library should be built in debug mode or optimized.
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.
Ssiz_t First(char c) const
Find first occurrence of a character c.
virtual ~TSystem()
Delete the OS interface.
virtual void Unload(const char *module)
Unload a shared library.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
static Int_t gLibraryVersionMax
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 * GetBuildCompiler() const
Return the build compiler.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
TString & GetLastErrorString()
Return the thread local storage for the custom last error message.
const char * GetUser() const
static Int_t * gLibraryVersion
virtual EStatus Handle(std::exception &exc)=0
virtual void AddDynamicPath(const char *pathname)
Add a new directory to the dynamic path.
virtual const char * GetBuildArch() const
Return the build architecture.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
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)
virtual Bool_t Init()
Initialize the OS interface.
virtual const char * GetLibraries(const char *regexp="", const char *option="", Bool_t isRegexp=kTRUE)
Return a space separated list of loaded shared libraries.
Long_t ExecPlugin(int nargs, const T &... params)
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)
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
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 const char * GetBuildDir() const
Return the path of the build directory.
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.
Int_t GetEntriesFast() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
virtual Int_t GetAclicProperties() const
Return the ACLiC properties field.
virtual int SendBuf(int sock, const void *buffer, int length)
Send a buffer headed by a length indicator.
Handles synchronous and a-synchronous timer events.
virtual void ListSymbols(const char *module, const char *re="")
List symbols in a shared library.
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.
char * Strip(const char *str, char c=' ')
Strip leading and trailing c (blanks by default) from a string.
virtual void Abort(int code=0)
Abort the application.
virtual void InnerLoop()
Inner event loop.
virtual const char * GetMakeSharedLib() const
Return the command line use to make a shared library.
virtual void SetSoExt(const char *soExt)
Set shared library extension, should be either .so, .sl, .a, .dll, etc.
virtual void Unsetenv(const char *name)
Unset environment variable.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
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 TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual void StartIdleing()
Called when system starts idleing.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
virtual Int_t GetEffectiveUid()
Returns the effective user id.
virtual const char * GetIncludePath()
Get the list of include path.
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
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.
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...
Ssiz_t Last(char c) const
Find last occurrence of a character c.
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 ~.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
virtual void SetProgname(const char *name)
Set the application name (from command line, argv[0]) and copy it in gProgName.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
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 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 const char * GetTitle() const
Returns title of object.
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.
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
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.
virtual std::string GetWorkingDirectory() const
Return working directory.
virtual int GetProcInfo(ProcInfo_t *info) const
Returns cpu and memory used by this process into the ProcInfo_t structure.
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.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
void SetErrorStr(const char *errstr)
Set the system error string.
virtual const char * GetName() const
Returns name of object.
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 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.
static Int_t gLibraryVersionIdx
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
virtual const char * GetObjExt() const
Get the object file extension.
virtual const char * GetError()
Return system error string.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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 const char * GetTitle() const
Returns title of object.
const char * Data() const
virtual void IgnoreSignal(ESignals sig, Bool_t ignore=kTRUE)
If ignore is true ignore the specified signal, else restore previous behaviour.