File: build.sh

package info (click to toggle)
0ad 0.0.26-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 130,460 kB
  • sloc: cpp: 261,824; ansic: 198,392; javascript: 19,067; python: 14,557; sh: 7,629; perl: 4,072; xml: 849; makefile: 741; java: 533; ruby: 229; php: 190; pascal: 30; sql: 21; tcl: 4
file content (35 lines) | stat: -rwxr-xr-x 963 bytes parent folder | download
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
#!/bin/sh
set -e
LIB_VERSION="fcollada-3.05+wildfiregames.6"
JOBS=${JOBS:="-j2"}
MAKE=${MAKE:="make"}
LDFLAGS=${LDFLAGS:=""}
CFLAGS=${CFLAGS:=""}
CXXFLAGS=${CXXFLAGS:=""}

if [ -e .already-built ] && [ "$(cat .already-built)" = "${LIB_VERSION}" ]
then
  echo "FCollada is already up to date."
  exit
fi

echo "Building FCollada..."
echo

if [ "$(uname -s)" = "Darwin" ]; then
  # The Makefile refers to pkg-config for libxml2, but we
  # don't have that (replace with xml2-config instead).
  sed -i.bak -e 's/pkg-config libxml-2.0/xml2-config/' src/Makefile
fi

rm -f .already-built
rm -f lib/*.a
mkdir -p lib
(cd src && rm -rf "output/" && "${MAKE}" clean && CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" && LDFLAGS="$LDFLAGS" "${MAKE}" "${JOBS}") || die "FCollada build failed"

if [ "$(uname -s)" = "Darwin" ]; then
  # Undo Makefile change as we don't want to have it when creating patches.
  mv src/Makefile.bak src/Makefile
fi

echo "$LIB_VERSION" > .already-built