Skip to content

Commit

Permalink
Avoid linking with libdl on BSD systems
Browse files Browse the repository at this point in the history
FreeBSD does not have libdl, so, when linking with -ldl fails.
This patch simply check if you are running on BSD, and does not
invoke -ldl during compilation.

Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
  • Loading branch information
leitao authored and nfont committed Nov 9, 2016
1 parent eca0c56 commit 28ec980
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -64,7 +64,7 @@ pseries_platform_SOURCES = src/common/pseries_platform.c src/common/pseries_plat
librtas_error_SOURCES = src/common/librtas_error.c src/common/librtas_error.h

src_nvram_SOURCES = src/nvram.c src/nvram.h $(pseries_platform_SOURCES)
src_nvram_LDADD = -ldl -lz
src_nvram_LDADD = -lz @LIBDL@

src_lsprop_SOURCES = src/lsprop.c $(pseries_platform_SOURCES)

Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Expand Up @@ -58,6 +58,22 @@ AS_IF([test "x$with_librtas" != "xno"],

AM_CONDITIONAL([WITH_LIBRTAS], [test "x$with_librtas" = "xyes"])

# Check what OS you are running
AC_CANONICAL_HOST
case $host_os in
linux*)
LIBDL="-ldl"
;;
*freebsd*)
LIBDL=""
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AC_SUBST(LIBDL)

# check for systemd
systemd_unit_dir=/usr/lib/systemd/system
AC_ARG_WITH([systemd],
Expand Down

0 comments on commit 28ec980

Please sign in to comment.