xref: /5.5.2/tlm/deps/packages/flex/flex_unix.sh (revision 86f2ed0b)
1#!/bin/bash
2
3INSTALL_DIR=$1
4PLATFORM=$2
5VERSION=$3
6
7# Build and install m4, then add to path
8tar zxf m4-1.4.18.tar.gz || exit 1
9pushd m4-1.4.18 || exit 1
10./configure --prefix=${INSTALL_DIR} || exit 1
11make && make install
12popd || exit 1
13PATH=${INSTALL_DIR}/bin:$PATH
14
15# Build and install flex
16tar zxf flex-${VERSION}.tar.gz || exit 1
17pushd flex-${VERSION} || exit 1
18./configure --prefix=${INSTALL_DIR} || exit 1
19make && make install
20
21if [ $(uname -s) = "Darwin" ]; then
22    install_name_tool -id @rpath/libfl.2.dylib ${INSTALL_DIR}/lib/libfl.2.dylib
23fi
24