diff -uNr geant4.7.1.p01.ORIG/config/sys/Darwin-g++.gmk geant4.7.1.p01/config/sys/Darwin-g++.gmk --- geant4.7.1.p01.ORIG/config/sys/Darwin-g++.gmk 2005-10-25 16:13:16.000000000 +0900 +++ geant4.7.1.p01/config/sys/Darwin-g++.gmk 2005-11-14 14:25:28.000000000 +0900 @@ -29,9 +29,15 @@ FCFLAGS += -pg CCFLAGS += -pg endif - FC := g77 - FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore - FCLIBS := -lg2c -lnsl + ifeq ($(shell which gfortran | grep -c 'no gfortran'),0) + FC := gfortran + FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore + FCLIBS := -lgfortran -lgfortranbegin -lnsl + else + FC := g77 + FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore + FCLIBS := -lg2c -lnsl + endif ECHO := /bin/echo -n SHEXT := dylib X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 diff -uNr geant4.7.1.p01.ORIG/config/sys/Linux-g++.gmk geant4.7.1.p01/config/sys/Linux-g++.gmk --- geant4.7.1.p01.ORIG/config/sys/Linux-g++.gmk 2005-10-25 16:13:16.000000000 +0900 +++ geant4.7.1.p01/config/sys/Linux-g++.gmk 2005-11-14 14:25:28.000000000 +0900 @@ -37,9 +37,17 @@ endif G4RUNPATHOPTION := -Wl,-rpath CC := gcc - FC := g77 - FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore - FCLIBS := -lg2c -lnsl + + ifeq ($(shell which gfortran | grep -c 'no gfortran'),0) + FC := gfortran + FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore + FCLIBS := -lgfortran -lgfortranbegin -lnsl + else + FC := g77 + FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore + FCLIBS := -lg2c -lnsl + endif + ECHO := /bin/echo -e SHEXT := so X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11