Finding automatically g++ include directories for dependencies
[u/mrichter/AliRoot.git] / conf / MachineDef.Linux
index 1e60b54b85ab5dc160a9f4cd73f127b1049617f5..2e854b80a1cc6155b5dc118b689903830c569aff 100644 (file)
@@ -8,12 +8,17 @@ CC          = echo $*.c ; gcc
 
 # Global optimisation
 OPT           = -O2
+OPT           = -g
 
 # Shared library suffix
 SL           = so
 
 # The options
-CXXOPTS       = $(OPT) -Wall -fPIC  -fno-rtti -fno-exceptions
+#
+# starting from root.2.22 on Linux the flags -fno-rtti -fno-exceptions are
+# not necessary any more
+#
+CXXOPTS       = $(OPT) -Wall -fPIC
 COPT         = $(OPT)
 FOPT         = $(OPT) -fno-second-underscore
 
@@ -26,9 +31,11 @@ CLIBFOPT      =
 
 # Additional directories for dependencies
 
-DEPINC        = -I/usr/local/include/g++ -I/usr/local/include \
-               -I/usr/local/i686-pc-linux-gnu/include \
-               -I/usr/local/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.60/include
+DEPINC       = `rm -f /tmp/d.cxx; touch /tmp/d.cxx ; \
+                 g++ -v -c /tmp/d.cxx -o /dev/null 2>&1 | \
+                 awk 'BEGIN {i=0} {if(substr($$0,1,10)=="End of sea") i=0; \
+                 if(i==1) printf "%s",$$sub(" ","-I")" "; \
+                 if(substr($$0,1,10) == "\#include <") i=1}' ; rm /tmp/d.cxx`
                
 LD            = g++
 LDFLAGS       = $(OPT)