File:  [Local Repository] / imach / distributions / osx / gnuplot_bin / bin / install_name.sh
Revision 1.1: download - view: text, annotated - select for diffs
Tue Dec 8 16:04:55 2015 UTC (8 years, 11 months ago) by brouard
Branches: MAIN
CVS tags: HEAD
*** empty log message ***

#!/bin/bash
cp /Users/nbrouard/RPMS/gnuplot-cvs/gnuplot/gnuplot-5.1_cvs8Dec13\:19\:21-aquaterm .
ln -f gnuplot-5.1_cvs8Dec13\:19\:21-aquaterm gnuplot
otool -L gnuplot
mv /usr/local/libold /usr/local/lib
# libgd.3.dylib libjpeg.8.dylib libpng16.16.dylib libtiff.5.dylib libpangocairo-1.0.0.dylib libpango-1.0.0.dylib libgobject-2.0.0.dylib libglib-2.0.0.dylib libintl.8.dylib  libcairo.2.dylib
rm -rf ../lib
mkdir ../lib
for i in `otool -L gnuplot |grep /usr/local|awk '{print $1}'`
do
    cp -n ${i} ../lib
    ii=`echo ${i} | awk -F / '{print $NF}'`
    echo ii=${ii}
#otool -L ../lib/${i} |grep /usr/local/lib|awk -F "[/ ]" '{print $5}'`
    echo TO BE DONE 2 `otool -L ../lib/${ii} |grep /usr/local|awk '{print $1}'`
    for j in `otool -L ../lib/${ii} |grep /usr/local|awk '{print $1}'`
    do
	jj=`echo ${j} | awk -F / '{print $NF}'`
	echo jj=${jj}
	chmod -R u+rw ../lib
	cp -n ${j} ../lib
	if [ ${i} == ${j} ]; then
	    install_name_tool -id @executable_path/../lib/${jj} ../lib/${ii}
	else
	    install_name_tool -change ${j} @executable_path/../lib/${jj} ../lib/${ii}
	fi
	echo TO BE DONE 3 `otool -L ../lib/${jj} |grep /usr/local|awk '{print $1}'`
	for k in `otool -L ../lib/${jj} |grep /usr/local|awk '{print $1}'`
	do
	    kk=`echo ${k} | awk -F / '{print $NF}'`
	echo kk=${kk}
	chmod -R u+rw ../lib
	cp -n ${k} ../lib
	if [ ${k} == ${j} ]; then
	    install_name_tool -id @executable_path/../lib/${kk} ../lib/${jj}
	else
	    install_name_tool -change ${k} @executable_path/../lib/${kk} ../lib/${jj}
	fi  
	done
	echo DONE 3 OTOOL -L 
	otool -L ../lib/${jj}
    done
    DONE 2 OTOOL -L
    otool -L ../lib/${ii}
    install_name_tool -change ${i} @executable_path/../lib/${ii} gnuplot 
done
#for i in libfreetype.6.dylib libfontconfig.1.dylib
# for i in libfreetype.6.dylib libfontconfig.1.dylib
# do
#     cp -f /opt/X11/lib/${i} ../lib
#     echo TO BE DONE 2 `otool -L ../lib/${i} |grep /usr/local/lib|awk -F "[/ ]" '{print $5}'`
#     for j in `otool -L ../lib/${i} |grep /usr/local/lib|awk -F "[/ ]" '{print $5}'`
#     do
# 	chmod -R u+rw ../lib
# 	cp /opt/X11/lib/${j} ../lib
# 	if [ ${i} == ${j} ]; then
# 	    install_name_tool -id @executable_path/../lib/${j} ../lib/${i}
# 	else
# 	    install_name_tool -change /opt/X11/lib/${j} @executable_path/../lib/${j} ../lib/${i}
# 	fi
# 	otool -L ../lib/${i}
#     done
#     install_name_tool -change /opt/X11/lib/${i} @executable_path/../lib/${i} gnuplot 
# done
mv /usr/local/lib /usr/local/libold
PATH=/usr/bin:/bin:/usr/sbin:/sbin::/Users/nbrouard/bin DYLD_PRINT_LIBRARIES=y ./gnuplot -e "set out 'toto.png'; set ter pngcairo; plot sin(x);"
exit

 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>