]> www.ginac.de Git - ginac.git/blobdiff - cint/ginaccint.cpp
* basic::collec() never worked correctly on non-polynomials till now.
[ginac.git] / cint / ginaccint.cpp
index 0c6e1c1ed5cd30f68b97d9bce49f71a4528590a7..cd875e90879a58004a855e9427274b5cd4fbe4a4 100644 (file)
@@ -14,30 +14,33 @@ extern char **environ;
 
 int main(int argc, char * *argv)
 {
 
 int main(int argc, char * *argv)
 {
-    // manually "expand" autoconf-style variables
-    if (exec_prefix=="${prefix}")
-        exec_prefix = prefix;
-    if (bindir=="${exec_prefix}/bin")
-        bindir = exec_prefix + "/bin";
-    if (libdir=="${exec_prefix}/lib")
-        libdir = exec_prefix + "/lib";
-    // now we can guess what to start
-    std::string binprog = bindir + "/ginaccint.bin";
-    
-    // extend LD_LIBRARY_PATH by libdir, so ginaccint.bin really finds libginac
-    const char * LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH");
-    if (LD_LIBRARY_PATH == NULL)
-        setenv("LD_LIBRARY_PATH", libdir.c_str(), 1);
-    else
-        setenv("LD_LIBRARY_PATH", (std::string(LD_LIBRARY_PATH)+':'+libdir).c_str(), 1);
-    
-    // hard-wire CINTSYSDIR, inherited from configure, if it is not set
-    setenv("CINTSYSDIR", CINTSYSDIR.c_str(), 0);
-    
-    // execute the real thing
-    int error = execve(binprog.c_str(), argv, environ);
-    
-    // only gets here on error
-    std::cerr << argv[0] << ": cannot exec " << binprog << std::endl;
-    return error;
+       // manually "expand" autoconf-style variables
+       if (exec_prefix=="${prefix}")
+               exec_prefix = prefix;
+       if (bindir=="${exec_prefix}/bin")
+               bindir = exec_prefix + "/bin";
+       if (libdir=="${exec_prefix}/lib")
+               libdir = exec_prefix + "/lib";
+       // now we can guess what to start
+       std::string binprog = bindir + "/ginaccint.bin";
+       
+       // extend LD_LIBRARY_PATH by libdir, so ginaccint.bin really finds libginac
+       const char * LD_LIBRARY_PATH = getenv("LD_LIBRARY_PATH");
+       if (LD_LIBRARY_PATH == NULL)
+               setenv("LD_LIBRARY_PATH", libdir.c_str(), 1);
+       else
+               setenv("LD_LIBRARY_PATH", (std::string(LD_LIBRARY_PATH)+':'+libdir).c_str(), 1);
+       
+       // hard-wire CINTSYSDIR, inherited from configure, but only if it has
+       // been set therein (to allow for system-wide installations of cint)
+       // and without overriding it if the user has specified it.
+       if (CINTSYSDIR != "@CINTSYSDIR@")
+               setenv("CINTSYSDIR", CINTSYSDIR.c_str(), 0);
+       
+       // execute the real thing
+       int error = execve(binprog.c_str(), argv, environ);
+       
+       // only gets here on error
+       std::cerr << argv[0] << ": cannot exec " << binprog << std::endl;
+       return error;
 }
 }