Alexandre Julliard : configure: Only check for the static versions of libicu.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 7 15:26:42 CDT 2007


Module: wine
Branch: master
Commit: bb168aaba84fe0584fb0be9a0e0531c36b8fa602
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bb168aaba84fe0584fb0be9a0e0531c36b8fa602

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon May  7 17:06:48 2007 +0200

configure: Only check for the static versions of libicu.

Get rid of hardcoded path names to avoid trouble on 64-bit platforms.
Based on a patch by Robert Millan.

---

 configure    |   67 ++++++++++++++++++++++++++++++---------------------------
 configure.ac |   25 +++++++++++----------
 2 files changed, 48 insertions(+), 44 deletions(-)

diff --git a/configure b/configure
index 44d6f0e..c6481f8 100755
--- a/configure
+++ b/configure
@@ -10364,66 +10364,69 @@ fi
 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
 then
     saved_libs="$LIBS"
-    for i in ${ICU_LIB_DIR-/usr/lib}/libsicu ${ICU_LIB_DIR-/usr/lib}/libicu
-    do
-        TEST_ICUUC_LIB="${ICUUC_LIB-${i}uc.a}"
-        TEST_ICUDATA_LIB="${ICUDATA_LIB-${i}data.a}"
-        { echo "$as_me:$LINENO: checking whether can link with ICU libraries $TEST_ICUUC_LIB and $TEST_ICUDATA_LIB" >&5
-echo $ECHO_N "checking whether can link with ICU libraries $TEST_ICUUC_LIB and $TEST_ICUDATA_LIB... $ECHO_C" >&6; }
-        LIBS="$saved_libs $TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s"
-    	cat >conftest.$ac_ext <<_ACEOF
+    icu_libs="-lsicuuc -lsicudata -lstdc++ -lgcc_s"
+    if test -n "$ICU_LIB_DIR"
+    then
+        icu_libs="-L$ICU_LIB_DIR $icu_libs"
+    fi
+    { echo "$as_me:$LINENO: checking whether can link with ICU libraries" >&5
+echo $ECHO_N "checking whether can link with ICU libraries... $ECHO_C" >&6; }
+    LIBS="$saved_libs $icu_libs"
+    if test "$cross_compiling" = yes; then
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <unicode/ubidi.h>
-int
-main ()
-{
-ubidi_open()
-  ;
-  return 0;
-}
+main () { ubidi_open(); return 0; }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f 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
+  (eval "$ac_link") 2>&5
   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
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (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_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ICU 1
 _ACEOF
 
-            	     ICULIBS="$TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s"
+                 ICULIBS="icu_libs"
 
-                     { echo "$as_me:$LINENO: result: yes" >&5
+                 { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
+( exit $ac_status )
+{ echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-    done
     LIBS="$saved_libs"
 fi
 
diff --git a/configure.ac b/configure.ac
index b62c0a5..683e753 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,18 +593,19 @@ dnl **** Check for the ICU library ****
 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
 then
     saved_libs="$LIBS"
-    for i in ${ICU_LIB_DIR-/usr/lib}/libsicu ${ICU_LIB_DIR-/usr/lib}/libicu
-    do
-        TEST_ICUUC_LIB="${ICUUC_LIB-${i}uc.a}"
-        TEST_ICUDATA_LIB="${ICUDATA_LIB-${i}data.a}"
-        AC_MSG_CHECKING(whether can link with ICU libraries $TEST_ICUUC_LIB and $TEST_ICUDATA_LIB)
-        LIBS="$saved_libs $TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s"
-    	AC_TRY_LINK([#include <unicode/ubidi.h>],[ubidi_open()],
-                    [AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
-            	     AC_SUBST(ICULIBS,"$TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s")
-                     AC_MSG_RESULT(yes)],
-                    [AC_MSG_RESULT(no)])
-    done
+    icu_libs="-lsicuuc -lsicudata -lstdc++ -lgcc_s"
+    if test -n "$ICU_LIB_DIR"
+    then
+        icu_libs="-L$ICU_LIB_DIR $icu_libs"
+    fi
+    AC_MSG_CHECKING(whether can link with ICU libraries)
+    LIBS="$saved_libs $icu_libs"
+    AC_TRY_RUN([#include <unicode/ubidi.h>
+main () { ubidi_open(); return 0; }],
+		[AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
+                 AC_SUBST(ICULIBS,"icu_libs")
+                 AC_MSG_RESULT(yes)],
+                [AC_MSG_RESULT(no)],[AC_MSG_RESULT(no)])
     LIBS="$saved_libs"
 fi
 




More information about the wine-cvs mailing list