#!/bin/sh # This file is a part of Julia. License is MIT: https://julialang.org/license # Run as: fixup-libstdc++.sh if test -z $1 { echo "Usage: $0 " exit 1 } setglobal libdir = $1 setglobal private_libdir = $2 if test ! -f "$libdir/libjulia.so" { echo "ERROR: Could not open $libdir/libjulia.so" > !2 exit 2 } proc find_shlib { if test -f $1 { ldd $1 | grep $2 | cut -d' ' -f3 | xargs } } # Discover libstdc++ location and name setglobal LIBSTD = $[find_shlib "$libdir/libjulia.so" "libstdc++.so] setglobal LIBSTD_NAME = $[basename $LIBSTD] setglobal LIBSTD_DIR = $[dirname $LIBSTD] if test ! -f "$private_libdir/$LIBSTD_NAME" && test -f "$LIBSTD_DIR/$LIBSTD_NAME" { cp -v "$LIBSTD_DIR/$LIBSTD_NAME" $private_libdir chmod 755 "$private_libdir/$LIBSTD_NAME" }