summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorescoffon <escoffon>1998-07-01 18:28:41 (GMT)
committerescoffon <escoffon>1998-07-01 18:28:41 (GMT)
commit0cd8b438851fba52f42877525214ee7382290b0b (patch)
tree0adc3b36e7d07fd47e3f4d1a9363d8464b6fb58a /unix
parent46581d8aea4d13bed3e2759770da9213435cde0f (diff)
downloadtk-0cd8b438851fba52f42877525214ee7382290b0b.zip
tk-0cd8b438851fba52f42877525214ee7382290b0b.tar.gz
tk-0cd8b438851fba52f42877525214ee7382290b0b.tar.bz2
- added support for configuration of debug/nodebug in configure script.
- also added a atring to append to generated libraries when built with symbols.
Diffstat (limited to 'unix')
-rw-r--r--unix/Makefile.in18
-rw-r--r--unix/configure.in24
2 files changed, 38 insertions, 4 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 837e5b5..88df1da 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -81,6 +81,20 @@ TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
# for this version of Tk:
TCL_BIN_DIR = @TCL_BIN_DIR@
+# Libraries built with optimization switches have this additional extension
+DBGX = @DBGX@
+
+# The default switches for optimization or debugging
+CFLAGS_DEBUG = @CFLAGS_DEBUG@
+CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@
+
+# To change the compiler switches, for example to change from optimization to
+# debugging symbols, change the following line:
+#CFLAGS = $(CFLAGS_DEBUG)
+#CFLAGS = $(CFLAGS_OPTIMIZE)
+#CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_OPTIMIZE)
+CFLAGS = $(@CFLAGS_DEFAULT@)
+
# A "-I" switch that can be used when compiling to make all of the
# X11 include files accessible (the configure script will try to
# set this value, and will cause it to be an empty string if the
@@ -96,10 +110,6 @@ X11_LIB_SWITCHES = @XLIBSW@
# configure script.
LIBS = @TCL_BUILD_LIB_SPEC@ @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
-# To change the compiler switches, for example to change from -O
-# to -g, change the following line:
-CFLAGS = -O
-
# To turn off the security checks that disallow incoming sends when
# the X server appears to be insecure, reverse the comments on the
# following lines:
diff --git a/unix/configure.in b/unix/configure.in
index 5f0ba06..0b7cc16 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -52,6 +52,19 @@ fi
file=$TCL_BIN_DIR/tclConfig.sh
. $file
+
+# Set the default compiler switches based on the --enable-symbols option
+
+AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols],
+ [tcl_ok=$enableval], [tcl_ok=no])
+if test "$tcl_ok" = "yes"; then
+ CFLAGS_DEFAULT=CFLAGS_DEBUG
+ DBGX=g
+else
+ CFLAGS_DEFAULT=CFLAGS_OPTIMIZE
+ DBGX=""
+fi
+
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
SHLIB_LD=$TCL_SHLIB_LD
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
@@ -59,6 +72,8 @@ SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
SHLIB_VERSION=$TCL_SHLIB_VERSION
DL_LIBS=$TCL_DL_LIBS
LD_FLAGS=$TCL_LD_FLAGS
+CFLAGS_DEBUG=$TCL_CFLAGS_DEBUG
+CFLAGS_OPTIMIZE=$TCL_CFLAGS_OPTIMIZE
LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
@@ -376,6 +391,15 @@ else
TK_LIB_SPEC="-L${exec_prefix}/lib -ltk`echo ${VERSION} | tr -d .`"
fi
+echo CFLAGS_DEBUG=$CFLAGS_DEBUG
+echo CFLAGS_DEFAULT=$CFLAGS_DEFAULT
+echo CFLAGS_OPTIMIZE=$CFLAGS_OPTIMIZE
+echo DBGX=$DBGX
+
+AC_SUBST(CFLAGS_DEBUG)
+AC_SUBST(CFLAGS_DEFAULT)
+AC_SUBST(CFLAGS_OPTIMIZE)
+AC_SUBST(DBGX)
AC_SUBST(DL_LIBS)
AC_SUBST(LD_FLAGS)
AC_SUBST(MATH_LIBS)