SDL_image: autoconf: use ax_compute_relative_paths

From d46502644cc70203f9ac05c4aff0dc3bc448358c Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 27 Jul 2022 21:09:33 +0200
Subject: [PATCH] autoconf: use ax_compute_relative_paths

---
 .gitignore                             |   3 +-
 Makefile.in                            |   6 +-
 acinclude/ax_compute_relative_paths.m4 | 173 +++++++++++++
 acinclude/ax_normalize_path.m4         | 115 ++++++++
 acinclude/ax_recursive_eval.m4         |  56 ++++
 aclocal.m4                             |   3 +
 conan.lock                             |  55 ++++
 conanbuildinfo.txt                     | 346 +++++++++++++++++++++++++
 conanfile.py                           |  10 +
 conaninfo.txt                          |  24 ++
 configure                              |  96 ++++++-
 configure.ac                           |   5 +-
 graph_info.json                        |   9 +
 sdl2_image-config.cmake.in             |   2 +-
 test/Makefile.in                       |   6 +-
 15 files changed, 899 insertions(+), 10 deletions(-)
 create mode 100644 acinclude/ax_compute_relative_paths.m4
 create mode 100644 acinclude/ax_normalize_path.m4
 create mode 100644 acinclude/ax_recursive_eval.m4
 create mode 100644 conan.lock
 create mode 100644 conanbuildinfo.txt
 create mode 100644 conanfile.py
 create mode 100644 conaninfo.txt
 create mode 100644 graph_info.json

diff --git a/.gitignore b/.gitignore
index e74da17b..256ac82f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ autom4te*
 config.cache
 config.log
 config.status
+configure~
 Makefile
 libtool
 .deps
@@ -28,4 +29,4 @@ Release
 
 # generated zlib files
 external/zlib-1.2.11/zconf.h
-external/zlib-1.2.11/zconf.h.included
\ No newline at end of file
+external/zlib-1.2.11/zconf.h.included
diff --git a/Makefile.in b/Makefile.in
index 08823178..7b149d7e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -97,7 +97,11 @@ noinst_PROGRAMS = showimage$(EXEEXT) showanim$(EXEEXT)
 @BUILD_TESTS_TRUE@am__append_1 = test
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/acinclude/libtool.m4 \
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/acinclude/ax_compute_relative_paths.m4 \
+	$(top_srcdir)/acinclude/ax_normalize_path.m4 \
+	$(top_srcdir)/acinclude/ax_recursive_eval.m4 \
+	$(top_srcdir)/acinclude/libtool.m4 \
 	$(top_srcdir)/acinclude/ltoptions.m4 \
 	$(top_srcdir)/acinclude/ltsugar.m4 \
 	$(top_srcdir)/acinclude/ltversion.m4 \
