-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathtkPkgConfig.c
More file actions
151 lines (135 loc) · 4.18 KB
/
Copy pathtkPkgConfig.c
File metadata and controls
151 lines (135 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*
* tkPkgConfig.c --
*
* This file contains the configuration information to embed into the tcl
* binary library.
*
* Copyright © 2002 Andreas Kupries <andreas_kupries@users.sourceforge.net>
* Copyright © 2017 Stuart Cassoff <stwo@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
/* Note, the definitions in this module are influenced by the following C
* preprocessor macros:
*
* - _WIN32 || __CYGWIN__ The value for the fontsytem key will be
* MAC_OSX_TK chosen based on these macros/defines.
* HAVE_XFT declares that xft font support was requested.
*
* - CFG_RUNTIME_* Paths to various stuff at runtime.
* - CFG_INSTALL_* Paths to various stuff at installation time.
*
* - TCL_CFGVAL_ENCODING string containing the encoding used for the
* configuration values.
*/
#include "tkInt.h"
#ifndef TCL_CFGVAL_ENCODING
#define TCL_CFGVAL_ENCODING "utf-8"
#endif
/*
* Use C preprocessor statements to define the various values for the embedded
* configuration information.
*/
#if defined(_WIN32)
# define CFG_FONTSYSTEM "gdi"
#elif defined(MAC_OSX_TK)
# define CFG_FONTSYSTEM "cocoa"
#elif defined(HAVE_XFT)
# define CFG_FONTSYSTEM "xft"
#else
# define CFG_FONTSYSTEM "x11"
#endif
/*
The macOS framework build first installs the framework in the build
directory and then copies it to /Library/Frameworks/Tk.framework.
Without these macros the pkgconfig paths point into the build
directory instead of into the installed framework.
*/
#if defined(MAC_OSX_TK) && defined(TK_FRAMEWORK)
#undef CFG_INSTALL_LIBDIR
#undef CFG_RUNTIME_LIBDIR
#undef CFG_INSTALL_BINDIR
#undef CFG_RUNTIME_BINDIR
#undef CFG_INSTALL_DOCDIR
#undef CFG_RUNTIME_DOCDIR
#undef CFG_INSTALL_SCRDIR
#undef CFG_RUNTIME_SCRDIR
#undef CFG_INSTALL_INCDIR
#undef CFG_RUNTIME_INCDIR
#undef CFG_INSTALL_DEMODIR
#undef CFG_RUNTIME_DEMODIR
#define VERSION_DIR "/Library/Frameworks/Tk.framework/Versions/"TK_VERSION
#define CFG_INSTALL_LIBDIR VERSION_DIR
#define CFG_RUNTIME_LIBDIR CFG_INSTALL_LIBDIR
#define CFG_INSTALL_BINDIR VERSION_DIR
#define CFG_RUNTIME_BINDIR CFG_INSTALL_BINDIR
#define CFG_INSTALL_DOCDIR VERSION_DIR "/Resources/Documentation"
#define CFG_RUNTIME_DOCDIR CFG_INSTALL_DOCDIR
#define CFG_INSTALL_SCRDIR VERSION_DIR "/Resources/Scripts"
#define CFG_RUNTIME_SCRDIR CFG_INSTALL_SCRDIR
#define CFG_INSTALL_INCDIR VERSION_DIR "/Headers"
#define CFG_RUNTIME_INCDIR CFG_INSTALL_INCDIR
#define CFG_INSTALL_DEMODIR VERSION_DIR "/Resources/Scripts/demos"
#define CFG_RUNTIME_DEMODIR CFG_INSTALL_DEMODIR
#endif
static const Tcl_Config cfg[] = {
{"fontsystem", CFG_FONTSYSTEM},
/* Runtime paths to various stuff */
#ifdef CFG_RUNTIME_LIBDIR
{"libdir,runtime", CFG_RUNTIME_LIBDIR},
#endif
#ifdef CFG_RUNTIME_BINDIR
{"bindir,runtime", CFG_RUNTIME_BINDIR},
#endif
#ifdef CFG_RUNTIME_SCRDIR
{"scriptdir,runtime", CFG_RUNTIME_SCRDIR},
#endif
#ifdef CFG_RUNTIME_INCDIR
{"includedir,runtime", CFG_RUNTIME_INCDIR},
#endif
#ifdef CFG_RUNTIME_DOCDIR
{"docdir,runtime", CFG_RUNTIME_DOCDIR},
#endif
#ifdef CFG_RUNTIME_DEMODIR
{"demodir,runtime", CFG_RUNTIME_DEMODIR},
#endif
#if !defined(STATIC_BUILD) && defined(CFG_RUNTIME_DLLFILE)
{"dllfile,runtime", CFG_RUNTIME_DLLFILE},
#endif
/* Installation paths to various stuff */
#ifdef CFG_INSTALL_LIBDIR
{"libdir,install", CFG_INSTALL_LIBDIR},
#endif
#ifdef CFG_INSTALL_BINDIR
{"bindir,install", CFG_INSTALL_BINDIR},
#endif
#ifdef CFG_INSTALL_SCRDIR
{"scriptdir,install", CFG_INSTALL_SCRDIR},
#endif
#ifdef CFG_INSTALL_INCDIR
{"includedir,install", CFG_INSTALL_INCDIR},
#endif
#ifdef CFG_INSTALL_DOCDIR
{"docdir,install", CFG_INSTALL_DOCDIR},
#endif
#ifdef CFG_INSTALL_DEMODIR
{"demodir,install", CFG_INSTALL_DEMODIR},
#endif
/* Last entry, closes the array */
{NULL, NULL}
};
void
TkInitEmbeddedConfigurationInformation(
Tcl_Interp *interp) /* Interpreter the configuration command is
* registered in. */
{
Tcl_RegisterConfig(interp, "tk", cfg, TCL_CFGVAL_ENCODING);
}
/*
* Local Variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* End:
*/