configure: Fixes to make SDL link as C++ on Haiku. Fixes #4590.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
diff --git a/Makefile.in b/Makefile.in
index 5db3eea..65ccc55 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -30,6 +30,7 @@ AR = @AR@
RANLIB = @RANLIB@
RC = @RC@
LINKER = @LINKER@
+LIBTOOLLINKERTAG = @LIBTOOLLINKERTAG@
TARGET = libSDL2.la
OBJECTS = @OBJECTS@
@@ -153,13 +154,13 @@ update-revision:
.PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d)
$(objects)/$(TARGET): $(GEN_HEADERS) $(GEN_OBJECTS) $(OBJECTS) $(VERSION_OBJECTS)
- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(LINKER) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -o $@ $(OBJECTS) $(GEN_OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS)
- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(LINKER) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLMAIN_OBJECTS) -rpath $(libdir)
$(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS)
- $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=CC --mode=link $(LINKER) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
+ $(RUN_CMD_LTLINK)$(LIBTOOL) --tag=$(LIBTOOLLINKERTAG) --mode=link $(LINKER) -static -o $@ $(SDLTEST_OBJECTS) -rpath $(libdir)
install: all install-bin install-hdrs install-lib install-data
install-bin:
diff --git a/configure b/configure
index 37bfa35..fd4d670 100755
--- a/configure
+++ b/configure
@@ -690,6 +690,7 @@ ALSA_CFLAGS
POW_LIB
LIBOBJS
ALLOCA
+LIBTOOLLINKERTAG
LINKER
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
@@ -16020,13 +16021,16 @@ esac
case "$host" in
*-*-haiku*)
LINKER='$(CXX)'
+ LIBTOOLLINKERTAG='CXX'
;;
*)
LINKER='$(CC)'
+ LIBTOOLLINKERTAG='CC'
;;
esac
+
if test x$srcdir != x.; then
INCLUDE="-Iinclude $INCLUDE"
elif test -d .git; then
diff --git a/configure.ac b/configure.ac
index 1e5d571..2dbfd29 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,12 +85,15 @@ dnl use CXX for linker on Haiku
case "$host" in
*-*-haiku*)
LINKER='$(CXX)'
+ LIBTOOLLINKERTAG='CXX'
;;
*)
LINKER='$(CC)'
+ LIBTOOLLINKERTAG='CC'
;;
esac
AC_SUBST(LINKER)
+AC_SUBST(LIBTOOLLINKERTAG)
if test x$srcdir != x.; then
INCLUDE="-Iinclude $INCLUDE"