From d8b36eeadc493fe6193016174997dffa126bc312 Mon Sep 17 00:00:00 2001
From: Ingo Weinhold <ingo_weinhold@gmx.de>
Date: Mon, 8 Jul 2013 15:51:09 +0200
Subject: progs/Makefile.in: make sure the right programs are installed

The Makefile installed the libtool wrapper scripts which are only meant
to be used for the build.

diff --git a/progs/Makefile.in b/progs/Makefile.in
index 79cbc99..b2aad36 100644
--- a/progs/Makefile.in
+++ b/progs/Makefile.in
@@ -199,19 +199,19 @@ transform.h :
 	echo "#endif /* __TRANSFORM_H */"				>>$@
 
 install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir)
-@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
-@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
+@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/tic$x     $(DESTDIR)$(bindir)/$(actual_tic)
+@MAKE_TERMINFO@	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/toe$x     $(DESTDIR)$(bindir)/$(actual_toe)
 @MAKE_TERMINFO@	@echo "linking $(actual_infotocap) to $(actual_tic)"
 @MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap)
 @MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_infotocap))
 @MAKE_TERMINFO@	@echo "linking $(actual_captoinfo) to $(actual_tic)"
 @MAKE_TERMINFO@	-@rm -f $(DESTDIR)$(bindir)/$(actual_captoinfo)
 @MAKE_TERMINFO@	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo))
-	$(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
-	$(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
-	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x    $(DESTDIR)$(bindir)/$(actual_tabs)
-	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
-	$(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/clear$x   $(DESTDIR)$(bindir)/$(actual_clear)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/tabs$x    $(DESTDIR)$(bindir)/$(actual_tabs)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/tput$x    $(DESTDIR)$(bindir)/$(actual_tput)
+	$(LIBTOOL_INSTALL) $(INSTALL_PROG) .libs/tset$x    $(DESTDIR)$(bindir)/$(actual_tset)
 	@echo "linking $(actual_reset) to $(actual_tset)"
 	-@rm -f $(DESTDIR)$(bindir)/$(actual_reset)
 	(cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tset) $(actual_reset))
-- 
2.28.0


From 67e19e268a2f5f200ec1a4e218e7a9299dc92841 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 27 Dec 2020 17:47:12 +0100
Subject: Fix linking with libtool disabled

Disabling libtool allows to set the ABI version for backwards
compatibility.

diff --git a/aclocal.m4 b/aclocal.m4
index c27cc36..2899f53 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -6704,6 +6704,10 @@ CF_EOF
 			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
 		fi
 		;;
+	(haiku*)
+		CF_SHARED_SONAME
+		MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
+		;;
 	(hpux[[7-8]]*)
 		# HP-UX 8.07 ld lacks "+b" option used for libdir search-list
 		if test "$GCC" != yes; then
diff --git a/configure b/configure
index 06f344f..8713faf 100755
--- a/configure
+++ b/configure
@@ -5899,6 +5899,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
 			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
 		fi
 		;;
+	(haiku*)
+		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
+		if test "$cf_cv_shlib_version" = rel; then
+			cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
+		else
+			cf_shared_soname='`basename $@`'
+		fi
+		MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
+		;;
 	(hpux[7-8]*)
 		# HP-UX 8.07 ld lacks "+b" option used for libdir search-list
 		if test "$GCC" != yes; then
-- 
2.28.0

