diff options
author | Adrian Thurston <thurston@colm.net> | 2020-03-22 13:00:03 +0200 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2020-03-22 13:03:10 +0200 |
commit | d5b745ef0f7a5b42674918ac204973c582de2297 (patch) | |
tree | f5b58f6669e73a3c106d375eff3e050b75b9cd13 | |
parent | 197fdd7e939855e229ff6755b76fe8c52756cbf0 (diff) | |
download | colm-d5b745ef0f7a5b42674918ac204973c582de2297.tar.gz |
use a static link with libcolm.a when running out of the source tree
A dynamic link is proving complicated on OSX. When the package is configured to
install to a new install location, but make install hasn't happened yet the
link fails This may indicate we are not getting the code we think we are. We
can eschew all these risks with a static link and reserve dynamic linking for
when we are running from the installed location.
This patch also includes some testing fixes
-rw-r--r-- | .github/workflows/build-test.yml | 2 | ||||
-rw-r--r-- | src/main.cc | 6 | ||||
-rwxr-xr-x | test/dist.sh | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1b4c9441..07940dd8 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -35,4 +35,4 @@ jobs: run: cd unpack/colm-* && make - name: test the dist - run: cd unpack/colm--*/test && ./runtests + run: cd unpack/colm-*/test && ./runtests diff --git a/src/main.cc b/src/main.cc index a3a7d2c9..5d6cbac4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -485,7 +485,7 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation ) " -I%s/../aapl" " -I%s/include" " -L%s" - " -Wl,-rpath,%s", + " %s/libcolm.a", binaryFn, intermedFn, srcLocation, srcLocation, location, location ); } @@ -510,7 +510,9 @@ void compileOutput( const char *argv0, const bool inSource, char *srcLocation ) strcat( command, " -L" ); strcat( command, *lp ); } - strcat( command, " -lcolm" ); + + if ( !inSource ) + strcat( command, " -lcolm" ); if( !compileOutputCommand( command ) && run ) runOutputProgram(); diff --git a/test/dist.sh b/test/dist.sh index 823d16f9..738a7938 100755 --- a/test/dist.sh +++ b/test/dist.sh @@ -10,7 +10,7 @@ trap "rm -f $DIST" EXIT make dist WORKDIR=`mktemp -d /tmp/colm.XXXXXX` -#trap "rm -Rf $DIST $WORKDIR" EXIT +trap "rm -Rf $DIST $WORKDIR" EXIT tar -C $WORKDIR -xzvf $DIST cd $WORKDIR/${DIST%.tar.gz} |