From 2ffc7e2c2d9fd1a5384fc7d5705fe7ec8991c552 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 1 Jan 2007 13:44:45 +0100 Subject: [PATCH] configure: Use the correct ar tool when building Mingw import libraries. --- configure | 143 +++++++++++++++++++++++++++++++++++++++++- configure.ac | 2 + dlls/Makedll.rules.in | 4 +- 3 files changed, 146 insertions(+), 3 deletions(-) diff --git a/configure b/configure index a68d2d16424..2bcd9ea70df 100755 --- a/configure +++ b/configure @@ -754,6 +754,7 @@ IMPLIBEXT LIBWINE_LDFLAGS DLLTOOL DLLWRAP +MINGWAR COREFOUNDATIONLIB IOKITLIB LDEXECFLAGS @@ -13437,6 +13438,102 @@ else DLLWRAP="$ac_cv_prog_DLLWRAP" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; 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_MINGWAR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MINGWAR"; then + ac_cv_prog_MINGWAR="$MINGWAR" # 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_MINGWAR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +MINGWAR=$ac_cv_prog_MINGWAR +if test -n "$MINGWAR"; then + { echo "$as_me:$LINENO: result: $MINGWAR" >&5 +echo "${ECHO_T}$MINGWAR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MINGWAR"; then + ac_ct_MINGWAR=$MINGWAR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; 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_ac_ct_MINGWAR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_MINGWAR"; then + ac_cv_prog_ac_ct_MINGWAR="$ac_ct_MINGWAR" # 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_ac_ct_MINGWAR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_MINGWAR=$ac_cv_prog_ac_ct_MINGWAR +if test -n "$ac_ct_MINGWAR"; then + { echo "$as_me:$LINENO: result: $ac_ct_MINGWAR" >&5 +echo "${ECHO_T}$ac_ct_MINGWAR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_MINGWAR" = x; then + MINGWAR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + MINGWAR=$ac_ct_MINGWAR + fi +else + MINGWAR="$ac_cv_prog_MINGWAR" +fi + if test "$DLLWRAP" = "false"; then LIBEXT="a" else @@ -14245,6 +14342,49 @@ fi done test -n "$CROSSWINDRES" || CROSSWINDRES="false" + for ac_prog in i586-mingw32msvc-ar i386-mingw32msvc-ar i386-mingw32-ar mingw32-ar mingw-ar +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_MINGWAR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MINGWAR"; then + ac_cv_prog_MINGWAR="$MINGWAR" # 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_MINGWAR="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +MINGWAR=$ac_cv_prog_MINGWAR +if test -n "$MINGWAR"; then + { echo "$as_me:$LINENO: result: $MINGWAR" >&5 +echo "${ECHO_T}$MINGWAR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$MINGWAR" && break +done +test -n "$MINGWAR" || MINGWAR="false" + if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi fi ;; @@ -21438,6 +21578,7 @@ IMPLIBEXT!$IMPLIBEXT$ac_delim LIBWINE_LDFLAGS!$LIBWINE_LDFLAGS$ac_delim DLLTOOL!$DLLTOOL$ac_delim DLLWRAP!$DLLWRAP$ac_delim +MINGWAR!$MINGWAR$ac_delim COREFOUNDATIONLIB!$COREFOUNDATIONLIB$ac_delim IOKITLIB!$IOKITLIB$ac_delim LDEXECFLAGS!$LDEXECFLAGS$ac_delim @@ -21460,7 +21601,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` = 77; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 78; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 92552d355bc..6fad99e8001 100644 --- a/configure.ac +++ b/configure.ac @@ -992,6 +992,7 @@ case $host_os in cygwin*|mingw32*) AC_CHECK_TOOL(DLLTOOL,dlltool,false) AC_CHECK_TOOL(DLLWRAP,dllwrap,false) + AC_CHECK_TOOL(MINGWAR,ar,false) if test "$DLLWRAP" = "false"; then LIBEXT="a" else @@ -1104,6 +1105,7 @@ case $host_os in WINE_CHECK_MINGW_PROG(CROSSCC,gcc,false) WINE_CHECK_MINGW_PROG(DLLTOOL,dlltool,false) WINE_CHECK_MINGW_PROG(CROSSWINDRES,windres,false) + WINE_CHECK_MINGW_PROG(MINGWAR,ar,false) if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi fi ;; diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in index 632730fa918..fe777841da7 100644 --- a/dlls/Makedll.rules.in +++ b/dlls/Makedll.rules.in @@ -12,6 +12,7 @@ DLLFLAGS = @DLLFLAGS@ DLLEXT = @DLLEXT@ IMPLIBEXT = @IMPLIBEXT@ +MINGWAR = @MINGWAR@ DEFS = -D__WINESRC__ $(EXTRADEFS) BASEMODULE = $(MODULE:%.dll=%) MAINSPEC = $(BASEMODULE).spec @@ -56,8 +57,7 @@ lib$(BASEMODULE).def.a: $(IMPLIB_OBJS) lib$(BASEMODULE).a: $(SPEC_DEF) $(IMPLIB_OBJS) $(DLLTOOL) -k -l $@ -d $(SPEC_DEF) - $(AR) $@ $(IMPLIB_OBJS) - $(RANLIB) $@ + $(MINGWAR) rs $@ $(IMPLIB_OBJS) $(SUBDIRS): implib