-
Notifications
You must be signed in to change notification settings - Fork 0
/
0201-Cygwin-ada-shared-prefix.patch
183 lines (175 loc) · 8.28 KB
/
0201-Cygwin-ada-shared-prefix.patch
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
--- src/gcc-11-20230303/gcc/ada/gcc-interface/Makefile.in
+++ origsrc/gcc-11-20230303/gcc/ada/gcc-interface/Makefile.in
@@ -196,6 +196,11 @@
MULTISUBDIR =
RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
+SHARED_PFX=lib
+ifneq (,$(filter %cygwin,$(target)))
+SHARED_PFX=cyg
+endif
+
# Link flags used to build gnat tools. By default we prefer to statically
# link with libgcc to avoid a dependency on shared libgcc (which is tricky
# to deal with as it may conflict with the libgcc provided by the system).
@@ -545,16 +550,16 @@
# Also install the .dSYM directories if they exist (these directories
# contain the debug information for the shared libraries on darwin)
for file in gnat gnarl; do \
- if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
- $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ if [ -f $(RTSDIR)/$(SHARED_PFX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
+ $(INSTALL) $(RTSDIR)/$(SHARED_PFX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(DESTDIR)$(ADA_RTL_DSO_DIR); \
fi; \
- if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
- $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(DESTDIR)$(ADA_RTL_DSO_DIR)/lib$${file}$(soext); \
+ if [ -f $(RTSDIR)/$(SHARED_PFX)$${file}$(soext) ]; then \
+ $(LN_S) $(SHARED_PFX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(DESTDIR)$(ADA_RTL_DSO_DIR)/$(SHARED_PFX)$${file}$(soext); \
fi; \
- if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
- $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
+ if [ -d $(RTSDIR)/$(SHARED_PFX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
+ $(CP) -r $(RTSDIR)/$(SHARED_PFX)$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
$(DESTDIR)$(ADA_RTL_DSO_DIR); \
fi; \
done
@@ -668,25 +673,25 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib
- $(RM) $(RTSDIR)/libgna*$(soext)
+ $(RM) $(RTSDIR)/$(SHARED_PFX)gna*$(soext)
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
$(PICFLAG_FOR_TARGET) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SO_OPTS)$(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(MISCLIB) -lm
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
$(PICFLAG_FOR_TARGET) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SO_OPTS)$(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(THREADSLIB)
- cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnat$(soext)
- cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl$(soext)
+ cd $(RTSDIR); $(LN_S) $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SHARED_PFX)gnat$(soext)
+ cd $(RTSDIR); $(LN_S) $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SHARED_PFX)gnarl$(soext)
# Create static libgnat and libgnarl compiled with -fPIC
$(RM) $(RTSDIR)/libgnat_pic$(arext) $(RTSDIR)/libgnarl_pic$(arext)
@@ -707,7 +712,7 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib-shared-default
- $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(MV) $(RTSDIR)/$(SHARED_PFX)gna*$(soext) .
$(MV) $(RTSDIR)/libgnat_pic$(arext) .
$(MV) $(RTSDIR)/libgnarl_pic$(arext) .
$(RM) ../stamp-gnatlib2-$(RTSDIR)
@@ -719,7 +724,7 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib
- $(MV) libgna*$(soext) $(RTSDIR)
+ $(MV) $(SHARED_PFX)gna*$(soext) $(RTSDIR)
$(MV) libgnat_pic$(arext) $(RTSDIR)
$(MV) libgnarl_pic$(arext) $(RTSDIR)
@@ -733,7 +738,7 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib-shared-win32
- $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(MV) $(RTSDIR)/$(SHARED_PFX)gna*$(soext) .
$(RM) ../stamp-gnatlib2-$(RTSDIR)
$(MAKE) $(FLAGS_TO_PASS) \
GNATLIBFLAGS="$(GNATLIBFLAGS)" \
@@ -743,7 +748,7 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib
- $(MV) libgna*$(soext) $(RTSDIR)
+ $(MV) $(SHARED_PFX)gna*$(soext) $(RTSDIR)
# ??? we need to add the option to support auto-import of arrays/records to
# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
@@ -758,22 +763,22 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib
- $(RM) $(RTSDIR)/libgna*$(soext)
+ $(RM) $(RTSDIR)/$(SHARED_PFX)gna*$(soext)
$(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
$(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
$(PICFLAG_FOR_TARGET) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
+ $(SO_OPTS)$(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
$(PICFLAG_FOR_TARGET) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+ $(SO_OPTS)$(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(THREADSLIB) -Wl,$(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
gnatlib-shared-darwin:
$(MAKE) $(FLAGS_TO_PASS) \
@@ -784,29 +789,29 @@
THREAD_KIND="$(THREAD_KIND)" \
LN_S="$(LN_S)" \
gnatlib
- $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
- $(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
+ $(RM) $(RTSDIR)/$(SHARED_PFX)gnat$(soext) $(RTSDIR)/$(SHARED_PFX)gnarl$(soext)
+ $(CP) $(RTSDIR)/$(SHARED_PFX)gnat$(arext) $(RTSDIR)/$(SHARED_PFX)gnat_pic$(arext)
$(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
$(SO_OPTS) \
- -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -Wl,-install_name,@rpath/$(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(MISCLIB)
cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
| sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ -o $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
$(GNATRTL_TASKING_OBJS) \
$(SO_OPTS) \
- -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
- cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnat$(soext)
- cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl$(soext)
- cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
- cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
+ -Wl,-install_name,@rpath/$(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(THREADSLIB) -Wl,$(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+ cd $(RTSDIR); $(LN_S) $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SHARED_PFX)gnat$(soext)
+ cd $(RTSDIR); $(LN_S) $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(SHARED_PFX)gnarl$(soext)
+ cd $(RTSDIR); dsymutil $(SHARED_PFX)gnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+ cd $(RTSDIR); dsymutil $(SHARED_PFX)gnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
gnatlib-shared:
$(MAKE) $(FLAGS_TO_PASS) \