From 00cf13a6e192e936b0eb386d94b89c89293a94e2 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 14 Sep 2004 19:27:58 +0000 Subject: [PATCH] Autodetect libgif so extension and try to load it. --- configure | 74 ++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + dlls/oleaut32/olepicture.c | 15 ++++++---- include/config.h.in | 3 ++ 4 files changed, 88 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 9255a4dfe7d..c70f226ed12 100755 --- a/configure +++ b/configure @@ -15546,6 +15546,80 @@ cat >>confdefs.h <<_ACEOF #define SONAME_LIBUNGIF "$ac_cv_lib_soname_ungif" _ACEOF fi + +echo "$as_me:$LINENO: checking for -lgif soname" >&5 +echo $ECHO_N "checking for -lgif soname... $ECHO_C" >&6 +if test "${ac_cv_lib_soname_gif+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_get_soname_save_LIBS=$LIBS +LIBS="-lgif $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 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 DGifOpen (); +int +main () +{ +DGifOpen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (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); }; } && + { 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_gif=`$ac_cv_path_LDD conftest$ac_exeext | grep libgif\\.$LIBEXT | sed "s/^.*\(libgif\.$LIBEXT[^ ]*\).*$/\1/"` + if test "x$ac_cv_lib_soname_gif" = "x" + then + ac_cv_lib_soname_gif="libgif.$LIBEXT" + fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_soname_gif="libgif.$LIBEXT" +fi +rm -f conftest.err 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_gif" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_gif" >&6 +if test "x$ac_cv_lib_soname_gif" != xNONE +then +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBGIF "$ac_cv_lib_soname_gif" +_ACEOF +fi fi diff --git a/configure.ac b/configure.ac index 62c3c006c4e..fdfc6d56b75 100644 --- a/configure.ac +++ b/configure.ac @@ -1028,6 +1028,7 @@ then WINE_GET_SONAME(curses,waddch) WINE_GET_SONAME(jpeg,jpeg_start_decompress) WINE_GET_SONAME(ungif,DGifOpen) + WINE_GET_SONAME(gif,DGifOpen) fi diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index b1fa7fee278..198a55d0a3d 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -50,9 +50,12 @@ */ #ifdef HAVE_GIF_LIB_H # include -#ifndef SONAME_LIBUNGIF -#define SONAME_LIBUNGIF "libungif.so" -#endif +# ifndef SONAME_LIBUNGIF +# define SONAME_LIBUNGIF "libungif.so" +# endif +# ifndef SONAME_LIBGIF +# define SONAME_LIBGIF "libgif.so" +# endif #endif #define NONAMELESSUNION @@ -903,7 +906,9 @@ struct gifdata { static void *load_libungif(void) { - if((libungif_handle = wine_dlopen(SONAME_LIBUNGIF, RTLD_NOW, NULL, 0)) != NULL) { + if(((libungif_handle = wine_dlopen(SONAME_LIBUNGIF, RTLD_NOW, NULL, 0)) != NULL) || + ((libungif_handle = wine_dlopen(SONAME_LIBGIF , RTLD_NOW, NULL, 0)) != NULL) + ) { #define LOAD_FUNCPTR(f) \ if((p##f = wine_dlsym(libungif_handle, #f, NULL, 0)) == NULL) { \ @@ -1022,7 +1027,7 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) { if(!libungif_handle) { if(!load_libungif()) { - FIXME("Failed reading GIF because unable to find %s\n", SONAME_LIBUNGIF); + FIXME("Failed reading GIF because unable to find %s/%s\n", SONAME_LIBUNGIF, SONAME_LIBGIF); return E_FAIL; } } diff --git a/include/config.h.in b/include/config.h.in index bf1561d1983..8143a621e82 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -881,6 +881,9 @@ /* Define to the soname of the libfreetype library. */ #undef SONAME_LIBFREETYPE +/* Define to the soname of the libgif library. */ +#undef SONAME_LIBGIF + /* Define to the soname of the libGL library. */ #undef SONAME_LIBGL -- 2.11.4.GIT