shithub: sox

Download patch

ref: 72751915968c8dbcef0252c5fda7a07b4eb4026e
parent: 1317b2de1cdb6c68719441141aa3337d80d6c2dd
author: robs <robs>
date: Tue Jan 22 14:25:12 EST 2008

Fix -V on non-gnu systems

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,7 +49,6 @@
 check_include_files("unistd.h"           HAVE_UNISTD_H)
 
 check_function_exists("fseeko"           HAVE_FSEEKO)
-check_function_exists("getopt_long"      HAVE_GETOPT_LONG)
 check_function_exists("gettimeofday"     HAVE_GETTIMEOFDAY)
 check_function_exists("popen"            HAVE_POPEN)
 check_function_exists("strcasecmp"       HAVE_STRCASECMP)
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
   o Fix [1748909] sox does not report remaining playtime of mp3s.  (robs)
   o Fix failure to read AIFF files with empty MARK chunk.  (robs)
   o Fix spurious 'Premature EOF' message in some circumstances.  (robs)
+  o Fix -V (without argument) on non-gnu systems.  (robs)
   o Switched to 16-bit for libao driver since not all its plugins
     support it (such as oss, nas, and pulse audio) (Morita Sho)
   o Stop crash when "rec" is ran with no arguments (Morita Sho).
--- a/configure.ac
+++ b/configure.ac
@@ -88,8 +88,6 @@
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday)
-AC_REPLACE_FUNCS(getopt_long)
-AM_CONDITIONAL(GETOPT_LONG, test x$getopt_long = xtrue)
 
 dnl Check if math library is needed.
 AC_CHECK_FUNC(pow)
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -1,6 +1,3 @@
-#include "soxconfig.h"
-#ifndef HAVE_GETOPT_LONG
-
 /* Getopt for GNU.
    NOTE: getopt is now part of the C library, so if you don't know what
    "Keep this file name-space clean" means, talk to drepper@gnu.org
@@ -1280,6 +1277,3 @@
 }
 
 #endif /* TEST */
-#else
-void dummy(void); /* To suppress empty file warning */
-#endif /* HAVE_GETOPT_LONG */
--- a/src/getopt1.c
+++ b/src/getopt1.c
@@ -1,5 +1,3 @@
-#include "soxconfig.h"
-#ifndef HAVE_GETOPT_LONG
 /* getopt_long and getopt_long_only entry points for GNU getopt.
    Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
      Free Software Foundation, Inc.
@@ -198,6 +196,3 @@
 }
 
 #endif /* TEST */
-#else
-void dummy(void); /* To suppress empty file warning */
-#endif /* HAVE_GETOPT_LONG */
--- a/src/sox.c
+++ b/src/sox.c
@@ -23,6 +23,7 @@
  */
 
 #include "sox_i.h"
+#include "getopt.h"
 
 #include <ctype.h>
 #include <errno.h>
@@ -49,12 +50,6 @@
 
 #ifdef HAVE_UNISTD_H
   #include <unistd.h>
-#endif
-
-#ifdef HAVE_GETOPT_LONG
-  #include <getopt.h>
-#else
-  #include "getopt.h"
 #endif
 
 #ifdef HAVE_GETTIMEOFDAY
--- a/src/soxconfig.h.cmake
+++ b/src/soxconfig.h.cmake
@@ -8,7 +8,6 @@
 #cmakedefine HAVE_FFMPEG              1
 #cmakedefine HAVE_FLAC                1
 #cmakedefine HAVE_FSEEKO              1
-#cmakedefine HAVE_GETOPT_LONG         1
 #cmakedefine HAVE_GETTIMEOFDAY        1
 #cmakedefine HAVE_ID3TAG              1
 #cmakedefine HAVE_INTTYPES_H          1
--- a/watcom/stconfig.h
+++ b/watcom/stconfig.h
@@ -15,11 +15,6 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #define HAVE_FCNTL_H 1
 
-/* Define to 1 if you have the `getopt_long' function. */
-#undef HAVE_GETOPT_LONG
-/* My Open Watcom 1.4 rc2 has getopt via <unistd.h> but there are issues
-after "-" and invalid options. */
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1