archrelease: copy trunk to extra-x86_64
[arch-packages.git] / java11-openjfx / trunk / java11-openjfx-flags.patch
blob26680f4de52738e383a74e3134f5580e755b712b
1 From a28f9aaab759d82384279c16d86bb98ab47412a3 Mon Sep 17 00:00:00 2001
2 From: Georgy Yakovlev <gyakovlev@gentoo.org>
3 Date: Sat, 1 Jun 2019 00:12:55 -0700
4 Subject: [PATCH] respect user cflags
6 ---
7 buildSrc/linux.gradle | 7 ++++++-
8 .../gstreamer/projects/linux/avplugin/Makefile | 16 ++++++----------
9 .../gstreamer/projects/linux/fxplugins/Makefile | 17 ++++++-----------
10 .../projects/linux/gstreamer-lite/Makefile | 16 ++++++----------
11 .../native/jfxmedia/projects/linux/Makefile | 16 ++++++----------
12 5 files changed, 30 insertions(+), 42 deletions(-)
14 diff --git a/buildSrc/linux.gradle b/buildSrc/linux.gradle
15 index 7a7cbc72..6705a0f3 100644
16 --- a/buildSrc/linux.gradle
17 +++ b/buildSrc/linux.gradle
18 @@ -44,8 +44,11 @@ LINUX.library = { name -> return "lib${name}.so" as String }
19 def commonFlags = [
20 "-fno-strict-aliasing", "-fPIC", "-fno-omit-frame-pointer", // optimization flags
21 "-fstack-protector",
22 + "-Wno-error=cast-function-type",
23 "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=trampolines"] // warning flags
25 +commonFlags.addAll(System.getenv("CFLAGS").trim().split(" "))
27 if (!IS_64) {
28 commonFlags += "-m32"
30 @@ -61,6 +64,8 @@ def linkFlags = ["-static-libgcc", "-static-libstdc++", "-shared", commonFlags,
31 "-z", "relro",
32 "-Wl,--gc-sections"].flatten()
34 +linkFlags.addAll(System.getenv("LDFLAGS").trim().split(" "))
36 if (IS_DEBUG_NATIVE) {
37 linkFlags += "-g"
39 @@ -294,7 +299,7 @@ LINUX.iio.nativeSource = [
40 LINUX.iio.compiler = compiler
41 LINUX.iio.ccFlags = [cFlags, "-fvisibility=hidden"].flatten()
42 LINUX.iio.linker = IS_STATIC_BUILD ? "ld" : linker
43 -LINUX.iio.linkFlags = [linkFlags].flatten()
44 +LINUX.iio.linkFlags = [linkFlags, "-ljpeg"].flatten()
45 LINUX.iio.lib = "javafx_iio"
47 LINUX.prismES2 = [:]
48 diff --git a/modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile b/modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile
49 index 450b55d3..f27b9479 100644
50 --- a/modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile
51 +++ b/modules/javafx.media/src/main/native/gstreamer/projects/linux/avplugin/Makefile
52 @@ -17,7 +17,7 @@ TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
53 OBJBASE_DIR = $(BUILD_DIR)/obj/plugins/avplugin
54 endif
56 -CFLAGS = -fPIC \
57 +CFLAGS := -fPIC \
58 -Wformat \
59 -Wextra \
60 -Wformat-security \
61 @@ -29,13 +29,8 @@ CFLAGS = -fPIC \
62 -DLINUX \
63 -DGST_DISABLE_LOADSAVE \
64 -DGSTREAMER_LITE \
65 - -ffunction-sections -fdata-sections
67 -ifeq ($(BUILD_TYPE), Release)
68 - CFLAGS += -Os
69 -else
70 - CFLAGS += -g -Wall
71 -endif
72 + -ffunction-sections -fdata-sections \
73 + ${CFLAGS}
75 PACKAGES_INCLUDES := $(shell pkg-config --cflags glib-2.0)
76 PACKAGES_LIBS := $(shell pkg-config --libs glib-2.0 gobject-2.0)
77 @@ -46,11 +41,12 @@ INCLUDES= -I../../../plugins \
78 -I../../../gstreamer-lite/gstreamer/libs \
79 $(PACKAGES_INCLUDES)
81 -LDFLAGS = -L$(BUILD_DIR) \
82 +LDFLAGS := -L$(BUILD_DIR) \
83 -lgstreamer-lite \
84 $(PACKAGES_LIBS) \
85 -z relro \
86 - -static-libgcc -static-libstdc++ -Wl,--gc-sections
87 + -static-libgcc -static-libstdc++ -Wl,--gc-sections \
88 + ${LDFLAGS}
90 ifneq ($(strip $(LIBAV_DIR)),)
91 INCLUDES += -I$(LIBAV_DIR)/include
92 diff --git a/modules/javafx.media/src/main/native/gstreamer/projects/linux/fxplugins/Makefile b/modules/javafx.media/src/main/native/gstreamer/projects/linux/fxplugins/Makefile
93 index 1e58d4d3..627865f9 100644
94 --- a/modules/javafx.media/src/main/native/gstreamer/projects/linux/fxplugins/Makefile
95 +++ b/modules/javafx.media/src/main/native/gstreamer/projects/linux/fxplugins/Makefile
96 @@ -14,7 +14,7 @@ DIRLIST = progressbuffer \
98 TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
100 -CFLAGS = -fPIC \
101 +CFLAGS := -fPIC \
102 -Wformat \
103 -Wextra \
104 -Wformat-security \
105 @@ -30,14 +30,8 @@ CFLAGS = -fPIC \
106 -DGST_DISABLE_LOADSAVE \
107 -DGST_DISABLE_GST_DEBUG \
108 -DGSTREAMER_LITE \
109 - -ffunction-sections -fdata-sections
111 -ifeq ($(BUILD_TYPE), Release)
112 - CFLAGS += -Os
113 -else
114 - CFLAGS += -g -Wall
115 -endif
117 + -ffunction-sections -fdata-sections \
118 + ${CFLAGS}
120 INCLUDES = -I$(SRCBASE_DIR) \
121 $(addprefix -I$(SRCBASE_DIR)/,$(DIRLIST)) \
122 @@ -47,9 +41,10 @@ INCLUDES = -I$(SRCBASE_DIR) \
123 PACKAGES_INCLUDES := $(shell pkg-config --cflags glib-2.0)
124 PACKAGES_LIBS := $(shell pkg-config --libs glib-2.0 gobject-2.0)
126 -LDFLAGS = -L$(BUILD_DIR) -lgstreamer-lite $(PACKAGES_LIBS) \
127 +LDFLAGS := -L$(BUILD_DIR) -lgstreamer-lite $(PACKAGES_LIBS) \
128 -z relro \
129 - -static-libgcc -static-libstdc++ -Wl,--gc-sections
130 + -static-libgcc -static-libstdc++ -Wl,--gc-sections \
131 + ${LDFLAGS}
133 ifeq ($(ARCH), x32)
134 CFLAGS += -m32
135 diff --git a/modules/javafx.media/src/main/native/gstreamer/projects/linux/gstreamer-lite/Makefile b/modules/javafx.media/src/main/native/gstreamer/projects/linux/gstreamer-lite/Makefile
136 index 5baa30a1..ddf0e521 100644
137 --- a/modules/javafx.media/src/main/native/gstreamer/projects/linux/gstreamer-lite/Makefile
138 +++ b/modules/javafx.media/src/main/native/gstreamer/projects/linux/gstreamer-lite/Makefile
139 @@ -37,7 +37,7 @@ DIRLIST = gstreamer/gst \
141 TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
143 -CFLAGS =-fPIC \
144 +CFLAGS :=-fPIC \
145 -Wformat \
146 -Wextra \
147 -Wformat-security \
148 @@ -51,13 +51,8 @@ CFLAGS =-fPIC \
149 -DLINUX \
150 -DGST_DISABLE_GST_DEBUG \
151 -DGST_DISABLE_LOADSAVE \
152 - -ffunction-sections -fdata-sections
154 -ifeq ($(BUILD_TYPE), Release)
155 - CFLAGS += -Os
156 -else
157 - CFLAGS += -g -Wall
158 -endif
159 + -ffunction-sections -fdata-sections \
160 + ${CFLAGS}
162 INCLUDES = -I$(BASE_DIR)/plugins \
163 -I$(SRCBASE_DIR)/projects/build/linux/common \
164 @@ -75,9 +70,10 @@ INCLUDES = -I$(BASE_DIR)/plugins \
165 PACKAGES_INCLUDES := $(shell pkg-config --cflags alsa glib-2.0)
166 PACKAGES_LIBS := $(shell pkg-config --libs alsa glib-2.0 gobject-2.0 gmodule-2.0 gthread-2.0)
168 -LDFLAGS = -L$(BUILD_DIR) -lm $(PACKAGES_LIBS) \
169 +LDFLAGS := -L$(BUILD_DIR) -lm $(PACKAGES_LIBS) \
170 -z relro \
171 - -static-libgcc -static-libstdc++ -Wl,--gc-sections
172 + -static-libgcc -static-libstdc++ -Wl,--gc-sections \
173 + ${LDFLAGS}
175 ifeq ($(ARCH), x32)
176 CFLAGS += -m32
177 diff --git a/modules/javafx.media/src/main/native/jfxmedia/projects/linux/Makefile b/modules/javafx.media/src/main/native/jfxmedia/projects/linux/Makefile
178 index ecbd859f..5881cf53 100644
179 --- a/modules/javafx.media/src/main/native/jfxmedia/projects/linux/Makefile
180 +++ b/modules/javafx.media/src/main/native/jfxmedia/projects/linux/Makefile
181 @@ -17,7 +17,7 @@ DIRLIST = jni \
183 TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
185 -CFLAGS = -DTARGET_OS_LINUX=1 \
186 +CFLAGS := -DTARGET_OS_LINUX=1 \
187 -D_GNU_SOURCE \
188 -DGST_REMOVE_DEPRECATED \
189 -DGST_DISABLE_GST_DEBUG \
190 @@ -26,7 +26,8 @@ CFLAGS = -DTARGET_OS_LINUX=1 \
191 -DHAVE_CONFIG_H \
192 -DJFXMEDIA_JNI_EXPORTS \
193 -DLINUX \
194 - -ffunction-sections -fdata-sections
195 + -ffunction-sections -fdata-sections \
196 + ${CFLAGS}
198 CPPFLAGS = -fno-rtti -ffunction-sections -fdata-sections
200 @@ -56,21 +57,16 @@ ifdef HOST_COMPILE
201 -I$(GSTREAMER_LITE_DIR)/gstreamer/libs \
202 $(PACKAGES_INCLUDES)
204 - LDFLAGS = -Wl,-rpath,\$$ORIGIN -L$(BUILD_DIR) -lgstreamer-lite $(PACKAGES_LIBS) \
205 + LDFLAGS := -Wl,-rpath,\$$ORIGIN -L$(BUILD_DIR) -lgstreamer-lite $(PACKAGES_LIBS) \
206 -z relro \
207 - -static-libgcc -static-libstdc++ -Wl,--gc-sections
208 + -static-libgcc -static-libstdc++ -Wl,--gc-sections \
209 + ${LDFLAGS}
210 else
211 CFLAGS += $(EXTRA_CFLAGS)
212 INCLUDES = $(BASE_INCLUDES)
213 LDFLAGS = -Wl,-rpath,\$$ORIGIN -L$(BUILD_DIR) $(EXTRA_LDFLAGS)
214 endif
216 -ifeq ($(BUILD_TYPE), Release)
217 - CFLAGS += -Os
218 -else
219 - CFLAGS += -g -Wall -D_DEBUG
220 -endif
222 ifeq ($(ARCH), x32)
223 CFLAGS += -m32
224 LDFLAGS += -m32
226 2.21.0