diff --git a/acinclude/ax_compute_relative_paths.m4 b/acinclude/ax_compute_relative_paths.m4
new file mode 100644
index 00000000..10247079
--- /dev/null
+++ b/acinclude/ax_compute_relative_paths.m4
@@ -0,0 +1,173 @@
+# ==============================================================================
+#  https://www.gnu.org/software/autoconf-archive/ax_compute_relative_paths.html
+# ==============================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPUTE_RELATIVE_PATHS(PATH_LIST)
+#
+# DESCRIPTION
+#
+#   PATH_LIST is a space-separated list of colon-separated triplets of the
+#   form 'FROM:TO:RESULT'. This function iterates over these triplets and
+#   set $RESULT to the relative path from $FROM to $TO. Note that $FROM and
+#   $TO needs to be absolute filenames for this macro to success.
+#
+#   For instance,
+#
+#     first=/usr/local/bin
+#     second=/usr/local/share
+#     AX_COMPUTE_RELATIVE_PATHS([first:second:fs second:first:sf])
+#     # $fs is set to ../share
+#     # $sf is set to ../bin
+#
+#   $FROM and $TO are both eval'ed recursively and normalized, this means
+#   that you can call this macro with autoconf's dirnames like `prefix' or
+#   `datadir'. For example:
+#
+#     AX_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data])
+#
+#   AX_COMPUTE_RELATIVE_PATHS should also works with DOS filenames.
+#
+#   You may want to use this macro in order to make your package
+#   relocatable. Instead of hardcoding $datadir into your programs just
+#   encode $bin_to_data and try to determine $bindir at run-time.
+#
+#   This macro requires AX_NORMALIZE_PATH and AX_RECURSIVE_EVAL.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 12
+
+AU_ALIAS([ADL_COMPUTE_RELATIVE_PATHS], [AX_COMPUTE_RELATIVE_PATHS])
+AC_DEFUN([AX_COMPUTE_RELATIVE_PATHS],
+[for _lcl_i in $1; do
+  _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'`
+  _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'`
+  _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'`
+  AX_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from])
+  AX_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to])
+  _lcl_notation="$_lcl_from$_lcl_to"
+  AX_NORMALIZE_PATH([_lcl_from],['/'])
+  AX_NORMALIZE_PATH([_lcl_to],['/'])
+  AX_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp])
+  AX_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"])
+  eval $_lcl_result_var='[$]_lcl_result_tmp'
+done])
+
+## Note:
+## *****
+## The following helper macros are too fragile to be used out
+## of AX_COMPUTE_RELATIVE_PATHS (mainly because they assume that
+## paths are normalized), that's why I'm keeping them in the same file.
+## Still, some of them maybe worth to reuse.
+
+dnl AX_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT)
+dnl ===========================================
+dnl Compute the relative path to go from $FROM to $TO and set the value
+dnl of $RESULT to that value.  This function work on raw filenames
+dnl (for instead it will considerate /usr//local and /usr/local as
+dnl two distinct paths), you should really use AX_COMPUTE_RELATIVE_PATHS
+dnl instead to have the paths sanitized automatically.
+dnl
+dnl For instance:
+dnl    first_dir=/somewhere/on/my/disk/bin
+dnl    second_dir=/somewhere/on/another/disk/share
+dnl    AX_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second)
+dnl will set $first_to_second to '../../../another/disk/share'.
+AC_DEFUN([AX_COMPUTE_RELATIVE_PATH],
+[AX_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix])
+AX_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel])
+AX_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix])
+$3="[$]_lcl_first_rel[$]_lcl_second_suffix"])
+
+dnl AX_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT)
+dnl ============================================
+dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT.
+dnl
+dnl For instance:
+dnl    first_path=/somewhere/on/my/disk/bin
+dnl    second_path=/somewhere/on/another/disk/share
+dnl    AX_COMPUTE_COMMON_PATH(first_path, second_path, common_path)
+dnl will set $common_path to '/somewhere/on'.
+AC_DEFUN([AX_COMPUTE_COMMON_PATH],
+[$3=''
+_lcl_second_prefix_match=''
+while test "[$]_lcl_second_prefix_match" != 0; do
+  _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"`
+  _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"`
+  if test "[$]_lcl_second_prefix_match" != 0; then
+    if test "[$]_lcl_first_prefix" != "[$]$3"; then
+      $3="[$]_lcl_first_prefix"
+    else
+      _lcl_second_prefix_match=0
+    fi
+  fi
+done])
+
+dnl AX_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT)
+dnl ==============================================
+dnl Subtract $SUBPATH from $PATH, and set the resulting suffix
+dnl (or the empty string if $SUBPATH is not a subpath of $PATH)
+dnl to $RESULT.
+dnl
+dnl For instance:
+dnl    first_path=/somewhere/on/my/disk/bin
+dnl    second_path=/somewhere/on
+dnl    AX_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path)
+dnl will set $common_path to '/my/disk/bin'.
+AC_DEFUN([AX_COMPUTE_SUFFIX_PATH],
+[$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`])
+
+dnl AX_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT)
+dnl ============================================
+dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that
+dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../'
+dnl should be needed to move from $PATH to $SUBPATH) and set the value
+dnl of $RESULT to that value.  If $SUBPATH is not a subpath of PATH,
+dnl set $RESULT to the empty string.
+dnl
+dnl For instance:
+dnl    first_path=/somewhere/on/my/disk/bin
+dnl    second_path=/somewhere/on
+dnl    AX_COMPUTE_BACK_PATH(first_path, second_path, back_path)
+dnl will set $back_path to '../../../'.
+AC_DEFUN([AX_COMPUTE_BACK_PATH],
+[AX_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix])
+$3=''
+_lcl_tmp='xxx'
+while test "[$]_lcl_tmp" != ''; do
+  _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"`
+  if test "[$]_lcl_first_suffix" != ''; then
+     _lcl_first_suffix="[$]_lcl_tmp"
+     $3="../[$]$3"
+  fi
+done])
diff --git a/acinclude/ax_normalize_path.m4 b/acinclude/ax_normalize_path.m4
new file mode 100644
index 00000000..b789a936
--- /dev/null
+++ b/acinclude/ax_normalize_path.m4
@@ -0,0 +1,115 @@
+# ===========================================================================
+#    https://www.gnu.org/software/autoconf-archive/ax_normalize_path.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING])
+#
+# DESCRIPTION
+#
+#   Perform some cleanups on the value of $VARNAME (interpreted as a path):
+#
+#     - empty paths are changed to '.'
+#     - trailing slashes are removed
+#     - repeated slashes are squeezed except a leading doubled slash '//'
+#       (which might indicate a networked disk on some OS).
+#
+#   REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
+#   REFERENCE_STRING contains some backslashes, all slashes and backslashes
+#   are turned into backslashes, otherwise they are all turned into slashes.
+#
+#   This makes processing of DOS filenames quite easier, because you can
+#   turn a filename to the Unix notation, make your processing, and turn it
+#   back to original notation.
+#
+#     filename='A:\FOO\\BAR\'
+#     old_filename="$filename"
+#     # Switch to the unix notation
+#     AX_NORMALIZE_PATH([filename], ["/"])
+#     # now we have $filename = 'A:/FOO/BAR' and we can process it as if
+#     # it was a Unix path.  For instance let's say that you want
+#     # to append '/subpath':
+#     filename="$filename/subpath"
+#     # finally switch back to the original notation
+#     AX_NORMALIZE_PATH([filename], ["$old_filename"])
+#     # now $filename equals to 'A:\FOO\BAR\subpath'
+#
+#   One good reason to make all path processing with the unix convention is
+#   that backslashes have a special meaning in many cases. For instance
+#
+#     expr 'A:\FOO' : 'A:\Foo'
+#
+#   will return 0 because the second argument is a regex in which
+#   backslashes have to be backslashed. In other words, to have the two
+#   strings to match you should write this instead:
+#
+#     expr 'A:\Foo' : 'A:\\Foo'
+#
+#   Such behavior makes DOS filenames extremely unpleasant to work with. So
+#   temporary turn your paths to the Unix notation, and revert them to the
+#   original notation after the processing. See the macro
+#   AX_COMPUTE_RELATIVE_PATHS for a concrete example of this.
+#
+#   REFERENCE_STRING defaults to $VARIABLE, this means that slashes will be
+#   converted to backslashes if $VARIABLE already contains some backslashes
+#   (see $thirddir below).
+#
+#     firstdir='/usr/local//share'
+#     seconddir='C:\Program Files\\'
+#     thirddir='C:\home/usr/'
+#     AX_NORMALIZE_PATH([firstdir])
+#     AX_NORMALIZE_PATH([seconddir])
+#     AX_NORMALIZE_PATH([thirddir])
+#     # $firstdir = '/usr/local/share'
+#     # $seconddir = 'C:\Program Files'
+#     # $thirddir = 'C:\home\usr'
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AU_ALIAS([ADL_NORMALIZE_PATH], [AX_NORMALIZE_PATH])
+AC_DEFUN([AX_NORMALIZE_PATH],
+[case ":[$]$1:" in
+# change empty paths to '.'
+  ::) $1='.' ;;
+# strip trailing slashes
+  :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
+  :*:) ;;
+esac
+# squeeze repeated slashes
+case ifelse($2,,"[$]$1",$2) in
+# if the path contains any backslashes, turn slashes into backslashes
+ *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
+# if the path contains slashes, also turn backslashes into slashes
+ *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
+esac])
diff --git a/acinclude/ax_recursive_eval.m4 b/acinclude/ax_recursive_eval.m4
new file mode 100644
index 00000000..0625aca2
--- /dev/null
+++ b/acinclude/ax_recursive_eval.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+#    https://www.gnu.org/software/autoconf-archive/ax_recursive_eval.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_RECURSIVE_EVAL(VALUE, RESULT)
+#
+# DESCRIPTION
+#
+#   Interpolate the VALUE in loop until it doesn't change, and set the
+#   result to $RESULT. WARNING: It's easy to get an infinite loop with some
+#   unsane input.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 1
+
+AC_DEFUN([AX_RECURSIVE_EVAL],
+[_lcl_receval="$1"
+$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
+       _lcl_receval_old="[$]_lcl_receval"
+       eval _lcl_receval="\"[$]_lcl_receval\""
+     done
+     echo "[$]_lcl_receval")`])
diff --git a/aclocal.m4 b/aclocal.m4
index 6406b8aa..4c646e74 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1015,6 +1015,9 @@ AC_DEFUN([_AM_SUBST_NOTMAKE])
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
+m4_include([acinclude/ax_compute_relative_paths.m4])
+m4_include([acinclude/ax_normalize_path.m4])
+m4_include([acinclude/ax_recursive_eval.m4])
 m4_include([acinclude/libtool.m4])
 m4_include([acinclude/ltoptions.m4])
 m4_include([acinclude/ltsugar.m4])
diff --git a/conan.lock b/conan.lock
new file mode 100644
index 00000000..106a0241
--- /dev/null
+++ b/conan.lock
@@ -0,0 +1,55 @@
+{
+ "graph_lock": {
+  "nodes": {
+   "0": {
+    "options": "",
+    "build_requires": [
+     "1",
+     "3"
+    ],
+    "path": "conanfile.py",
+    "context": "host"
+   },
+   "1": {
+    "ref": "autoconf/2.71",
+    "options": "",
+    "package_id": "5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9",
+    "prev": "0",
+    "requires": [
+     "2"
+    ],
+    "context": "host"
+   },
+   "2": {
+    "ref": "m4/1.4.19",
+    "options": "",
+    "package_id": "24647d9fe8ec489125dfbae4b3ebefaf7581674c",
+    "prev": "0",
+    "context": "host"
+   },
+   "3": {
+    "ref": "libtool/2.4.6",
+    "options": "fPIC=True\nshared=False",
+    "package_id": "ed03dd185916c6a62cfea9667c4eb5fa400961da",
+    "prev": "0",
+    "requires": [
+     "4"
+    ],
+    "context": "host"
+   },
+   "4": {
+    "ref": "automake/1.16.5",
+    "options": "",
+    "package_id": "258f6f05ca54813b3d7180161753df7f9ccf7e1d",
+    "prev": "0",
+    "requires": [
+     "1"
+    ],
+    "context": "host"
+   }
+  },
+  "revisions_enabled": false
+ },
+ "version": "0.4",
+ "profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=gcc\ncompiler.libcxx=libstdc++11\ncompiler.version=12\nos=Linux\nos_build=Linux\n[options]\n[build_requires]\n[env]\nCC=/usr/bin/gcc\nCXX=/usr/bin/g++"
+}
\ No newline at end of file
diff --git a/conanbuildinfo.txt b/conanbuildinfo.txt
new file mode 100644
index 00000000..2c9bfae6
--- /dev/null
+++ b/conanbuildinfo.txt
@@ -0,0 +1,346 @@
+[includedirs]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/include
+
+[libdirs]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/lib
+
+[bindirs]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/bin
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin
+/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin
+/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin
+
+[resdirs]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res
+
+[builddirs]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/
+/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/
+/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/
+
+[libs]
+ltdl
+
+[system_libs]
+dl
+
+[defines]
+
+
+[cppflags]
+
+
+[cxxflags]
+
+
+[cflags]
+
+
+[sharedlinkflags]
+
+
+[exelinkflags]
+
+
+[sysroot]
+
+
+[frameworks]
+
+
+[frameworkdirs]
+
+
+
+[includedirs_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/include
+
+[libdirs_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/lib
+
+[bindirs_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/bin
+
+[resdirs_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res
+
+[builddirs_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/
+
+[libs_libtool]
+ltdl
+
+[system_libs_libtool]
+dl
+
+[defines_libtool]
+
+
+[cppflags_libtool]
+
+
+[cxxflags_libtool]
+
+
+[cflags_libtool]
+
+
+[sharedlinkflags_libtool]
+
+
+[exelinkflags_libtool]
+
+
+[sysroot_libtool]
+
+
+[frameworks_libtool]
+
+
+[frameworkdirs_libtool]
+
+
+[rootpath_libtool]
+/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da
+
+[name_libtool]
+libtool
+
+[version_libtool]
+2.4.6
+
+[generatornames_libtool]
+
+
+[generatorfilenames_libtool]
+
+
+
+[includedirs_automake]
+
+
+[libdirs_automake]
+
+
+[bindirs_automake]
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin
+
+[resdirs_automake]
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res
+
+[builddirs_automake]
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/
+
+[libs_automake]
+
+
+[system_libs_automake]
+
+
+[defines_automake]
+
+
+[cppflags_automake]
+
+
+[cxxflags_automake]
+
+
+[cflags_automake]
+
+
+[sharedlinkflags_automake]
+
+
+[exelinkflags_automake]
+
+
+[sysroot_automake]
+
+
+[frameworks_automake]
+
+
+[frameworkdirs_automake]
+
+
+[rootpath_automake]
+/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d
+
+[name_automake]
+automake
+
+[version_automake]
+1.16.5
+
+[generatornames_automake]
+
+
+[generatorfilenames_automake]
+
+
+
+[includedirs_autoconf]
+
+
+[libdirs_autoconf]
+
+
+[bindirs_autoconf]
+/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin
+
+[resdirs_autoconf]
+
+
+[builddirs_autoconf]
+/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/
+
+[libs_autoconf]
+
+
+[system_libs_autoconf]
+
+
+[defines_autoconf]
+
+
+[cppflags_autoconf]
+
+
+[cxxflags_autoconf]
+
+
+[cflags_autoconf]
+
+
+[sharedlinkflags_autoconf]
+
+
+[exelinkflags_autoconf]
+
+
+[sysroot_autoconf]
+
+
+[frameworks_autoconf]
+
+
+[frameworkdirs_autoconf]
+
+
+[rootpath_autoconf]
+/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
+
+[name_autoconf]
+autoconf
+
+[version_autoconf]
+2.71
+
+[generatornames_autoconf]
+
+
+[generatorfilenames_autoconf]
+
+
+
+[includedirs_m4]
+
+
+[libdirs_m4]
+
+
+[bindirs_m4]
+/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin
+
+[resdirs_m4]
+
+
+[builddirs_m4]
+/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/
+
+[libs_m4]
+
+
+[system_libs_m4]
+
+
+[defines_m4]
+
+
+[cppflags_m4]
+
+
+[cxxflags_m4]
+
+
+[cflags_m4]
+
+
+[sharedlinkflags_m4]
+
+
+[exelinkflags_m4]
+
+
+[sysroot_m4]
+
+
+[frameworks_m4]
+
+
+[frameworkdirs_m4]
+
+
+[rootpath_m4]
+/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c
+
+[name_m4]
+m4
+
+[version_m4]
+1.4.19
+
+[generatornames_m4]
+
+
+[generatorfilenames_m4]
+
+
+
+[USER_autoconf]
+[USER_automake]
+ar_lib=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16/ar-lib
+compile=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16/compile
+[USER_libtool]
+[USER_m4]
+[ENV_libtool]
+ACLOCAL_PATH=["/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res/aclocal"]
+AUTOMAKE_CONAN_INCLUDES=["/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res/aclocal"]
+LIBTOOLIZE=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/bin/libtoolize
+LIBTOOL_ACLOCALDIR=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res/aclocal
+LIBTOOL_DATADIR=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res
+LIBTOOL_PKGAUXDIR=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res/libtool/build-aux
+LIBTOOL_PKGLTDLDIR=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/res/libtool
+LIBTOOL_PREFIX=/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da
+PATH=["/home/maarten/.conan/data/libtool/2.4.6/_/_/package/ed03dd185916c6a62cfea9667c4eb5fa400961da/bin"]
+[ENV_automake]
+ACLOCAL=["/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal"]
+AUTOMAKE=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/automake
+AUTOMAKE_DATADIR=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res
+AUTOMAKE_LIBDIR=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16
+AUTOMAKE_PERLLIBDIR=/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/res/automake-1.16
+PATH=["/home/maarten/.conan/data/automake/1.16.5/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin"]
+[ENV_autoconf]
+AC_MACRODIR=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf
+AUTOCONF=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoconf
+AUTOHEADER=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoheader
+AUTOM4TE=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autom4te
+AUTOM4TE_PERLLIBDIR=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf
+AUTORECONF=/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoreconf
+PATH=["/home/maarten/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin"]
+[ENV_m4]
+M4=/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/m4
+PATH=["/home/maarten/.conan/data/m4/1.4.19/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin"]
\ No newline at end of file
diff --git a/conanfile.py b/conanfile.py
new file mode 100644
index 00000000..f27f6471
--- /dev/null
+++ b/conanfile.py
@@ -0,0 +1,10 @@
+from conans import ConanFile
+
+
+class Sdl2Ttf(ConanFile):
+    def build_requirements(self):
+        self.build_requires("autoconf/2.71")
+        self.build_requires("libtool/2.4.6")
+
+    def build(self):
+        self.run("./autogen.sh")
diff --git a/conaninfo.txt b/conaninfo.txt
new file mode 100644
index 00000000..bb95071f
--- /dev/null
+++ b/conaninfo.txt
@@ -0,0 +1,24 @@
+[settings]
+
+
+[requires]
+
+
+[options]
+
+
+[full_settings]
+
+
+[full_requires]
+
+
+[full_options]
+
+
+[recipe_hash]
+
+
+[env]
+    CC=/usr/bin/gcc
+    CXX=/usr/bin/g++
diff --git a/configure b/configure
index 2a0dda0a..fc81ca32 100755
--- a/configure
+++ b/configure
@@ -15725,9 +15725,99 @@ else
 fi
 
 
-eval pkg_prefix=$prefix
-eval pkg_cmakedir=$libdir/cmake/SDL2_image
-cmake_prefix_relpath="$(echo -n "$pkg_cmakedir" | sed -E "s#^$pkg_prefix##" | sed -E "s#[A-Za-z0-9_ .-]+#..#g")"
+pkg_cmakedir='$libdir/cmake/SDL2_image'
+for _lcl_i in pkg_cmakedir:prefix:cmake_prefix_relpath; do
+  _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'`
+  _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'`
+  _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'`
+  _lcl_receval="$_lcl_from"
+_lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_receval="$_lcl_to"
+_lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "$_lcl_receval_old" != "$_lcl_receval"; do
+       _lcl_receval_old="$_lcl_receval"
+       eval _lcl_receval="\"$_lcl_receval\""
+     done
+     echo "$_lcl_receval")`
+  _lcl_notation="$_lcl_from$_lcl_to"
+  case ":$_lcl_from:" in
+# change empty paths to '.'
+  ::) _lcl_from='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+ *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\,g'` ;;
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  case ":$_lcl_to:" in
+# change empty paths to '.'
+  ::) _lcl_to='.' ;;
+# strip trailing slashes
+  :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;;
+  :*:) ;;
+esac
+# squeeze repeated slashes
+case '/' in
+# if the path contains any backslashes, turn slashes into backslashes
+ *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\,g'` ;;
+# if the path contains slashes, also turn backslashes into slashes
+ *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;;
+esac
+  _lcl_common_prefix=''
+_lcl_second_prefix_match=''
+while test "$_lcl_second_prefix_match" != 0; do
+  _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"`
+  _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"`
+  if test "$_lcl_second_prefix_match" != 0; then
+    if test "$_lcl_first_prefix" != "$_

(Patch may be truncated, please check the link at the top of this post.)