From 67e8dc68613953a714dee6e9f6d28853af100513 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 20 May 2002 18:29:58 +0000 Subject: [PATCH] Added configure check for the soname of libraries that we load dynamically. Added a few other configure macros, and moved all macros into aclocal.m4. --- aclocal.m4 | 104 ++++++++++ configure | 460 +++++++++++++++++++++++++++++++++-------- configure.ac | 163 +++++---------- dlls/gdi/freetype.c | 8 +- dlls/wineps/truetype.c | 6 +- dlls/x11drv/xrender.c | 18 +- include/config.h.in | 12 ++ 7 files changed, 566 insertions(+), 205 deletions(-) create mode 100644 aclocal.m4 diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 00000000000..fb7579e46b4 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,104 @@ +dnl Macros used to build the Wine configure script +dnl +dnl Copyright 2002 Alexandre Julliard +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License, or (at your option) any later version. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl + +dnl **** Get the ldd program name; used by WINE_GET_SONAME **** +dnl +dnl Usage: WINE_PATH_LDD +dnl +AC_DEFUN([WINE_PATH_LDD],[AC_PATH_PROG(LDD,ldd,true,/sbin:/usr/sbin:$PATH)]) + +dnl **** Extract the soname of a library **** +dnl +dnl Usage: WINE_GET_SONAME(LIBRARY, FUNCTION, [OTHER_LIBRARIES]) +dnl +AC_DEFUN([WINE_GET_SONAME], +[AC_REQUIRE([WINE_PATH_LDD]) +AC_CACHE_CHECK([for -l$1 soname], ac_cv_lib_soname_$1, +[ac_get_soname_save_LIBS=$LIBS +LIBS="-l$1 $3 $LIBS" + AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], + [ac_cv_lib_soname_$1=`$ac_cv_path_LDD conftest$ac_exeext | grep lib$1\\.so | sed 's/^[[ ]]*\([[^ ]]*\)[[ ]]*=>.*$/\1/'` + if test "x$ac_cv_lib_soname_$1" = "x" + then + ac_cv_lib_soname_$1="lib$1.so" + fi], + [ac_cv_lib_soname_$1="lib$1.so"]) + LIBS=$ac_get_soname_save_LIBS]) +if test "x$ac_cv_lib_soname_$1" != xNONE +then AC_DEFINE_UNQUOTED(AS_TR_CPP(SONAME_LIB$1),"$ac_cv_lib_soname_$1", + [Define to the soname of the lib$1 library.])dnl +fi]) + +dnl **** Check if a structure contains a specified member **** +dnl +dnl Usage: WINE_CHECK_STRUCT_MEMBER(struct,member,[includes,[action-if-found,[action-if-not-found]]]) +dnl +AC_DEFUN([WINE_CHECK_STRUCT_MEMBER], +[AC_CACHE_CHECK([for $2 in struct $1], ac_cv_c_$1_$2, + AC_TRY_COMPILE([$3],[struct $1 s; s.$2 = 0],ac_cv_c_$1_$2="yes",ac_cv_c_$1_$2="no")) +AS_IF([ test "x$ac_cv_c_$1_$2" = "xyes"],[$4],[$5]) +]) + +dnl **** Check for reentrant libc **** +dnl +dnl Usage: WINE_CHECK_ERRNO(errno-name,[action-if-yes,[action-if-no]]) +dnl +dnl For cross-compiling we blindly assume that libc is reentrant. This is +dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions). +dnl +AC_DEFUN([WINE_CHECK_ERRNO], +[AC_CACHE_CHECK([for reentrant libc: $1],[wine_cv_libc_r_$1], + [AC_TRY_RUN([int myerrno = 0; +char buf[256]; +int *$1(){return &myerrno;} +main(){connect(0,buf,255); exit(!myerrno);}], + wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no, + wine_cv_libc_r_$1=yes)]) +AS_IF([test "$wine_cv_libc_r_$1" = "yes"],[$2],[$3])]) + +dnl **** Link C code with an assembly file **** +dnl +dnl Usage: WINE_TRY_ASM_LINK(asm-code,includes,function,[action-if-found,[action-if-not-found]]) +dnl +AC_DEFUN([WINE_TRY_ASM_LINK], +[ac_try_asm_link_saved_libs=$LIBS +LIBS="conftest_asm.s $LIBS" +cat > conftest_asm.s <&6 else - saved_cflags=$CFLAGS - CFLAGS="$CFLAGS -mpreferred-stack-boundary=2" - cat >conftest.$ac_ext <<_ACEOF + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -mpreferred-stack-boundary=2" +cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -9308,18 +9308,18 @@ else int main () { -return 0 + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' + { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9331,9 +9331,8 @@ else cat conftest.$ac_ext >&5 ac_cv_c_gcc_stack_boundary="no" fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS=$saved_cflags - +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved fi echo "$as_me:$LINENO: result: $ac_cv_c_gcc_stack_boundary" >&5 echo "${ECHO_T}$ac_cv_c_gcc_stack_boundary" >&6 @@ -9349,7 +9348,7 @@ echo $ECHO_N "checking whether .type must sit inside a .def directive... $ECHO_C if test "${ac_cv_c_type_in_def+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_libs=$LIBS + ac_try_asm_link_saved_libs=$LIBS LIBS="conftest_asm.s $LIBS" cat > conftest_asm.s <&5 ac_cv_c_type_in_def="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$saved_libs +rm -f conftest_asm.s +LIBS=$ac_try_asm_link_saved_libs fi echo "$as_me:$LINENO: result: $ac_cv_c_type_in_def" >&5 echo "${ECHO_T}$ac_cv_c_type_in_def" >&6 @@ -9413,7 +9413,7 @@ echo $ECHO_N "checking whether external symbols need an underscore prefix... $EC if test "${ac_cv_c_extern_prefix+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_libs=$LIBS + ac_try_asm_link_saved_libs=$LIBS LIBS="conftest_asm.s $LIBS" cat > conftest_asm.s <&5 ac_cv_c_extern_prefix="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$saved_libs +rm -f conftest_asm.s +LIBS=$ac_try_asm_link_saved_libs fi echo "$as_me:$LINENO: result: $ac_cv_c_extern_prefix" >&5 echo "${ECHO_T}$ac_cv_c_extern_prefix" >&6 @@ -9476,20 +9477,14 @@ echo $ECHO_N "checking whether stdcall symbols need to be decorated... $ECHO_C" if test "${ac_cv_c_stdcall_decoration+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_libs=$LIBS + ac_try_asm_link_saved_libs=$LIBS LIBS="conftest_asm.s $LIBS" -if test "$ac_cv_c_extern_prefix" = "yes" -then cat > conftest_asm.s < conftest_asm.s <conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -9503,7 +9498,7 @@ extern void __attribute__((__stdcall__)) ac_test(void); int main () { -ac_test(); return 0 +ac_test() ; return 0; } @@ -9527,7 +9522,8 @@ cat conftest.$ac_ext >&5 ac_cv_c_stdcall_decoration="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$saved_libs +rm -f conftest_asm.s +LIBS=$ac_try_asm_link_saved_libs fi echo "$as_me:$LINENO: result: $ac_cv_c_stdcall_decoration" >&5 echo "${ECHO_T}$ac_cv_c_stdcall_decoration" >&6 @@ -9546,7 +9542,7 @@ echo $ECHO_N "checking whether assembler accepts .string... $ECHO_C" >&6 if test "${ac_cv_c_asm_string+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_libs=$LIBS + ac_try_asm_link_saved_libs=$LIBS LIBS="conftest_asm.s $LIBS" cat > conftest_asm.s <&5 ac_cv_c_asm_string="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$saved_libs +rm -f conftest_asm.s +LIBS=$ac_try_asm_link_saved_libs fi echo "$as_me:$LINENO: result: $ac_cv_c_asm_string" >&5 echo "${ECHO_T}$ac_cv_c_asm_string" >&6 @@ -9961,9 +9958,9 @@ echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6 if test "${ac_cv_c_dll_gnuelf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_cflags=$CFLAGS - CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic" - cat >conftest.$ac_ext <<_ACEOF + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic" +cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -9976,7 +9973,7 @@ else int main () { -return 1 + ; return 0; } @@ -10000,8 +9997,7 @@ cat conftest.$ac_ext >&5 ac_cv_c_dll_gnuelf="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - CFLAGS=$saved_cflags - +CFLAGS=$ac_wine_try_cflags_saved fi echo "$as_me:$LINENO: result: $ac_cv_c_dll_gnuelf" >&5 echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6 @@ -10015,9 +10011,9 @@ echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" if test "${ac_cv_c_dll_unixware+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - saved_cflags=$CFLAGS - CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic" - cat >conftest.$ac_ext <<_ACEOF + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic" +cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" @@ -10030,7 +10026,7 @@ else int main () { -return 1 + ; return 0; } @@ -10054,8 +10050,7 @@ cat conftest.$ac_ext >&5 ac_cv_c_dll_unixware="no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - CFLAGS=$saved_cflags - +CFLAGS=$ac_wine_try_cflags_saved fi echo "$as_me:$LINENO: result: $ac_cv_c_dll_unixware" >&5 echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6 @@ -10109,11 +10104,318 @@ esac +if test "$LIBEXT" = "so" +then + # Extract the first word of "ldd", so it can be a program name with args. +set dummy ldd; 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_path_LDD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LDD in + [\\/]* | ?:[\\/]*) + ac_cv_path_LDD="$LDD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /sbin:/usr/sbin:$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_path_LDD" && ac_cv_path_LDD="true" + ;; +esac +fi +LDD=$ac_cv_path_LDD + +if test -n "$LDD"; then + echo "$as_me:$LINENO: result: $LDD" >&5 +echo "${ECHO_T}$LDD" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +echo "$as_me:$LINENO: checking for -lX11 soname" >&5 +echo $ECHO_N "checking for -lX11 soname... $ECHO_C" >&6 +if test "${ac_cv_lib_soname_X11+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_get_soname_save_LIBS=$LIBS +LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XCreateWindow (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XCreateWindow (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep libX11\\.so | sed 's/^[ ]*\([^ ]*\)[ ]*=>.*$/\1/'` + if test "x$ac_cv_lib_soname_X11" = "x" + then + ac_cv_lib_soname_X11="libX11.so" + fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_soname_X11="libX11.so" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_get_soname_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_soname_X11" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_X11" >&6 +if test "x$ac_cv_lib_soname_X11" != xNONE +then +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBX11 "$ac_cv_lib_soname_X11" +_ACEOF +fi + +echo "$as_me:$LINENO: checking for -lXext soname" >&5 +echo $ECHO_N "checking for -lXext soname... $ECHO_C" >&6 +if test "${ac_cv_lib_soname_Xext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_get_soname_save_LIBS=$LIBS +LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XextCreateExtension (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XextCreateExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep libXext\\.so | sed 's/^[ ]*\([^ ]*\)[ ]*=>.*$/\1/'` + if test "x$ac_cv_lib_soname_Xext" = "x" + then + ac_cv_lib_soname_Xext="libXext.so" + fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_soname_Xext="libXext.so" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_get_soname_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xext" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_Xext" >&6 +if test "x$ac_cv_lib_soname_Xext" != xNONE +then +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBXEXT "$ac_cv_lib_soname_Xext" +_ACEOF +fi + +echo "$as_me:$LINENO: checking for -lXrender soname" >&5 +echo $ECHO_N "checking for -lXrender soname... $ECHO_C" >&6 +if test "${ac_cv_lib_soname_Xrender+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_get_soname_save_LIBS=$LIBS +LIBS="-lXrender $X_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XRenderQueryExtension (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XRenderQueryExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrender\\.so | sed 's/^[ ]*\([^ ]*\)[ ]*=>.*$/\1/'` + if test "x$ac_cv_lib_soname_Xrender" = "x" + then + ac_cv_lib_soname_Xrender="libXrender.so" + fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_soname_Xrender="libXrender.so" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_get_soname_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_soname_Xrender" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_Xrender" >&6 +if test "x$ac_cv_lib_soname_Xrender" != xNONE +then +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBXRENDER "$ac_cv_lib_soname_Xrender" +_ACEOF +fi + +echo "$as_me:$LINENO: checking for -lfreetype soname" >&5 +echo $ECHO_N "checking for -lfreetype soname... $ECHO_C" >&6 +if test "${ac_cv_lib_soname_freetype+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_get_soname_save_LIBS=$LIBS +LIBS="-lfreetype $X_LIBS $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char FT_Init_FreeType (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +FT_Init_FreeType (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep libfreetype\\.so | sed 's/^[ ]*\([^ ]*\)[ ]*=>.*$/\1/'` + if test "x$ac_cv_lib_soname_freetype" = "x" + then + ac_cv_lib_soname_freetype="libfreetype.so" + fi +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_soname_freetype="libfreetype.so" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_get_soname_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_soname_freetype" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_freetype" >&6 +if test "x$ac_cv_lib_soname_freetype" != xNONE +then +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBFREETYPE "$ac_cv_lib_soname_freetype" +_ACEOF +fi +fi + wine_cv_libc_reentrant=no - - echo "$as_me:$LINENO: checking for reentrant libc: __errno_location" >&5 +echo "$as_me:$LINENO: checking for reentrant libc: __errno_location" >&5 echo $ECHO_N "checking for reentrant libc: __errno_location... $ECHO_C" >&6 if test "${wine_cv_libc_r___errno_location+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10150,17 +10452,13 @@ wine_cv_libc_r___errno_location=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi echo "$as_me:$LINENO: result: $wine_cv_libc_r___errno_location" >&5 echo "${ECHO_T}$wine_cv_libc_r___errno_location" >&6 -if test "$wine_cv_libc_r___errno_location" = "yes" -then - wine_cv_libc_reentrant=__errno_location -fi - - - echo "$as_me:$LINENO: checking for reentrant libc: __error" >&5 +if test "$wine_cv_libc_r___errno_location" = "yes"; then + wine_cv_libc_reentrant=__errno_location +else + echo "$as_me:$LINENO: checking for reentrant libc: __error" >&5 echo $ECHO_N "checking for reentrant libc: __error... $ECHO_C" >&6 if test "${wine_cv_libc_r___error+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10172,7 +10470,7 @@ else #line $LINENO "configure" #include "confdefs.h" int myerrno = 0; -char buf[256]; +char buf256; int *__error(){return &myerrno;} main(){connect(0,buf,255); exit(!myerrno);} _ACEOF @@ -10197,17 +10495,13 @@ wine_cv_libc_r___error=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi echo "$as_me:$LINENO: result: $wine_cv_libc_r___error" >&5 echo "${ECHO_T}$wine_cv_libc_r___error" >&6 -if test "$wine_cv_libc_r___error" = "yes" -then - wine_cv_libc_reentrant=__error -fi - - - echo "$as_me:$LINENO: checking for reentrant libc: ___errno" >&5 +if test "$wine_cv_libc_r___error" = "yes"; then + wine_cv_libc_reentrant=__error +else + echo "$as_me:$LINENO: checking for reentrant libc: ___errno" >&5 echo $ECHO_N "checking for reentrant libc: ___errno... $ECHO_C" >&6 if test "${wine_cv_libc_r____errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10219,7 +10513,7 @@ else #line $LINENO "configure" #include "confdefs.h" int myerrno = 0; -char buf[256]; +char buf256; int *___errno(){return &myerrno;} main(){connect(0,buf,255); exit(!myerrno);} _ACEOF @@ -10244,17 +10538,13 @@ wine_cv_libc_r____errno=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi echo "$as_me:$LINENO: result: $wine_cv_libc_r____errno" >&5 echo "${ECHO_T}$wine_cv_libc_r____errno" >&6 -if test "$wine_cv_libc_r____errno" = "yes" -then - wine_cv_libc_reentrant=___errno -fi - - - echo "$as_me:$LINENO: checking for reentrant libc: __thr_errno" >&5 +if test "$wine_cv_libc_r____errno" = "yes"; then + wine_cv_libc_reentrant=___errno +else + echo "$as_me:$LINENO: checking for reentrant libc: __thr_errno" >&5 echo $ECHO_N "checking for reentrant libc: __thr_errno... $ECHO_C" >&6 if test "${wine_cv_libc_r___thr_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10266,7 +10556,7 @@ else #line $LINENO "configure" #include "confdefs.h" int myerrno = 0; -char buf[256]; +char buf256; int *__thr_errno(){return &myerrno;} main(){connect(0,buf,255); exit(!myerrno);} _ACEOF @@ -10291,17 +10581,13 @@ wine_cv_libc_r___thr_errno=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi echo "$as_me:$LINENO: result: $wine_cv_libc_r___thr_errno" >&5 echo "${ECHO_T}$wine_cv_libc_r___thr_errno" >&6 -if test "$wine_cv_libc_r___thr_errno" = "yes" -then - wine_cv_libc_reentrant=__thr_errno -fi - - - echo "$as_me:$LINENO: checking for reentrant libc: __errno" >&5 +if test "$wine_cv_libc_r___thr_errno" = "yes"; then + wine_cv_libc_reentrant=__thr_errno +else + echo "$as_me:$LINENO: checking for reentrant libc: __errno" >&5 echo $ECHO_N "checking for reentrant libc: __errno... $ECHO_C" >&6 if test "${wine_cv_libc_r___errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10313,7 +10599,7 @@ else #line $LINENO "configure" #include "confdefs.h" int myerrno = 0; -char buf[256]; +char buf256; int *__errno(){return &myerrno;} main(){connect(0,buf,255); exit(!myerrno);} _ACEOF @@ -10338,13 +10624,20 @@ wine_cv_libc_r___errno=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi echo "$as_me:$LINENO: result: $wine_cv_libc_r___errno" >&5 echo "${ECHO_T}$wine_cv_libc_r___errno" >&6 -if test "$wine_cv_libc_r___errno" = "yes" -then - wine_cv_libc_reentrant=__errno +if test "$wine_cv_libc_r___errno" = "yes"; then + wine_cv_libc_reentrant=__errno +fi + + +fi + +fi + +fi + fi @@ -12468,10 +12761,6 @@ _ACEOF fi - - - - echo "$as_me:$LINENO: checking for f_bfree in struct statfs" >&5 echo $ECHO_N "checking for f_bfree in struct statfs... $ECHO_C" >&6 if test "${ac_cv_c_statfs_f_bfree+set}" = set; then @@ -12817,8 +13106,6 @@ fi - - ac_config_commands="$ac_config_commands controls" ac_config_commands="$ac_config_commands dlls/ddraw/d3ddevice" @@ -13709,6 +13996,7 @@ s,@LDSHARED@,$LDSHARED,;t t s,@LDDLLFLAGS@,$LDDLLFLAGS,;t t s,@LIBEXT@,$LIBEXT,;t t s,@LDPATH@,$LDPATH,;t t +s,@LDD@,$LDD,;t t s,@ALLOCA@,$ALLOCA,;t t /@MAKE_RULES@/r $MAKE_RULES s,@MAKE_RULES@,,;t t diff --git a/configure.ac b/configure.ac index 250e5458537..68245e699fd 100644 --- a/configure.ac +++ b/configure.ac @@ -622,13 +622,9 @@ int main(void) { fi dnl Check for -mpreferred-stack-boundary - AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], - ac_cv_c_gcc_stack_boundary, - [saved_cflags=$CFLAGS - CFLAGS="$CFLAGS -mpreferred-stack-boundary=2" - AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no") - CFLAGS=$saved_cflags - ]) + AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support], ac_cv_c_gcc_stack_boundary, + [WINE_TRY_CFLAGS([-mpreferred-stack-boundary=2], + ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")]) if test "$ac_cv_c_gcc_stack_boundary" = "yes" then CFLAGS="$CFLAGS -mpreferred-stack-boundary=2" @@ -637,18 +633,13 @@ fi dnl **** Check if we need to place .type inside a .def directive **** -AC_CACHE_CHECK([whether .type must sit inside a .def directive], - ac_cv_c_type_in_def, -[saved_libs=$LIBS -LIBS="conftest_asm.s $LIBS" -cat > conftest_asm.s < conftest_asm.s < conftest_asm.s < conftest_asm.s < conftest_asm.s < #endif +#ifndef SONAME_LIBFREETYPE +#define SONAME_LIBFREETYPE "libfreetype.so" +#endif + static FT_Library library = 0; static void *ft_handle = NULL; @@ -242,7 +246,7 @@ static BOOL AddFontFileToList(char *file) for(insertface = &family->FirstFace; *insertface; insertface = &(*insertface)->next) { if(!strcmpW((*insertface)->StyleName, StyleW)) { - ERR("Already loaded font %s %s\n", debugstr_w(family->FamilyName), + WARN("Already loaded font %s %s\n", debugstr_w(family->FamilyName), debugstr_w(StyleW)); HeapFree(GetProcessHeap(), 0, StyleW); pFT_Done_Face(ft_face); @@ -449,7 +453,7 @@ BOOL WineEngInit(void) TRACE("\n"); - ft_handle = wine_dlopen("libfreetype.so", RTLD_NOW, NULL, 0); + ft_handle = wine_dlopen(SONAME_LIBFREETYPE, RTLD_NOW, NULL, 0); if(!ft_handle) { WINE_MESSAGE( "Wine cannot find the FreeType font library. To enable Wine to\n" diff --git a/dlls/wineps/truetype.c b/dlls/wineps/truetype.c index d670809c16e..55500f08988 100644 --- a/dlls/wineps/truetype.c +++ b/dlls/wineps/truetype.c @@ -78,6 +78,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); FT_LOAD_IGNORE_TRANSFORM | \ FT_LOAD_LINEAR_DESIGN ) +#ifndef SONAME_LIBFREETYPE +#define SONAME_LIBFREETYPE "libfreetype.so" +#endif + static void *ft_handle = NULL; #define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL; @@ -590,7 +594,7 @@ BOOL PSDRV_GetTrueTypeMetrics(void) return TRUE; - ft_handle = wine_dlopen("libfreetype.so", RTLD_NOW, NULL, 0); + ft_handle = wine_dlopen(SONAME_LIBFREETYPE, RTLD_NOW, NULL, 0); if(!ft_handle) { WINE_MESSAGE( "Wine cannot find the FreeType font library. To enable Wine to\n" diff --git a/dlls/x11drv/xrender.c b/dlls/x11drv/xrender.c index 15cc22f547d..fe4c877de09 100644 --- a/dlls/x11drv/xrender.c +++ b/dlls/x11drv/xrender.c @@ -82,6 +82,17 @@ static INT mru = -1; static int antialias = 1; +/* some default values just in case */ +#ifndef SONAME_LIBX11 +#define SONAME_LIBX11 "libX11.so" +#endif +#ifndef SONAME_LIBXEXT +#define SONAME_LIBXEXT "libXext.so" +#endif +#ifndef SONAME_LIBXRENDER +#define SONAME_LIBXRENDER "libXrender.so" +#endif + static void *xrender_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f; @@ -111,10 +122,9 @@ void X11DRV_XRender_Init(void) int error_base, event_base, i; XRenderPictFormat pf; - /* FIXME: should find correct soname at compile time */ - if (!wine_dlopen("libX11.so", RTLD_NOW|RTLD_GLOBAL, NULL, 0)) return; - if (!wine_dlopen("libXext.so", RTLD_NOW|RTLD_GLOBAL, NULL, 0)) return; - xrender_handle = wine_dlopen("libXrender.so", RTLD_NOW, NULL, 0); + if (!wine_dlopen(SONAME_LIBX11, RTLD_NOW|RTLD_GLOBAL, NULL, 0)) return; + if (!wine_dlopen(SONAME_LIBXEXT, RTLD_NOW|RTLD_GLOBAL, NULL, 0)) return; + xrender_handle = wine_dlopen(SONAME_LIBXRENDER, RTLD_NOW, NULL, 0); if(!xrender_handle) return; #define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(xrender_handle, #f, NULL, 0)) == NULL) goto sym_not_found; diff --git a/include/config.h.in b/include/config.h.in index 6343b39d34a..52d1616bc7a 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -638,6 +638,18 @@ /* The size of a `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG +/* Define to the soname of the libfreetype library. */ +#undef SONAME_LIBFREETYPE + +/* Define to the soname of the libX11 library. */ +#undef SONAME_LIBX11 + +/* Define to the soname of the libXext library. */ +#undef SONAME_LIBXEXT + +/* Define to the soname of the libXrender library. */ +#undef SONAME_LIBXRENDER + /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time.