From 7afcc417b3d26274342ad5293eaad76d7719ae32 Mon Sep 17 00:00:00 2001 From: don bright Date: Sat, 29 Dec 2012 14:26:59 -0600 Subject: prevent LD_LIBRARY_PATH problems on unix (not OSX) systems with dependency builds, by using RPATH during build. remove the shell script workaround that was added during the previous commit, as it is 'less clean' a solution. diff --git a/README.md b/README.md index ebe69c0..678b213 100644 --- a/README.md +++ b/README.md @@ -176,13 +176,6 @@ check dependencies Then follow the Compilation instructions below. -Note that if you build dependencies with this method, you may have to -modify your LD_LIBRARY_PATH environment variable every time you run the -openscad binary to avoid library problems. A workaround script called -"openscad-unirun.sh" has been included to solve this: copy it somewhere -in your PATH (/usr/local/bin) and run 'openscad-unirun.sh' instead of -the openscad binary. - ### Building for Windows OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to diff --git a/openscad.pro b/openscad.pro index 6d9556b..0048963 100644 --- a/openscad.pro +++ b/openscad.pro @@ -101,6 +101,15 @@ netbsd* { } } +# Prevent LD_LIBRARY_PATH problems when running the openscad binary +# on systems where uni-build-dependencies.sh was used. +# Will not affect 'normal' builds. Also this is not tested on Mac +!isEmpty(OPENSCAD_LIBDIR) { + unix:!macx { + QMAKE_LFLAGS = -Wl,-R$$OPENSCAD_LIBDIR/lib $$QMAKE_LFLAGS + } +} + # See Dec 2011 OpenSCAD mailing list, re: CGAL/GCC bugs. *g++* { QMAKE_CXXFLAGS *= -fno-strict-aliasing diff --git a/scripts/openscad-unirun.sh b/scripts/openscad-unirun.sh deleted file mode 100755 index b0836eb..0000000 --- a/scripts/openscad-unirun.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -LD_LIBRARY_PATH=$HOME/openscad_deps/lib:$HOME/openscad_deps/lib64:$LD_LIBRARY_PATH openscad - -- cgit v0.10.1