diff options
author | stu <stwo@users.sourceforge.net> | 2017-05-20 11:47:46 (GMT) |
---|---|---|
committer | stu <stwo@users.sourceforge.net> | 2017-05-20 11:47:46 (GMT) |
commit | 2afd7451e708c09b61ba7820e627a2d6fbecb3fb (patch) | |
tree | 37e2fb2c7bf2677ee7a88230996bc9d70627cbad /unix | |
parent | 2f6784b43da06329dbec3b7f0442161a0d748ffb (diff) | |
download | tk-2afd7451e708c09b61ba7820e627a2d6fbecb3fb.zip tk-2afd7451e708c09b61ba7820e627a2d6fbecb3fb.tar.gz tk-2afd7451e708c09b61ba7820e627a2d6fbecb3fb.tar.bz2 |
Bring more TIP #59 to Tk.<br>
Move ::tk::pkgconfig setup code from unix/tkUnixRFont.c to new file generic/tkPkgConfig.c.<br>
Copied Tcl/tests/config.test into new file Tk/tests/pkgconfig.test.
I believe the name 'pkgconfig.test' is better.<br>
Adjust build system to accommodate.<br>
Use value 'x11' for when fontsystem 'xft' unavailable.<br>
Diffstat (limited to 'unix')
-rw-r--r-- | unix/Makefile.in | 32 | ||||
-rwxr-xr-x | unix/configure | 28 | ||||
-rw-r--r-- | unix/configure.ac | 6 | ||||
-rw-r--r-- | unix/tkConfig.h.in | 3 | ||||
-rw-r--r-- | unix/tkUnixRFont.c | 13 |
5 files changed, 68 insertions, 14 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index 99f2284..e71005e 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -369,8 +369,9 @@ GENERIC_OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkBusy.o \ tkClipboard.o \ tkCmds.o tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o \ tkEvent.o tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \ - tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \ - tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o + tkGrid.o tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o \ + tkPkgConfig.o tkPlace.o tkSelect.o tkStyle.o tkUndo.o tkUtil.o \ + tkVisual.o tkWindow.o TTK_OBJS = \ ttkBlink.o ttkButton.o ttkCache.o ttkClamTheme.o ttkClassicTheme.o \ @@ -431,6 +432,7 @@ GENERIC_SRCS = \ $(GENERIC_DIR)/tkGrid.c $(GENERIC_DIR)/tkConsole.c \ $(GENERIC_DIR)/tkMain.c $(GENERIC_DIR)/tkOption.c \ $(GENERIC_DIR)/tkPack.c $(GENERIC_DIR)/tkPlace.c \ + $(GENERIC_DIR)/tkPkgConfig.c \ $(GENERIC_DIR)/tkSelect.c $(GENERIC_DIR)/tkStyle.c \ $(GENERIC_DIR)/tkUndo.c $(GENERIC_DIR)/tkUtil.c \ $(GENERIC_DIR)/tkVisual.c $(GENERIC_DIR)/tkWindow.c \ @@ -1009,6 +1011,32 @@ tkOption.o: $(GENERIC_DIR)/tkOption.c tkPack.o: $(GENERIC_DIR)/tkPack.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPack.c +# TIP #59, embedding of configuration information into the binary library. +# +# Part of Tk's configuration information are the paths where it was installed +# and where it will look for its libraries (which can be different). We derive +# this information from the variables which can be overridden by the user. As +# every path can be configured separately we do not remember one general +# prefix/exec_prefix but all the different paths individually. + +tkPkgConfig.o: $(GENERIC_DIR)/tkPkgConfig.c + $(CC) -c $(CC_SWITCHES) \ + -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR)\"" \ + -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR)\"" \ + -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR)\"" \ + -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR)\"" \ + -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \ + -DCFG_INSTALL_DEMODIR="\"$(DEMO_INSTALL_DIR)\"" \ + \ + -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ + -DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \ + -DCFG_RUNTIME_SCRDIR="\"$(TK_LIBRARY)\"" \ + -DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \ + -DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \ + -DCFG_RUNTIME_DEMODIR="\"$(DEMO_INSTALL_DIR)\"" \ + \ + $(GENERIC_DIR)/tkPkgConfig.c + tkPlace.o: $(GENERIC_DIR)/tkPlace.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPlace.c diff --git a/unix/configure b/unix/configure index 894f7d8..e8fb0d4 100755 --- a/unix/configure +++ b/unix/configure @@ -766,6 +766,7 @@ with_tcl enable_man_symlinks enable_man_compression enable_man_suffix +with_encoding enable_threads enable_shared enable_64bit @@ -1430,6 +1431,8 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) + --with-encoding encoding for configuration values (default: + iso8859-1) --with-x use the X Window System Some influential environment variables: @@ -3950,6 +3953,31 @@ $as_echo "$tcl_cv_cc_pipe" >&6; } fi #------------------------------------------------------------------------ +# Embedded configuration information, encoding to use for the values, TIP #59 +#------------------------------------------------------------------------ + + + +# Check whether --with-encoding was given. +if test "${with_encoding+set}" = set; then : + withval=$with_encoding; with_tcencoding=${withval} +fi + + + if test x"${with_tcencoding}" != x ; then + +cat >>confdefs.h <<_ACEOF +#define TCL_CFGVAL_ENCODING "${with_tcencoding}" +_ACEOF + + else + +$as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h + + fi + + +#------------------------------------------------------------------------ # Threads support - this auto-enables if Tcl was compiled threaded #------------------------------------------------------------------------ diff --git a/unix/configure.ac b/unix/configure.ac index 9c9765f..59c7601 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -111,6 +111,12 @@ if test -z "$no_pipe" && test -n "$GCC"; then fi #------------------------------------------------------------------------ +# Embedded configuration information, encoding to use for the values, TIP #59 +#------------------------------------------------------------------------ + +SC_TCL_CFG_ENCODING + +#------------------------------------------------------------------------ # Threads support - this auto-enables if Tcl was compiled threaded #------------------------------------------------------------------------ diff --git a/unix/tkConfig.h.in b/unix/tkConfig.h.in index 4fd7726..99e87f9 100644 --- a/unix/tkConfig.h.in +++ b/unix/tkConfig.h.in @@ -136,6 +136,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* What encoding should be used for embedded configuration info? */ +#undef TCL_CFGVAL_ENCODING + /* Is this a 64-bit build? */ #undef TCL_CFG_DO64BIT diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 9c1116d..379af05 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -57,24 +57,13 @@ static Tcl_ThreadDataKey dataKey; /* * Package initialization: - * Nothing to do here except register the fact that we're using Xft in - * the TIP 59 configuration database. + * Nothing to do! */ -#ifndef TCL_CFGVAL_ENCODING -#define TCL_CFGVAL_ENCODING "ascii" -#endif - void TkpFontPkgInit( TkMainInfo *mainPtr) /* The application being created. */ { - static const Tcl_Config cfg[] = { - { "fontsystem", "xft" }, - { 0,0 } - }; - - Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING); } static XftFont * |