Changeset 153 for trunk/aclocal.m4


Ignore:
Timestamp:
Jan 11, 2008, 11:47:17 PM (14 years ago)
Author:
katerina
Message:

Use -D_FORTIFY_SOURCE=1 -fstack-protector-all if supported. Compiler warnings fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/aclocal.m4

    r144 r153  
    11211121      ssp_cv_cc,
    11221122      [ssp_old_cflags="$CFLAGS"
    1123        CFLAGS="$CFLAGS -fstack-protector"
     1123       CFLAGS="$CFLAGS -fstack-protector-all"
    11241124       AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
    11251125       CFLAGS="$ssp_old_cflags"
    11261126      ])
    1127     if test $ssp_cv_cc = yes; then
    1128       CFLAGS="$CFLAGS -fstack-protector"
    1129       AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
     1127    if test $ssp_cv_cc = no; then
     1128      AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
     1129        ssp_cv_cc,
     1130        [ssp_old_cflags="$CFLAGS"
     1131         CFLAGS="$CFLAGS -fstack-protector-all"
     1132         AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
     1133         CFLAGS="$ssp_old_cflags"
     1134        ])
     1135      if test $ssp_cv_cc = yes; then
     1136        CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1 -fstack-protector-all"
     1137        AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
     1138      fi
     1139    else
     1140      if test $ssp_cv_cc = yes; then
     1141        CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1 -fstack-protector"
     1142        AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
     1143      fi
    11301144    fi
    11311145  fi
     
    17041718                AC_MSG_CHECKING([whether pthreads work with $flag])
    17051719                PTHREAD_CFLAGS="$flag"
    1706                 PTHREAD_LDFLAGS="$flag"
    17071720                ;;
    17081721
     
    17301743        LIBS="$PTHREAD_LIBS $LIBS"
    17311744        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
    1732         LDFLAGS="$LDFLAGS $PTHREAD_LDFLAGS"
     1745        LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
    17331746
    17341747        # Check for various functions.  We must include pthread.h,
     
    17581771        PTHREAD_LIBS=""
    17591772        PTHREAD_CFLAGS=""
    1760         PTHREAD_LDFLAGS=""
    17611773done
    17621774fi
Note: See TracChangeset for help on using the changeset viewer.