Browse Source

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

sdl2-config is installed by default if no flag is specified.
Hugh McMaster 6 năm trước cách đây
mục cha
commit
46af90d8c3
2 tập tin đã thay đổi với 23 bổ sung0 xóa
  1. 7 0
      Makefile.in
  2. 16 0
      configure.ac

+ 7 - 0
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:

+ 16 - 0
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