Skip to content

Commit

Permalink
check libiconv_open in -liconv and add it to showfont link libs if found
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Nov 9, 2020
1 parent e31d11a commit b13aa50
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -45,7 +45,7 @@ pkgconfig_DATA = SDL_ttf.pc

noinst_PROGRAMS = showfont glfont

showfont_LDADD = libSDL_ttf.la
showfont_LDADD = libSDL_ttf.la @ICONV_LIBS@
glfont_LDADD = libSDL_ttf.la @GL_LIBS@ @MATHLIB@

# Rule to build tar-gzipped distribution package
Expand Down
3 changes: 2 additions & 1 deletion Makefile.in
Expand Up @@ -161,6 +161,7 @@ FT2_CONFIG = @FT2_CONFIG@
FT2_LIBS = @FT2_LIBS@
GL_LIBS = @GL_LIBS@
GREP = @GREP@
ICONV_LIBS = @ICONV_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand Down Expand Up @@ -304,7 +305,7 @@ EXTRA_DIST = \
libSDL_ttf_la_LIBADD = @MATHLIB@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = SDL_ttf.pc
showfont_LDADD = libSDL_ttf.la
showfont_LDADD = libSDL_ttf.la @ICONV_LIBS@
glfont_LDADD = libSDL_ttf.la @GL_LIBS@ @MATHLIB@
all: all-am

Expand Down
101 changes: 85 additions & 16 deletions configure
Expand Up @@ -789,6 +789,7 @@ am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
MATHLIB
ICONV_LIBS
GL_LIBS
X_EXTRA_LIBS
X_LIBS
Expand Down Expand Up @@ -3764,13 +3765,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:3767: $ac_compile\"" >&5)
(eval echo "\"\$as_me:3768: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:3770: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:3771: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:3773: output\"" >&5)
(eval echo "\"\$as_me:3774: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
Expand Down Expand Up @@ -4981,7 +4982,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 4984 "configure"' > conftest.$ac_ext
echo '#line 4985 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
Expand Down Expand Up @@ -7139,11 +7140,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7142: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7143: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7146: \$? = $ac_status" >&5
echo "$as_me:7147: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
Expand Down Expand Up @@ -7478,11 +7479,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7481: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7482: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7485: \$? = $ac_status" >&5
echo "$as_me:7486: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
Expand Down Expand Up @@ -7583,11 +7584,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7586: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7587: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7590: \$? = $ac_status" >&5
echo "$as_me:7591: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Expand Down Expand Up @@ -7638,11 +7639,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7641: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7642: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7645: \$? = $ac_status" >&5
echo "$as_me:7646: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
Expand Down Expand Up @@ -10440,7 +10441,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10443 "configure"
#line 10444 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -10536,7 +10537,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10539 "configure"
#line 10540 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
Expand Down Expand Up @@ -12732,8 +12733,6 @@ fi
;;
esac
case "$host" in
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
Expand Down Expand Up @@ -15521,6 +15520,76 @@ if test x$have_opengl = xyes; then
else
GL_LIBS=""
fi
{ $as_echo "$as_me:$LINENO: checking for libiconv_open in -liconv" >&5
$as_echo_n "checking for libiconv_open in -liconv... " >&6; }
if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-liconv $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char libiconv_open ();
int
main ()
{
return libiconv_open ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_lib_iconv_libiconv_open=yes
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_iconv_libiconv_open=no
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iconv_libiconv_open" >&5
$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then
ICONV_LIBS="-liconv"
fi
Expand Down
7 changes: 2 additions & 5 deletions configure.in
Expand Up @@ -70,11 +70,6 @@ case "$host" in
;;
esac


dnl Check for iconv (character conversion library; see iconv.m4)
dnl This isn't available on many systems
dnl AM_ICONV

case "$host" in
*-*-beos*)
ac_default_prefix=/boot/develop/tools/gnupro
Expand Down Expand Up @@ -166,7 +161,9 @@ if test x$have_opengl = xyes; then
else
GL_LIBS=""
fi
AC_CHECK_LIB(iconv, libiconv_open, [ICONV_LIBS="-liconv"])
AC_SUBST([GL_LIBS])
AC_SUBST([ICONV_LIBS])
AC_SUBST([MATHLIB])
AC_SUBST([WINDRES])

Expand Down

0 comments on commit b13aa50

Please sign in to comment.