Skip to content

Commit

Permalink
getopt compiled conditionally now.
Browse files Browse the repository at this point in the history
  • Loading branch information
dynamite1981 committed May 15, 2006
1 parent 9a9da0d commit 5d98d36
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 4 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ 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]))

##### Output mechanism checks #####
# These checks enable or disable certain output mechanisms,
# depending on system facilities and user requests.
Expand Down
12 changes: 6 additions & 6 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
bin_PROGRAMS = adplay

adplay_SOURCES = adplay.cc getopt.c getopt1.c getopt.h output.cc output.h \
players.h defines.h
adplay_SOURCES = adplay.cc output.cc output.h players.h defines.h

EXTRA_adplay_SOURCES = oss.cc oss.h null.h disk.cc disk.h esound.cc esound.h \
qsa.cc qsa.h sdl.cc sdl.h alsa.cc alsa.h ao.cc ao.h
qsa.cc qsa.h sdl.cc sdl.h alsa.cc alsa.h ao.cc ao.h getopt.c \
getopt1.c getopt.h

adplay_LDADD = @drivers@ $(adplug_LIBS) @ESD_LIBS@ @QSA_LIBS@ @SDL_LIBS@ \
@ALSA_LIBS@ @AO_LIBS@
adplay_DEPENDENCIES = @drivers@
adplay_LDADD = $(drivers) $(adplug_LIBS) @ESD_LIBS@ @QSA_LIBS@ @SDL_LIBS@ \
@ALSA_LIBS@ @AO_LIBS@ $(GETOPT_SOURCES)
adplay_DEPENDENCIES = $(drivers) $(GETOPT_SOURCES)

adplug_data_dir = $(sharedstatedir)/adplug

Expand Down
6 changes: 5 additions & 1 deletion src/adplay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
#if defined (__APPLE__) || (defined(__SVR4) && defined(__sun))
# include <unistd.h>
#else
# include "getopt.h"
# ifdef HAVE_GETOPT_H
# include <getopt.h>
# else
# include "getopt.h"
# endif
#endif

#include "defines.h"
Expand Down

0 comments on commit 5d98d36

Please sign in to comment.