configure: Merge the libfreetype existence check with the soname check.

This commit is contained in:
Alexandre Julliard 2007-07-09 22:43:20 +02:00
parent d68d4335af
commit 24a55f3862
4 changed files with 59 additions and 205 deletions

215
configure vendored
View File

@ -747,10 +747,9 @@ ICULIBS
RESOLVLIBS
LCMSLIBS
LDAPLIBS
ft_devel
FREETYPELIBS
FREETYPEINCL
ft_devel
ft_devel2
FONTSSUBDIRS
ESDCONFIG
ESDLIBS
@ -12631,12 +12630,11 @@ done
LIBS="$ac_wine_check_funcs_save_LIBS"
fi
FREETYPELIBS=""
FREETYPEINCL=""
# Extract the first word of "freetype-config", so it can be a program name with args.
set dummy freetype-config; ac_word=$2
wine_cv_msg_freetype=yes
for ac_prog in freetype-config freetype2-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ft_devel+set}" = set; then
@ -12652,7 +12650,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ft_devel="freetype-config"
ac_cv_prog_ft_devel="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@ -12660,7 +12658,6 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_ft_devel" && ac_cv_prog_ft_devel="no"
fi
fi
ft_devel=$ac_cv_prog_ft_devel
@ -12673,66 +12670,22 @@ echo "${ECHO_T}no" >&6; }
fi
if test "$ft_devel" = "no"
test -n "$ft_devel" && break
done
test -n "$ft_devel" || ft_devel="false"
if test "$ft_devel" != "false"
then
# Extract the first word of "freetype2-config", so it can be a program name with args.
set dummy freetype2-config; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ft_devel2+set}" = set; then
ac_freetype_libs=`$ft_devel --libs`
ac_freetype_incl=`$ft_devel --cflags`
{ echo "$as_me:$LINENO: checking for -lfreetype" >&5
echo $ECHO_N "checking for -lfreetype... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_freetype+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$ft_devel2"; then
ac_cv_prog_ft_devel2="$ft_devel2" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ft_devel2="freetype2-config"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_prog_ft_devel2" && ac_cv_prog_ft_devel2="no"
fi
fi
ft_devel2=$ac_cv_prog_ft_devel2
if test -n "$ft_devel2"; then
{ echo "$as_me:$LINENO: result: $ft_devel2" >&5
echo "${ECHO_T}$ft_devel2" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
if test "$ft_devel2" = "freetype2-config"
then
ft_devel=$ft_devel2
fi
fi
if test "$ft_devel" = "no"
then
wine_cv_msg_freetype=yes
else
FREETYPELIBS=`$ft_devel --libs`
FREETYPEINCL=`$ft_devel --cflags`
{ echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6; }
if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lfreetype $FREETYPELIBS $LIBS"
cat >conftest.$ac_ext <<_ACEOF
ac_check_soname_save_LIBS=$LIBS
LIBS="-lfreetype $ac_freetype_libs $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@ -12772,34 +12725,41 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_freetype_FT_Init_FreeType=yes
case "$LIBEXT" in
dll) ;;
dylib) ac_cv_lib_soname_freetype=`otool -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep "libfreetype\\.$LIBEXT" | sed -e "s/^.*\(libfreetype\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;;
esac
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_freetype_FT_Init_FreeType=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
LIBS=$ac_check_soname_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
echo "${ECHO_T}$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
if test $ac_cv_lib_freetype_FT_Init_FreeType = yes; then
ft_lib=yes
if test "x$ac_cv_lib_soname_freetype" = "x"; then
{ echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6; }
ft_lib=no
else
ft_lib=no
{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_freetype" >&5
echo "${ECHO_T}$ac_cv_lib_soname_freetype" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype"
_ACEOF
ft_lib=yes
fi
if test "$ft_lib" = "no"
if test "$ft_lib" = "yes"
then
wine_cv_msg_freetype=yes
FREETYPELIBS=""
FREETYPEINCL=""
else
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
CPPFLAGS="$ac_freetype_incl $CPPFLAGS"
@ -12983,7 +12943,7 @@ _ACEOF
fi
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $FREETYPELIBS"
CFLAGS="$CFLAGS $ac_freetype_libs"
for ac_func in FT_Load_Sfnt_Table
do
@ -13087,11 +13047,11 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_FREETYPE 1
_ACEOF
FREETYPELIBS="$ac_freetype_libs"
FREETYPEINCL="$ac_freetype_incl"
wine_cv_msg_freetype=no
else
FREETYPELIBS=""
FREETYPEINCL=""
wine_cv_msg_freetype=yes
fi
fi
fi
@ -15421,84 +15381,6 @@ _ACEOF
fi
{ echo "$as_me:$LINENO: checking for -lfreetype" >&5
echo $ECHO_N "checking for -lfreetype... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_freetype+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lfreetype $X_LIBS $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 FT_Init_FreeType ();
int
main ()
{
return FT_Init_FreeType ();
;
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 "echo \"\$as_me:$LINENO: $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
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 &&
$as_test_x conftest$ac_exeext; then
case "$LIBEXT" in
dll) ;;
dylib) ac_cv_lib_soname_freetype=`otool -L conftest$ac_exeext | grep "libfreetype\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libfreetype\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep "libfreetype\\.$LIBEXT" | sed -e "s/^.*\(libfreetype\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;;
esac
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_soname_save_LIBS
fi
if test "x$ac_cv_lib_soname_freetype" = "x"; then
{ echo "$as_me:$LINENO: result: not found" >&5
echo "${ECHO_T}not found" >&6; }
else
{ echo "$as_me:$LINENO: result: $ac_cv_lib_soname_freetype" >&5
echo "${ECHO_T}$ac_cv_lib_soname_freetype" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype"
_ACEOF
fi
@ -21985,10 +21867,9 @@ ICULIBS!$ICULIBS$ac_delim
RESOLVLIBS!$RESOLVLIBS$ac_delim
LCMSLIBS!$LCMSLIBS$ac_delim
LDAPLIBS!$LDAPLIBS$ac_delim
ft_devel!$ft_devel$ac_delim
FREETYPELIBS!$FREETYPELIBS$ac_delim
FREETYPEINCL!$FREETYPEINCL$ac_delim
ft_devel!$ft_devel$ac_delim
ft_devel2!$ft_devel2$ac_delim
FONTSSUBDIRS!$FONTSSUBDIRS$ac_delim
ESDCONFIG!$ESDCONFIG$ac_delim
ESDLIBS!$ESDLIBS$ac_delim
@ -22009,7 +21890,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 72; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@ -810,33 +810,17 @@ then
fi
dnl **** Check for FreeType 2 ****
AC_SUBST(FREETYPELIBS,"")
AC_SUBST(FREETYPEINCL,"")
AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
if test "$ft_devel" = "no"
wine_cv_msg_freetype=yes
AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],false)
if test "$ft_devel" != "false"
then
AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
if test "$ft_devel2" = "freetype2-config"
ac_freetype_libs=`$ft_devel --libs`
ac_freetype_incl=`$ft_devel --cflags`
WINE_CHECK_SONAME(freetype,FT_Init_FreeType,[ft_lib=yes],[ft_lib=no],[$ac_freetype_libs])
if test "$ft_lib" = "yes"
then
ft_devel=$ft_devel2
fi
fi
if test "$ft_devel" = "no"
then
wine_cv_msg_freetype=yes
else
FREETYPELIBS=`$ft_devel --libs`
FREETYPEINCL=`$ft_devel --cflags`
AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$FREETYPELIBS)
if test "$ft_lib" = "no"
then
wine_cv_msg_freetype=yes
FREETYPELIBS=""
FREETYPEINCL=""
else
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
CPPFLAGS="$ac_freetype_incl $CPPFLAGS"
AC_CHECK_HEADERS(ft2build.h \
freetype/freetype.h \
freetype/ftglyph.h \
@ -857,7 +841,7 @@ else
wine_cv_fttrigon=yes],[wine_cv_fttrigon=no])
AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <freetype/ftmodapi.h>])
ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $FREETYPELIBS"
CFLAGS="$CFLAGS $ac_freetype_libs"
AC_CHECK_FUNCS(FT_Load_Sfnt_Table)
CFLAGS="$ac_save_CFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
@ -865,11 +849,9 @@ else
if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
then
AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
AC_SUBST(FREETYPELIBS,"$ac_freetype_libs")
AC_SUBST(FREETYPEINCL,"$ac_freetype_incl")
wine_cv_msg_freetype=no
else
FREETYPELIBS=""
FREETYPEINCL=""
wine_cv_msg_freetype=yes
fi
fi
fi
@ -1159,7 +1141,6 @@ AC_DEFINE_UNQUOTED(SONAME_EXT,[".$LIBEXT"],[Define to the file extension of shar
WINE_CHECK_SONAME(X11,XCreateWindow,,,[$X_LIBS $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xext,XextCreateExtension,,,[$X_LIBS -lX11 $X_EXTRA_LIBS])
WINE_CHECK_SONAME(freetype,FT_Init_FreeType,,,[$X_LIBS])
dnl **** Check for functions ****

View File

@ -128,10 +128,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(font);
#include <freetype/ftmodapi.h>
#endif
#ifndef SONAME_LIBFREETYPE
#define SONAME_LIBFREETYPE "libfreetype" SONAME_EXT
#endif
#ifndef HAVE_FT_TRUETYPEENGINETYPE
typedef enum
{

View File

@ -83,10 +83,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
FT_LOAD_IGNORE_TRANSFORM | \
FT_LOAD_LINEAR_DESIGN )
#ifndef SONAME_LIBFREETYPE
#define SONAME_LIBFREETYPE "libfreetype" SONAME_EXT
#endif
static void *ft_handle = NULL;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL;