forked from cms-sw/cmsdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
charybdis-1003-macosx.patch
66 lines (62 loc) · 2.23 KB
/
charybdis-1003-macosx.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/charybdis/1.003/configure b/charybdis/1.003/configure
index 1818d4d..da228cd 100755
--- a/charybdis/1.003/configure
+++ b/charybdis/1.003/configure
@@ -121,23 +121,25 @@ if [ $ARCH = Linux ]; then
fi
fi
# Linux platform with gcc4: new Fortran90 compiler.
-if [ $ARCH = Linux-gcc4 ]; then
- export FC=gfortran
- export FFLAGS="${FFLAGS_OPT}"
- export CFLAGS="${CFLAGS_OPT}"
- export CXXFLAGS="${CXXFLAGS_OPT}"
- export FLIBS="-lgfortran -lgfortranbegin"
- if [ ${COMPMODE} = OPT ]; then
- export FFLAGS="${FFLAGS_OPT}"
- export CFLAGS="${CFLAGS_OPT}"
- export CXXFLAGS="${CXXFLAGS_OPT}"
- fi
- if [ ${COMPMODE} = DBG ]; then
- export FFLAGS="${FFLAGS_DBG}"
- export CFLAGS="${CFLAGS_DBG}"
- export CXXFLAGS="${CXXFLAGS_DBG}"
- fi
-fi
+case $ARCH in
+ *-gcc4)
+ export FC=gfortran
+ export FFLAGS="${FFLAGS_OPT}"
+ export CFLAGS="${CFLAGS_OPT}"
+ export CXXFLAGS="${CXXFLAGS_OPT}"
+ export FLIBS="-lgfortran -lgfortranbegin"
+ if [ ${COMPMODE} = OPT ]; then
+ export FFLAGS="${FFLAGS_OPT}"
+ export CFLAGS="${CFLAGS_OPT}"
+ export CXXFLAGS="${CXXFLAGS_OPT}"
+ fi
+ if [ ${COMPMODE} = DBG ]; then
+ export FFLAGS="${FFLAGS_DBG}"
+ export CFLAGS="${CFLAGS_DBG}"
+ export CXXFLAGS="${CXXFLAGS_DBG}"
+ fi
+ ;;
+esac
#Platform & opt/dbg - independent flags and variables:
diff --git a/charybdis/1.003/Makeshared.subdir b/charybdis/1.003/Makeshared.subdir
index 102c2fc..1d38460 100644
--- a/charybdis/1.003/Makeshared.subdir
+++ b/charybdis/1.003/Makeshared.subdir
@@ -42,7 +42,13 @@ objects += $(patsubst $(DIRNAME)/%.c,$(TMPDIR)/%.o,$(wildcard $(DIRNAME)/*.c))
$(LIBNAME): $(objects)
@mkdir -p $(LIBDIR)
@echo creating the shared library $@
- $(CXX) $(LDFLAGSSHARED) $(objects) -o $@ -shared -Wl,-soname,$(notdir $@)
+ case ${ARCH} in \
+ Linux-*) \
+ $(CXX) $(LDFLAGSSHARED) $(objects) -o $@ -shared -Wl,-soname,$(notdir $@) \
+ ;; \
+ Darwin-*) \
+ $(CXX) $(LDFLAGSSHARED) $(objects) -o $@ -Wl,-commons -Wl,use_dylibs -shared -L$(PYTHIA6_ROOT)/lib -lpythia6 -L$(LHAPDF_ROOT)/lib -lLHAPDF -L$(ZLIB_ROOT)/lib -lz $(shell gfortran --print-file-name=libgfortran.a) -dynamic ;; \
+ esac
deps := $(patsubst $(DIRNAME)/%.F,$(TMPDIR)/%.d,$(wildcard $(DIRNAME)/*.F))