summaryrefslogtreecommitdiff
path: root/cad/plugins/GROMACS/gromacs-3.3.2/packaging/MacOSX/stitch_gromacs.sh
blob: 6aece242792d9c648d944544168738aa600a5e77 (plain)
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
#!/bin/sh
rm -rf gromacs-3.3.2-joined
mkdir gromacs-3.3.2-joined
cd gromacs-3.3.2-i386
find . -type d -exec mkdir ../gromacs-3.3.2-joined/{} \;
find . -name "*.a" -exec cp {} ../gromacs-3.3.2-joined/{}-i386 \;
find . -name "*.a" -exec cp {} ../gromacs-3.3.2-joined/{} \;
for name in `find . -type f`
do
  if [ -x "$name" ]
  then
    file $name | grep Mach-O > /tmp/stitch_gromacs_junk
    if [ "$?" == "0" ]
    then
      cp $name ../gromacs-3.3.2-joined/$name-i386
      cp $name ../gromacs-3.3.2-joined/$name
    fi
  fi
done
cd ../gromacs-3.3.2-ppc
find . -name "*.a" -exec cp {} ../gromacs-3.3.2-joined/{}-ppc \;
for name in `find . -type f`
do
  if [ -x "$name" ]
  then
    file $name | grep Mach-O > /tmp/stitch_gromacs_junk
    if [ "$?" == "0" ]
    then
      cp $name ../gromacs-3.3.2-joined/$name-ppc
    fi
  fi
done
cd ../gromacs-3.3.2-joined
echo "Starting joining process"
for name in `find . -type f ! -name "*-i386" ! -name "*-ppc" -print`
do
  rm $name
  echo $name
  lipo -create $name-i386 $name-ppc -output $name
  rm $name-i386 $name-ppc
done
mkdir ../gromacs-3.3.2-univ
cd gromacs-3.3.2-i386
find . -print | cpio -pudvm ../gromacs-3.3.2-univ
cd ../gromacs-3.3.2-joined
find . -type f -print -exec cp {} ../gromacs-3.3.2-univ/{} \;