From 693bcba7c5261324ef8560a98f6d7b08f033bed7 Mon Sep 17 00:00:00 2001 From: escoffon Date: Wed, 22 Jul 1998 13:39:13 +0000 Subject: Added support for specifying warning flags for the compiler, with checks for gcc and appropriate defaults. --- unix/Makefile.in | 6 +++++- unix/configure.in | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/unix/Makefile.in b/unix/Makefile.in index 8a96a01..0ecf5cd 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -74,6 +74,9 @@ MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann # Libraries built with optimization switches have this additional extension DBGX = @DBGX@ +# warning flags +CFLAGS_WARNING = @CFLAGS_WARNING@ + # The default switches for optimization or debugging CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ @@ -207,7 +210,8 @@ CC = @CC@ #---------------------------------------------------------------- -CC_SWITCHES = ${CFLAGS} ${TCL_SHLIB_CFLAGS} -I${GENERIC_DIR} -I${SRC_DIR} \ +CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TCL_SHLIB_CFLAGS} \ +-I${GENERIC_DIR} -I${SRC_DIR} \ ${AC_FLAGS} ${MATH_FLAGS} ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \ ${COMPILE_DEBUG_FLAGS} ${ENV_FLAGS} -DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\" diff --git a/unix/configure.in b/unix/configure.in index fd88976..15c91d7 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,7 +2,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. AC_INIT(../generic/tcl.h) -# SCCS: %Z% $Id: configure.in,v 1.8 1998/07/21 15:26:05 escoffon Exp $ +# SCCS: %Z% $Id: configure.in,v 1.9 1998/07/22 13:39:13 escoffon Exp $ TCL_VERSION=8.0 TCL_MAJOR_VERSION=8 @@ -29,6 +29,13 @@ AC_SUBST(CC) fi AC_C_CROSS +# set the warning flags depending on whether or not we are using gcc +if test "${GCC}" = "yes" ; then + CFLAGS_WARNING="-Wall -Wconversion" +else + CFLAGS_WARNING="" +fi + #-------------------------------------------------------------------- # Supply substitutes for missing POSIX library procedures, or # set flags so Tcl uses alternate procedures. @@ -1227,6 +1234,7 @@ AC_SUBST(BUILD_DLTEST) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(CFLAGS_OPTIMIZE) +AC_SUBST(CFLAGS_WARNING) AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX) AC_SUBST(DBGX) -- cgit v0.12