Skip to content

Commit

Permalink
Add a configure option allowing users to choose whether to install sd…
Browse files Browse the repository at this point in the history
…l2-config

sdl2-config is installed by default if no flag is specified.
  • Loading branch information
hughmcmaster committed Apr 7, 2019
1 parent 2c92c8e commit 46af90d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile.in
Expand Up @@ -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

Expand Down Expand Up @@ -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 \
Expand All @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions configure.ac
Expand Up @@ -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
Expand Down

0 comments on commit 46af90d

Please sign in to comment.