]> Dogcows Code - chaz/yoink/blob - options.lua
global gravity for rigid bodies
[chaz/yoink] / options.lua
1
2 --
3 -- Yoink Configuration Rules
4 -- Use this file with config.lua to generate config files.
5 --
6
7 local project = "Yoink"
8 local version = "0.1"
9 local website = "http://www.dogcows.com/yoink"
10 local contact = "chaz@dogcows.com"
11
12
13 local check = require "check"
14 local util = require "utility"
15
16 return string.format("%s %s", project, version),
17 {
18 name = "Yoink Configuration",
19 caption = "Choose the category of settings to view/change.",
20 {
21 name = "Installation Paths",
22 caption = "Set the directory paths where program files will be installed.",
23 {
24 symbol = "prefix",
25 value = "/usr/local",
26 cmdline = "--prefix",
27 name = "Prefix",
28 caption = "Set the base installation directory.",
29 check = function(value)
30 libdir = value .. "/lib"
31 return value
32 end
33 },
34 {
35 symbol = "exec_prefix",
36 value = "$(prefix)",
37 cmdline = "--exec-prefix",
38 name = "Executable Prefix",
39 caption = "Set the base installation directory for executables.",
40 visible = function() return showAdvanced end
41 },
42 {
43 symbol = "bindir",
44 value = "$(exec_prefix)/bin",
45 cmdline = "--bindir",
46 name = "Binaries",
47 caption = "Set the executable storage directory."
48 },
49 {
50 symbol = "libdir",
51 value = "/usr/local/lib"
52 },
53 {
54 symbol = "datarootdir",
55 value = "$(prefix)/share",
56 cmdline = "--datarootdir",
57 name = "Data Root",
58 caption = "Set the base installation directory for resource files.",
59 visible = function() return showAdvanced end
60 },
61 {
62 symbol = "datadir",
63 value = "$(datarootdir)",
64 cmdline = "--datadir",
65 name = "Data",
66 caption = "Set the program resource storage directory."
67 },
68 {
69 symbol = "pkgdatadir",
70 value = "$(datadir)/$(projectName)",
71 config = "YOINK_DATADIR",
72 export = "pkgdatadir",
73 name = "Package Data",
74 caption = "Set the program resource storage directory.",
75 visible = function() return showAdvanced end
76 },
77 {
78 symbol = "mandir",
79 value = "$(datarootdir)/man",
80 cmdline = "--mandir",
81 name = "Manuals",
82 caption = "Set the manual page storage directory."
83 }
84 },
85 {
86 name = "Build Options",
87 caption = "Set toolset commands and flags.",
88 {
89 symbol = "build",
90 value = util.exec("config.guess"),
91 cmdline = "--build",
92 name = "Build Triplet",
93 caption = "Set the build triplet.",
94 check = function(value) return value end
95 },
96 {
97 symbol = "host",
98 value = "",
99 cmdline = "--host",
100 name = "Host Triplet",
101 caption = "Set the host triplet.",
102 check = function(value)
103 if value == ""
104 then
105 CC = "gcc"
106 CXX = "g++"
107 AR = "ar"
108 RANLIB = "ranlib"
109 WINDRES = "windres"
110 else
111 CC = value .. "-gcc"
112 CXX = value .. "-g++"
113 AR = value .. "-ar"
114 RANLIB = value .. "-ranlib"
115 WINDRES = value .. "-windres"
116 end
117 if value:find("mingw32")
118 then
119 platform = "win32"
120 EXEEXT = ".exe"
121 else
122 platform = "posix"
123 EXEEXT = ""
124 end
125 return value
126 end,
127 before = {"dependencies", "CC", "CXX", "AR", "RANLIB", "WINDRES"}
128 },
129 {
130 symbol = "EXEEXT",
131 value = "",
132 name = "Executable Suffix",
133 export = "EXEEXT",
134 caption = "Set the extension of binary executables.",
135 help = [[
136 Some platforms follow certain conventions with regard
137 to the file extension of executables. By default, the
138 build system will create executables with no suffix,
139 but specifying this option will cause the text to be
140 appended to the names of these files.
141
142 This option may be changed without your intervention if
143 automatic checks determine there is a common executable
144 suffix for the host platform.
145 ]],
146 visible = function() return showAdvanced end
147 },
148 {
149 symbol = "platform",
150 value = {"posix", "win32"},
151 config = "PLATFORM",
152 name = "Platform",
153 caption = "Set the architectural platform to target.",
154 visible = function() return showAdvanced end,
155 check = function(value)
156 if value == "win32"
157 then
158 PKG_LDLIBS = PKG_LDLIBS:setFlag("-lws2_32")
159 else
160 PKG_LDLIBS = PKG_LDLIBS:unsetFlag("-lws2_32")
161 end
162 return value
163 end,
164 before = {"LDLIBS"}
165 },
166 {
167 name = "Toolset Options",
168 caption = "Customize the toolset.",
169 help = [[
170 You can set which compilers and other tools to use.
171 You may also specify which extra flags should be used
172 during the compile and linking phase.
173 ]],
174 {
175 symbol = "CC",
176 value = "cc",
177 cmdline = "CC",
178 name = "CC",
179 caption = "Set the C compiler command."
180 },
181 {
182 symbol = "CXX",
183 value = "g++",
184 cmdline = "CXX",
185 name = "CXX",
186 caption = "Set the C++ compiler command."
187 },
188 {
189 symbol = "AR",
190 value = "ar",
191 cmdline = "AR",
192 name = "AR",
193 caption = "Set the archiver for static libraries command."
194 },
195 {
196 symbol = "RANLIB",
197 value = "ranlib",
198 cmdline = "RANLIB",
199 name = "RANLIB",
200 caption = "Set the archive indexer command."
201 },
202 {
203 symbol = "WINDRES",
204 value = "windres",
205 cmdline = "WINDRES",
206 name = "WINDRES",
207 caption = "Set the Windows resource compiler command.",
208 visible = function() return platform == "win32" end
209 },
210 "------------INSERT-BLANK-LINE------------",
211 {
212 symbol = "CFLAGS",
213 value = "-Wall -Wno-uninitialized -O2",
214 cmdline = "CFLAGS",
215 name = "CFLAGS",
216 caption = "Set the C compiler flags."
217 },
218 {
219 symbol = "CXXFLAGS",
220 value = "$(CFLAGS)",
221 cmdline = "CXXFLAGS",
222 name = "CXXFLAGS",
223 caption = "Set the C++ compiler flags."
224 },
225 {
226 symbol = "CPPFLAGS",
227 value = "",
228 cmdline = "CPPFLAGS",
229 name = "CPPFLAGS",
230 caption = "Set the C preprocessor flags."
231 },
232 {
233 symbol = "LDLIBS",
234 value = "",
235 cmdline = "LIBS",
236 name = "LIBS",
237 caption = "Set the libraries the executable should link with."
238 },
239 {
240 symbol = "LDFLAGS",
241 value = "",
242 cmdline = "LDFLAGS",
243 name = "LDFLAGS",
244 caption = "Set the linker flags."
245 },
246 {
247 symbol = "dependencies",
248 value = "sdl gl glu libpng openal vorbisfile lua|lua5.1",
249 check = function(value)
250 local value, err = util.pkgfind(value, libdir)
251 if value
252 then
253 PKG_CFLAGS = util.pkgconfig("CFLAGS", value, libdir)
254 PKG_LDLIBS = util.pkgconfig("LIBS", value, libdir) .. " -lz"
255 PKG_LDFLAGS = util.pkgconfig("LDFLAGS", value, libdir)
256 end
257 return value, err
258 end,
259 after = {"prefix"},
260 temp = true
261 },
262 {
263 symbol = "PKG_CFLAGS",
264 value = "",
265 after = {"dependencies"}
266 },
267 {
268 symbol = "PKG_CXXFLAGS",
269 value = "$(PKG_CFLAGS)",
270 after = {"PKG_CFLAGS"}
271 },
272 {
273 symbol = "PKG_LDLIBS",
274 value = "",
275 after = {"dependencies"}
276 },
277 {
278 symbol = "PKG_LDFLAGS",
279 value = "",
280 after = {"dependencies"}
281 }
282 },
283 "------------INSERT-BLANK-LINE------------",
284 {
285 symbol = "tracking",
286 value = true,
287 cmdline = "--enable-dependency-tracking",
288 name = "Dependency Tracking",
289 caption = "Enable tracking of code dependencies.",
290 help = [[
291 If you are working on the code, you want this enabled
292 so that the files you edit will automatically be
293 rebuilt when you run make. This may add some overhead
294 to the build process.
295
296 If in doubt, say Yes.
297 ]]
298 },
299 {
300 symbol = "pch",
301 value = false,
302 cmdline = "--enable-pch",
303 name = "Use Precompiled Header",
304 caption = "Enable building and using a precompiled header.",
305 help = [[
306 Recent versions of GCC can use precompiled headers
307 which may improve compile times.
308
309 If in doubt, say No.
310 ]]
311 },
312 {
313 symbol = "profile",
314 value = false,
315 cmdline = "--enable-profile",
316 config = "ENABLE_PROFILING",
317 name = "Profiling",
318 caption = "Compile in gprof instructions for profiling.",
319 help = [[
320 Yoink can be compiled with extra instructions to
321 generate statistical data regarding the performance of
322 the code. This data is saved to a file which can be
323 used by the gprof program to generate a nice report.
324
325 If in doubt, say No.
326 ]],
327 check = function(value)
328 if value
329 then
330 PKG_CFLAGS = PKG_CFLAGS:setFlag("-pg")
331 PKG_LDFLAGS = PKG_LDFLAGS:setFlag("-pg")
332 else
333 PKG_CFLAGS = PKG_CFLAGS:unsetFlag("-pg")
334 PKG_LDFLAGS = PKG_LDFLAGS:unsetFlag("-pg")
335 end
336 return value
337 end
338 }
339 },
340 {
341 name = "Program Features",
342 caption = "Choose which features to compile into the program.",
343 {
344 symbol = "debug",
345 value = false,
346 cmdline = "--enable-debug",
347 config = {"DEBUG", "!NDEBUG"},
348 name = "Debug Mode",
349 caption = "Compile in debug codepaths.",
350 help = [[
351 The debug target mode enables runtime assertions and
352 other codepaths appropriate for finding bugs and
353 diagnosing problems. The release target mode will
354 avoid compiling in this extra overhead and also set
355 some compiler flags for optimizing the performance of
356 the code.
357
358 Note that logging and exception-handling facilities are
359 still available in release mode, and debug symbols are
360 always available provided you do not explicitly strip
361 them out. Therefore, many problems can be diagnosed
362 without these extra codepaths.
363
364 If in doubt, say No.
365 ]],
366 check = function(value)
367 if value then
368 CFLAGS = CFLAGS:setFlag("-Wall", "-g")
369 end
370 return value
371 end
372 },
373 {
374 symbol = "clock_gettime",
375 value = false,
376 cmdline = "--enable-clock_gettime",
377 config = "ENABLE_CLOCK_GETTIME",
378 name = "clock_gettime",
379 caption = "Use a high-res clock on platforms that support it.",
380 help = [[
381 By default, Yoink will use whatever timing facility is
382 provided by SDL. This only provides a low-resolution
383 guarantee. On some targets, a much higher-resolution
384 timer is available through the use of clock_gettime(2).
385 On such platforms, SDL might have been built to use
386 this time source. This option will cause Yoink to use
387 it directly so that the high resolution is guaranteed.
388
389 If in doubt, say No.
390 ]],
391 visible = function() return platform == "posix" end
392 },
393 {
394 symbol = "doublePrecision",
395 value = false,
396 cmdline = "--enable-double-precision",
397 config = "ENABLE_DOUBLE_PRECISION",
398 name = "Double Precision",
399 caption = "Use doubles for floating point numbers.",
400 help = [[
401 The most common data type for storing non-integral
402 numbers is called a float. These are quickly processed
403 on modern hardware, but they suffer problems in
404 accuracy. A much more accurate data type is a double,
405 but they may take a bit longer to process.
406
407 In most cases, floats are adequate. Yet, using doubles
408 will help prevent small inaccuracies from accumulating
409 over time and becoming a bigger deal.
410
411 If in doubt, say No.
412 ]]
413 },
414 {
415 symbol = "hotloading",
416 value = false,
417 cmdline = "--enable-hotloading",
418 config = "ENABLE_HOTLOADING",
419 name = "Hotloading",
420 caption = "Allow assets to reload themselves automatically.",
421 help = [[
422 Hotloading allows game resources to be reloaded into
423 the game automatically whenever they are changed on
424 disk. For example, if you are running Yoink at the
425 same time as you are editing one of its image files,
426 any changes you save to the file will immediately be
427 seen in the game. Other types of assets are also
428 hotloadable. This is very useful to content creators
429 interested in rapid development.
430
431 Currently only recent Linux kernels are supported.
432 There is a small amount of overhead associated with
433 hotloading; as such, it is not recommended unless you
434 plan to take advantage of its benefits.
435
436 If in doubt, say No.
437 ]],
438 visible = function() return platform == "posix" end
439 },
440 {
441 symbol = "threads",
442 value = true,
443 cmdline = "--enable-threads",
444 config = "ENABLE_THREADS",
445 name = "Threads",
446 caption = "Use threads for concurrency where appropriate.",
447 help = [[
448 If you have multiple processors or cores, enabling
449 threads will allow the workload to be shared. This
450 may have limited usefulness even if you have only a
451 single core.
452
453 If in doubt, say Yes.
454 ]]
455 },
456 {
457 symbol = "gui",
458 value = {"none", "gtk", "qt4"},
459 cmdline = "--with-gui",
460 config = "WITH_GUI",
461 name = "GUI Toolkit",
462 caption = "Set which (if any) widget toolkit to use for dialogs.",
463 help = [[
464 Sometimes Yoink will show a dialog window for the
465 purpose of providing diagnostics information. If you
466 have KDE, you probably want to choose QT4 for this
467 purpose. If you have Gnome or any other environment,
468 you may prefer GTK2. This option will make certain QT4
469 or GTK2 libraries dependencies. If you choose "none,"
470 no dialog windows will be shown, and any such
471 information can be seen from the terminal output.
472
473 Under certain targets, the native API will be used and
474 this option will have no effect. For example, a
475 mingw32 target will automatically use native win32
476 dialogs.
477
478 If in doubt, say None.
479 ]],
480 visible = function() return platform == "posix" end,
481 check = function(value)
482 dependencies = dependencies:unsetFlag("gtk+-2.0", "QtGui")
483 if value == "gtk" then dependencies = dependencies:setFlag("gtk+-2.0")
484 elseif value == "qt4" then dependencies = dependencies:setFlag("QtGui") end
485 return value
486 end,
487 before = {"dependencies"}
488 }
489 },
490 {
491 name = "Package Strings",
492 caption = "Set the package strings.",
493 visible = function() return showAdvanced end,
494 {
495 symbol = "PACKAGE",
496 value = project,
497 config = {"PACKAGE_NAME", "PACKAGE"},
498 name = "Package Name",
499 export = "PACKAGE",
500 caption = "Set the name of the program.",
501 check = function(value)
502 projectName = util.symbolize(value) return value
503 end
504 },
505 {
506 symbol = "projectName",
507 value = util.symbolize(project),
508 export = "projectName",
509 },
510 {
511 symbol = "VERSION",
512 value = version,
513 config = "PACKAGE_VERSION",
514 export = "VERSION",
515 name = "Version",
516 caption = "Set the three-part version number of the program.",
517 check = function(value)
518 versionMajor, versionMinor, versionRevision = util.splitVersion(value)
519 return value
520 end,
521 before = {"versionMajor", "versionMinor", "versionRevision"}
522 },
523 {
524 symbol = "packageString",
525 value = "$(PACKAGE) $(VERSION)",
526 config = "PACKAGE_STRING",
527 name = "Full String",
528 caption = "Set the complete package string."
529 },
530 {
531 symbol = "TARNAME",
532 value = "$(projectName)",
533 config = "PACKAGE_TARNAME",
534 name = "Archive Name",
535 caption = "Set the name used in creating tarballs."
536 },
537 {
538 symbol = "archiveFormat",
539 value = {"bzip2", "gzip", "lzma", "xz", "all"},
540 name = "Default Archive Format",
541 caption = "Set the default compression format for tarballs."
542 },
543 {
544 symbol = "email",
545 value = contact,
546 config = "PACKAGE_BUGREPORT",
547 export = "email",
548 name = "Email Address",
549 caption = "Set the email address for collecting bug reports."
550 },
551 {
552 symbol = "website",
553 value = website,
554 config = "PACKAGE_URL",
555 name = "Website URL",
556 caption = "Set the project website URL."
557 },
558 {
559 symbol = "versionMajor",
560 value = 0,
561 config = "VERSION_MAJOR"
562 },
563 {
564 symbol = "versionMinor",
565 value = 0,
566 config = "VERSION_MINOR"
567 },
568 {
569 symbol = "versionRevision",
570 value = 0,
571 config = "VERSION_REVISION"
572 },
573 {
574 symbol = "gitHead",
575 value = "",
576 check = function(value)
577 local hash, code = util.exec("git show-ref --head HEAD | sed -n 's/\\(.*\\) HEAD/\\1/p'")
578 if code == 0 then value = hash end
579 return value
580 end
581 },
582 {
583 symbol = "manCompression",
584 value = {"none", "bzip2", "gzip"},
585 cmdline = "--with-man-compression",
586 name = "Manual Compression",
587 caption = "Set which compression to use for installed man pages"
588 },
589 {
590 symbol = "includeConfig",
591 value = true,
592 config = "INCLUDE_CONFIG_FILE",
593 name = "Compile config.mk into executable",
594 caption = "What the name says."
595 }
596 },
597 "------------INSERT-BLANK-LINE------------",
598 {
599 symbol = "showAdvanced",
600 value = false,
601 name = "Show Advanced Options",
602 caption = "Show advanced (and often less useful) options."
603 }
604 }
605
This page took 0.059229 seconds and 4 git commands to generate.