Changeset 664


Ignore:
Timestamp:
Oct 22, 2007 5:34:55 PM (12 years ago)
Author:
lou
Message:

Patch libtool for 64-bit GCC build on Solaris. Do a better job of ignoring
/usr/ucb/cc on Solaris. Pull cygwin libtool patches into their own macro for
clarity. Remove some lines that've been commented out for a while.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r594 r664  
    880880
    881881save_cflags="$CFLAGS"
    882 # For *-*-solaris*, promote Studio/Workshop compiler to front of list.
    883 # ToDo: If Studio/Workshop cc is not present, we may find /usr/ucb/cc, which
    884 # is likely to be a non-functional shell. But many installations will have
    885 # both cc and gcc, so promoting gcc isn't good either. How to test reliably?
     882
     883# For *-*-solaris*, promote Studio/Workshop cc compiler to front of list.
     884# Depending on the user's PATH, when Studio/Workshop cc is not present we may
     885# find /usr/ucb/cc, which is likely to be a non-functional shell. The test used
     886# here is the same as that used in /usr/ucb/cc. This doesn't entirely solve the
     887# problem, as the user may still need to force the issue if /usr/ucb/cc and gcc
     888# both work and the user's PATH leads to /usr/ucb/cc before gcc.
     889
    886890case $build in
    887891  *-cygwin* | *-mingw*)
     
    892896             fi ;;
    893897  *-*-solaris*)
    894              comps="cc xlc gcc pgcc icc" ;;
     898             if test -f /usr/ccs/bin/ucbcc ; then
     899               comps="cc xlc gcc pgcc icc"
     900             else
     901               comps="xlc gcc pgcc icc"
     902             fi
     903             ;;
    895904  *-linux-*) comps="xlc gcc cc pgcc icc" ;;
    896905  *)         comps="xlc_r xlc cc gcc pgcc icc" ;;
     
    17751784
    17761785###########################################################################
     1786#                      COIN_PATCH_LIBTOOL_CYGWIN                          #
     1787###########################################################################
     1788
     1789# Patches to libtool for cygwin. Lots for cl, a few for GCC.
     1790# For cl:
     1791# - cygpath is not correctly quoted in fix_srcfile_path
     1792# - paths generated for .lib files is not run through cygpath -w
     1793
     1794
     1795AC_DEFUN([AC_COIN_PATCH_LIBTOOL_CYGWIN],
     1796[ case "$CXX" in
     1797    cl* | */cl* | CL* | */CL*)
     1798      AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
     1799      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1800          -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1801          -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     1802          -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
     1803          -e 's%lib /OUT:%lib -OUT:%' \
     1804          -e "s%cygpath -w%$CYGPATH_W%" \
     1805          -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
     1806          -e 's/$AR t/lib -nologo -list/' \
     1807          -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
     1808          -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
     1809          -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
     1810      libtool > conftest.bla
     1811
     1812      mv conftest.bla libtool
     1813      chmod 755 libtool
     1814      ;;
     1815    *)
     1816      AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
     1817      sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
     1818          -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
     1819          -e 's|libext="lib"|libext="a"|' \
     1820      libtool > conftest.bla
     1821
     1822      mv conftest.bla libtool
     1823      chmod 755 libtool
     1824      ;;
     1825  esac ]) # COIN_PATCH_LIBTOOL_CYGWIN
     1826
     1827###########################################################################
    17771828#                           COIN_PROG_LIBTOOL                             #
    17781829###########################################################################
     
    18081859  AC_SUBST(ac_cxx_preproc_warn_flag)
    18091860
    1810 # Fix bugs in libtool script for Windows native compilation:
    1811 # - cygpath is not correctly quoted in fix_srcfile_path
    1812 # - paths generated for .lib files is not run through cygpath -w
    1813 
    1814 
    1815 # - lib includes subdirectory information; we want to replace
    1816 #
    1817 # old_archive_cmds="lib /OUT:\$oldlib\$oldobjs\$old_deplibs"
    1818 #
    1819 # by
    1820 #
    1821 # old_archive_cmds="echo \$oldlib | grep .libs >/dev/null; if test \$? = 0; then cd .libs; lib /OUT:\`echo \$oldlib\$oldobjs\$old_deplibs | sed -e s@\.libs/@@g\`; cd .. ; else lib /OUT:\$oldlib\$oldobjs\$old_deplibs ; fi"
    1822 #
    1823 #          -e 's%old_archive_cmds="lib /OUT:\\\$oldlib\\\$oldobjs\\\$old_deplibs"%old_archive_cmds="echo \\\$oldlib \| grep .libs >/dev/null; if test \\\$? = 0; then cd .libs; lib /OUT:\\\`echo \\\$oldlib\\\$oldobjs\\\$old_deplibs \| sed -e s@\\.libs/@@g\\\`; cd .. ; else lib /OUT:\\\$oldlib\\\$oldobjs\\\$old_deplibs; fi"%' \
    1824 
    1825 # The following was a hack for chaniing @BACKSLASH to \
    1826 #          -e 'sYcompile_command=`\$echo "X\$compile_command" | \$Xsed -e '"'"'s%@OUTPUT@%'"'"'"\$output"'"'"'%g'"'"'`Ycompile_command=`\$echo "X\$compile_command" | \$Xsed -e '"'"'s%@OUTPUT@%'"'"'"\$output"'"'"'%g'"'"' | \$Xsed -e '"'"'s%@BACKSLASH@%\\\\\\\\\\\\\\\\%g'"'"'`Y' \
    1827 
    1828   # Correct cygpath for minGW (ToDo!)
    18291861  AC_MSG_NOTICE([Build is "$build".])
    18301862  mydos2unix='| dos2unix'
     
    18371869
    18381870  case $build in
     1871    # Here we need to check if -m32 is specified.  If so, we need to correct
     1872    # sys_lib_search_path_spec
    18391873    *x86_64-*)
    1840 # Here we need to check if -m32 is specified.  If so, we need to correct sys_lib_search_path_spec
    18411874      if test "$GCC" = yes && (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm32' >& /dev/null); then
    18421875        AC_MSG_NOTICE(Applying patches to libtool for 32bit compilation)
     
    18461879      fi
    18471880      ;;
     1881    # The opposite problem: if we want to do a 64-bit build, the system search
     1882    # libraries need to point to the sparcv9 subdirectories. If they do not
     1883    # already do that, fix them.
     1884    sparc-sun-solaris*)
     1885      if test "$GCC" = yes && \
     1886         (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm64' >/dev/null 2>&1) ; then
     1887        fixlibtmp=`$CC -print-search-dirs | $EGREP '^libraries:'`
     1888        if `echo "$fixlibtmp" | $EGREP -v sparcv9  >/dev/null 2>&1` ; then
     1889          AC_MSG_NOTICE([Applying patches to libtool for 64-bit compilation])
     1890          fixlibtmp=`echo $fixlibtmp | sed -e 's/libraries: =//' -e 's/:/ /g'`
     1891          v9syslibpath=
     1892          for lib in $fixlibtmp ; do
     1893            if test -d "${lib}sparcv9" ; then
     1894              v9syslibpath="$v9syslibpath ${lib}sparcv9/"
     1895            fi
     1896          done
     1897          sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="'"$v9syslibpath"'"|' libtool > conftest.bla
     1898          mv conftest.bla libtool
     1899          chmod 755 libtool 
     1900        fi
     1901      fi
     1902      ;;
     1903    # Cygwin. Ah, cygwin. Too big and ugly to inline; see the macro.
    18481904    *-cygwin* | *-mingw*)
    1849     case "$CXX" in
    1850       cl* | */cl* | CL* | */CL*)
    1851         AC_MSG_NOTICE(Applying patches to libtool for cl compiler)
    1852         sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1853             -e 's|fix_srcfile_path=\"\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1854             -e 's%compile_deplibs=\"\$dir/\$old_library \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$old_library | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1855             -e 's%compile_deplibs=\"\$dir/\$linklib \$compile_deplibs\"%compile_deplibs="'\`"$CYGPATH_W"' \$dir/\$linklib | sed -e '"'"'sY\\\\\\\\Y/Yg'"'"\`' \$compile_deplibs\"'% \
    1856             -e 's%lib /OUT:%lib -OUT:%' \
    1857             -e "s%cygpath -w%$CYGPATH_W%" \
    1858             -e 's%$AR x \\$f_ex_an_ar_oldlib%bla=\\`lib -nologo -list \\$f_ex_an_ar_oldlib | xargs echo '"$mydos2unix"'\\`; echo \\$bla; for i in \\$bla; do lib -nologo -extract:\\$i \\$f_ex_an_ar_oldlib; done%' \
    1859             -e 's/$AR t/lib -nologo -list/' \
    1860             -e 's%f_ex_an_ar_oldlib="\($?*1*\)"%f_ex_an_ar_oldlib='\`"$CYGPATH_W"' \1`%' \
    1861             -e 's%^archive_cmds=.*%archive_cmds="\\$CC -o \\$lib \\$libobjs \\$compiler_flags \\\\\\`echo \\\\\\"\\$deplibs\\\\\\" | \\$SED -e '"\'"'s/ -lc\\$//'"\'"'\\\\\\` -link -dll~linknames="%' \
    1862             -e 's%old_archive_cmds="lib -OUT:\\$oldlib\\$oldobjs\\$old_deplibs"%old_archive_cmds="if test -r \\$oldlib; then bla=\\"\\$oldlib\\"; else bla=; fi; lib -OUT:\\$oldlib \\\\\\$bla\\$oldobjs\\$old_deplibs"%' \
    1863         libtool > conftest.bla
    1864 
    1865         mv conftest.bla libtool
    1866         chmod 755 libtool
    1867         ;;
    1868       *)
    1869         AC_MSG_NOTICE(Applying patches to libtool for GNU compiler)
    1870         sed -e 's|fix_srcfile_path=\"`cygpath -w \"\$srcfile\"`\"|fix_srcfile_path=\"\\\`'"$CYGPATH_W"' \\\"\\$srcfile\\\"\\\`\"|' \
    1871             -e 's|"lib /OUT:\\$oldlib\\$oldobjs\\$old_deplibs"|"\\$AR \\$AR_FLAGS \\$oldlib\\$oldobjs\\$old_deplibs~\\$RANLIB \\$oldlib"|' \
    1872             -e 's|libext="lib"|libext="a"|' \
    1873         libtool > conftest.bla
    1874 
    1875         mv conftest.bla libtool
    1876         chmod 755 libtool
    1877         ;;
    1878     esac
    1879     ;;
     1905      AC_COIN_PATCH_LIBTOOL_CYGWIN
     1906      ;;
    18801907    *-darwin*)
    18811908      AC_MSG_NOTICE(Applying patches to libtool for Darwin)
Note: See TracChangeset for help on using the changeset viewer.