|
From: Mo D. <md...@cy...> - 2000-07-19 00:47:40
|
I wrote up this patch to fix the problem with Tcl not respecting
the CFLAGS variable set in the users env. If nobody has a problem
with it, I will add commit it to the CVS (along with the equivalent
patch to tk and the windows builds for tcl and tk).
Mo DeJong
Red Hat Inc
Index: unix/Makefile.in
===================================================================
RCS file: /home/cvs/external/tcl/unix/Makefile.in,v
retrieving revision 1.66
diff -u -r1.66 Makefile.in
--- Makefile.in 2000/06/06 04:39:49 1.66
+++ Makefile.in 2000/07/19 00:40:49
@@ -87,7 +87,7 @@
#CFLAGS = $(CFLAGS_DEBUG)
#CFLAGS = $(CFLAGS_OPTIMIZE)
#CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE)
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS_DEFAULT@
# To disable ANSI-C procedure prototypes reverse the comment characters
# on the following lines:
Index: unix/configure.in
===================================================================
RCS file: /home/cvs/external/tcl/unix/configure.in,v
retrieving revision 1.58
diff -u -r1.58 configure.in
--- configure.in 2000/05/03 00:15:10 1.58
+++ configure.in 2000/07/19 00:40:49
@@ -28,6 +28,7 @@
#------------------------------------------------------------------------
AC_PROG_RANLIB
+SC_ENABLE_SYMBOLS
SC_ENABLE_GCC
AC_HAVE_HEADERS(unistd.h limits.h)
@@ -408,11 +409,7 @@
#--------------------------------------------------------------------
SC_CONFIG_CFLAGS
-
-SC_ENABLE_SYMBOLS
-
TCL_DBGX=${DBGX}
-CFLAGS=${CFLAGS_DEFAULT}
#--------------------------------------------------------------------
# The statements below check for systems where POSIX-style
@@ -558,12 +555,16 @@
AC_SUBST(BUILD_DLTEST)
AC_SUBST(CFLAGS)
+AC_SUBST(CFLAGS_DEFAULT)
+AC_SUBST(CFLAGS_DEBUG)
+AC_SUBST(CFLAGS_OPTIMIZE)
+AC_SUBST(CFLAGS_WARNING)
+AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
AC_SUBST(TCL_DBGX)
AC_SUBST(DL_OBJS)
-AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(MAKE_LIB)
AC_SUBST(TCL_SHARED_BUILD)
Index: unix/tcl.m4
===================================================================
RCS file: /home/cvs/external/tcl/unix/tcl.m4,v
retrieving revision 1.23
diff -u -r1.23 tcl.m4
--- tcl.m4 2000/07/17 08:26:31 1.23
+++ tcl.m4 2000/07/19 00:40:50
@@ -408,22 +408,16 @@
# Arguments:
# none
#
-# Requires the following vars to be set:
-# CFLAGS_DEBUG
-# CFLAGS_OPTIMIZE
-# LDFLAGS_DEBUG
-# LDFLAGS_OPTIMIZE
-#
# Results:
#
# Adds the following arguments to configure:
# --enable-symbols
#
# Defines the following vars:
-# CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true
-# Sets to CFLAGS_OPTIMIZE if false
-# LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true
-# Sets to LDFLAGS_OPTIMIZE if false
+# CFLAGS_DEBUG
+# CFLAGS_OPTIMIZE
+# CFLAGS_DEFAULT Set to $(CFLAGS_DEBUG) or
+# Set to $(CFLAGS_OPTIMIZE)
# DBGX Debug library extension
#
#------------------------------------------------------------------------
@@ -431,14 +425,24 @@
AC_DEFUN(SC_ENABLE_SYMBOLS, [
AC_MSG_CHECKING([for build with symbols])
AC_ARG_ENABLE(symbols, [ --enable-symbols build with
debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
+ CFLAGS_DEBUG=-g
+ CFLAGS_OPTIMIZE=-O
if test "$tcl_ok" = "yes"; then
- CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
- LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test -z "$CFLAGS" ; then
+ CFLAGS=${CFLAGS_DEBUG}
+ CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
+ else
+ CFLAGS_DEFAULT=${CFLAGS}
+ fi
DBGX=g
AC_MSG_RESULT([yes])
else
- CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
- LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ if test -z "$CFLAGS" ; then
+ CFLAGS=${CFLAGS_OPTIMIZE}
+ CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
+ else
+ CFLAGS_DEFAULT=${CFLAGS}
+ fi
DBGX=""
AC_MSG_RESULT([no])
fi
@@ -512,17 +516,11 @@
# The name of the built export / import file which
# should be used to link to the Tcl shared library.
# Empty if Tcl is unshared.
-# CFLAGS_DEBUG -
-# Flags used when running the compiler in debug mode
-# CFLAGS_OPTIMIZE -
-# Flags used when running the compiler in optimize mode
#
# EXTRA_CFLAGS
#
# Subst's the following vars:
# DL_LIBS
-# CFLAGS_DEBUG
-# CFLAGS_OPTIMIZE
#--------------------------------------------------------------------
AC_DEFUN(SC_CONFIG_CFLAGS, [
@@ -603,8 +601,6 @@
TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'
ECHO_VERSION='`echo ${VERSION}`'
TCL_LIB_VERSIONS_OK=ok
- CFLAGS_DEBUG=-g
- CFLAGS_OPTIMIZE=-O
if test "$using_gcc" = "yes" ; then
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
else
@@ -1192,9 +1188,6 @@
fi
AC_SUBST(DL_LIBS)
- AC_SUBST(CFLAGS_DEBUG)
- AC_SUBST(CFLAGS_OPTIMIZE)
- AC_SUBST(CFLAGS_WARNING)
])
#--------------------------------------------------------------------
--
The TclCore mailing list is sponsored by Ajuba Solutions
To unsubscribe: email tcl...@aj... with the
word UNSUBSCRIBE as the subject.
|