Makefile.in
author Ryan C. Gordon
Mon, 21 Aug 2017 00:42:06 -0400
changeset 11334 749cb40916f2
parent 11291 a153a5c6d413
child 11365 a9bd2625fa01
permissions -rw-r--r--
x11: specify event mask for buttons when grabbing pointer (thanks, Stas!).

This fixes a strange corner case (notes appended below), and should be
safe to do anyhow.

Fixes Bugzilla #3674.

"I did more tests.
It appears the bug only happens if there is
another window on the screen that has "always
on top" property. For me it is xawtv - it is
always opened in a screen corner. Closing
xawtv or removing "always on top" property
from it makes the problem to go away.
Plus, it doesn't appear like the buttons are
not delivered at all. It appears that instead
the button presses are delivered on some mouse
positions, but not delivered when you move the
mouse to other part of the window... So this is
really weird and is likely somewhere deep in the
Xorg.
Maybe somehow it happens that the cursor is
actually above the xawtv window, but, because
my app uses grab, it is not visible there, and
in that case the events are not delivered to
my app?
But with my patch the button events are
always delivered flawlessly, it seems.

Hmm, and that indeed seems to explain my problem:
if the mask is set properly and my app uses
grab, then, even if the mouse is above some
other window, the events would still be delivered
to the grabbing app, which is what actually wanted
because my app uses relative mouse mode, so it
doesn't know the pointer can cross some other window
(my app draws the pointer itself).
So my current theory is that my patch only enforces
the mouse grab, which otherwise can be tricked by
some other window preventing the button events
delivery (but motion events are still delivered
via xinput2, which makes it all look very obscure)."
slouken@1362
     1
# Makefile to build and install the SDL library
slouken@1362
     2
slouken@1362
     3
top_builddir = .
slouken@1362
     4
srcdir  = @srcdir@
slouken@1362
     5
objects = build
jadahl@10303
     6
gen = gen
slouken@1362
     7
prefix = @prefix@
slouken@1362
     8
exec_prefix = @exec_prefix@
slouken@2156
     9
bindir	= @bindir@
slouken@2156
    10
libdir  = @libdir@
slouken@2156
    11
includedir = @includedir@
slouken@2156
    12
datarootdir = @datarootdir@
slouken@2156
    13
datadir	= @datadir@
slouken@1391
    14
auxdir	= @ac_aux_dir@
slouken@1362
    15
distpath = $(srcdir)/..
slouken@6250
    16
distdir = SDL2-@SDL_VERSION@
slouken@1362
    17
distfile = $(distdir).tar.gz
slouken@1362
    18
slouken@1380
    19
@SET_MAKE@
slouken@1362
    20
SHELL	= @SHELL@
slouken@1362
    21
CC      = @CC@
slouken@1362
    22
INCLUDE = @INCLUDE@
slouken@1362
    23
CFLAGS  = @BUILD_CFLAGS@
slouken@1521
    24
EXTRA_CFLAGS = @EXTRA_CFLAGS@
slouken@1393
    25
LDFLAGS = @BUILD_LDFLAGS@
slouken@1521
    26
EXTRA_LDFLAGS = @EXTRA_LDFLAGS@
slouken@1362
    27
LIBTOOL = @LIBTOOL@
slouken@1362
    28
INSTALL = @INSTALL@
slouken@1419
    29
AR	= @AR@
slouken@1419
    30
RANLIB	= @RANLIB@
slouken@2204
    31
WINDRES	= @WINDRES@
slouken@1362
    32
slouken@6250
    33
TARGET  = libSDL2.la
slouken@1362
    34
OBJECTS = @OBJECTS@
jadahl@10303
    35
GEN_HEADERS = @GEN_HEADERS@
jadahl@10303
    36
GEN_OBJECTS = @GEN_OBJECTS@
slouken@3334
    37
VERSION_OBJECTS = @VERSION_OBJECTS@
slouken@1362
    38
slouken@11245
    39
SDLMAIN_TARGET = libSDL2main.la
slouken@1397
    40
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
slouken@1397
    41
slouken@11245
    42
SDLTEST_TARGET = libSDL2_test.la
slouken@6688
    43
SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
slouken@6688
    44
jadahl@10303
    45
WAYLAND_SCANNER = @WAYLAND_SCANNER@
jadahl@10303
    46
slouken@11210
    47
SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.in debian docs include Makefile.* sdl2-config.cmake.in sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in SDL2Config.cmake src test VisualC.html VisualC VisualC-WinRT Xcode Xcode-iOS
slouken@6250
    48
GEN_DIST = SDL2.spec
slouken@1362
    49
sbc@8876
    50
ifneq ($V,1)
sbc@8876
    51
RUN_CMD_AR     = @echo "  AR    " $@;
sbc@8876
    52
RUN_CMD_CC     = @echo "  CC    " $@;
sbc@8876
    53
RUN_CMD_CXX    = @echo "  CXX   " $@;
sbc@8876
    54
RUN_CMD_LTLINK = @echo "  LTLINK" $@;
sbc@8876
    55
