Skip to content
Browse files

Adapted for win32 (mingw) building

  • Loading branch information...
1 parent 27f929f commit 3410eac9f35b2be14e024f9433d40c4dbc9692cf @nikias nikias committed Sep 10, 2011
Showing with 21 additions and 5 deletions.
  1. +19 −3 Makefile.static
  2. +2 −2 config.h
View
22 Makefile.static
@@ -1,21 +1,37 @@
TARGET=libusb-1.0.a
-CFLAGS=-m32 -I. -Ilibusb -Ilibusb/os -Wall -O2 -fPIC -DPIC -DHAVE_CONFIG_H -fvisibility=hidden -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -pthread
+CFLAGS=-m32 -I. -Ilibusb -Ilibusb/os -Wall -O2 -DPIC -DHAVE_CONFIG_H -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow
OS_OBJ=
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
- CFLAGS+=-DOS_DARWIN
+ CFLAGS+=-fPIC -fvisibility=hidden -pthread -DOS_DARWIN -DHAVE_STRUCT_TIMESPEC=1 -DTHREADS_POSIX
OS_OBJ = libusb/os/darwin_usb.o
endif
ifeq ($(UNAME), Linux)
- CFLAGS+=-DUSBI_TIMERFD_AVAILABLE -DOS_LINUX
+ CFLAGS+=-fPIC -fvisibility=hidden -pthread -DUSBI_TIMERFD_AVAILABLE -DOS_LINUX -DHAVE_STRUCT_TIMESPEC=1 -DTHREADS_POSIX
OS_OBJ = libusb/os/linux_usbfs.o
endif
+WIN32=
+ifeq ($(findstring CYG,$(UNAME)), CYG)
+ WIN32=1
+ CC=gcc-3
+endif
+ifeq ($(findstring MINGW,$(UNAME)), MINGW)
+ WIN32=1
+ CC=gcc
+endif
+ifdef WIN32
+ CFLAGS+=-DWIN32 -DOS_WINDOWS
+ OS_OBJ = libusb/os/windows_usb.o \
+ libusb/os/threads_windows.o \
+ libusb/os/poll_windows.o
+endif
+
objects= \
libusb/core.o \
libusb/descriptor.o \
View
4 config.h
@@ -32,7 +32,7 @@
#define HAVE_STRING_H 1
/* Define to 1 if the system has the type `struct timespec'. */
-#define HAVE_STRUCT_TIMESPEC 1
+/* #undef HAVE_STRUCT_TIMESPEC */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
@@ -87,7 +87,7 @@
#define STDC_HEADERS 1
/* Use Posix Threads */
-#define THREADS_POSIX /**/
+/* #undef THREADS_POSIX */
/* timerfd headers available */
/* #undef USBI_TIMERFD_AVAILABLE */

0 comments on commit 3410eac

Please sign in to comment.
Something went wrong with that request. Please try again.