Update deprecated autoconf macros and automatically derive version number from latest git tag

This commit is contained in:
Nikias Bassen
2025-09-29 11:19:59 +02:00
parent e22e5b2a54
commit c71cc3d9ca
3 changed files with 38 additions and 6 deletions
+6
View File
@@ -7,6 +7,12 @@ test -z "$srcdir" && srcdir=.
(
cd "$srcdir"
gprefix=`which glibtoolize 2>&1 >/dev/null`
if [ $? -eq 0 ]; then
glibtoolize --force
else
libtoolize --force
fi
aclocal
autoheader
automake --add-missing
+12 -6
View File
@@ -1,16 +1,22 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
AC_INIT([ifuse], [1.1.5], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
AC_PREREQ(2.68)
AC_INIT([ifuse], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_SRCDIR([src/])
AC_CONFIG_HEADERS([config.h])
# Check if we have a version defined
if test -z $PACKAGE_VERSION; then
AC_MSG_ERROR([PACKAGE_VERSION is not defined. Make sure to configure a source tree checked out from git or that .tarball-version is present.])
fi
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
LT_INIT
# Checks for libraries.
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0)
@@ -18,8 +24,7 @@ PKG_CHECK_MODULES(libfuse, fuse3 >= 3.0.0)
PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h stdint.h stdlib.h string.h])
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -36,17 +41,18 @@ AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_OUTPUT([
AC_CONFIG_FILES([
Makefile
src/Makefile
docs/Makefile
])
AC_OUTPUT
echo "
Configuration for $PACKAGE $VERSION:
-------------------------------------------
Install prefix ..........: $prefix
Install prefix: .........: $prefix
Now type 'make' to build $PACKAGE $VERSION,
and then 'make install' for installation.
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
SRCDIR=`dirname $0`
if test -n "$1"; then
VER=$1
else
if test -r "${SRCDIR}/.git" && test -x "`which git`" ; then
git update-index -q --refresh
if ! VER=`git describe --tags --dirty 2>/dev/null`; then
COMMIT=`git rev-parse --short HEAD`
DIRTY=`git diff --quiet HEAD || echo "-dirty"`
VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY}
fi
else
if test -f "${SRCDIR}/.tarball-version"; then
VER=`cat "${SRCDIR}/.tarball-version"`
fi
fi
fi
VER=`printf %s "$VER" | head -n1`
printf %s "$VER"