Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env bash
- if [ ! -f 'build.sh' ]; then
- echo 'ERROR: This script must be run from the directory it is in' >&2
- exit 1
- fi
- if [ -z "${TCLVERS}" ]; then
- echo 'ERROR: The TCLVERS environment variable is not set' >&2
- exit 1
- fi
- NSFVERS="2.0.0"
- NSFVERSEXTRA=""
- SRC="src/nsf${NSFVERS}.tar.gz"
- SRCURL="http://sourceforge.net/projects/next-scripting/files/${NSFVERS}/nsf${NSFVERS}.tar.gz/download"
- BUILDDIR="$(pwd)/build/nsf${NSFVERS}"
- OUTDIR="$(pwd)/out"
- INSTDIR="$(pwd)/inst"
- export NSFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR
- # Set configure options for this sub-project
- LDFLAGS="${LDFLAGS} ${KC_NSF_LDFLAGS}"
- CFLAGS="${CFLAGS} ${KC_NSF_CFLAGS}"
- CPPFLAGS="${CPPFLAGS} ${KC_NSF_CPPFLAGS}"
- LIBS="${LIBS} ${KC_NSF_LIBS}"
- export LDFLAGS CFLAGS CPPFLAGS LIBS
- rm -rf 'build' 'out' 'inst'
- mkdir 'build' 'out' 'inst' || exit 1
- if [ ! -f "${SRC}" ]; then
- mkdir 'src' >/dev/null 2>/dev/null
- if [ ! -d 'buildsrc' ]; then
- rm -f "${SRC}.tmp"
- wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
- mv "${SRC}.tmp" "${SRC}"
- fi
- fi
- (
- cd 'build' || exit 1
- if [ ! -d '../buildsrc' ]; then
- gzip -dc "../${SRC}" | tar -xf -
- else
- cp -rp ../buildsrc/* './'
- fi
- cd "${BUILDDIR}" || exit 1
- # Build
- echo "Running: ./configure --enable-shared --disable-symbols --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
- ./configure --enable-shared --disable-symbols --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
- echo "Running: ${MAKE:-make}"
- ${MAKE:-make} || exit 1
- echo "Running: ${MAKE:-make} install"
- ${MAKE:-make} install
- mkdir "${OUTDIR}/lib" || exit 1
- cp -r "${INSTDIR}/lib"/nsf* "${OUTDIR}/lib/"
- "${STRIP:-strip}" -g "${OUTDIR}"/lib/nsf*/*.so >/dev/null 2>/dev/null
- exit 0
- ) || exit 1
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement