aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libltdl
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libltdl')
-rwxr-xr-xvcpkg/ports/libltdl/libtoolize-ltdl-no-la19
-rw-r--r--vcpkg/ports/libltdl/portfile.cmake38
-rw-r--r--vcpkg/ports/libltdl/vcpkg-port-config.cmake43
-rw-r--r--vcpkg/ports/libltdl/vcpkg.json14
4 files changed, 114 insertions, 0 deletions
diff --git a/vcpkg/ports/libltdl/libtoolize-ltdl-no-la b/vcpkg/ports/libltdl/libtoolize-ltdl-no-la
new file mode 100755
index 0000000..9443725
--- /dev/null
+++ b/vcpkg/ports/libltdl/libtoolize-ltdl-no-la
@@ -0,0 +1,19 @@
+#!/bin/sh
+me=libtoolize-ltdl-no-la
+if test -n "$VCPKG_LIBLTDL_LIBTOOLIZE"; then
+ libtoolize="${VCPKG_LIBLTDL_LIBTOOLIZE}"
+elif hash glibtoolize 2>/dev/null; then
+ libtoolize=glibtoolize
+else
+ libtoolize=libtoolize
+fi
+echo "$me: running: ${libtoolize} $*" 1>&2
+"${libtoolize}" "$@" &&
+echo "$me: disabling libltdl.la check in m4/ltdl.m4" # most distros removes the la file
+if test -f m4/ltdl.m4 ; then
+ sed -e 's,test -f "\$with_ltdl_lib/libltdl.la",test -d "\$with_ltdl_lib",' m4/ltdl.m4 > m4/_ltdl.m4.tmp &&
+ cp m4/_ltdl.m4.tmp m4/ltdl.m4 &&
+ rm m4/_ltdl.m4.tmp
+else
+ echo "$me: Cannot find m4/libltdl.m4" 1>&2
+fi
diff --git a/vcpkg/ports/libltdl/portfile.cmake b/vcpkg/ports/libltdl/portfile.cmake
new file mode 100644
index 0000000..81e48cd
--- /dev/null
+++ b/vcpkg/ports/libltdl/portfile.cmake
@@ -0,0 +1,38 @@
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://ftpmirror.gnu.org/libtool/libtool-${VERSION}.tar.xz"
+ "https://ftp.gnu.org/pub/gnu/libtool/libtool-${VERSION}.tar.xz"
+ FILENAME "gnu-libtool-${VERSION}.tar.xz"
+ SHA512 eed207094bcc444f4bfbb13710e395e062e3f1d312ca8b186ab0cbd22dc92ddef176a0b3ecd43e02676e37bd9e328791c59a38ef15846d4eae15da4f20315724
+)
+
+vcpkg_extract_source_archive(SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+)
+
+vcpkg_list(SET OPTIONS "")
+if(VCPKG_TARGET_IS_WINDOWS)
+ string(APPEND VCPKG_C_FLAGS " -D_CRT_SECURE_NO_WARNINGS")
+ string(APPEND VCPKG_CXX_FLAGS " -D_CRT_SECURE_NO_WARNINGS")
+ if(NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_list(APPEND OPTIONS ac_cv_header_dirent_h=no) # Ignore vcpkg port dirent
+ endif()
+endif()
+
+vcpkg_make_configure(
+ SOURCE_PATH "${SOURCE_PATH}/libltdl"
+ AUTORECONF
+ OPTIONS
+ --enable-ltdl-install
+ ${OPTIONS}
+)
+vcpkg_make_install()
+
+file(COPY "${CURRENT_PORT_DIR}/libtoolize-ltdl-no-la" DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}")
+file(CHMOD "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/libtoolize-ltdl-no-la" FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE
+)
+file(COPY "${CURRENT_PORT_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/libltdl/COPYING.LIB")
diff --git a/vcpkg/ports/libltdl/vcpkg-port-config.cmake b/vcpkg/ports/libltdl/vcpkg-port-config.cmake
new file mode 100644
index 0000000..9217079
--- /dev/null
+++ b/vcpkg/ports/libltdl/vcpkg-port-config.cmake
@@ -0,0 +1,43 @@
+# Provide variables to use lib ltldl with autoconf.
+#
+# - <PREFIX>_LIBTOOLIZE
+# A libtoolize (wrapper) which disables the check for libltdl.la.
+# la files are removed from packages in vcpkg (and in most distros).
+# They add little value in modern environments, and they use absolute paths.
+# - <PREFIX>_OPTIONS_RELEASE,
+# <PREFIX>_OPTIONS_DEBUG:
+# Options to pass to vcpkg_make_configure.
+#
+# Usage:
+# vcpkg_libltdl_get_vars(LIBLTDL)
+# set(ENV{LIBTOOLIZE} "${LIBLTDL_LIBTOOLIZE}")
+#
+# vcpkg_make_configure(
+# SOURCE_PATH "${SOURCE_PATH}"
+# AUTORECONF
+# OPTIONS_RELEASE
+# ${LIBLTDL_OPTIONS_RELEASE}
+# OPTIONS_DEBUG
+# ${LIBLTDL_OPTIONS_RELEASE}
+# )
+
+function(vcpkg_libltdl_get_vars prefix)
+ # Forward libtoolize from environment to libtoolize-ltdl-no-la.
+ if(NOT "$ENV{LIBTOOLIZE}" STREQUAL "")
+ set(ENV{VCPKG_LIBLTDL_LIBTOOLIZE} "$ENV{LIBTOOLIZE}")
+ endif()
+
+ vcpkg_list(SET options_release
+ "--with-included-ltdl=no"
+ "--with-ltdl-include=${CURRENT_INSTALLED_DIR}/include"
+ "--with-ltdl-lib=${CURRENT_INSTALLED_DIR}/lib"
+ )
+ vcpkg_list(SET options_debug
+ "--with-included-ltdl=no"
+ "--with-ltdl-include=${CURRENT_INSTALLED_DIR}/include"
+ "--with-ltdl-lib=${CURRENT_INSTALLED_DIR}/debug/lib"
+ )
+ set("${prefix}_OPTIONS_RELEASE" "${options_release}" PARENT_SCOPE)
+ set("${prefix}_OPTIONS_DEBUG" "${options_debug}" PARENT_SCOPE)
+ set("${prefix}_LIBTOOLIZE" "${CURRENT_INSTALLED_DIR}/manual-tools/libltdl/libtoolize-ltdl-no-la" PARENT_SCOPE)
+endfunction()
diff --git a/vcpkg/ports/libltdl/vcpkg.json b/vcpkg/ports/libltdl/vcpkg.json
new file mode 100644
index 0000000..a57b9b3
--- /dev/null
+++ b/vcpkg/ports/libltdl/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "libltdl",
+ "version": "2.5.4",
+ "description": "A system independent dlopen wrapper for GNU libtool",
+ "homepage": "https://www.gnu.org/software/libtool/",
+ "license": "LGPL-2.1-or-later",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-make",
+ "host": true
+ }
+ ]
+}