From 330fc08a3f15ce0bd86f70069b14dd5474763ed9 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Wed, 1 Aug 2007 03:03:51 +0000 Subject: [PATCH] more mingw fixes --- configure.in | 9 +++++++++ src/flac/Makefile.am | 1 + src/metaflac/Makefile.am | 1 + src/test_libFLAC++/Makefile.am | 1 + src/test_libFLAC/Makefile.am | 1 + src/test_seeking/Makefile.am | 1 + 6 files changed, 14 insertions(+) diff --git a/configure.in b/configure.in index 8826f191..9bbae797 100644 --- a/configure.in +++ b/configure.in @@ -74,6 +74,7 @@ esac AM_CONDITIONAL(FLaC__CPU_IA32, test "x$cpu_ia32" = xtrue) AM_CONDITIONAL(FLaC__CPU_PPC, test "x$cpu_ppc" = xtrue) AM_CONDITIONAL(FLaC__CPU_SPARC, test "x$cpu_sparc" = xtrue) + case "$host" in i386-*-openbsd3.[[0-3]]) OBJ_FORMAT=aoutb ;; *-*-cygwin|*mingw*) OBJ_FORMAT=win32 ;; @@ -81,6 +82,14 @@ case "$host" in *) OBJ_FORMAT=elf ;; esac AC_SUBST(OBJ_FORMAT) + +# only needed because of ntohl() usage, can get rid of after that's gone: +case "$host" in + *-*-cygwin|*mingw*) MINGW_WINSOCK_LIBS=-lwsock32 ;; + *) MINGW_WINSOCK_LIBS= ;; +esac +AC_SUBST(MINGW_WINSOCK_LIBS) + case "$host" in *-pc-linux-gnu) sys_linux=true diff --git a/src/flac/Makefile.am b/src/flac/Makefile.am index 94669e21..3ebd8e32 100644 --- a/src/flac/Makefile.am +++ b/src/flac/Makefile.am @@ -48,4 +48,5 @@ flac_LDADD = \ $(top_builddir)/src/libFLAC/libFLAC.la \ @OGG_LIBS@ \ @LIBICONV@ \ + @MINGW_WINSOCK_LIBS@ \ -lm diff --git a/src/metaflac/Makefile.am b/src/metaflac/Makefile.am index 31e5c60d..e7024a21 100644 --- a/src/metaflac/Makefile.am +++ b/src/metaflac/Makefile.am @@ -49,4 +49,5 @@ metaflac_LDADD = \ $(top_builddir)/src/libFLAC/libFLAC.la \ @OGG_LIBS@ \ @LIBICONV@ \ + @MINGW_WINSOCK_LIBS@ \ -lm diff --git a/src/test_libFLAC++/Makefile.am b/src/test_libFLAC++/Makefile.am index fcc33af7..462cbf2d 100644 --- a/src/test_libFLAC++/Makefile.am +++ b/src/test_libFLAC++/Makefile.am @@ -28,6 +28,7 @@ test_libFLAC___LDADD = \ $(top_builddir)/src/libFLAC++/libFLAC++.la \ $(top_builddir)/src/libFLAC/libFLAC.la \ @OGG_LIBS@ \ + @MINGW_WINSOCK_LIBS@ \ -lm test_libFLAC___SOURCES = \ decoders.cpp \ diff --git a/src/test_libFLAC/Makefile.am b/src/test_libFLAC/Makefile.am index 07a0d45f..d38f2999 100644 --- a/src/test_libFLAC/Makefile.am +++ b/src/test_libFLAC/Makefile.am @@ -29,6 +29,7 @@ test_libFLAC_LDADD = \ $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ $(top_builddir)/src/libFLAC/libFLAC.la \ @OGG_LIBS@ \ + @MINGW_WINSOCK_LIBS@ \ -lm test_libFLAC_SOURCES = \ bitwriter.c \ diff --git a/src/test_seeking/Makefile.am b/src/test_seeking/Makefile.am index 335bddcc..120e233f 100644 --- a/src/test_seeking/Makefile.am +++ b/src/test_seeking/Makefile.am @@ -28,6 +28,7 @@ noinst_PROGRAMS = test_seeking test_seeking_LDADD = \ $(top_builddir)/src/libFLAC/libFLAC.la \ @OGG_LIBS@ \ + @MINGW_WINSOCK_LIBS@ \ -lm test_seeking_SOURCES = \ main.c