Use -fPIC for building plugins on NetBSD, OpenBSD, FreeBSD, BSDI and Cygwin.

Required for plugins to work on x86-64.

Thanks to snadge for this patch.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@183 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2012-05-15 12:22:13 +00:00
parent 26a62fe7fa
commit 4e53ace4f1
2 changed files with 10 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ AC_DEFUN(AC_CHECK_PLUGIN_SUPPORT,
LDFLAGS="$LDFLAGS -Wl,-Bexport"
;;
NetBSD*)
SHLIB_CFLAGS="-fPIC"
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
SHLIB_LD="ld -Bshareable"
else
@@ -73,12 +74,15 @@ AC_DEFUN(AC_CHECK_PLUGIN_SUPPORT,
SHLIB_LD="ld -Bshareable"
;;
FreeBSD*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="$CC -shared"
;;
OpenBSD*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="$CC -shared"
;;
BSDI*)
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="$CC -shared"
;;
NEXTSTEP*)
@@ -143,6 +147,7 @@ AC_DEFUN(AC_CHECK_PLUGIN_SUPPORT,
])
;;
CYGWIN*)
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".dll"
SHLIB_LD="dllwrap --export-all --output-def \$(PLUGIN_NAME).def --implib lib\$(PLUGIN_NAME).a --driver-name \$(CC)"
;;