Skip to content

Commit

Permalink
[lrslib] Add LibraryProduct for liblrsnash (JuliaPackaging#2862)
Browse files Browse the repository at this point in the history
* Add LibraryProduct for `liblrsnash`

* instead of outputting here and copying to there, just output there

Co-authored-by: Mosè Giordano <[email protected]>

* use GCC toolchain in apple and freebsd platforms

First attempt to duct-tape JuliaPackaging#2862 (comment)

* don't refer to $LDFLAGS, it's not set

Co-authored-by: Mosè Giordano <[email protected]>

Co-authored-by: Mosè Giordano <[email protected]>
  • Loading branch information
bzinberg and giordano authored Apr 21, 2021
1 parent 77d7ec4 commit 645bce8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions L/lrslib/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sources = [
script = raw"""
cd $WORKSPACE/srcdir/lrslib*
extraargs=""
cflags="-O3 -Wall"
cflags="-fPIC -O3 -Wall"
# 32bit linux, arm and windows:
if [[ $target == i686* ]] || [[ $target == arm* ]]; then
Expand All @@ -25,10 +25,11 @@ if [[ $target == i686* ]] || [[ $target == arm* ]]; then
fi
if [[ $target == *apple* ]]; then
export CC=gcc
sed -i -e 's#-Wl,-soname=#-install_name #' makefile
extraargs="SONAME=liblrs.0.dylib SHLINK=liblrs.dylib SHLIB=liblrs.0.0.0.dylib"
elif [[ $target == *freebsd* ]]; then
export CC="$CC $LDFLAGS"
export CC="gcc"
elif [[ $target == *mingw* ]]; then
extraargs="SONAME=liblrs-0.dll SHLINK=liblrs.dll SHLIB=liblrs-0-0-0.dll"
cflags="$cflags -DSIGNALS -DTIMES"
Expand All @@ -40,6 +41,8 @@ if [[ $target == *mingw* ]]; then
for file in ${bindir}/{lrs,lrsnash,redund}; do mv $file $file.exe; done
mv ${prefix}/lib/*lrs*.dll ${libdir}/
fi
${CC} -shared ${cflags} -o "${libdir}/liblrsnash.${dlext}" lrsnashlib.c -L${libdir} -llrs -lgmp -Wl,-rpath,${libdir} -DMA -DGMP -DLRS_QUIET -I${includedir}
"""

# These are the platforms we will build for by default, unless further
Expand All @@ -52,6 +55,7 @@ products = [
ExecutableProduct("lrsnash", :lrsnash)
ExecutableProduct("redund", :redund)
LibraryProduct("liblrs", :liblrs)
LibraryProduct("liblrsnash", :liblrsnash)
]

# Dependencies that must be installed before this package can be built
Expand All @@ -61,4 +65,3 @@ dependencies = [

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)

0 comments on commit 645bce8

Please sign in to comment.