Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lrslib] Add LibraryProduct for liblrsnash #2862

Merged
merged 5 commits into from
Apr 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)