libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] [PATCH 1/2] Fix linkage on OS/2


From: KO Myung-Hun
Subject: [Libcdio-devel] [PATCH 1/2] Fix linkage on OS/2
Date: Mon, 21 Jul 2014 00:47:14 +0900

OS/2 kLIBC has getopt() already.

-----
  CCLD     cd-drive.exe
ld.exe: symbol `_optarg' defined more than once in 
F:/lang/gcc/usr/lib/libc_dll.a(IMPORT#45#426bf)
-----
---
 configure.ac    |    5 +++++
 src/Makefile.am |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index f8b081b..2b06a68 100755
--- a/configure.ac
+++ b/configure.ac
@@ -360,6 +360,8 @@ case $srcdir in
 esac
 AC_SUBST(native_abs_top_srcdir)
 
+HAVE_GETOPT=no
+
 case $host_os in
      aix*)
        ## Don't use AIX driver until starts to really work
@@ -497,6 +499,7 @@ int has_timeout=sizeof(test.timeout);],
        LT_NO_UNDEFINED="-no-undefined"
        LDFLAGS="$LDFLAGS -Zbin-files"
        cd_drivers="${cd_drivers}, OS2 "
+       HAVE_GETOPT=yes
        ;;
      *)
        AC_MSG_WARN([Don't have OS CD-reading support for ${host_os}...])
@@ -508,6 +511,8 @@ AC_SUBST(LIBCDIO_CFLAGS)
 AC_SUBST(LIBISO9660_CFLAGS)
 AC_SUBST(LT_NO_UNDEFINED)
 
+AM_CONDITIONAL(HAVE_GETOPT, test "x$HAVE_GETOPT" = "xyes")
+
 AC_MSG_CHECKING(extern long timezone variable)
 AC_LINK_IFELSE([AC_LANG_SOURCE([[
 #ifdef NEED_TIMEZONEVAR
diff --git a/src/Makefile.am b/src/Makefile.am
index 719f160..fe445ed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,11 @@
 #   You should have received a copy of the GNU General Public License
 #   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+if HAVE_GETOPT
+GETOPT_C =
+else
 GETOPT_C = getopt.c getopt1.c
+endif
 
 noinst_HEADERS = cddb.h getopt.h util.h
 
-- 
1.7.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]