Changeset 777


Ignore:
Timestamp:
Nov 16, 2007 8:17:14 PM (12 years ago)
Author:
lou
Message:

Make 64-bit GCC builds work on Solaris x86, and make them more robust against
variations in GCC behaviour on both SPARC and x86.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coin.m4

    r726 r777  
    18291829
    18301830###########################################################################
     1831#                    COIN_PATCH_LIBTOOL_SOLARIS                           #
     1832###########################################################################
     1833# If we want to do a 64-bit build with GCC on Solaris, the system search
     1834# libraries need to point to 64-bit subdirectories. If they do not already do
     1835# that, fix them. This patch is evolving, as are GCC compilers.  GCC 4.2.1
     1836# reports the correct search list, given the correct call. GCC 4.1.1 does not.
     1837# `Correct call' means -m64 is specified. `Correct search list' seems to amount
     1838# to prepending the list of 64-bit subdirectories to the 32-bit directories.
     1839# Both SPARC and x86 have this issue, but a different hardware id string is
     1840# required depending on the underlying CPU. The macro executes isainfo to get
     1841# the string. This will fail, of course, if we're cross-compiling. The
     1842# alternative is to fail on a regular basis each time a new CPU identifier is
     1843# needed. This macro will also fail if the search list reported with
     1844# -print-search-dirs differs between the C, C++, and Fortran compilers; each
     1845# have their own setting in libtool.  If GCC reports the correct search list
     1846# given the -m64 flag, the best solution is to define CC='gcc -m64', and
     1847# similarly for CXX, F77, so that libtool will make the correct call.
     1848###########################################################################
     1849AC_DEFUN([AC_COIN_PATCH_LIBTOOL_SOLARIS],
     1850[ if test "$GCC" = yes && \
     1851     (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm64' >/dev/null 2>&1) ; then
     1852    hdwisa=`isainfo | sed -e 's/\(@<:@^ @:>@*\) .*$/\1/'`
     1853    if `$EGREP 'sys_lib_search_path_spec=' libtool | $EGREP -v $hdwisa >/dev/null 2>&1` ; then
     1854      AC_MSG_NOTICE([Applying patches to libtool for 64-bit GCC compilation])
     1855      fixlibtmp=`$CC -m64 -print-search-dirs | $EGREP '^libraries:'`
     1856      fixlibtmp=`echo $fixlibtmp | sed -e 's/libraries: =//' -e 's/:/ /g'`
     1857      if `echo "$fixlibtmp" | $EGREP -v $hdwisa  >/dev/null 2>&1` ; then
     1858        # AC_MSG_NOTICE(Compensating for broken gcc)
     1859        for lib in $fixlibtmp ; do
     1860          if test -d "${lib}${hdwisa}" ; then
     1861            syslibpath64="$syslibpath64 ${lib}${hdwisa}/"
     1862          fi
     1863        done
     1864        syslibpath64="${syslibpath64} ${fixlibtmp}"
     1865      else
     1866        syslibpath64="$fixlibtmp"
     1867      fi
     1868      sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="'"$syslibpath64"'"|' libtool > conftest.bla
     1869      mv conftest.bla libtool
     1870      chmod 755 libtool 
     1871    fi
     1872    # AC_MSG_NOTICE(Result is )
     1873    # $EGREP 'sys_lib_search_path_spec=' libtool
     1874  fi ]) # COIN_PATCH_LIBTOOL_SOLARIS
     1875
     1876###########################################################################
    18311877#                           COIN_PROG_LIBTOOL                             #
    18321878###########################################################################
     
    18821928      fi
    18831929      ;;
    1884     # The opposite problem: if we want to do a 64-bit build, the system search
    1885     # libraries need to point to the sparcv9 subdirectories. If they do not
    1886     # already do that, fix them.
    1887     sparc-sun-solaris*)
    1888       if test "$GCC" = yes && \
    1889          (echo $CXXFLAGS $CFLAGS $FFLAGS | $EGREP 'm64' >/dev/null 2>&1) ; then
    1890         fixlibtmp=`$CC -print-search-dirs | $EGREP '^libraries:'`
    1891         if `echo "$fixlibtmp" | $EGREP -v sparcv9  >/dev/null 2>&1` ; then
    1892           AC_MSG_NOTICE([Applying patches to libtool for 64-bit compilation])
    1893           fixlibtmp=`echo $fixlibtmp | sed -e 's/libraries: =//' -e 's/:/ /g'`
    1894           v9syslibpath=
    1895           for lib in $fixlibtmp ; do
    1896             if test -d "${lib}sparcv9" ; then
    1897               v9syslibpath="$v9syslibpath ${lib}sparcv9/"
    1898             fi
    1899           done
    1900           sed -e 's|sys_lib_search_path_spec=".*"|sys_lib_search_path_spec="'"$v9syslibpath"'"|' libtool > conftest.bla
    1901           mv conftest.bla libtool
    1902           chmod 755 libtool 
    1903         fi
    1904       fi
     1930
     1931    *-solaris*)
     1932      AC_COIN_PATCH_LIBTOOL_SOLARIS
    19051933      ;;
    19061934    # Cygwin. Ah, cygwin. Too big and ugly to inline; see the macro.
Note: See TracChangeset for help on using the changeset viewer.