diff --git a/Makefile_geant4 b/Makefile_geant4 index b87fa81..1128776 100644 --- a/Makefile_geant4 +++ b/Makefile_geant4 @@ -15,6 +15,8 @@ else CMAKE = cmake3 endif +include $(BUILD_SCRIPTS)/geant4_version.mk + all: $(G4DIR)/.make_install_done $(TARFILE): @@ -33,6 +35,10 @@ $(G4DIR)/.patch_done: $(G4DIR)/.untar_done then patch Geant4ToolchainBackwardCompatibility.cmake \ < $(BUILD_SCRIPTS)/patches/geant4/Geant4ToolchainBackwardCompatibility.cmake.patch; \ fi +ifeq ($(GEANT4_EQ_10_04), true) + patch $(G4DIR)/config/sys/Linux-g++.gmk \ + < $(BUILD_SCRIPTS)/patches/geant4/Linux-g++.gmk.patch +endif date > $@ $(G4DIR)/.configure_done: $(G4DIR)/.patch_done diff --git a/geant4_version.mk b/geant4_version.mk new file mode 100644 index 0000000..637827b --- /dev/null +++ b/geant4_version.mk @@ -0,0 +1,6 @@ +ifdef GEANT4_VERSION + GEANT4_MAJOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F. '{print $$1}') + GEANT4_MINOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F. '{print $$2}' | bc) + GEANT4_SUBMINOR_VERSION := $(shell echo $(GEANT4_VERSION) | awk -F'.p' '{print $$3}' | bc) + GEANT4_EQ_10_04 := $(shell if [[ $(GEANT4_MAJOR_VERSION) -eq 10 && $(GEANT4_MINOR_VERSION) -eq 4 ]]; then echo true; else echo false; fi) +endif diff --git a/patches/geant4/Linux-g++.gmk.patch b/patches/geant4/Linux-g++.gmk.patch new file mode 100644 index 0000000..995478d --- /dev/null +++ b/patches/geant4/Linux-g++.gmk.patch @@ -0,0 +1,49 @@ +--- Linux-g++.gmk.original 2021-09-22 14:45:22.608148649 -0400 ++++ Linux-g++.gmk.patched 2021-09-22 16:22:16.414406962 -0400 +@@ -92,19 +92,15 @@ + QTHOME := /usr + endif + ifndef QTMOC +- QTMOC := $(QTHOME)/bin/moc ++# QTMOC := $(shell if [ -f "$(QTHOME)/bin/moc-qt5" ]; then echo $(QTHOME)/bin/moc-qt5; elif [ -f "$(QTHOME)/bin/moc-qt4" ]; then echo $(QTHOME)/bin/moc-qt4; else echo $(QTHOME)/bin/moc; fi) ++ QTMOC := dummy_value + endif + +- QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' ) ++ QT_VERSION := $(shell $(QTMOC) -v | awk '{print $$2}' | awk -F. '{print $$1}') + + ifeq ($(QT_VERSION),5) + ifndef QTFLAGS # Qt5 +- QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt +- QTFLAGS += -I $(QTHOME)/include/QtCore +- QTFLAGS += -I $(QTHOME)/include/QtGui +- QTFLAGS += -I $(QTHOME)/include/QtWidgets +- QTFLAGS += -I $(QTHOME)/include/QtOpenGL +- QTFLAGS += -I $(QTHOME)/include/QtPrintSupport ++ QTFLAGS := -I $(QTHOME)/include -I$(QTHOME)/include/Qt5 + endif + else # Qt4 + ifndef QTFLAGS +@@ -115,18 +111,18 @@ + endif + endif + ifndef QTLIBPATH +- QTLIBPATH := $(QTHOME)/lib ++ QTLIBPATH := $(QTHOME)/lib64 + QT_SEARCH_LIB := $(shell ls $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l ) + ifneq ($(QT_SEARCH_LIB),0) +- QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION) ++ QTLIBPATH := $(QTHOME)/lib64/qt$(QT_VERSION) + endif + endif + ifeq ($(QT_VERSION),5) + ifndef QTLIBS # Qt5 +- QTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtPrintSupport ++ QTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5PrintSupport + endif + ifndef GLQTLIBS +- GLQTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtWidgets -lQtOpenGL -lQtPrintSupport ++ GLQTLIBS := -L$(QTLIBPATH) -lQt5Core -lQt5Gui -lQt5Widgets -lQt5OpenGL -lQt5PrintSupport + endif + else # Qt4 + ifndef QTLIBS