Corrected library order + fixes needed to compile static libraries and executables...
[u/mrichter/AliRoot.git] / cmake / modules / ALICEMacros.cmake
CommitLineData
e969a926 1# -*- mode: cmake -*-
2#_______________________________________________________________________________
51ba4a8b 3
e969a926 4Macro(CHANGE_FILE_EXTENSION OLD_EXT NEW_EXT RESULT LIST)
5
6# This is probably an obsolete Macro
7
8 If (${OLD_EXT} MATCHES "^[*][.]+.*$")
9 String(REGEX REPLACE "^[*]+([.].*)$" "\\1" OLD_EXT1 ${OLD_EXT})
10 Endif (${OLD_EXT} MATCHES "^[*][.]+.*$")
11
12 If (${NEW_EXT} MATCHES "^[*][.]+.*$")
13 String(REGEX REPLACE "^[*]+([.].*)" "\\1" NEW_EXT1 ${NEW_EXT})
14 Endif (${NEW_EXT} MATCHES "^[*][.]+.*$")
15
16 Set(FLIST)
17 Foreach (_current_FILE ${LIST})
18
19 String(REGEX REPLACE "^(.*)${OLD_EXT1}$" "\\1${NEW_EXT1}" res ${_current_FILE})
20 Set (FLIST ${FLIST} ${res})
21
22 Endforeach (_current_FILE ${LIST})
23 Set(${RESULT} ${FLIST})
24
25Endmacro (CHANGE_FILE_EXTENSION)
26
27#_______________________________________________________________________________
28Macro (CHECK_OUT_OF_SOURCE_BUILD)
29
30# Checks that the binary is built outside the source
31
32 String(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
33 If(insource)
34 File(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Testing)
35 File(REMOVE ${CMAKE_SOURCE_DIR}/DartConfiguration.tcl)
36 Message(FATAL_ERROR "ALIROOT should be installed as an out of source build, to keep the source directory clean. Please create a extra build directory and run the command 'cmake path_to_source_dir' in this newly created directory. You have also to delete the directory CMakeFiles and the file CMakeCache.txt in the source directory. Otherwise cmake will complain even if you run it from an out-of-source directory.")
37 Endif(insource)
38
39EndMacro (CHECK_OUT_OF_SOURCE_BUILD)
40
41#_______________________________________________________________________________
42Function (AddLibrary LIB SRCS DHDRS)
43
44# Adds an AliRoot library as a target
51ba4a8b 45 string(REGEX REPLACE "$ENV{ALICE_ROOT}/?([^/]*)/?.*" "\\1" label ${CMAKE_CURRENT_SOURCE_DIR})
e969a926 46
a1ea9532 47 # Message(STATUS Debug ${LIB})
ffeaf110 48 Set(_path)
49 List(LENGTH SRCS _len)
50 If(_len GREATER 0)
51 List(GET SRCS 0 _file)
52 Get_filename_component(_path ${_file} PATH)
ffeaf110 53 Endif(_len GREATER 0)
54
55 Set(LDEF)
56 If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
57 Set(LDEF "${LIB}LinkDef.h")
58 Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
59
60 If(_path)
61 If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
62 Set(LDEF "${_path}/${LIB}LinkDef.h")
63 Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
64 Endif(_path)
65
a1ea9532 66 # Message(STATUS Debug - ${CMAKE_CURRENT_SOURCE_DIR} - ${LIB} - ${LDEF})
96c0c856 67
e969a926 68 Set(DICT)
a1ea9532 69 # Message(STATUS Debug ${LDEF})
ffeaf110 70 If(LDEF)
e969a926 71# even with no cxx files, one may want to build an empty lib as a placeholder
72# in AliRoot this is signalled by the existence of an (empty) ${LIB}LinkDef.h
73 Set(DICT "G__${LIB}.cxx")
74 Set(ASRCS ${SRCS} ${DICT})
75 Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${DICT}" "${INCLUDE_DIRECTORIES}")
96c0c856 76 If(ALICE_STATIC_BUILD)
77 Set(STATIC_DICT "G__${LIB}_a.cxx")
78 Set(STATIC_ASRCS ${SRCS} ${STATIC_DICT})
79 Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${STATIC_DICT}" "${INCLUDE_DIRECTORIES}")
80 EndIf(ALICE_STATIC_BUILD)
ffeaf110 81 Else(LDEF)
46e443ec 82 Message(STATUS "No ${LIB}LinkDef.h found... building lib with no ROOT dict")
e969a926 83 Set(ASRCS ${SRCS})
96c0c856 84 If(ALICE_STATIC_BUILD)
85 Set(STATIC_ASRCS ${SRCS})
86 EndIf(ALICE_STATIC_BUILD)
ffeaf110 87 Endif(LDEF)
e969a926 88
89 Add_Library(${LIB} SHARED ${ASRCS})
51ba4a8b 90 set_property(TARGET ${LIB} PROPERTY LABELS ${label})
f180903d 91 Target_Link_Libraries(${LIB} ${ALIROOT_LIBRARIES} ${DMONLIBS})
e969a926 92 Set_Target_Properties(${LIB} PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES})
51ba4a8b 93# message("${LIB}-${label}")
e969a926 94 Install(TARGETS ${LIB} DESTINATION ${ALIROOT_INSTALL_DIR}/lib
95 COMPONENT shared)
96
97 If(ALICE_STATIC_BUILD)
96c0c856 98 Add_Library(${LIB}_a STATIC ${STATIC_ASRCS})
e969a926 99 Install(TARGETS ${LIB}_a DESTINATION ${ALIROOT_INSTALL_DIR}/lib/static)
100 EndIf(ALICE_STATIC_BUILD)
101
102 If(ARGV3)
103 Install(FILES ${ARGV3} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
104 Endif(ARGV3)
105
106 CheckViols(${LIB} "${SRCS}")
61aa89dd 107 add_dependencies("${label}-all" ${LIB})
0199f547 108 if(ALICE_STATIC_BUILD)
109 add_dependencies("${label}-all" "${LIB}_a")
110 endif(ALICE_STATIC_BUILD)
e969a926 111EndFunction (AddLibrary)
96c0c856 112#_______________________________________________________________________________
113Function (AddHLTLibrary LIB SRCS DHDRS)
114
115# Adds an AliRoot library as a target
51ba4a8b 116 string(REGEX REPLACE "$ENV{ALICE_ROOT}/?([^/]*)/?.*" "\\1" label ${CMAKE_CURRENT_SOURCE_DIR})
96c0c856 117 Set(_path)
118 List(LENGTH SRCS _len)
119 If(_len GREATER 0)
120 List(GET SRCS 0 _file)
121 Get_filename_component(_path ${_file} PATH)
96c0c856 122 Endif(_len GREATER 0)
123
124 Set(LDEF)
125 If(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${LIB}LinkDef.h)
126 Set(LDEF "${CMAKE_CURRENT_BINARY_DIR}/${LIB}LinkDef.h")
127 Endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${LIB}LinkDef.h)
128
129 If(NOT LDEF)
130 If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
131 Set(LDEF "${LIB}LinkDef.h")
132 Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}LinkDef.h)
133 EndIf(NOT LDEF)
134
135 If(_path AND NOT LDEF)
136 If(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
137 Set(LDEF "${_path}/${LIB}LinkDef.h")
138 Endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/${LIB}LinkDef.h)
139 Endif(_path AND NOT LDEF)
140
141 Set(DICT)
142 If(LDEF)
143# even with no cxx files, one may want to build an empty lib as a placeholder
144# in AliRoot this is signalled by the existence of an (empty) ${LIB}LinkDef.h
145 Set(DICT "G__${LIB}.cxx")
146 Set(ASRCS ${SRCS} ${DICT})
147 Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${DICT}" "${INCLUDE_DIRECTORIES}")
148 If(ALICE_STATIC_BUILD)
149 Set(STATIC_DICT "G__${LIB}_a.cxx")
150 Set(STATIC_ASRCS ${SRCS} ${STATIC_DICT})
151 Root_Generate_Dictionary("${DHDRS}" "${LDEF}" "${STATIC_DICT}" "${INCLUDE_DIRECTORIES}")
152 EndIf(ALICE_STATIC_BUILD)
153 Else(LDEF)
154 Message(STATUS "No ${LIB}LinkDef.h found... building lib with no ROOT dict")
155 Set(ASRCS ${SRCS})
156 If(ALICE_STATIC_BUILD)
157 Set(STATIC_ASRCS ${SRCS})
158 EndIf(ALICE_STATIC_BUILD)
159 Endif(LDEF)
160
161 Add_Library(${LIB} SHARED ${ASRCS})
51ba4a8b 162 set_property(TARGET ${LIB} PROPERTY LABELS ${label})
f180903d 163 Target_Link_Libraries(${LIB} ${ALIROOT_LIBRARIES} ${DMONLIBS})
96c0c856 164 Set_Target_Properties(${LIB} PROPERTIES ${ALIROOT_LIBRARY_PROPERTIES})
51ba4a8b 165# message("${LIB}-${label}")
96c0c856 166 Install(TARGETS ${LIB} DESTINATION ${ALIROOT_INSTALL_DIR}/lib
167 COMPONENT shared)
168
169 If(ALICE_STATIC_BUILD)
170 Add_Library(${LIB}_a STATIC ${STATIC_ASRCS})
171 Install(TARGETS ${LIB}_a DESTINATION ${ALIROOT_INSTALL_DIR}/lib/static)
172 EndIf(ALICE_STATIC_BUILD)
173
174 If(ARGV3)
175 Install(FILES ${ARGV3} DESTINATION ${ALIROOT_INSTALL_DIR}/include)
176 Endif(ARGV3)
177
178 CheckViols(${LIB} "${SRCS}")
61aa89dd 179 add_dependencies("${label}-all" ${LIB})
0199f547 180 if(ALICE_STATIC_BUILD)
181 add_dependencies("${label}-all" "${LIB}_a")
182 endif(ALICE_STATIC_BUILD)
96c0c856 183EndFunction (AddHLTLibrary)
e969a926 184
185#_______________________________________________________________________________
186Macro (SetModule)
187
188String(REGEX REPLACE "${ALICE_ROOT}/?([^/]*)/?$" "\\1" ALIROOT_MODULE "${CMAKE_CURRENT_SOURCE_DIR}")
189Add_Definitions(-D_MODULE_=\"${ALIROOT_MODULE}\")
190
191EndMacro(SetModule)
192
193
194#_______________________________________________________________________________
195Function (AddExecutable BIN SRCS LIBS)
196
197# Adds an AliRoot executable as a target
51ba4a8b 198
199 string(REGEX REPLACE "$ENV{ALICE_ROOT}/?([^/]*)/?.*" "\\1" label ${CMAKE_CURRENT_SOURCE_DIR})
96c0c856 200 String(REGEX REPLACE "(.*)exe" "\\1" executable_name "${BIN}")
a1ea9532 201 # MESSAGE("EXECUTABLE: ${executable_name}")
96c0c856 202
e969a926 203 Add_Executable(${BIN} ${SRCS})
51ba4a8b 204 set_property(TARGET ${BIN} PROPERTY LABELS ${label})
205# message("${BIN}-${label}")
f180903d 206 Target_Link_Libraries(${BIN} ${ROOT_LIBRARIES} ${LIBS} ${DMONLIBS})
96c0c856 207 set_target_properties(${BIN} PROPERTIES OUTPUT_NAME ${executable_name})
e969a926 208 Install(TARGETS ${BIN} DESTINATION ${ALIROOT_INSTALL_DIR}/bin)
209
210 If(ALICE_STATIC_BUILD)
211 Add_Executable(${BIN}_a ${SRCS})
212 Set(_ar_libs)
96c0c856 213 # There are no static libs for external libraries, so we have to filter
214 # here. This is an ugly way how to do it, so this has to be improved.
e969a926 215 Foreach(_lib ${LIBS})
4c166a14 216 If(${_lib} STREQUAL GLU OR ${_lib} STREQUAL XMLParser OR ${_lib} STREQUAL dim)
96c0c856 217 Set(_ar_libs ${_ar_libs} ${_lib})
4c166a14 218 Else(${_lib} STREQUAL GLU OR ${_lib} STREQUAL XMLParser OR ${_lib} STREQUAL dim)
96c0c856 219 Set(_ar_libs ${_ar_libs} ${_lib}_a)
4c166a14 220 EndIf(${_lib} STREQUAL GLU OR ${_lib} STREQUAL XMLParser OR ${_lib} STREQUAL dim)
e969a926 221 EndForeach(_lib ${LIBS})
4c166a14 222 Target_Link_Libraries(${BIN}_a ${ALIROOT_LIBRARIES} ${_ar_libs} ${DMONLIBS})
e969a926 223 Install(TARGETS ${BIN}_a DESTINATION ${ALIROOT_INSTALL_DIR}/bin)
224 EndIf(ALICE_STATIC_BUILD)
225
226 CheckViols(${BIN} "${SRCS}")
61aa89dd 227 add_dependencies("${label}-all" ${BIN})
0199f547 228 if(ALICE_STATIC_BUILD)
229 add_dependencies("${label}-all" "${BIN}_a")
230 endif(ALICE_STATIC_BUILD)
e969a926 231EndFunction (AddExecutable)
232
233#_______________________________________________________________________________
234Macro (SetupSystem)
235
236# Set up all system dependencies of AliRoot
237
238Message(STATUS "Setting up system dependent parameters for ${ALICE_TARGET}" )
239
3c34a311 240# macosx64
e969a926 241If(ALICE_TARGET STREQUAL macosx64)
242
243 Execute_process(
244 COMMAND sw_vers -productVersion
245 OUTPUT_VARIABLE MACOSX
246 OUTPUT_STRIP_TRAILING_WHITESPACE)
247
248 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\1" MACOSX_MAJOR "${MACOSX}")
249 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\2" MACOSX_MINOR "${MACOSX}")
250
251 Message(STATUS "Mac OS X ${MACOSX_MAJOR}.${MACOSX_MINOR}")
252
253 Find_Package(fink)
254
84641bd5 255# Set(CMAKE_CXX_COMPILER g++)
256# Set(CMAKE_C_COMPILER gcc)
e969a926 257# I found no way to make this work...
258# Set(CMAKE_CXX_LINK_EXECUTABLE
259# "MACOSX_DEPLOYMENT_TARGET=${MACOSX_MAJOR}.${MACOSX_MINOR} ${CMAKE_CXX_LINK_EXECUTABLE}")
260
ce4a61cd 261 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -O -g -flat_namespace -single_module -undefined dynamic_lookup -m64")
e969a926 262
ce4a61cd 263 Set(CMAKE_Fortran_FLAGS "-O -g -fno-second-underscore -m64")
e969a926 264
265 Set(CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")
266
d3b3a3b2 267 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m64 -pipe -Wall -W -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
ce4a61cd 268 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -g -m64 -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")
e969a926 269
270 If(CMAKE_Fortran_COMPILER MATCHES g95)
271 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
e969a926 272 Else(CMAKE_Fortran_COMPILER MATCHES g95)
273 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
274 Execute_process(
275 COMMAND gfortran -m64 -print-file-name=libgfortran.dylib
276 OUTPUT_VARIABLE FLIB
277 OUTPUT_STRIP_TRAILING_WHITESPACE)
278 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
279 Execute_process(
280 COMMAND gfortran -m64 -print-file-name=libgfortranbegin.a
281 OUTPUT_VARIABLE FLIB
282 OUTPUT_STRIP_TRAILING_WHITESPACE)
283 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
284 Endif(CMAKE_Fortran_COMPILER MATCHES g95)
285
e969a926 286# I think this is useless
287# Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES} -L/usr/X11R6/lib -lX11")
96c0c856 288 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES} -L/usr/X11/lib")
e969a926 289
290# Would like to use this, but did not manage on the Mac
291#Include(FindOpenGL)
292#Set(ROOT_LIBRARIES ${ROOT_LIBRARIES} ${OPENGL_LIBRARIES})
293#Set(ROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
294# Poor man's version of the above
295 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
296
e969a926 297#
298# LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \
299# unset LD_PREBIND ; \
300# g++
301# ALLD = ar
302# ALFLAGS = cr
303# ALLIB =
304# AEXT = a
305#
306
307Endif(ALICE_TARGET STREQUAL macosx64)
308
3c34a311 309# linuxx8664gcc
e2d7359f 310If(ALICE_TARGET STREQUAL linuxx8664gcc)
311
312
ce4a61cd 313 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -O -g -shared -Wl")
e2d7359f 314
ce4a61cd 315 Set(CMAKE_Fortran_FLAGS "-O -g -fno-second-underscore -m64")
e2d7359f 316
317 Set(CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ")
318
ce4a61cd 319 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m64 -pipe -W -Wall -Weffc++ -Woverloaded-virtual -fmessage-length=0 -Wno-long-long -Dlinux -I/usr/X11R6/include")
320 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -g -m64 -Wall -W -pipe")
e2d7359f 321
322 If(CMAKE_Fortran_COMPILER MATCHES g95)
323 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
e2d7359f 324 Else(CMAKE_Fortran_COMPILER MATCHES g95)
325 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
326 Execute_process(
327 COMMAND gfortran -m64 -print-file-name=libgfortran.so
328 OUTPUT_VARIABLE FLIB
329 OUTPUT_STRIP_TRAILING_WHITESPACE)
330 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
331 Execute_process(
332 COMMAND gfortran -m64 -print-file-name=libgfortranbegin.a
333 OUTPUT_VARIABLE FLIB
334 OUTPUT_STRIP_TRAILING_WHITESPACE)
335 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
336 Endif(CMAKE_Fortran_COMPILER MATCHES g95)
337
e2d7359f 338 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES}")
339
340 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
341
e2d7359f 342Endif(ALICE_TARGET STREQUAL linuxx8664gcc)
343
b8aad0f9 344# linux
345If(ALICE_TARGET STREQUAL linux)
346
347
ce4a61cd 348 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -O -g -shared -Wl")
b8aad0f9 349
ce4a61cd 350 Set(CMAKE_Fortran_FLAGS "-O -g -fno-second-underscore -m32")
b8aad0f9 351
352 Set(CLIBDEFS "-DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ")
353
ce4a61cd 354 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m32 -pipe -W -Wall -Weffc++ -Woverloaded-virtual -fmessage-length=0 -Wno-long-long -Dlinux -I/usr/X11R6/include")
355 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -g -m32 -Wall -W -pipe")
b8aad0f9 356
357 If(CMAKE_Fortran_COMPILER MATCHES g95)
358 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
b8aad0f9 359 Else(CMAKE_Fortran_COMPILER MATCHES g95)
360 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
361 Execute_process(
362 COMMAND gfortran -m32 -print-file-name=libgfortran.so
363 OUTPUT_VARIABLE FLIB
364 OUTPUT_STRIP_TRAILING_WHITESPACE)
365 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
366 Execute_process(
367 COMMAND gfortran -m32 -print-file-name=libgfortranbegin.a
368 OUTPUT_VARIABLE FLIB
369 OUTPUT_STRIP_TRAILING_WHITESPACE)
370 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
371 Endif(CMAKE_Fortran_COMPILER MATCHES g95)
372
b8aad0f9 373 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES}")
374
375 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
376
b8aad0f9 377Endif(ALICE_TARGET STREQUAL linux)
378
3c34a311 379# macosx
380If(ALICE_TARGET STREQUAL macosx)
381
382 Execute_process(
383 COMMAND sw_vers -productVersion
384 OUTPUT_VARIABLE MACOSX
385 OUTPUT_STRIP_TRAILING_WHITESPACE)
386
387 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\1" MACOSX_MAJOR "${MACOSX}")
388 String(REGEX REPLACE "^(.*)[.](.*)[.](.*)$" "\\2" MACOSX_MINOR "${MACOSX}")
389
390 Message(STATUS "Mac OS X ${MACOSX_MAJOR}.${MACOSX_MINOR}")
391
392 Find_Package(fink)
393
ce4a61cd 394 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -O -g -flat_namespace -single_module -undefined dynamic_lookup -m32")
3c34a311 395
ce4a61cd 396 Set(CMAKE_Fortran_FLAGS "-O -g -fno-second-underscore -m32")
3c34a311 397
398 Set(CLIBDEFS "-DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")
399
38e6cbb2 400 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m32 -pipe -Wall -W -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
ce4a61cd 401 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -g -m32 -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")
3c34a311 402
403 If(CMAKE_Fortran_COMPILER MATCHES g95)
404 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95 -single_module")
3c34a311 405 Else(CMAKE_Fortran_COMPILER MATCHES g95)
38e6cbb2 406 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -single_module -DFORTRAN_GFORTRAN")
3c34a311 407 Execute_process(
408 COMMAND gfortran -m32 -print-file-name=libgfortran.dylib
409 OUTPUT_VARIABLE FLIB
410 OUTPUT_STRIP_TRAILING_WHITESPACE)
411 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
412 Execute_process(
413 COMMAND gfortran -m32 -print-file-name=libgfortranbegin.a
414 OUTPUT_VARIABLE FLIB
415 OUTPUT_STRIP_TRAILING_WHITESPACE)
416 Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} ${FLIB}")
417 Endif(CMAKE_Fortran_COMPILER MATCHES g95)
418
419 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES}")
420
421 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
422
3c34a311 423Endif(ALICE_TARGET STREQUAL macosx)
424
70e4828f 425# solarisCC5
426If(ALICE_TARGET STREQUAL solarisCC5)
427
ce4a61cd 428 Set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -O -g")
70e4828f 429
430 Set(CLIBDEFS "-DCERNLIB_SUN -DCERNLIB_BLDLIB -DCERNLIB_CZ")
431
ce4a61cd 432 Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g +w -KPIC -template=no%extdef")
433 Set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -g -KPIC -erroff=%none")
70e4828f 434
ce4a61cd 435 Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O -g -KPIC -erroff=%none")
70e4828f 436
437 Set(ALIROOT_LIBRARIES "${ROOT_LIBRARIES}")
438
439 Set(ALIROOT_INCLUDE_DIR ${ROOT_INCLUDE_DIR} /usr/X11/include)
440
29d55f77 441 Set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -L/usr/dt/lib -L/usr/openwin/lib -L/usr/ccs/lib -lXm -lXt -lX11 -lm -lgen -ldl -lsocket -lsunmath -lfsu -lfui -lnsl")
70e4828f 442
443Endif(ALICE_TARGET STREQUAL solarisCC5)
444
e969a926 445EndMacro (SetupSystem)
446
447# ../build/Makefile.alphacxx6
448# # -*- mode: makefile -*-
449# # Makefile to build AliRoot for Alpha OSF1
450#
451# # System dependent commands
452#
453# XARGS = xargs
454#
455# # The compilers
456# CXX = cxx
457# F77 = f77
458#
459# # Global optimisation
460# OPT = -O
461# NOOPT = -O0
462#
463# CXXOPT = $(OPT)
464# CXXNOOPT = $(NOOPT)
465# COPT = $(OPT)
466# FOPT = $(OPT)
467#
468# # CERNLIB defines
469# CLIBDEFS = -DCERNLIB_DECS -DCERNLIB_BLDLIB -DCERNLIB_CZ
470# CLIBCXXOPTS =
471# CLIBCOPT =
472# CLIBFOPT = -I. $(CLIBDEFS)
473#
474# # Compiler flags
475# CXXFLAGS = $(CXXOPT) -nostdnew -rtti -taso
476# CXXFLAGSNO = $(CXXNOOPT) -nostdnew -rtti -taso
477# CFLAGS = $(COPT) -fPIC -pipe -mcpu=ev5 -D__osf__ -D__alpha
478# FFLAGS = $(FOPT) -nofor_main -warn noinformational -taso $(CLIBFOPT)
479# # rmkdepend flags for building dependencies of FORTRAN files
480# DEPENDFFLAGS = $(filter-out -warn noinformational,$(FFLAGS))
481#
482# # rootcint flags
483# CINTFLAGS = -D__DECCXX
484#
485# LD = cxx
486# LDFLAGS =
487#
488# SHLD = ld
489# SOFLAGS = -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/cxx \
490# -expect_unresolved "*" -msym -shared -taso \
491# /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o
492#
493# SHLIB = -lUfor -lfor -lFutil
494# SOEXT = so
495#
496# #System libraries
497#
498# # Flags for static libraries
499# AFLAGS = $(filter-out -rpath /usr/lib/cmplrs/cxx -msym -shared /usr/lib/cmplrs/cc/crt0.o,$(SOFLAGS))
500# AFLAGS += $(SHLIB)
501#
502# # Additional flags and libraries for building aliroot executable
503# SYSLIBS := -lXm -lXt -lX11 -lPW -lUfor -lfor -lFutil -lots -taso -lbsd
504#
505# # Cure funny problem
506# # sometimes in dependencies system include files of the sort
507# # /usr/.../filename AND /usr/.../filename.cc are present
508# # DEC believes that /usr/.../filename is the executable to be
509# # built from /usr/.../filename.cc
510# # Just avoid this to happen
511#
512# % : %.cc
513# @;
514#
515#
516#
517#
518#
519#
520#
521#
522#
523# ../build/Makefile.hpuxacc
524# # -*- mode: makefile -*-
525# # Makefile to build AliRoot on HP-UX
526#
527# # System dependent commands
528#
529# XARGS = xargs
530#
531# # The compilers
532# CXX = aCC
533# F77 = f77
534# CC = cc
535#
536# # Global optimisation
537# OPT = -g -O
538# NOOPT = -g
539#
540# CXXOPT = $(OPT)
541# CXXNOOPT = $(NOOPT)
542# COPT = $(OPT)
543# FOPT = $(OPT)
544#
545# # CERNLIB defines
546# CLIBDEFS = -DCERNLIB_HPUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
547# CLIBCXXOPTS =
548# CLIBCOPT = +z -Ae
549# CLIBFOPT = $(CLIBDEFS) -WF,-P
550#
551# CXXFLAGS = $(CXXOPT) -Wc,-ansi_for_scope,on +Z -z +W70,495,740,749,823,829 -Dextname
552# CXXFLAGSNO = $(CXXNOOPT) -Wc,-ansi_for_scope,on +Z -z +W70,495,740,749,823,829 -Dextname
553# CFLAGS = $(COPT) +Z -Ae
554# FFLAGS = $(CLIBFOPT) $(FOPT) +ppu +Z
555# # rmkdepend flags for building dependencies of FORTRAN files
556# DEPENDFFLAGS = $(FFLAGS)
557#
558# # rootcint flags
559# CINTFLAGS =
560#
561# LD = aCC
562# LDFLAGS = $(OPT) -z -Wl,+s -Wl,-E
563#
564# SHLD = $(LD)
565# SOFLAGS = -b /usr/lib/libm.sl
566#
567# SOEXT = sl
568#
569# # additional ROOT libraries
570# SYSLIBS := -lcrypt -L/usr/lib/X11R6 -lX11
571#
572#
573#
574#
575#
e969a926 576# ../build/Makefile.linuxalphagcc
577# # -*- mode: makefile -*-
578# # Makefile to build AliRoot for Linux on alpha
579#
580# # System dependent commands
581#
582# XARGS = xargs -r
583#
584# # The compilers
585# CXX = g++
586# F77 = g77
587# CC = gcc
588# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
589# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
590#
591# # Global optimisation
592# OPT = -O -g -mieee -mno-soft-float
593# NOOPT = -g -mieee -mno-soft-float
594#
595# CXXOPT = $(OPT)
596# CXXNOOPT = $(NOOPT)
597# COPT = $(OPT)
598# FOPT = $(OPT)
599#
600# # CERNLIB defines
601# CLIBDEFS = -DCERNLIB_UNIX -DCERNLIB_DECS -DCERNLIB_BLDLIB -DCERNLIB_CZ
602# CLIBCXXOPTS =
603# CLIBCOPT =
604# CLIBFOPT = $(CLIBDEFS)
605#
606# # Compiler flags
607#
608# CXXFLAGS = $(OPT) -Wall -fPIC -pipe
609# CXXFLAGSNO = $(NOOPT) -Wall -fPIC -pipe
610# CFLAGS = $(OPT) -Wall -fPIC -pipe -ansi
611# FFLAGS = $(CLIBFOPT) $(FOPT) -Wall -fPIC -pipe -fno-second-underscore
612# # rmkdepend flags for building dependencies of FORTRAN files
613# DEPENDFFLAGS = $(FFLAGS)
614#
615# # rootcint flags
616# CINTFLAGS =
617#
618# LD = g++
619# LDFLAGS = $(OPT)
620#
621# SHLD = $(LD)
622# SOFLAGS = $(OPT) -Wall -fPIC -pipe -shared -Wl
623# SHLIB = -lg2c
624# SOEXT = so
625#
626# ALLD = ar
627# ALFLAGS = cr
628# ALLIB =
629# AEXT = a
630#
631# #System libraries
632# SYSLIBS := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11
633#
634#
635#
636#
637#
638# ../build/Makefile.linuxia64ecc
639# # -*- mode: makefile -*-
640# # Makefile for AliRoot for Itanium/Linux with Intel icc compiler
641#
642# # System dependent commands
643#
644# XARGS = xargs -r
645#
646# # The compilers
647# CXX = icc
648# F77 = ifort
649# CC = icc
650#
651# # Global optimisation
652# OPT = -g #-O
653# NOOPT = -g
654#
655# CXXOPT = $(OPT)
656# CXXNOOPT = $(OPT)
657# COPT = $(OPT)
658# FOPT = $(OPT)
659#
660# # CERNLIB defines
661# CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ
662# CLIBCXXOPTS =
663# CLIBCOPT =
664# CLIBFOPT = $(CLIBDEFS)
665#
666# # Compiler flags
667# CXXFLAGS = $(CXXOPT)
668# CXXFLAGSNO = $(CXXNOOPT)
669# CFLAGS = $(COPT)
670# FFLAGS = $(CLIBFOPT) $(FOPT)
671# # rmkdepend flags for building dependencies of FORTRAN files
672# DEPENDFFLAGS = $(FFLAGS)
673#
674# # rootcint flags
675# CINTFLAGS =
676#
677# LD = icpc
678# LDFLAGS = $(OPT)
679#
680# SHLD = $(LD)
681# SOFLAGS = -Wl,-soname,$$TMPLIB -shared -O
682# SHLIB =
683# SOEXT = so
684#
685# ALLD = ar
686# ALFLAGS = cr
687# ALLIB =
688# AEXT = a
689#
690# # additional ROOT libraries
691#
692# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
693#
694# SYSLIBS := $(LIBNOVER) -lcrypt -L/usr/local/lib -lXt -lCEPCF90 -lF90 \
695# -lPEPCF90 -lintrins -L/usr/X11R6/lib -lX11
696# ../build/Makefile.linuxia64gcc
697# # -*- mode: makefile -*-
698# # Makefile for AliRoot for Itanium/Linux with gcc
699#
700# # System dependent commands
701#
702# XARGS = xargs -r
703#
704# # The compilers
705# CXX = g++
706# F77 = g77
707# CC = gcc
708#
709# # Global optimisation
710# OPT = -g -O
711# NOOPT = -g
712#
713# CXXOPT = $(OPT)
714# CXXNOOPT = $(NOOPT)
715# COPT = $(OPT)
716# FOPT = $(OPT)
717#
718# # CERNLIB defines
719# CLIBDEFS = -DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ
720# CLIBCXXOPTS =
721# CLIBCOPT =
722# CLIBFOPT = $(CLIBDEFS)
723#
724# # Compiler flags
725# CXXFLAGS = $(CXXOPT) -Wall -Weffc++ -fPIC -pipe
726# CXXFLAGSNO = $(CXXNOOPT) -Wall -Weffc++ -fPIC -pipe
727# CFLAGS = -Wall -fPIC -pipe
728# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore
729# # rmkdepend flags for building dependencies of FORTRAN files
730# DEPENDFFLAGS = $(FFLAGS)
731#
732# # rootcint flags
733# CINTFLAGS =
734#
735# LD = g++
736# LDFLAGS = $(OPT) -Wl,-Map -Wl,$@.map
737#
738# SHLD = $(LD)
739# SOFLAGS = -shared -Wl -O2
740# SOEXT = so
741#
742# ALLD = ar
743# ALFLAGS = cr
744# ALLIB =
745# AEXT = a
746#
747# # additional ROOT libraries
748#
749# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
750#
751# #System libraries
752# SYSLIBS := -ldl -lbsd -lg2c -L/usr/X11R6/lib -lX11 $(LIBNOVER)
753#
754#
755#
756#
757#
758# ../build/Makefile.linuxicc
759# # -*- mode: makefile -*-
760# # Makefile for AliRoot for Linux with the Intel icc compiler
761#
762# # System dependent commands
763#
764# XARGS = xargs -r
765#
766# # The compilers
767# CXX = icc
768# CC = icc
769#
770# # Compiler version:
771# ICC_MAJOR := $(shell $(CXX) -V 2>&1 | awk '{ if (NR==1) print $$8 }' | \
772# cut -d'.' -f1)
773# ICC_MINOR := $(shell $(CXX) -V 2>&1 | awk '{ if (NR==1) print $$8 }' | \
774# cut -d'.' -f2)
775#
776# F77 = ifort
777#
778# # Global optimisation
779# OPT = -O -ip
780# NOOPT = -O0
781#
782# CXXOPT = $(OPT)
783# CXXNOOPT = $(NOOPT)
784# COPT = $(OPT)
785# FOPT = $(OPT)
786#
787# # CERNLIB defines
788# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
789# CLIBCXXOPTS =
790# CLIBCOPT =
791# CLIBFOPT = $(CLIBDEFS)
792#
793# # Compiler flags
794# CXXFLAGS = $(CXXOPT)
795# CXXFLAGSNO = $(CXXNOOPT)
796# CFLAGS = $(COPT)
797# FFLAGS = $(CLIBFOPT) $(FOPT)
798# # rmkdepend flags for building dependencies of FORTRAN files
799# DEPENDFFLAGS = $(FFLAGS)
800#
801# # rootcint flags
802# CINTFLAGS =
803#
804# LD = icpc
805# LDFLAGS = $(OPT)
806#
807# SHLD = $(LD)
808# SOFLAGS = -Wl,-soname,$$TMPLIB -shared $(OPT)
809# SHLIB =
810# SOEXT = so
811#
812# ALLD = ar
813# ALFLAGS = cr
814# ALLIB =
815# AEXT = a
816#
817# # additional ROOT libraries
818#
819# LIBNOVER = `find /lib -name 'libNoVersion*.so' | xargs --replace basename {} .so | sed -e 's/lib/ -l/'`
820#
821# #System libraries
822# SYSLIBS := -lcrypt -L/usr/X11R6/lib -lX11 $(LIBNOVER) -L/usr/local/lib \
823# -lXt -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \
824# -lifcore -lifport
e969a926 825# ../build/Makefile.macosxicc
826# # -*- mode: makefile -*-
827# # Makefile for AliRoot for MacOS X with gcc
828#
829# XARGS = xargs
830#
831# # fink directories
832# FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??')
833# ifeq (,$(FINK_ROOT))
834# # No fink, build will probably fail, but we try a guess
835# FINK_ROOT=/usr/local
836# endif
837#
838# # The compilers
839# CXX = icc
840# CC = icc
841#
842# F77 = ifort
843#
844# # Global optimisation
845# OPT = -O -g
846# NOOPT = -g
847#
848# CXXOPT = $(OPT)
849# CXXNOOPT = $(NOOPT)
850# COPT = $(OPT)
851# FOPT = $(OPT)
852#
853# # CERNLIB defines
854# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC
855# CLIBCXXOPTS =
856# CLIBCOPT =
857# CLIBFOPT = $(CLIBDEFS)
858#
859# # Compiler flags
860# CXXFLAGS = $(CXXOPT) -fPIC -wd1476 -I/usr/X11R6/include -I$(FINK_ROOT)/include
861#
862# CXXFLAGSNO = $(CXXNOOPT)
863#
864# CFLAGS = $(COPT) -fPIC -restrict -I$(FINK_ROOT)/include
865#
866# FFLAGS = $(CLIBFOPT) $(FOPT)
867# # rmkdepend flags for building dependencies of FORTRAN files
868# DEPENDFFLAGS = $(FFLAGS)
869#
870# # rootcint flags
871# CINTFLAGS =
872#
873# LD = icpc
874# LDFLAGS = $(OPT) $(DICTLOAD)
875#
876# SHLD := $(LD)
877# SOFLAGS := $(OPT) -dynamiclib -undefined dynamic_lookup -single_module
878# SHLIB :=
879# SOEXT := so
880#
881# DYLD := $(LD)
882# DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module
883# DYLIB :=
884# DYEXT := dylib
885#
886# ALLD = ar
887# ALFLAGS = cr
888# ALLIB =
889# AEXT = a
890#
891# DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
892#
893# EXEFLAGS := -bind_at_load
894#
895# #System libraries
896#
897# SYSLIBS := -L/usr/X11R6/lib -lX11 -lGL $(LIBNOVER) -L/usr/local/lib \
898# -lXt -L$(shell which ifort | sed -e 's|bin/ifort|lib|') \
899# -lifcore -lifport
900#
901#
902# ../build/Makefile.macosxxlc
903# # -*- mode: makefile -*-
904# # Makefile for AliRoot for MacOS X using the IBM xlc compiler
905#
906# # The compilers
907# CXX = xlC
908# F77 = xlf
909# CC = xlc
910#
911# # Global optimisation
912# OPT = -qnoopt #-O3 -g
913# NOOPT = -qnoopt
914#
915# CXXOPT = $(OPT)
916# CXXNOOPT = $(NOOPT)
917# COPT = $(OPT)
918# FOPT = $(OPT)
919#
920# # CERNLIB defines
921# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
922# CLIBCXXOPTS =
923# CLIBCOPT =
924# CLIBFOPT = $(shell echo $(CLIBDEFS) | sed -e's/-D/-WF,-D/g')
925#
926# # Compiler flags
927# CXXFLAGS = $(CXXOPT) -qpic -I/sw/include \
928# -qflttrap=overflow:zerodivide:invalid:inexact:enable
929# CXXFLAGSNO = $(CXXNOOPT) -qpic -I/sw/include \
930# -qflttrap=overflow:zerodivide:invalid:inexact:enable
931# CFLAGS = -qpic -qextname -I/sw/include \
932# -qflttrap=overflow:zerodivide:invalid:inexact:enable
933# FFLAGS = $(CLIBFOPT) $(FOPT) -qpic \
934# -qflttrap=overflow:zerodivide:invalid:inexact:enable
935# # rmkdepend flags for building dependencies
936# DEPENDFFLAGS = $(FFLAGS)
937# DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys
938#
939# # rootcint flags
940# CINTFLAGS =
941#
942# LD = xlC
943# LDFLAGS = $(OPT)
944#
945# SHLD := export MACOSX_DEPLOYMENT_TARGET=10.3 ; \
946# unset LD_PREBIND ; \
947# xlC
948# SOFLAGS := -bundle -undefined dynamic_lookup
949# #SHLIB := -lg2c
950# SHLIB :=
951# SOEXT := so
952#
953# DYLD := export MACOSX_DEPLOYMENT_TARGET=10.3 ; \
954# unset LD_PREBIND ; \
955# xlC
956# DYFLAGS = -qmkshrobj -undefined dynamic_lookup -single_module
957# DYLIB :=
958# DYEXT := dylib
959#
960# ALLD = ar
961# ALFLAGS = cr
962# ALLIB =
963# AEXT = a
964#
965#
966# #System libraries
967# SYSLIBS := -ldl -L/usr/X11R6/lib -lX11
968#
969# EXEFLAGS := -Wl,-bind_at_load
970#
971#
972#
973#
974# ../build/Makefile.solarisCC5
975# # -*- mode: makefile -*-
976# # Makefile to build ALIROOT for SunOS
977#
978# # System dependent commands
979#
980# XARGS = xargs
981#
982# # The compilers
983# CXX = /opt/SUNWspro/bin/CC
984# CC = /opt/SUNWspro/bin/cc
985# F77 = /opt/SUNWspro/bin/f77
986#
987# # Global optimisation
988# OPT = -g -O
989# NOOPT = -g
990#
991# CXXOPT = $(OPT)
992# CXXNOOPT = $(NOOPT)
993# COPT = $(OPT)
994# FOPT = $(OPT)
995#
996# # CERNLIB defines
997# CLIBDEFS = -DCERNLIB_SUN -DCERNLIB_BLDLIB -DCERNLIB_CZ
998# CLIBCXXOPTS =
999# CLIBCOPT =
1000# CLIBFOPT = $(CLIBDEFS) -xpp=cpp
1001#
1002# # Compiler flags
1003# CXXFLAGS = $(CXXOPT) +w -KPIC -features=rtti -D_XOPEN_SOURCE -D_XOPEN_VERSION=4 -D__EXTENSIONS__
1004# CXXFLAGSNO = $(CXXNOOPT) +w -KPIC -features=rtti
1005# CFLAGS = $(COPT) -KPIC -erroff=%none
1006# FFLAGS = $(FOPT) $(CLIBFOPT) $(CLIBDEFS) -KPIC
1007# # rmkdepend flags for building dependencies of FORTRAN files
1008# DEPENDFFLAGS = $(FFLAGS)
1009#
1010# # rootcint flags
1011# CINTFLAGS =
1012#
1013# SHLIB =
1014# SOEXT = so
1015#
1016# LD = /opt/SUNWspro/bin/CC
1017# LDFLAGS = $(OPT) -Qoption ld -t
1018#
1019# SHLD = $(LD)
1020# SOFLAGS = -G $(LDFLAGS) $(SHLIB)
1021#
1022# SYSLIBS := -L/usr/dt/lib -L/usr/openwin/lib -L/usr/ccs/lib -lXm -lXt \
1023# -lX11 -lm -lgen -ldl -lsocket -lsunmath -lfsu -lfui -lnsl
1024#
1025# # Additional flags and libraries for building aliroot executable
1026#
1027# EXEFLAGS := -O -Qoption ld -t
1028#
1029#
1030#
1031#
1032#
1033# ../build/Makefile.win32gcc
1034# # -*- mode: makefile -*-
1035# # Makefile to build AliRoot for Linux
1036#
1037# # System dependent commands
1038#
1039# XARGS = xargs -r
1040#
1041# # The compilers
1042# CXX = g++
1043# F77 = g77
1044# CC = gcc
1045# CCMAJORV = $(shell $(CC) -dumpversion | cut -d. -f1)
1046# CCMINORV = $(shell $(CC) -dumpversion | cut -d. -f2)
1047#
1048# # Global optimisation
1049# OPT = -O -g
1050# NOOPT = -g
1051#
1052# CXXOPT = $(OPT)
1053# CXXNOOPT = $(NOOPT)
1054# COPT = $(OPT)
1055# FOPT = $(OPT)
1056#
1057# # CERNLIB defines
1058# CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ
1059# CLIBCXXOPTS =
1060# CLIBCOPT =
1061# CLIBFOPT = $(CLIBDEFS)
1062#
1063# # Compiler flags
1064# CXXFLAGS = $(OPT) -Wall -pipe -Woverloaded-virtual -Weffc++ -D_DLL
1065# CXXFLAGSNO = $(NOOPT) -Wall -pipe -Woverloaded-virtual -Weffc++ -D_DLL
1066# CFLAGS = $(OPT) -Wall -D_DLL
1067# FFLAGS = $(CLIBFOPT) $(FOPT) -fno-second-underscore
1068# # rmkdepend flags for building dependencies of FORTRAN files
1069# DEPENDFFLAGS = $(FFLAGS)
1070#
1071# # rootcint flags
1072# CINTFLAGS =
1073#
1074# LD = g++
1075# LDFLAGS = $(OPT)
1076#
1077# SHLD = $(LD)
1078# SOFLAGS = $(OPT) -shared -Wl,--export-all-symbols -Wl,-soname=$$TMPLIB -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc
1079# SHLIB = $(shell root-config --libs) -lg2c
1080# SOEXT = dll
1081#
1082# ALLD = ar
1083# ALFLAGS = cr
1084# ALLIB =
1085# AEXT = a
1086#
1087# # additional ROOT libraries
1088#
1089# #System libraries
1090# SYSLIBS := -ldl -lg2c -lcrypt -L/usr/X11R6/lib -lX11
1091#
1092#
1093#
1094#
1095#
1096
1097
1098
1099
1100
1101