source: trunk/config/sys/Darwin-g++.gmk@ 1167

Last change on this file since 1167 was 1045, checked in by garnier, 17 years ago

maj en aussi sur CVS

File size: 4.5 KB
Line 
1#
2# ------ MacOS-X ------
3# MacOS 10.3 gcc-3.3
4# MacOS 10.4 gcc-4.0
5# MacOS 10.5 gcc-4.0
6#
7# Original author: Helmut Burkhardt - CERN
8# Revisions: Guy Barrand - LAL
9# Gabriele Cosmo - CERN
10# Laurent Garnier - LAL
11#
12ifeq ($(G4SYSTEM),Darwin-g++)
13 CXX := g++
14 CXXFLAGS := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
15 CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe -Wextra
16# CXXFLAGS := -Wall -Wextra -ansi -pedantic -Wuninitialized -Winline -Wunreachable-code
17 ifdef G4OPTIMISE
18# CXXFLAGS += -O2
19# FCFLAGS := -O2
20# CCFLAGS := -O2
21 else
22 ifdef G4DEBUG
23 CXXFLAGS += -g
24 FCFLAGS := -g
25 CCFLAGS := -g
26 endif
27 endif
28 ifdef G4PROFILE
29 CXXFLAGS += -pg
30 FCFLAGS += -pg
31 CCFLAGS += -pg
32 endif
33 FC := gfortran
34 FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
35 LDFLAGS += -bind_at_load
36 FCLIBS := -lg2c -lnsl
37 SHEXT := dylib
38 ifndef X11FLAGS
39 X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11
40 endif
41 ifndef X11LIBS
42 X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
43 endif
44 ifndef XMFLAGS
45 XMFLAGS := -I/sw/include
46# XMFLAGS := -I/usr/X11R6/include ##### some installations.
47 endif
48 ifndef XMLIBS
49 XMLIBS := -L/sw/lib -lXm -lXpm
50# XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations.
51 endif
52 ifndef XAWFLAGS
53 XAWFLAGS := -I/sw/include
54# XAWFLAGS := -I/usr/X11R6/include ##### some installations.
55 endif
56 ifndef XAWLIBS
57 XAWLIBS := -lXaw
58 endif
59 DLDLIBS := -ldl
60 ifndef OGLHOME
61 OGLHOME := /usr/X11R6
62 endif
63 ifndef OGLFLAGS
64 OGLFLAGS := -I$(OGLHOME)/include
65 endif
66 ifndef OGLLIBS
67 ifeq ($(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/'),9)
68 # the following lines are for building on MacOSX 10.5 "Leopard"
69 OGLLIBS := $(shell test -f /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib && echo "-L/usr/X11R6/lib -lGLU -lGL -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
70 else
71 OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
72 endif
73 endif
74
75# ---- QT Setup block -------------------------------------------------------
76 ifndef QTHOME
77 QTHOME := $(shell test -f /Library/Frameworks/Qt3Support.framework/Qt3Support && echo "/Library/Frameworks" || echo "/sw")
78 endif
79 ifndef QTMOC
80 ifeq ($(QTHOME),/Library/Frameworks)
81 QTMOC := /usr/bin/moc
82 else
83 QTMOC := $(QTHOME)/bin/moc
84 endif
85 endif
86
87 QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
88
89 ifndef QTFLAGS
90 ifeq ($(QT_VERSION),4)
91 QTFLAGS := -I $(QTHOME)/QtCore.framework/Headers
92 QTFLAGS += -I $(QTHOME)/QtGui.framework/Headers
93 QTFLAGS += -I $(QTHOME)/QtOpenGL.framework/Headers
94 else
95 QTFLAGS := -I $(QTHOME)/include/Qt -I$(QTHOME)/include
96 endif
97 endif
98 ifndef QTLIBPATH
99 ifeq ($(QT_VERSION),3)
100 QTLIBPATH := $(shell test -d $(QTHOME)/lib/qt3/lib && echo "$(QTHOME)/lib/qt3/lib" || echo "$(QTHOME)/lib" )
101 else
102 QTLIBPATH := -F$(QTHOME)
103 endif
104 endif
105 ifndef QTLIBS
106 ifeq ($(QT_VERSION),3)
107 QTLIBS := -L$(QTLIBPATH)
108 QT3_MT := $(shell ls $(QTLIBPATH)/libqt-mt.* 2>/dev/null | wc -l )
109 ifneq ($(QT3_MT),0)
110 QTLIBS += -lqt-mt
111 else
112 QTLIBS += -lqt
113 endif
114 QTLIBS += -lqui
115 else
116 QTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
117 endif
118 endif
119 ifndef GLQTLIBS
120 ifeq ($(QT_VERSION),3)
121 # already done in QTLIBS
122 # GLQTLIBS := $(QTLIBS)
123 else
124 GLQTLIBS := $(QTLIBPATH) -framework QtCore -framework QtGui
125 GLQTLIBS += -framework QtOpenGL
126 endif
127 endif
128#----------------------------------------------------------------------------
129
130 define build-granular-shared-lib
131 @libdir=`(cd $(@D);/bin/pwd)`; \
132 cd $(G4TMPDIR); \
133 $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \
134 -o $$libdir/$(@F) $(INTYLIBS) *.o
135 endef
136 define build-global-shared-lib
137 @libdir=`(cd $(@D);/bin/pwd)`; \
138 cd $(G4TMP)/$(G4SYSTEM); \
139 $(CXX) -dynamiclib -single_module -lgcov -undefined dynamic_lookup \
140 -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
141 endef
142
143endif
Note: See TracBrowser for help on using the repository browser.