Changeset 97fcf28 for configure.in


Ignore:
Timestamp:
07/19/10 10:09:58 (10 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
3ed3ed3
Parents:
307892f
Message:
  • Added a check for whether the compiler supports -fvisibility - this means we should be able to build on older versions of gcc again
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    rd48008d r97fcf28  
    5454
    5555if test "$GCC" = "yes"; then
     56       
     57        gcc_version=`gcc -dumpversion`
     58
     59        # This is probably not the most reliable way to test whether our
     60        # compiler supports visibility, but it's better than nothing
     61        #
     62        # According to the gcc wiki - http://gcc.gnu.org/wiki/Visibility -
     63        # visibility is supported in gcc 4.0 or later, so we just need to
     64        # check the major version number
     65
     66        major=${gcc_version%\.*\.*}
     67
     68        if test "$major" -lt 4; then
     69                vis=no
     70        else
     71                vis=yes
     72        fi
     73       
    5674        CFLAGS="$CFLAGS -Wall -Wextra -Wmissing-prototypes -O2"
    5775        CXXFLAGS="$CXXFLAGS -Wall -Wextra -O2"
    58 # We assume that gcc knows about -fvisibility and friends, as I can't see
    59 # a good easy way of testing for it here.
    6076        LIBCFLAGS="$CFLAGS"
    6177        LIBCFLAGS="$LIBCFLAGS -DLT_BUILDING_DLL=1"
    62         LIBCFLAGS="$LIBCFLAGS -fvisibility=hidden"
    6378        LIBCXXFLAGS="$CXXFLAGS"
    6479        LIBCXXFLAGS="$CXXFLAGS -DLT_BUILDING_DLL=1"
    65         LIBCXXFLAGS="$CXXFLAGS -fvisibility=hidden"
     80       
     81        if test "$vis" = "yes"; then
     82                LIBCFLAGS="$LIBCFLAGS -fvisibility=hidden"
     83                LIBCXXFLAGS="$CXXFLAGS -fvisibility=hidden"
     84        fi
    6685fi
    6786
Note: See TracChangeset for help on using the changeset viewer.