]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - build/Makefile.linux
memory leak fixed
[u/mrichter/AliRoot.git] / build / Makefile.linux
index 6771cf3de1bc461c17be93acfeeaa484e80cf104..89c8c3d414a2376b9b7d5b5350825db5b77dd22e 100644 (file)
@@ -5,12 +5,8 @@
 
 XARGS = xargs -r
 
-# The compilers
-CXX           = g++ 
-CC           = gcc
 CCMAJORV      = $(shell $(CC) -dumpversion | cut -d. -f1)
 CCMINORV      = $(shell $(CC) -dumpversion | cut -d. -f2)
-F77          = $(shell root-config --f77)
 
 # Global optimisation
 OPT           = -O -g
@@ -27,31 +23,33 @@ CLIBCXXOPTS   =
 CLIBCOPT      =
 CLIBFOPT      = $(CLIBDEFS)
 
+CXXWARN              = -Wall -Wno-long-long -W -Weffc++ -Wshadow -Woverloaded-virtual -ansi 
+
 # Compiler flags
 ifeq ($(CCMAJORV),2)
-CXXFLAGS       = $(OPT) -W -Wall -fPIC -pipe
-CXXFLAGSNO     = $(NOOPT) -W -Wall -fPIC -pipe
+CXXFLAGS       = $(OPT) -fPIC -pipe
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe
 else
 ifeq ($(CCMAJORV),3)
-CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0 
 else
 ifeq ($(CCMAJORV),4)
-CXXFLAGS       = $(OPT) -W -Wall -Weffc++ -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -Dlinux
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0
 else
-CXXFLAGS       = $(OPT) -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi -Dlinux
-CXXFLAGSNO     = $(NOOPT) -W -Wall -Weffc++ -fPIC -pipe -fmessage-length=0 -Wno-long-long -ansi
+CXXFLAGS       = $(OPT)   -fPIC -pipe -fmessage-length=0 -Dlinux
+CXXFLAGSNO     = $(NOOPT) -fPIC -pipe -fmessage-length=0 
 endif
 endif
 endif
 CFLAGS        = $(OPT) -Wall -Werror -fPIC -pipe -Wno-long-long -pedantic-errors -ansi
-FFLAGS         = $(CLIBFOPT) $(FOPT) -fno-second-underscore
+FFLAGS         = $(CLIBFOPT) $(FOPT) -fPIC -fno-second-underscore
 
-ifeq (g95,$(F77))
+ifneq (,$(findstring g95,$(F77)))
 FFLAGS       +=-DFORTRAN_G95
 else
-ifeq (gfortran,$(F77))
+ifneq (,$(findstring gfortran,$(F77)))
 FFLAGS       +=-DFORTRAN_GFORTRAN
 else
 FFLAGS       +=
@@ -64,7 +62,7 @@ DEPENDFFLAGS   = $(FFLAGS)
 # rootcint flags
 CINTFLAGS     = 
 
-LD            = g++
+LD            = $(shell root-config --ld) 
 LDFLAGS       = $(OPT) 
 
 SHLD         = $(LD)
@@ -74,12 +72,12 @@ SOEXT             = so
 #System libraries
 SYSLIBS      := -ldl -lcrypt -L/usr/X11R6/lib -lX11
 
-ifeq (g95,$(F77))
-SHLIB += -L$(shell g95 --print-search-dirs | sed -n -e 's/install: //p') -lf95
+ifneq (,$(findstring g95,$(F77)))
+SHLIB += -L$(shell $(F77) --print-search-dirs | sed -n -e 's/install: //p') -lf95
 else
-ifeq (gfortran,$(F77))
-SHLIB := $(shell gfortran -print-file-name=libgfortran.so)
-SHLIB += $(shell gfortran -print-file-name=libgfortranbegin.a)
+ifneq (,$(findstring gfortran,$(F77)))
+SHLIB := $(shell $(F77) -m32 -print-file-name=libgfortran.so)
+SHLIB += $(shell $(F77) -m32 -print-file-name=libgfortranbegin.a)
 SYSLIBS += $(SHLIB)
 else
 SHLIB         = -lg2c