Add a configure option allowing users to choose whether to install sdl2-config
authorHugh McMaster <hugh.mcmaster@outlook.com>
Sun, 07 Apr 2019 23:01:07 +1000
changeset 127138ed803255020
parent 12712 66a50635b3e8
child 12714 9b7633bd0aa0
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
configure.ac
     1.1 --- a/Makefile.in	Tue Apr 23 14:24:58 2019 +0200
     1.2 +++ b/Makefile.in	Sun Apr 07 23:01:07 2019 +1000
     1.3 @@ -44,6 +44,8 @@
     1.4  
     1.5  WAYLAND_SCANNER = @WAYLAND_SCANNER@
     1.6  
     1.7 +INSTALL_SDL2_CONFIG = @INSTALL_SDL2_CONFIG@
     1.8 +
     1.9  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
    1.10  GEN_DIST = SDL2.spec
    1.11  
    1.12 @@ -155,8 +157,11 @@
    1.13  
    1.14  install: all install-bin install-hdrs install-lib install-data
    1.15  install-bin:
    1.16 +ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
    1.17  	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
    1.18  	$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
    1.19 +endif
    1.20 +
    1.21  install-hdrs: update-revision
    1.22  	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
    1.23  	for file in $(HDRS) $(SDLTEST_HDRS); do \
    1.24 @@ -179,8 +184,10 @@
    1.25  	$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
    1.26  	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
    1.27  	$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
    1.28 +ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
    1.29  	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
    1.30  	$(INSTALL) -m 644 sdl2-config.cmake $(DESTDIR)$(libdir)/cmake/SDL2
    1.31 +endif
    1.32  
    1.33  uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
    1.34  uninstall-bin:
     2.1 --- a/configure.ac	Tue Apr 23 14:24:58 2019 +0200
     2.2 +++ b/configure.ac	Sun Apr 07 23:01:07 2019 +1000
     2.3 @@ -3919,6 +3919,22 @@
     2.4          ;;
     2.5  esac
     2.6  
     2.7 +# Check whether to install sdl2-config
     2.8 +AC_MSG_CHECKING(whether to install sdl2-config)
     2.9 +AC_ARG_ENABLE([sdl2-config],
    2.10 +    AS_HELP_STRING([--enable-sdl2-config], [Install sdl2-config [default=yes]]),
    2.11 +    [case "${enableval}" in
    2.12 +        yes) enable_sdl2_config="TRUE" ;;
    2.13 +        no) enable_sdl2_config="FALSE" ;;
    2.14 +        *) AC_MSG_ERROR([bad value '${enableval}' for --enable-sdl2-config]) ;;
    2.15 +    esac], [enable_sdl2_config="TRUE"])
    2.16 +if test "$enable_sdl2_config" = "TRUE"; then
    2.17 +    AC_MSG_RESULT(yes)
    2.18 +else
    2.19 +    AC_MSG_RESULT(no)
    2.20 +fi
    2.21 +AC_SUBST([INSTALL_SDL2_CONFIG], [$enable_sdl2_config])
    2.22 +
    2.23  # Verify that we have all the platform specific files we need
    2.24  
    2.25  if test x$have_joystick != xyes; then