RUN_CMD_RANLIB = @echo "  RANLIB" $@;
jadahl@10303
    56
RUN_CMD_GEN    = @echo "  GEN   " $@;
sbc@8876
    57
LIBTOOL += --quiet
sbc@8876
    58
endif
sbc@8876
    59
slouken@4929
    60
HDRS = \
slouken@4929
    61
	SDL.h \
slouken@4929
    62
	SDL_assert.h \
slouken@4929
    63
	SDL_atomic.h \
slouken@4929
    64
	SDL_audio.h \
slouken@8829
    65
	SDL_bits.h \
slouken@4929
    66
	SDL_blendmode.h \
slouken@4929
    67
	SDL_clipboard.h \
slouken@4929
    68
	SDL_cpuinfo.h \
slouken@8829
    69
	SDL_egl.h \
slouken@4929
    70
	SDL_endian.h \
slouken@4929
    71
	SDL_error.h \
slouken@4929
    72
	SDL_events.h \
icculus@7667
    73
	SDL_filesystem.h \
slouken@6690
    74
	SDL_gamecontroller.h \
slouken@4929
    75
	SDL_gesture.h \
slouken@4929
    76
	SDL_haptic.h \
slouken@5189
    77
	SDL_hints.h \
slouken@4929
    78
	SDL_joystick.h \
slouken@4929
    79
	SDL_keyboard.h \
slouken@5340
    80
	SDL_keycode.h \
slouken@4929
    81
	SDL_loadso.h \
slouken@5221
    82
	SDL_log.h \
slouken@4929
    83
	SDL_main.h \
slouken@6607
    84
	SDL_messagebox.h \
slouken@4929
    85
	SDL_mouse.h \
slouken@4929
    86
	SDL_mutex.h \
slouken@4929
    87
	SDL_name.h \
slouken@4929
    88
	SDL_opengl.h \
icculus@8827
    89
	SDL_opengl_glext.h \
slouken@4929
    90
	SDL_opengles.h \
slouken@8829
    91
	SDL_opengles2_gl2ext.h \
slouken@8829
    92
	SDL_opengles2_gl2.h \
slouken@8829
    93
	SDL_opengles2_gl2platform.h \
slouken@6205
    94
	SDL_opengles2.h \
slouken@8829
    95
	SDL_opengles2_khrplatform.h \
slouken@4929
    96
	SDL_pixels.h \
slouken@4929
    97
	SDL_platform.h \
slouken@4929
    98
	SDL_power.h \
slouken@4929
    99
	SDL_quit.h \
slouken@4929
   100
	SDL_rect.h \
slouken@5145
   101
	SDL_render.h \
slouken@4929
   102
	SDL_rwops.h \
slouken@4929
   103
	SDL_scancode.h \
slouken@4929
   104
	SDL_shape.h \
slouken@4929
   105
	SDL_stdinc.h \
slouken@4929
   106
	SDL_surface.h \
slouken@6345
   107
	SDL_system.h \
slouken@4929
   108
	SDL_syswm.h \
slouken@4929
   109
	SDL_thread.h \
slouken@4929
   110
	SDL_timer.h \
slouken@4929
   111
	SDL_touch.h \
icculus@7387
   112
	SDL_types.h \
slouken@4929
   113
	SDL_version.h \
slouken@4929
   114
	SDL_video.h \
slouken@4929
   115
	begin_code.h \
slouken@4929
   116
	close_code.h
slouken@2122
   117
slouken@6689
   118
SDLTEST_HDRS = $(shell ls $(srcdir)/include | fgrep SDL_test)
slouken@6688
   119
slouken@1362
   120
LT_AGE      = @LT_AGE@
slouken@1362
   121
LT_CURRENT  = @LT_CURRENT@
slouken@1362
   122
LT_RELEASE  = @LT_RELEASE@
slouken@1362
   123
LT_REVISION = @LT_REVISION@
slouken@11291
   124
LT_LDFLAGS  = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
slouken@1362
   125
slouken@6688
   126
all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
slouken@1622
   127
slouken@1622
   128
$(srcdir)/configure: $(srcdir)/configure.in
slouken@11206
   129
	@echo "Warning, configure is out of date, please re-run autogen.sh"
slouken@1362
   130
slouken@1362
   131
Makefile: $(srcdir)/Makefile.in
slouken@1362
   132
	$(SHELL) config.status $@
slouken@1362
   133
slouken@3416
   134
Makefile.in:;
slouken@3416
   135
slouken@1362
   136
$(objects):
slouken@1391
   137
	$(SHELL) $(auxdir)/mkinstalldirs $@
slouken@1362
   138
slouken@2982
   139
update-revision:
slouken@2982
   140
	$(SHELL) $(auxdir)/updaterev.sh
slouken@2982
   141
slouken@5346
   142
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
slouken@1362
   143
jadahl@10303
   144
$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
jadahl@10303
   145
	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
slouken@1362
   146
slouken@1397
   147
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
slouken@11291
   148
	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
slouken@1397
   149
