configure: Make the libjpeg soname check depend on the header check.

This commit is contained in:
Alexandre Julliard 2007-07-02 19:53:14 +02:00
parent f91909b3b0
commit d0fddf4f68
5 changed files with 95 additions and 96 deletions

160
configure vendored
View File

@ -13984,6 +13984,88 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
fi
fi
if test "$ac_cv_header_jpeglib_h" = "yes"
then
{ echo "$as_me:$LINENO: checking for -ljpeg" >&5
echo $ECHO_N "checking for -ljpeg... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_jpeg+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-ljpeg $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 jpeg_start_decompress ();
int
main ()
{
return jpeg_start_decompress ();
;
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_jpeg=`otool -L conftest$ac_exeext | grep "libjpeg\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_jpeg=`$ac_cv_path_LDD conftest$ac_exeext | grep "libjpeg\\.$LIBEXT" | sed -e "s/^.*\(libjpeg\.$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_jpeg" = "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_jpeg" >&5
echo "${ECHO_T}$ac_cv_lib_soname_jpeg" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBJPEG "$ac_cv_lib_soname_jpeg"
_ACEOF
fi fi
fi fi
@ -15478,84 +15560,6 @@ _ACEOF
fi fi
{ echo "$as_me:$LINENO: checking for -ljpeg" >&5
echo $ECHO_N "checking for -ljpeg... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_jpeg+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-ljpeg $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 jpeg_start_decompress ();
int
main ()
{
return jpeg_start_decompress ();
;
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_jpeg=`otool -L conftest$ac_exeext | grep "libjpeg\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libjpeg\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_jpeg=`$ac_cv_path_LDD conftest$ac_exeext | grep "libjpeg\\.$LIBEXT" | sed -e "s/^.*\(libjpeg\.$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_jpeg" = "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_jpeg" >&5
echo "${ECHO_T}$ac_cv_lib_soname_jpeg" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBJPEG "$ac_cv_lib_soname_jpeg"
_ACEOF
fi

View File

@ -992,6 +992,12 @@ then
WINE_CHECK_SONAME(crypto,BIO_new_socket) WINE_CHECK_SONAME(crypto,BIO_new_socket)
fi fi
dnl **** Check for libjpeg ****
if test "$ac_cv_header_jpeglib_h" = "yes"
then
WINE_CHECK_SONAME(jpeg,jpeg_start_decompress)
fi
dnl **** Check for gcc specific options **** dnl **** Check for gcc specific options ****
AC_SUBST(EXTRACFLAGS,"") AC_SUBST(EXTRACFLAGS,"")
@ -1140,7 +1146,6 @@ WINE_CHECK_SONAME(Xcursor,XcursorImageLoadCursor,,,[$X_LIBS -lX11 $X_EXTRA_LIBS]
WINE_CHECK_SONAME(freetype,FT_Init_FreeType,,,[$X_LIBS]) WINE_CHECK_SONAME(freetype,FT_Init_FreeType,,,[$X_LIBS])
WINE_CHECK_SONAME(GL,glXQueryExtension,,,[$X_LIBS $X_EXTRA_LIBS]) WINE_CHECK_SONAME(GL,glXQueryExtension,,,[$X_LIBS $X_EXTRA_LIBS])
WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1) WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)
WINE_CHECK_SONAME(jpeg,jpeg_start_decompress)
dnl **** Check for functions **** dnl **** Check for functions ****

View File

@ -47,10 +47,6 @@ MAKE_FUNCPTR(jpeg_finish_decompress);
MAKE_FUNCPTR(jpeg_destroy_decompress); MAKE_FUNCPTR(jpeg_destroy_decompress);
#undef MAKE_FUNCPTR #undef MAKE_FUNCPTR
#ifndef SONAME_LIBJPEG
#define SONAME_LIBJPEG "libjpeg" SONAME_EXT
#endif
static void *load_libjpeg(void) static void *load_libjpeg(void)
{ {
if((libjpeg_handle = wine_dlopen(SONAME_LIBJPEG, RTLD_NOW, NULL, 0)) != NULL) { if((libjpeg_handle = wine_dlopen(SONAME_LIBJPEG, RTLD_NOW, NULL, 0)) != NULL) {

View File

@ -24,7 +24,7 @@
# error You must include config.h first # error You must include config.h first
#endif #endif
#if defined(HAVE_GPHOTO2) && !defined(HAVE_JPEGLIB_H) #if defined(HAVE_GPHOTO2) && !defined(SONAME_LIBJPEG)
# warning "gphoto2 support in twain needs jpeg development headers" # warning "gphoto2 support in twain needs jpeg development headers"
# undef HAVE_GPHOTO2 # undef HAVE_GPHOTO2
#endif #endif
@ -38,7 +38,7 @@
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_JPEGLIB_H #ifdef SONAME_LIBJPEG
/* This is a hack, so jpeglib.h does not redefine INT32 and the like*/ /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
# define XMD_H # define XMD_H
# define UINT8 JPEG_UINT8 # define UINT8 JPEG_UINT8
@ -46,9 +46,6 @@
# undef FAR # undef FAR
# include <jpeglib.h> # include <jpeglib.h>
# undef UINT16 # undef UINT16
# ifndef SONAME_LIBJPEG
# define SONAME_LIBJPEG "libjpeg" SONAME_EXT
# endif
#endif #endif
#include <stdarg.h> #include <stdarg.h>
@ -96,7 +93,7 @@ struct tagActiveDS
#ifdef HAVE_GPHOTO2 #ifdef HAVE_GPHOTO2
CameraFile *file; CameraFile *file;
#endif #endif
#ifdef HAVE_JPEGLIB_H #ifdef SONAME_LIBJPEG
struct jpeg_source_mgr xjsm; struct jpeg_source_mgr xjsm;
struct jpeg_decompress_struct jd; struct jpeg_decompress_struct jd;
struct jpeg_error_mgr jerr; struct jpeg_error_mgr jerr;

View File

@ -67,7 +67,7 @@
#include "wine/wingdi16.h" #include "wine/wingdi16.h"
#ifdef HAVE_JPEGLIB_H #ifdef SONAME_LIBJPEG
/* This is a hack, so jpeglib.h does not redefine INT32 and the like*/ /* This is a hack, so jpeglib.h does not redefine INT32 and the like*/
#define XMD_H #define XMD_H
#define UINT8 JPEG_UINT8 #define UINT8 JPEG_UINT8
@ -77,9 +77,6 @@
# include <jpeglib.h> # include <jpeglib.h>
#undef jpeg_boolean #undef jpeg_boolean
#undef UINT16 #undef UINT16
#ifndef SONAME_LIBJPEG
#define SONAME_LIBJPEG "libjpeg" SONAME_EXT
#endif
#endif #endif
#include "ungif.h" #include "ungif.h"
@ -937,7 +934,7 @@ static HRESULT WINAPI OLEPictureImpl_IsDirty(
return E_NOTIMPL; return E_NOTIMPL;
} }
#ifdef HAVE_JPEGLIB_H #ifdef SONAME_LIBJPEG
static void *libjpeg_handle; static void *libjpeg_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f #define MAKE_FUNCPTR(f) static typeof(f) * p##f
@ -991,7 +988,7 @@ static boolean _jpeg_resync_to_restart(j_decompress_ptr cinfo, int desired) {
return FALSE; return FALSE;
} }
static void _jpeg_term_source(j_decompress_ptr cinfo) { } static void _jpeg_term_source(j_decompress_ptr cinfo) { }
#endif /* HAVE_JPEGLIB_H */ #endif /* SONAME_LIBJPEG */
struct gifdata { struct gifdata {
unsigned char *data; unsigned char *data;
@ -1210,7 +1207,7 @@ static HRESULT OLEPictureImpl_LoadGif(OLEPictureImpl *This, BYTE *xbuf, ULONG xr
static HRESULT OLEPictureImpl_LoadJpeg(OLEPictureImpl *This, BYTE *xbuf, ULONG xread) static HRESULT OLEPictureImpl_LoadJpeg(OLEPictureImpl *This, BYTE *xbuf, ULONG xread)
{ {
#ifdef HAVE_JPEGLIB_H #ifdef SONAME_LIBJPEG
struct jpeg_decompress_struct jd; struct jpeg_decompress_struct jd;
struct jpeg_error_mgr jerr; struct jpeg_error_mgr jerr;
int ret; int ret;