summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-01-15 01:19:47 +0000
committerPete Batard <pbatard@gmail.com>2010-01-15 01:19:47 +0000
commit3cb9ac7d88f2d7513b2b914510cd16def8eb8e1e (patch)
tree40c5d20c264e735de7c215f5ce9cb39231545997 /configure.ac
parent1626ee00424d3f9b90db1b9fc3834cfbbadda465 (diff)
downloadlibusb-3cb9ac7d88f2d7513b2b914510cd16def8eb8e1e.tar.gz
r76: added cygwin support
- use AM_CFLAGS instead of CFLAGS (configure.ac) - added -Werror in visibility attribute test to properly detect on cygwin (configure.ac) - moved -Wshadow to AM_CFLAGS and disabled it on cygwin (configure.ac) - emulated _open_osfhandle in windows_compat.c - removed unneeded <tchar> include in windows_usb.c
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 15 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 441370f..5aea8b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ case $host in
AC_MSG_RESULT([Linux])
backend="linux"
AC_CHECK_LIB(rt, clock_gettime)
- CFLAGS="-pthread"
+ AM_CFLAGS="-pthread -Wshadow"
AM_LDFLAGS=""
;;
*-darwin*)
@@ -29,7 +29,7 @@ case $host in
AC_DEFINE(USBI_OS_HANDLES_TIMEOUT, [], [Backend handles timeout])
AC_MSG_RESULT([Darwin/MacOS X])
backend="darwin"
- CFLAGS="-pthread"
+ AM_CFLAGS="-pthread -Wshadow"
AM_LDFLAGS="-Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation -Wl,-prebind -no-undefined"
;;
*-mingw*)
@@ -38,9 +38,18 @@ case $host in
AC_MSG_RESULT([Windows])
backend="windows"
LIBS="-lpthreadGC2 -lsetupapi -lole32"
- CFLAGS=""
+ AM_CFLAGS="-Wshadow"
AM_LDFLAGS=""
;;
+*-cygwin*)
+ AC_DEFINE(OS_WINDOWS, [], [Windows backend])
+ AC_SUBST(OS_WINDOWS)
+ AC_MSG_RESULT([Windows])
+ backend="windows"
+ LIBS="-lpthread -lsetupapi -lole32"
+ AM_CFLAGS=""
+ AM_LDFLAGS=""
+ ;;
*)
AC_MSG_ERROR([unsupported operating system])
esac
@@ -116,7 +125,8 @@ CFLAGS="$saved_cflags"
# check for -fvisibility=hidden compiler support (GCC >= 3.4)
saved_cflags="$CFLAGS"
-CFLAGS="$CFLAGS -fvisibility=hidden"
+# -Werror required for cygwin
+CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
[VISIBILITY_CFLAGS="-fvisibility=hidden"
AC_DEFINE([API_EXPORTED], [__attribute__((visibility("default")))], [Default visibility]) ],
@@ -132,7 +142,7 @@ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
CFLAGS="$saved_cflags"
-AM_CFLAGS="-std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
+AM_CFLAGS="$AM_CFLAGS -std=gnu99 $inline_cflags -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags"
AC_SUBST(VISIBILITY_CFLAGS)
AC_SUBST(AM_CFLAGS)