Skip to content

Commit 1795503

Browse files
committed
Use gnulib to provide getopt_long()
1 parent 97f6ac4 commit 1795503

Some content is hidden

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

48 files changed

+9396
-1427
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ m4/lt~obsolete.m4
2727
src/adplay
2828
src/config.h*
2929
src/.libs/
30+
gnulib/*.a
31+
gnulib/stddef.h
32+
gnulib/sys/
33+
gnulib/unistd.h

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +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
66

7-
ACLOCAL_AMFLAGS=-I m4
7+
ACLOCAL_AMFLAGS="-Im4" "-Im4/gnulib"

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ for any reason or you are hacking on the build system, you can run each step
2929
manually instead of using autoreconf:
3030

3131
libtoolize -c -f --install
32-
aclocal -I m4
32+
aclocal -Im4 -Im4/gnulib
3333
autoheader
3434
automake -a -c
3535
autoconf

configure.ac

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
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
7-
AC_CONFIG_MACRO_DIRS([m4])
7+
AC_CONFIG_MACRO_DIRS([m4 m4/gnulib])
88
AC_CONFIG_HEADERS([src/config.h])
9-
LT_INIT
10-
AC_LANG(C++)
119

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

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

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

212211
AC_SUBST([drivers])
213212

213+
gl_INIT
214+
214215
AC_OUTPUT
215216

216217
# 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)