]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
New version of hack_libtool utility to workaround problems on some Linux configurations
authorvsr <vsr@opencascade.com>
Sun, 5 Dec 2010 18:13:24 +0000 (18:13 +0000)
committervsr <vsr@opencascade.com>
Sun, 5 Dec 2010 18:13:24 +0000 (18:13 +0000)
configure.ac
salome_adm/unix/config_files/hack_libtool.m4

index d0a11fc2e0f5d4d3c7c6d38a693203665a379917..9b3df1dd45169d8d575cf3006d6636e4d00881db 100644 (file)
@@ -513,15 +513,10 @@ echo generating Makefiles and configure files
 echo ---------------------------------------------
 echo
 
+AC_HACK_LIBTOOL
 AC_CONFIG_COMMANDS([hack_libtool],[
 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
-  if test \"\$(echo \$[@] | grep -E '\\\-L/usr/lib(/../lib)?(64)? ')\" == \"\" \n\
-  then\n\
-    cmd=\"\1 \$[@]\"\n\
-  else\n\
-    cmd=\"\1 \"\`echo \$[@] | sed -r -e 's|(.*)-L/usr/lib(/../lib)?(64)? (.*)|\\\1\\\4 -L/usr/lib\\\3|g'\`\n\
-  fi\n\
-  \$cmd\n\
+  $(pwd)/hack_libtool \1 \"\$[@]\" \n\
 }\n\
 CC=\"hack_libtool\"%g" libtool
 ],[])
index 54a65dc8783589c168d62914fb061f6c00a0f9f6..c6c3c2d520d4cd76dd544431289183cd6cf75b43 100644 (file)
@@ -28,14 +28,21 @@ dnl to the native libraries (installed in /usr/lib[64]) instead of those supplie
 dnl with specific -Ldir options.
 
 AC_DEFUN([AC_HACK_LIBTOOL],[
-sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
-  if test \"\$(echo \$[@] | grep -E '\\\-L/usr/lib(/../lib)?(64)? ')\" == \"\" \n\
-  then\n\
-    cmd=\"\1 \$[@]\"\n\
-  else\n\
-    cmd=\"\1 \"\`echo \$[@] | sed -r -e 's|(.*)-L/usr/lib(/../lib)?(64)? (.*)|\\\1\\\4 -L/usr/lib\\\3|g'\`\n\
-  fi\n\
-  \$cmd\n\
-}\n\
-CC=\"hack_libtool\"%g" libtool
+cat > hack_libtool <<EOF
+#! /bin/sh
+
+cmd=""
+cmd_end=""
+
+for param in "\$[@]"
+do
+    case \${param} in
+       -L* ) where=\$(echo \${param} | cut -b3-) ; if test "\${where}" != "" ; then where=\$(cd \${where}; pwd) ; if test "\${where}" = "/usr/lib" || test "\${where}" = "/usr/lib64" ; then cmd_end="\${cmd_end} \${param}" ; else cmd="\${cmd} \${param}" ; fi ; fi ;;
+       *   ) cmd="\${cmd} \${param}" ;;
+    esac
+done
+cmd="\${cmd} \${cmd_end}"
+\$cmd
+EOF
+chmod a+x hack_libtool
 ])