Skip to content

Commit 1e2b5fd

Browse files
committed
Use gnulib to provide getopt_long()
1 parent aa5d1a2 commit 1e2b5fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+9395
-1424
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ compile
2222
src/adplay
2323
src/config.h*
2424
src/.libs/
25+
gnulib/*.a
26+
gnulib/stddef.h
27+
gnulib/sys/
28+
gnulib/unistd.h

Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
SUBDIRS = src doc
1+
SUBDIRS = gnulib src doc
22

3-
EXTRA_DIST = adplay.spec adplay.qpg
3+
EXTRA_DIST = adplay.spec adplay.qpg m4/gnulib/gnulib-cache.m4
44

55
AUTOMAKE_OPTIONS = dist-bzip2
6+
7+
ACLOCAL_AMFLAGS="-Im4" "-Im4/gnulib"

configure.ac

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# Tell autoconf we're compiling a C++ program using automake and libtool.
22
AC_INIT([adplay],[1.9])
33
AC_CONFIG_SRCDIR(src/adplay.cc)
4-
AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile)
4+
AC_CONFIG_FILES(Makefile gnulib/Makefile src/Makefile doc/Makefile)
55
AC_CANONICAL_TARGET
66
AM_INIT_AUTOMAKE
77
AC_CONFIG_HEADERS([src/config.h])
8-
LT_INIT
9-
AC_LANG(C++)
108

119
# Check if we got a sane C/C++ compilation environment.
1210
AC_PROG_INSTALL
1311
AC_PROG_CC
12+
gl_EARLY
1413
AC_PROG_CXX
1514
AC_PROG_CPP
1615
AC_PROG_CXXCPP
1716

17+
LT_INIT
18+
19+
AC_LANG(C++)
20+
1821
# Nothing works without these libraries...
1922
AC_CHECK_LIB(stdc++,main,,AC_MSG_ERROR([libstdc++ not installed]))
2023
PKG_CHECK_MODULES([adplug], [adplug >= 2.0],,[
@@ -23,10 +26,6 @@ I will try to do the old-style library search for which i cannot check \
2326
versions. Please bear in mind that i am requiring at least version 1.4.])
2427
AC_CHECK_LIB(adplug,main,,AC_MSG_ERROR([*** AdPlug not installed ***]))])
2528

26-
# Check if getopt header is installed on this system
27-
AC_CHECK_HEADERS([getopt.h], ,
28-
AC_SUBST(GETOPT_SOURCES, [getopt.c getopt1.c getopt.h]))
29-
3029
# Save compiler flags and set up for compiling test programs
3130
oldlibs="$LIBS"
3231
oldcppflags="$CPPFLAGS"
@@ -194,6 +193,8 @@ fi
194193

195194
AC_SUBST([drivers])
196195

196+
gl_INIT
197+
197198
AC_OUTPUT
198199

199200
# Display user informative configuration output

gnulib.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
gnulib is a tool and library that can provide implementation of functionality not available on all operating systems and libc implementations.
2+
3+
Adplug currently uses gnulib to provide getopt_long().
4+
5+
To refresh to the latest version, do the following steps.
6+
7+
* Remove the old instance
8+
* clone the gnulib repository outside of the Adplug source tree (In this example it is done in the parent directory)
9+
* Reimport gnulib
10+
11+
rm -Rf m4/gnulib gnulib
12+
pushd .
13+
cd ..
14+
git clone https://git.savannah.gnu.org/git/gnulib.git
15+
popd
16+
../gnulib/gnulib-tool --m4-base m4/gnulib/ --source-base gnulib --no-vc-files --import getopt-gnu

0 commit comments

Comments
 (0)