slouken@6688
   150
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
slouken@11291
   151
	$(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(CC) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
slouken@6688
   152
slouken@3352
   153
install: all install-bin install-hdrs install-lib install-data
slouken@1362
   154
install-bin:
slouken@2156
   155
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
slouken@6250
   156
	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
slouken@5345
   157
install-hdrs: update-revision
slouken@6250
   158
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
slouken@6688
   159
	for file in $(HDRS) $(SDLTEST_HDRS); do \
slouken@6250
   160
	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL2/$$file; \
slouken@1362
   161
	done
slouken@6250
   162
	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL2/SDL_config.h
slouken@5345
   163
	if test -f include/SDL_revision.h; then \
slouken@6250
   164
	    $(INSTALL) -m 644 include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
slouken@5345
   165
	else \
slouken@6250
   166
	    $(INSTALL) -m 644 $(srcdir)/include/SDL_revision.h $(DESTDIR)$(includedir)/SDL2/SDL_revision.h; \
slouken@5345
   167
	fi
slouken@5345
   168
slouken@6688
   169
install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET)
slouken@2156
   170
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
slouken@2156
   171
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
slouken@11245
   172
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
slouken@11245
   173
	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
slouken@1362
   174
install-data:
slouken@2156
   175
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal
slouken@6250
   176
	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
slouken@2156
   177
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
slouken@6250
   178
	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
slouken@9785
   179
	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
slouken@9785
   180
	$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
slouken@1362
   181
slouken@3352
   182
uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
slouken@1362
   183
uninstall-bin:
slouken@6250
   184
	rm -f $(DESTDIR)$(bindir)/sdl2-config
slouken@1362
   185
uninstall-hdrs:
slouken@6688
   186
	for file in $(HDRS) $(SDLTEST_HDRS); do \
slouken@6250
   187
	    rm -f $(DESTDIR)$(includedir)/SDL2/$$file; \
slouken@1362
   188
	done
slouken@6250
   189
	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_config.h
slouken@6250
   190
	rm -f $(DESTDIR)$(includedir)/SDL2/SDL_revision.h
slouken@6250
   191
	-rmdir $(DESTDIR)$(includedir)/SDL2
slouken@1362
   192
uninstall-lib:
slouken@2156
   193
	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET)
slouken@2156
   194
	rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
slouken@6688
   195
	rm -f $(DESTDIR)$(libdir)/$(SDLTEST_TARGET)
slouken@1362
   196
uninstall-data:
slouken@6250
   197
	rm -f $(DESTDIR)$(datadir)/aclocal/sdl2.m4
slouken@6250
   198
	rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl2.pc
slouken@9785
   199
	rm -f $(DESTDIR)$(libdir)/cmake/SDL2/sdl2-config.cmake
slouken@1362
   200
slouken@1362
   201
clean:
slouken@1362
   202
	rm -rf $(objects)
jadahl@10303
   203
	rm -rf $(gen)
slouken@1380
   204
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   205
slouken@1362
   206
distclean: clean
slouken@6250
   207
	rm -f Makefile Makefile.rules sdl2-config
slouken@3334
   208
	rm -f config.status config.cache config.log libtool
slouken@1362
   209
	rm -rf $(srcdir)/autom4te*
slouken@1603
   210
	find $(srcdir) \( \
slouken@1603
   211
	    -name '*~' -o \
slouken@1603
   212
	    -name '*.bak' -o \
slouken@1603
   213
	    -name '*.old' -o \
slouken@1603
   214
	    -name '*.rej' -o \
slouken@1603
   215
	    -name '*.orig' -o \
slouken@1603
   216
	    -name '.#*' \) \
slouken@1362
   217
	    -exec rm -f {} \;
slouken@1380
   218
	if test -f test/Makefile; then (cd test; $(MAKE) $@); fi
slouken@1362
   219
slouken@1362
   220
dist $(distfile):
slouken@1391
   221
	$(SHELL) $(auxdir)/mkinstalldirs $(distdir)
slouken@5498
   222
	(cd $(srcdir); tar cf - $(SRC_DIST)) | (cd $(distdir); tar xf -)
slouken@5498
   223
	tar cf - $(GEN_DIST) | (cd $(distdir); tar xf -)
slouken@1846
   224
	find $(distdir) \( \
slouken@1845
   225
	    -name '*~' -o \
slouken@1845
   226
	    -name '*.bak' -o \
slouken@1845
   227
	    -name '*.old' -o \
slouken@1845
   228
	    -name '*.rej' -o \
slouken@1845
   229
	    -name '*.orig' -o \
slouken@1845
   230
	    -name '.#*' \) \
slouken@1845
   231
	    -exec rm -f {} \;
slouken@1848
   232
	if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi
slouken@6886
   233
	(cd $(distdir); build-scripts/updaterev.sh)
slouken@1362
   234
	tar cvf - $(distdir) | gzip --best >$(distfile)
slouken@1362
   235
	rm -rf $(distdir)
slouken@1362
   236
slouken@1362
   237
rpm: $(distfile)
slouken@1362
   238
	rpmbuild -ta $?