Add a configure option allowing users to choose whether to install sdl2-config

sdl2-config is installed by default if no flag is specified.
This commit is contained in:
Hugh McMaster 2019-04-07 23:01:07 +10:00
parent 2c92c8e85a
commit 46af90d8c3
2 changed files with 23 additions and 0 deletions

View File

@ -44,6 +44,8 @@ SDLTEST_OBJECTS = @SDLTEST_OBJECTS@
WAYLAND_SCANNER = @WAYLAND_SCANNER@ 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 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 GEN_DIST = SDL2.spec
@ -155,8 +157,11 @@ $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
install: all install-bin install-hdrs install-lib install-data install: all install-bin install-hdrs install-lib install-data
install-bin: install-bin:
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir)
$(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config $(INSTALL) -m 755 sdl2-config $(DESTDIR)$(bindir)/sdl2-config
endif
install-hdrs: update-revision install-hdrs: update-revision
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL2
for file in $(HDRS) $(SDLTEST_HDRS); do \ for file in $(HDRS) $(SDLTEST_HDRS); do \
@ -179,8 +184,10 @@ install-data:
$(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
$(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig $(INSTALL) -m 644 sdl2.pc $(DESTDIR)$(libdir)/pkgconfig
ifeq ($(INSTALL_SDL2_CONFIG),TRUE)
$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2 $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/cmake/SDL2
$(INSTALL) -m 644 sdl2-config.cmake $(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: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data
uninstall-bin: uninstall-bin:

View File

@ -3919,6 +3919,22 @@ AS_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
;; ;;
esac 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 # Verify that we have all the platform specific files we need
if test x$have_joystick != xyes; then if test x$have_joystick != xyes; then