Skip to content

Commit

Permalink
added -fPIC to allow using the generated static libraries from a dyna…
Browse files Browse the repository at this point in the history
…mic one
  • Loading branch information
LeeAkinobu committed Sep 18, 2019
1 parent a737a24 commit 73c0fa6
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
26 changes: 26 additions & 0 deletions libjulius/configure
Original file line number Diff line number Diff line change
Expand Up @@ -4492,6 +4492,32 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fPIC compiler option is accepted" >&5
$as_echo_n "checking whether fPIC compiler option is accepted... " >&6; }
xxxCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$xxxCFLAGS -fPIC"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
CFLAGS="$xxxCFLAGS"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$want_pthread" = yes; then
case "$host_os" in
freebsd*)
Expand Down
10 changes: 10 additions & 0 deletions libjulius/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ dnl AC_CHECK_FUNCS(strdup strstr)
dnl AC_CHECK_FUNC(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
dnl AC_CHECK_FUNC(connect,,AC_CHECK_LIB(socket, connect))

dnl Checks whether fPIC compiler option is accepted
AC_MSG_CHECKING(whether fPIC compiler option is accepted)
xxxCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
[AC_MSG_RESULT(yes)
CFLAGS="$xxxCFLAGS -fPIC"],
[AC_MSG_RESULT(no)
CFLAGS="$xxxCFLAGS"])

dnl check for POSIX thread support
if test "$want_pthread" = yes; then
case "$host_os" in
Expand Down
30 changes: 28 additions & 2 deletions libsent/configure
Original file line number Diff line number Diff line change
Expand Up @@ -3358,6 +3358,33 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fPIC compiler option is accepted" >&5
$as_echo_n "checking whether fPIC compiler option is accepted... " >&6; }
xxxCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$xxxCFLAGS -fPIC"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
CFLAGS="$xxxCFLAGS"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext

case "$host_cpu" in
arm*)
use_intel_simd=no
Expand All @@ -3373,8 +3400,7 @@ if test "$use_intel_simd" = yes; then
xxxxFMA=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIMD FMA instruction" >&5
$as_echo_n "checking for SIMD FMA instruction... " >&6; }

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <immintrin.h>
Expand Down
10 changes: 10 additions & 0 deletions libsent/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ dnl Checks for compiler.
AC_PROG_CC
AC_PROG_CPP

dnl Checks whether fPIC compiler option is accepted
AC_MSG_CHECKING(whether fPIC compiler option is accepted)
xxxCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIC -Werror"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
[AC_MSG_RESULT(yes)
CFLAGS="$xxxCFLAGS -fPIC"],
[AC_MSG_RESULT(no)
CFLAGS="$xxxCFLAGS"])

dnl Checks for SIMD capability
case "$host_cpu" in
arm*)
Expand Down

0 comments on commit 73c0fa6

Please sign in to comment.