From 46af90d8c3646cb820354e6a562cb823c89efc8f Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Sun, 7 Apr 2019 23:01:07 +1000 Subject: [PATCH] Add a configure option allowing users to choose whether to install sdl2-config sdl2-config is installed by default if no flag is specified. --- Makefile.in | 7 +++++++ configure.ac | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Makefile.in b/Makefile.in index d72e82369fcb3..567624e90fb3a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,6 +44,8 @@ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ WAYLAND_SCANNER = @WAYLAND_SCANNER@ +INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@ + SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake cmake_uninstall.cmake.in configure configure.ac 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 wayland-protocols GEN_DIST = SDL2.spec @@ -155,8 +157,11 @@ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS) install: all install-bin install-hdrs install-lib install-data install-bin: +ifeq ($(INSTALL_SDL2_CONFIG),TRUE) $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config +endif + install-hdrs: update-revision $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2 for file in $(HDRS) $(SDLTEST_HDRS); do \ @@ -179,8 +184,10 @@ install-data: $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig +ifeq ($(INSTALL_SDL2_CONFIG),TRUE) $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2 $(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2 +endif uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-bin: diff --git a/configure.ac b/configure.ac index c891e07f4c1bd..81d41d948ebc2 100644 --- a/configure.ac +++ b/configure.ac @@ -3919,6 +3919,22 @@ AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau ;; esac +# Check whether to install sdl2-config +AC_MSG_CHECKING(whether to install sdl2-config) +AC_ARG_ENABLE([sdl2-config], + AS_HELP_STRING([--enable-sdl2-config], [Install sdl2-config [default=yes]]), + [case "${enableval}" in + yes) enable_sdl2_config="TRUE" ;; + no) enable_sdl2_config="FALSE" ;; + *) AC_MSG_ERROR([bad value '${enableval}' for --enable-sdl2-config]) ;; + esac], [enable_sdl2_config="TRUE"]) +if test "$enable_sdl2_config" = "TRUE"; then + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +AC_SUBST([INSTALL_SDL2_CONFIG], [$enable_sdl2_config]) + # Verify that we have all the platform specific files we need if test x$have_joystick != xyes; then