diff options
author | escoffon <escoffon@noemail.net> | 1998-07-22 13:39:28 (GMT) |
---|---|---|
committer | escoffon <escoffon@noemail.net> | 1998-07-22 13:39:28 (GMT) |
commit | 683fb14785eb5e493a70b9ae40f713745da65eca (patch) | |
tree | 0bb268e0d60763ccab65baf89734e7825afdfa38 /unix | |
parent | 943d172dd61feb35c6fdc1ee1cbcb18aefe0d1d4 (diff) | |
download | tk-683fb14785eb5e493a70b9ae40f713745da65eca.zip tk-683fb14785eb5e493a70b9ae40f713745da65eca.tar.gz tk-683fb14785eb5e493a70b9ae40f713745da65eca.tar.bz2 |
Added support for specifying warning flags for the compiler, with checks
for gcc and appropriate defaults.
FossilOrigin-Name: c20363a6d6369af3b83a6639cd7557c3c4563517
Diffstat (limited to 'unix')
-rw-r--r-- | unix/Makefile.in | 6 | ||||
-rw-r--r-- | unix/configure.in | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index 63a56a5..0b3989d 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -84,6 +84,9 @@ TCL_BIN_DIR = @TCL_BIN_DIR@ # 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@ @@ -200,7 +203,8 @@ TOOL_DIR = @TCL_SRC_DIR@/tools CC = @CC@ -CC_SWITCHES = ${CFLAGS} ${TK_SHLIB_CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} \ +CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TK_SHLIB_CFLAGS} \ +-I${UNIX_DIR} -I${GENERIC_DIR} \ -I${BMAP_DIR} -I${TCL_GENERIC_DIR} ${X11_INCLUDES} ${AC_FLAGS} ${PROTO_FLAGS} \ ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} diff --git a/unix/configure.in b/unix/configure.in index 54c897f..5579147 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -30,6 +30,13 @@ fi AC_C_CROSS AC_HAVE_HEADERS(unistd.h limits.h) +# 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 + #-------------------------------------------------------------------- # See if there was a command-line option for where Tcl is; if # not, assume that its top-level directory is a sibling of ours. @@ -394,6 +401,7 @@ TK_LIB_SPEC="-L${exec_prefix}/lib \${TK_LIB_FLAG}" AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(CFLAGS_OPTIMIZE) +AC_SUBST(CFLAGS_WARNING) AC_SUBST(DBGX) AC_SUBST(DL_LIBS) AC_SUBST(LD_FLAGS) |