Toplevel: Maybe-ize GDB_TK.

Nathanael Nerode neroden@twcny.rr.com
Wed Nov 20 13:23:00 GMT 2002


Another maybe-izing change for b-i-b, tested on i686-pc-linux-gnu.

The long comment added here indicates what I really want to do, but it needs
extensive testing so I'm doing the 'preliminaries' here.

	* configure: Move GDB_TK substitution to configure.in.
	* configure.in: Maybe-ize GDB_TK, rearrange slightly.

--- configure.4	2002-11-20 16:12:28.000000000 -0500
+++ configure	2002-11-20 16:18:42.000000000 -0500
@@ -1355,8 +1355,6 @@
       -e "s:@DEFAULT_LEX@:${DEFAULT_LEX}:" \
       -e "s:@DEFAULT_M4@:${DEFAULT_M4}:" \
           ./Makefile.tem > ${Makefile}
-  sed -e "s:@GDB_TK@:${GDB_TK}:" ${Makefile} >${Makefile}.tem
-  mv -f ${Makefile}.tem ${Makefile}
 
   # If this is a Canadian Cross, preset the values of many more
   # tools.
--- configure.in.4	2002-11-20 16:12:24.000000000 -0500
+++ configure.in	2002-11-20 16:18:22.000000000 -0500
@@ -848,13 +848,6 @@
   *msdosdjgpp*)
     enable_gdbtk=no ;;
 esac
-# Determine whether gdb needs tk/tcl or not.
-case "$enable_gdbtk" in
-  no)
-    GDB_TK="" ;;
-  *)
-    GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui" ;;
-esac
 
 copy_dirs=
 
@@ -1383,6 +1376,20 @@
   configure_target_modules="${configure_target_modules} configure-target-${module}"
 done
 
+# Determine whether gdb needs tk/tcl or not.
+# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
+# and in that case we want gdb to be built without tk.  Ugh!
+# In fact I believe gdb is the *only* package directly dependent on tk,
+# so we should be able to put the 'maybe's in unconditionally and
+# leave out the maybe dependencies when enable_gdbtk is false.  I'm not
+# 100% sure that that's safe though.
+case "$enable_gdbtk" in
+  no)
+    GDB_TK="" ;;
+  *)
+    GDB_TK="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" ;;
+esac
+
 # Create the 'maybe dependencies'.  This uses a temporary file.
 rm -f maybedep.tmp
 for item in ${all_build_modules} ${all_host_modules} ${all_target_modules} \
@@ -1593,6 +1600,7 @@
 
 sedtemp=sed.$$
 cat >$sedtemp <<EOF
+s%@GDB_TK@%${GDB_TK}%
 s%@all_build_modules@%${all_build_modules}%
 s%@configure_build_modules@%${configure_build_modules}%
 s%@all_host_modules@%${all_host_modules}%



More information about the Gcc-patches mailing list