Changeset 10f924c for configure.in


Ignore:
Timestamp:
05/23/14 17:31:26 (6 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:
2a7047c
Parents:
d3b6b91
Message:

Fixed broken -fvisibility check in configure

  • Added a m4 script that does this properly rather than our hax gcc version check.
  • Tidied up CFLAGS in configure so we aren't adding the same sets of flags multiple times
  • Created a wandio_internal.h file for storing global variables that shouldn't be made public

Thanks to Alistair King, whose patch to try and make this work for
non-gcc systems brought my attention to just how broken this was :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.in

    r12e6a39 r10f924c  
    105105LIBWANDIO_LIBS=""
    106106
    107 # Set our C compiler flags based on the gcc version
    108 if test "$GCC" = "yes"; then
     107CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1"
     108CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1"
     109
     110# Check for -fvisibility
     111gl_VISIBILITY
     112
    109113       
    110         gcc_version=`$CC -dumpversion`
    111 
    112         # This is probably not the most reliable way to test whether our
    113         # compiler supports visibility, but it's better than nothing
    114         #
    115         # According to the gcc wiki - http://gcc.gnu.org/wiki/Visibility -
    116         # visibility is supported in gcc 4.0 or later, so we just need to
    117         # check the major version number
    118 
    119         major=$(echo $gcc_version | cut -d'.' -f1)
    120 
    121         #major=${gcc_version%\.*\.*}
    122 
    123         if test "$major" -lt 4; then
    124                 vis=no
    125         else
    126                 vis=yes
    127         fi
    128        
    129         CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
    130         CXXFLAGS="$CXXFLAGS -Wall"
    131         LIBCFLAGS="$CFLAGS"
    132         LIBCFLAGS="$LIBCFLAGS -DLT_BUILDING_DLL=1"
    133         LIBCXXFLAGS="$CXXFLAGS"
    134         LIBCXXFLAGS="$CXXFLAGS -DLT_BUILDING_DLL=1"
    135        
    136         if test "$vis" = "yes"; then
    137                 LIBCFLAGS="$LIBCFLAGS -Wextra -fvisibility=hidden"
    138                 LIBCXXFLAGS="$CXXFLAGS -Wextra -fvisibility=hidden"
    139         fi
    140 fi
    141 
    142114# Check for libtool
    143115AC_PROG_LIBTOOL
Note: See TracChangeset for help on using the changeset viewer.