-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtcl_tk_options.gpr
More file actions
80 lines (68 loc) · 2.98 KB
/
tcl_tk_options.gpr
File metadata and controls
80 lines (68 loc) · 2.98 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
-- Copyright (C) Simon Wright <simon@pushface.org>
-- This package is free software; you can redistribute it and/or
-- modify it under terms of the GNU General Public License as
-- published by the Free Software Foundation; either version 2, or
-- (at your option) any later version. This package is distributed in
-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without
-- even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-- PARTICULAR PURPOSE. See the GNU General Public License for more
-- details. You should have received a copy of the GNU General Public
-- License distributed with this package; see file COPYING. If not,
-- write to the Free Software Foundation, 59 Temple Place - Suite
-- 330, Boston, MA 02111-1307, USA.
-- This file is used to define the architecture-dependent compilation
-- and linking options for building src/tcl_record_sizes.ads and for
-- the tash library itself (the first has to be built before the
-- second).
abstract project Tcl_Tk_Options is
type Platform_Type is ("linux", "macos", "windows");
Platform : Platform_Type := external ("TASH_PLATFORM", "linux");
C_Compiler_Switches := ();
Include_Prefix := "";
case Platform is
when "linux" =>
-- I'd prefer to get CFLAGS from `pkg-config --cflags
-- tk8.6`, but can't work out how.
C_Compiler_Switches := C_Compiler_Switches
& ("-I/usr/include/tcl8.6");
-- & external_as_list ("CFLAGS", " ");
when "macos" =>
-- Prior to https://github.com/Homebrew/homebrew-core/pull/124056,
-- tcl-tk was "keg-only" which meant it couldn't be found on the
-- standard include path ($HOMEBREW_PREFIX/include); however, you
-- can always find an installed package in $HOMEBREW_PREFIX/opt.
-- The change above moves the tcl-tk includes down a level, so
-- here we include both; one of them should work!
Include_Prefix := external ("HOMEBREW_PREFIX", "")
& "/opt/tcl-tk/include";
C_Compiler_Switches := C_Compiler_Switches &
(
"-I" & Include_Prefix,
"-I" & Include_Prefix & "/tcl-tk"
);
when "windows" =>
null;
end case;
Platform_Linker_Options := ();
case Platform is
when "linux" =>
-- I'd prefer to get LDFLAGS from `pkg-config --libs
-- tk8.6`, but can't work out how.
Platform_Linker_Options := Platform_Linker_Options &
("-ltk8.6", "-ltkstub8.6", "-ltcl8.6", "-ltclstub8.6");
when "macos" =>
Platform_Linker_Options := Platform_Linker_Options &
(
"-L" & external ("HOMEBREW_PREFIX", "") & "/opt/tcl-tk/lib",
"-L/usr/local/include", -- Github CI
"-ltk8.6",
"-ltcl8.6"
);
when "windows" =>
Platform_Linker_Options := Platform_Linker_Options &
(
"-ltk",
"-ltcl"
);
end case;
end Tcl_Tk_Options;