Fixed dll check for cygwin.

This commit is contained in:
Alexandre Julliard 2002-05-07 18:33:47 +00:00
parent ab5bba62f9
commit 466ae143ee
2 changed files with 103 additions and 104 deletions

132
configure vendored
View File

@ -9461,14 +9461,59 @@ LDSHARED=""
LDDLLFLAGS="" LDDLLFLAGS=""
if test "$LIBEXT" = "so" if test "$LIBEXT" = "so"
then then
echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5 case $target_os in
*cygwin*)
# Extract the first word of "dllwrap", so it can be a program name with args.
set dummy dllwrap; 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_DLLWRAP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$DLLWRAP"; then
ac_cv_prog_DLLWRAP="$DLLWRAP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLWRAP="dllwrap"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
test -z "$ac_cv_prog_DLLWRAP" && ac_cv_prog_DLLWRAP="false"
fi
fi
DLLWRAP=$ac_cv_prog_DLLWRAP
if test -n "$DLLWRAP"; then
echo "$as_me:$LINENO: result: $DLLWRAP" >&5
echo "${ECHO_T}$DLLWRAP" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$DLLWRAP" = "dllwrap"; then
LIBEXT="dll"
else
LIBEXT="a"
fi
;;
*)
echo "$as_me:$LINENO: checking whether we can build a GNU style ELF dll" >&5
echo $ECHO_N "checking whether we can build a GNU style ELF dll... $ECHO_C" >&6 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 if test "${ac_cv_c_dll_gnuelf+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
saved_cflags=$CFLAGS saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic" CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
#include "confdefs.h" #include "confdefs.h"
@ -9505,24 +9550,24 @@ cat conftest.$ac_ext >&5
ac_cv_c_dll_gnuelf="no" ac_cv_c_dll_gnuelf="no"
fi fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
CFLAGS=$saved_cflags CFLAGS=$saved_cflags
fi fi
echo "$as_me:$LINENO: result: $ac_cv_c_dll_gnuelf" >&5 echo "$as_me:$LINENO: result: $ac_cv_c_dll_gnuelf" >&5
echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6 echo "${ECHO_T}$ac_cv_c_dll_gnuelf" >&6
if test "$ac_cv_c_dll_gnuelf" = "yes" if test "$ac_cv_c_dll_gnuelf" = "yes"
then then
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)" LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
LDDLLFLAGS="-Wl,-Bsymbolic" LDDLLFLAGS="-Wl,-Bsymbolic"
else else
echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5 echo "$as_me:$LINENO: checking whether we can build a UnixWare (Solaris) dll" >&5
echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6 echo $ECHO_N "checking whether we can build a UnixWare (Solaris) dll... $ECHO_C" >&6
if test "${ac_cv_c_dll_unixware+set}" = set; then if test "${ac_cv_c_dll_unixware+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
saved_cflags=$CFLAGS saved_cflags=$CFLAGS
CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic" CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
#include "confdefs.h" #include "confdefs.h"
@ -9559,64 +9604,19 @@ cat conftest.$ac_ext >&5
ac_cv_c_dll_unixware="no" ac_cv_c_dll_unixware="no"
fi fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
CFLAGS=$saved_cflags CFLAGS=$saved_cflags
fi fi
echo "$as_me:$LINENO: result: $ac_cv_c_dll_unixware" >&5 echo "$as_me:$LINENO: result: $ac_cv_c_dll_unixware" >&5
echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6 echo "${ECHO_T}$ac_cv_c_dll_unixware" >&6
if test "$ac_cv_c_dll_unixware" = "yes" if test "$ac_cv_c_dll_unixware" = "yes"
then then
LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
LDDLLFLAGS="-Wl,-B,symbolic" LDDLLFLAGS="-Wl,-B,symbolic"
fi fi
fi fi
if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no" ;;
then esac
LIBEXT="a"
# Extract the first word of "dllwrap", so it can be a program name with args.
set dummy dllwrap; 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_DLLWRAP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$DLLWRAP"; then
ac_cv_prog_DLLWRAP="$DLLWRAP" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLWRAP="dllwrap"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
test -z "$ac_cv_prog_DLLWRAP" && ac_cv_prog_DLLWRAP="false"
fi
fi
DLLWRAP=$ac_cv_prog_DLLWRAP
if test -n "$DLLWRAP"; then
echo "$as_me:$LINENO: result: $DLLWRAP" >&5
echo "${ECHO_T}$DLLWRAP" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
if test "$DLLWRAP" = "dllwrap"; then
case $host_os in
*cygwin*)
LIBEXT="dll"
;;
esac
fi
fi
fi fi
if test "$LIBEXT" = "a"; then if test "$LIBEXT" = "a"; then

View File

@ -712,44 +712,43 @@ LDSHARED=""
LDDLLFLAGS="" LDDLLFLAGS=""
if test "$LIBEXT" = "so" if test "$LIBEXT" = "so"
then then
AC_CACHE_CHECK([whether we can build a GNU style ELF dll], case $target_os in
ac_cv_c_dll_gnuelf, *cygwin*)
[saved_cflags=$CFLAGS AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic" if test "$DLLWRAP" = "dllwrap"; then
AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no") dnl FIXME - check whether dllwrap works correctly...
CFLAGS=$saved_cflags LIBEXT="dll"
]) else
if test "$ac_cv_c_dll_gnuelf" = "yes" LIBEXT="a"
then fi
LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)" ;;
LDDLLFLAGS="-Wl,-Bsymbolic" *)
else AC_CACHE_CHECK([whether we can build a GNU style ELF dll],ac_cv_c_dll_gnuelf,
AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, [saved_cflags=$CFLAGS
ac_cv_c_dll_unixware, CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
[saved_cflags=$CFLAGS AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic" CFLAGS=$saved_cflags
AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no") ])
CFLAGS=$saved_cflags if test "$ac_cv_c_dll_gnuelf" = "yes"
]) then
if test "$ac_cv_c_dll_unixware" = "yes" LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
then LDDLLFLAGS="-Wl,-Bsymbolic"
LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)" else
LDDLLFLAGS="-Wl,-B,symbolic" AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
fi ac_cv_c_dll_unixware,
fi [saved_cflags=$CFLAGS
if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no" CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
then AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
LIBEXT="a" CFLAGS=$saved_cflags
AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false) ])
if test "$DLLWRAP" = "dllwrap"; then if test "$ac_cv_c_dll_unixware" = "yes"
dnl FIXME - check whether dllwrap works correctly... then
case $host_os in LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
*cygwin*) LDDLLFLAGS="-Wl,-B,symbolic"
LIBEXT="dll" fi
;; fi
esac ;;
fi esac
fi
fi fi
if test "$LIBEXT" = "a"; then if test "$LIBEXT" = "a"; then