Skip to content

Commit

Permalink
On Mac, use -dead_strip linker flag instead of --gc-sections --as-needed
Browse files Browse the repository at this point in the history
Fixes #7
  • Loading branch information
hroncok committed Jul 15, 2014
1 parent 935ccd2 commit 151a000
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Makefile.am
@@ -1,9 +1,7 @@
ACLOCAL_AMFLAGS = -I m4

AM_LDFLAGS = \
-Wl,--gc-sections \
-Wl,--as-needed \
-no-undefined
AM_LDFLAGS = @DEAD_STRIP@
AM_LDFLAGS += -no-undefined

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libadmesh.pc
Expand Down
15 changes: 15 additions & 0 deletions configure.ac
Expand Up @@ -31,6 +31,21 @@ AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_MKDIR_P

# =======================
# Platform specific setup
# =======================

AC_CANONICAL_HOST
case $host_os in
darwin* )
DEAD_STRIP="-Wl,-dead_strip"
;;
*)
DEAD_STRIP="-Wl,--gc-sections -Wl,--as-needed"
;;
esac
AC_SUBST(DEAD_STRIP)

# ================
# Check for cflags
# ================
Expand Down

0 comments on commit 151a000

Please sign in to comment.