Skip to content

Commit

Permalink
cupid: Add c99 CFLAG for isfinite
Browse files Browse the repository at this point in the history
The hope is that this will solve build issues with CentOS 5
since commit 3e9ce4a.
  • Loading branch information
grahambell committed Mar 18, 2014
1 parent 38ed158 commit 4286bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion applications/cupid/cupidsub/Makefile.am
Expand Up @@ -36,7 +36,7 @@ noinst_LTLIBRARIES = libcupidsub.la

libcupidsub_la_SOURCES = $(C_ROUTINES) $(CGENERIC_ROUTINES)

AM_CFLAGS = -I..
AM_CFLAGS = -I.. -std=c99

$(C_ROUTINES:.c=.o): ../cupid.h

Expand Down

1 comment on commit 4286bb0

@timj
Copy link
Member

@timj timj commented on 4286bb0 Mar 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. CentOS 5 clearly defaults to old C. Didn't notice this on the Mac. The alternative is to use a configure test. SMURF does the following:

dnl    SMURF requires C99 features, so unless we have GCC attempt
dnl    to enable that in the compiler.
if test "$GCC" != "yes"; then
   AC_PROG_CC_C99
fi

dnl    Check for GCC, so we can add SMURF compiler warning flags.
dnl    Would like to include -fstack-protector, but not all GCC versions
dnl    support that, so need to check that. SMURF is using C99 features
dnl    so we always ask that they are supported by GCC.
SMURF_CFLAGS="-std=c99 -Wall -Wextra -Wcast-qual -Wcast-align -Wwrite-strings \
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
-Wredundant-decls"

if test "$GCC" = "yes"; then
    have_fsp=yes
    AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
    fsp_old_cflags="$CFLAGS"
    CFLAGS="$CFLAGS -fstack-protector -pedantic-errors"
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[have_fsp=no])
    echo $have_fsp
    if test "$have_fsp" = "no"; then
        CFLAGS="$fsp_old_cflags $SMURF_CFLAGS"
    else
        CFLAGS="$CFLAGS $SMURF_CFLAGS"
    fi
fi

I'm not sure if AC_PROG_CC_C99 will solve the problem all on its own.

Please sign in to comment.