mkdir -p ${BIN_DIR}
mkdir -p ${SHARE_DIR}
mkdir -p ${DOC_DIR}
mkdir -p ${PREFIX}/lib

# Copy binaries and scripts
# perl scripts use /usr/bin/env so there is no need to do modify them
if [[ "$OSTYPE" == "darwin"* ]]; then
    find . -maxdepth 1 -type f -perm +111 -exec cp -p \{\} ${BIN_DIR} \;
else
    find . -maxdepth 1 -type f -executable -exec cp -p \{\} ${BIN_DIR} \;
fi

# Compile selection functions and install them.
# The SYSTEM variable is not really needed