@@ -10,12 +10,14 @@ MOSNAME=`echo ${MOSLINE} | awk -F 'macOS ' '{print $NF}' | tr -d '\\' | tr ' '
10
10
11
11
HOMEBREW=$1
12
12
13
+ EXTRPTH=" local"
13
14
if [ " $HOMEBREW " = " true" ] ; then
14
15
# It's HOMEBREW
15
16
if [ ` uname -m` = " x86_64" ] ; then
16
17
BASEDIR=usr
17
18
else
18
19
BASEDIR=/opt/homebrew
20
+ EXTRPTH=" opt"
19
21
fi
20
22
else
21
23
BASEDIR=opt
64
66
echo " BASEDIR is ${BASEDIR} " 1>&2
65
67
find_libs () {
66
68
echo " *** find_libs \" $1 \" \" $2 \" " 1>&2
67
- otool --help
68
- otool -L ${PKG} .app/Contents/MacOS/$2
69
+ otool -L ${PKG} .app/Contents/MacOS/$2 | grep \/ ${BASEDIR} \/
69
70
L2=` otool -L ${PKG} .app/Contents/MacOS/$2 | grep \/ ${BASEDIR} \/ $1 | cut -d\ -f1 | grep -o ' [^/]*$' `
71
+ echo $L2
70
72
LIST=" "
71
73
while [ " $L2 " != " $LIST " ] ; do
72
74
LIST=$L2
73
75
for i in $LIST ; do
74
76
xx=` find \/ ${BASEDIR} -name $i 2> /dev/null | tail -n 1`
75
- # echo "Looking for \"$i\" ($xx)" 1>&2
77
+ echo " Looking for \" $i \" ($xx )" 1>&2
76
78
if [ ! -f ${PKG} .app/Contents/MacOS/$i ] ; then
77
79
if [ " $xx " = " " ] ; then
78
- /bin/cp -f /${BASEDIR} /local /lib/$i ${PKG} .app/Contents/MacOS
80
+ /bin/cp -f /${BASEDIR} /${EXTRPTH} /lib/$i ${PKG} .app/Contents/MacOS
79
81
else
80
82
/bin/cp -f $xx ${PKG} .app/Contents/MacOS
81
83
fi
@@ -104,7 +106,7 @@ find_libs () {
104
106
}
105
107
106
108
107
- LIBS1=` find_libs local ${PKG} `
109
+ LIBS1=` find_libs ${EXTRPTH} ${PKG} `
108
110
# LIBS2=`find_libs intel ${PKG}`
109
111
110
112
if [ " $FC " = " ifort" ] ; then
@@ -115,15 +117,7 @@ if [ "$FC" = "ifort" ] ; then
115
117
LIBS2=" ${LIBS2} libifport.dylib"
116
118
fi
117
119
else
118
- if [ " $HOMEBREW " = " true" ] ; then
119
- if [ ` uname -m` = " x86_64" ] ; then
120
- PATH2=/${BASEDIR} /local/
121
- else
122
- PATH2=/${BASEDIR} /opt/
123
- fi
124
- else
125
- PATH2=/${BASEDIR} /local/
126
- fi
120
+ PATH2=/${BASEDIR} /${EXTRPTH} /
127
121
PATH3=/usr/local/
128
122
LIBS2=" libgfortran.5.dylib"
129
123
fi
@@ -137,7 +131,7 @@ echo "LIBS2 = $LIBS2"
137
131
for i in $LIBS1 ; do
138
132
echo " *** Configuring : $i *** "
139
133
xx=` find /${BASEDIR} -name $i 2> /dev/null | tail -n 1`
140
- #cp /${BASEDIR} /local /lib/$i ${PKG} .app/Contents/MacOS
134
+ #cp /${BASEDIR} /${EXTRPTH} /lib/$i ${PKG} .app/Contents/MacOS
141
135
if [ ! -f ${PKG} .app/Contents/MacOS/$i ] ; then
142
136
143
137
/bin/cp -f $xx ${PKG} .app/Contents/MacOS
@@ -148,12 +142,12 @@ for i in $LIBS1 ; do
148
142
chmod +w ${PKG} .app/Contents/MacOS/$i
149
143
fi
150
144
install_name_tool -id $i ${PKG} .app/Contents/MacOS/$i
151
- # install_name_tool -change /${BASEDIR}/local /lib/$i '@executable_path/'$i ${PKG}.app/Contents/MacOS/${PKG}
145
+ # install_name_tool -change /${BASEDIR}/${EXTRPTH} /lib/$i '@executable_path/'$i ${PKG}.app/Contents/MacOS/${PKG}
152
146
install_name_tool -change $xx ' @executable_path/' $i ${PKG} .app/Contents/MacOS/${PKG}
153
147
# echo '****' install_name_tool -change $xx '@executable_path/'$i ${PKG}.app/Contents/MacOS/${PKG}
154
148
if [ " ${BASEDIR} " = " usr" ] ; then
155
149
# This is probably a HOMEBREW setup, so there might be references into the Cellar
156
- NLST=` otool -L ${PKG} .app/Contents/MacOS/$i | grep \/ ${BASEDIR} \/ local /Cellar | cut -d\ -f1`
150
+ NLST=` otool -L ${PKG} .app/Contents/MacOS/$i | grep \/ ${BASEDIR} \/ ${EXTRPTH} /Cellar | cut -d\ -f1`
157
151
for j in $NLST ; do
158
152
k=` echo $j | grep -o ' [^/]*$' `
159
153
install_name_tool -change $j ' @executable_path/' $k ${PKG} .app/Contents/MacOS/$i
0 commit comments