Skip to content

Commit c71cc3d

Browse files
committed
Update deprecated autoconf macros and automatically derive version number from latest git tag
1 parent e22e5b2 commit c71cc3d

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

autogen.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ test -z "$srcdir" && srcdir=.
77
(
88
cd "$srcdir"
99

10+
gprefix=`which glibtoolize 2>&1 >/dev/null`
11+
if [ $? -eq 0 ]; then
12+
glibtoolize --force
13+
else
14+
libtoolize --force
15+
fi
1016
aclocal
1117
autoheader
1218
automake --add-missing

configure.ac

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# -*- Autoconf -*-
22
# Process this file with autoconf to produce a configure script.
33

4-
AC_PREREQ(2.64)
5-
AC_INIT([ifuse], [1.1.5], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
4+
AC_PREREQ(2.68)
5+
AC_INIT([ifuse], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/ifuse/issues],, [https://libimobiledevice.org])
66
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
77
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
88
AC_CONFIG_SRCDIR([src/])
99
AC_CONFIG_HEADERS([config.h])
1010

11+
# Check if we have a version defined
12+
if test -z $PACKAGE_VERSION; then
13+
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.])
14+
fi
15+
1116
# Checks for programs.
1217
AC_PROG_CC
1318
AM_PROG_CC_C_O
19+
LT_INIT
1420

1521
# Checks for libraries.
1622
PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0)
1723
PKG_CHECK_MODULES(libfuse, fuse3 >= 3.0.0)
1824
PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
1925

2026
# Checks for header files.
21-
AC_HEADER_STDC
22-
AC_CHECK_HEADERS([arpa/inet.h stdint.h stdlib.h string.h])
27+
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
2328

2429
# Checks for typedefs, structures, and compiler characteristics.
2530
AC_C_CONST
@@ -36,17 +41,18 @@ AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
3641

3742
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
3843

39-
AC_OUTPUT([
44+
AC_CONFIG_FILES([
4045
Makefile
4146
src/Makefile
4247
docs/Makefile
4348
])
49+
AC_OUTPUT
4450

4551
echo "
4652
Configuration for $PACKAGE $VERSION:
4753
-------------------------------------------
4854

49-
Install prefix ..........: $prefix
55+
Install prefix: .........: $prefix
5056

5157
Now type 'make' to build $PACKAGE $VERSION,
5258
and then 'make install' for installation.

git-version-gen

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
SRCDIR=`dirname $0`
3+
if test -n "$1"; then
4+
VER=$1
5+
else
6+
if test -r "${SRCDIR}/.git" && test -x "`which git`" ; then
7+
git update-index -q --refresh
8+
if ! VER=`git describe --tags --dirty 2>/dev/null`; then
9+
COMMIT=`git rev-parse --short HEAD`
10+
DIRTY=`git diff --quiet HEAD || echo "-dirty"`
11+
VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY}
12+
fi
13+
else
14+
if test -f "${SRCDIR}/.tarball-version"; then
15+
VER=`cat "${SRCDIR}/.tarball-version"`
16+
fi
17+
fi
18+
fi
19+
VER=`printf %s "$VER" | head -n1`
20+
printf %s "$VER"

0 commit comments

Comments
 (0)