Commit 1e9d7d85 authored by Timothy B. Terriberry's avatar Timothy B. Terriberry Committed by Ralph Giles

Clean up mingw32 configuruation.

Properly check for HTTP support and handle the case where it's
 disabled.
Also fixes the include paths broken by 3e7f0ddc.
parent 100027a3
......@@ -15,10 +15,12 @@ libopusfile_la_SOURCES = \
libopusfile_la_LIBADD = $(DEPS_LIBS)
libopusfile_la_LDFLAGS = -no-undefined \
-version-info @OP_LT_CURRENT@:@OP_LT_REVISION@:@OP_LT_AGE@
if OP_ENABLE_HTTP
if OP_WIN32
libopusfile_la_SOURCES += src/wsockwrapper.c
libopusfile_la_LIBADD += -lws2_32
endif
endif
noinst_PROGRAMS = examples/opusfile_example examples/seeking_example
......
......@@ -29,6 +29,19 @@ AC_SUBST(OP_LT_CURRENT)
AC_SUBST(OP_LT_REVISION)
AC_SUBST(OP_LT_AGE)
CC_CHECK_CFLAGS_APPEND(
[-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long])
# Platform-specific tweaks
case $host in
*-mingw*)
# -std=c89 causes some warnings under mingw.
CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
host_mingw=true
;;
esac
AM_CONDITIONAL(OP_WIN32, test "x$host_mingw" = xtrue)
AC_ARG_ENABLE([assertions],
AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
enable_assertions=no)
......@@ -41,17 +54,26 @@ AC_ARG_ENABLE([http],
AS_HELP_STRING([--disable-http], [Disable HTTP support]),,
enable_http=yes)
# AS_IF([test "x$enable_http" != "xno"],
# AC_CHECK_HEADER([sys/socket.h],,
# AC_MSG_WARN([HTTP support requires a posix socket library.])
# enable_http=no
# )
# )
AM_COND_IF(OP_WIN32,
AS_IF([test "x$enable_http" != "xno"],
AC_CHECK_HEADER([winsock2.h],,
AC_MSG_WARN([HTTP support requires a Winsock socket library.])
enable_http=no
)
),
AS_IF([test "x$enable_http" != "xno"],
AC_CHECK_HEADER([sys/socket.h],,
AC_MSG_WARN([HTTP support requires a POSIX socket library.])
enable_http=no
)
)
)
AS_IF([test "x$enable_http" != "xno"], [
openssl="openssl"
AC_DEFINE([OP_ENABLE_HTTP], [1], [Enable HTTP support])
])
AM_CONDITIONAL(OP_ENABLE_HTTP, [test "x$enable_http" != "xno"])
AC_SUBST(openssl)
PKG_CHECK_MODULES([DEPS], [ogg >= 1.3 opus >= 1.0.1 ${openssl}])
......@@ -85,18 +107,6 @@ CC_ATTRIBUTE_VISIBILITY([default], [
CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
])
CC_CHECK_CFLAGS_APPEND([-std=c89 -pedantic -Wall -Wextra -Wno-parentheses -Wno-long-long])
# Platform-specific tweaks
case $host in
*-mingw*)
# -std=c89 causes some warnings under mingw.
CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
host_mingw=true
;;
esac
AM_CONDITIONAL(OP_WIN32, test "x$host_mingw" = xtrue)
dnl Check for doxygen
AC_ARG_ENABLE([doc],
AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
......
......@@ -226,8 +226,8 @@ static const char *op_parse_file_url(const char *_src){
#else /* _WIN32 */
#include <winsock2.h>
#include <ws2tcpip.h>
#include "win32/winerrno.h"
#include "win32/wsockwrapper.h"
#include "winerrno.h"
#include "wsockwrapper.h"
#define ERRNO() (WSAGetLastError() - WSABASEERR)
#define CLOSE(x) closesocket(x)
#define IOCTL(fd,req,arg) ioctlsocket(fd,req,(u_long*)(arg))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment