Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use gnulib to provide the newest implementation of getopt_long() #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ m4/lt~obsolete.m4
src/adplay
src/config.h*
src/.libs/
gnulib/*.a
gnulib/stddef.h
gnulib/sys/
gnulib/unistd.h
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SUBDIRS = src doc
SUBDIRS = gnulib src doc

EXTRA_DIST = adplay.spec adplay.qpg
EXTRA_DIST = adplay.spec adplay.qpg m4/gnulib/gnulib-cache.m4

AUTOMAKE_OPTIONS = dist-bzip2

ACLOCAL_AMFLAGS=-I m4
ACLOCAL_AMFLAGS="-Im4" "-Im4/gnulib"
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for any reason or you are hacking on the build system, you can run each step
manually instead of using autoreconf:

libtoolize -c -f --install
aclocal -I m4
aclocal -Im4 -Im4/gnulib
autoheader
automake -a -c
autoconf
Expand Down
17 changes: 9 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# Tell autoconf we're compiling a C++ program using automake and libtool.
AC_INIT([adplay],[1.9])
AC_CONFIG_SRCDIR(src/adplay.cc)
AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile)
AC_CONFIG_FILES(Makefile gnulib/Makefile src/Makefile doc/Makefile)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_MACRO_DIRS([m4 m4/gnulib])
AC_CONFIG_HEADERS([src/config.h])
LT_INIT
AC_LANG(C++)

# Check if we got a sane C/C++ compilation environment.
AC_PROG_INSTALL
AC_PROG_CC
gl_EARLY
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP

LT_INIT

AC_LANG(C++)

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

# Check if getopt header is installed on this system
AC_CHECK_HEADERS([getopt.h], ,
AC_SUBST(GETOPT_SOURCES, [getopt.c getopt1.c getopt.h]))

# Save compiler flags and set up for compiling test programs
oldlibs="$LIBS"
oldcppflags="$CPPFLAGS"
Expand Down Expand Up @@ -211,6 +210,8 @@ fi

AC_SUBST([drivers])

gl_INIT

AC_OUTPUT

# Display user informative configuration output
Expand Down
16 changes: 16 additions & 0 deletions gnulib.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
gnulib is a tool and library that can provide implementation of functionality not available on all operating systems and libc implementations.

Adplug currently uses gnulib to provide getopt_long().

To refresh to the latest version, do the following steps.

* Remove the old instance
* clone the gnulib repository outside of the Adplug source tree (In this example it is done in the parent directory)
* Reimport gnulib

rm -Rf m4/gnulib gnulib
pushd .
cd ..
git clone https://git.savannah.gnu.org/git/gnulib.git
popd
../gnulib/gnulib-tool --m4-base m4/gnulib/ --source-base gnulib --no-vc-files --import getopt-gnu
Loading