From 7cf71fab95056b3c812b21247a24bab74678980b Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 26 Jan 2008 20:08:42 +0000 Subject: * support for mingw (Petr Stetiar) git-svn-id: https://svn.gnumonks.org/trunk/librfid@2051 e0336214-984f-0b4b-a45f-81c69e1f0ede --- Makefile.am | 2 +- README.MinGW | 31 +++++++++++++++++++++++++++++++ configure.in | 24 ++++++++++++++---------- src/Makefile.am | 2 +- 4 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 README.MinGW diff --git a/Makefile.am b/Makefile.am index 0d087f4..7c0f889 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,7 +13,7 @@ if ENABLE_WIN32 SUBDIRS += win32 endif -EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch +EXTRA_DIST = LICENSING librfid.spec openct-cm5121-librfid.patch README.MinGW $(OBJECTS): libtool libtool: $(LIBTOOL_DEPS) diff --git a/README.MinGW b/README.MinGW new file mode 100644 index 0000000..b23960a --- /dev/null +++ b/README.MinGW @@ -0,0 +1,31 @@ +Quick steps for MinGW+autotools setup +===================================== + +1. Download MinGW/MSys packages from MinGW's project homepage[A]. I've downloaded[B]. +2. Unpack MinGW packages to some directory. In my case it was to c:\mingw. +3. Install MSys using exe installer. In my case I've installed it in c:\mingw\msys. +4. Unpack MSys packages[B] to directory, where you've installed MSys in step 4. +5. Install msysDTK (very old Perl etc. needed for autotools). +6. Run msys.bat and just cd to librfid directory and run ./autogen.sh, then ./configure +7. Lucky number + +A. http://http://www.mingw.org/download.shtml +B. MinGW packages: + --------------- + gcc-g++-3.4.5-20060117-1.tar.gz + gcc-core-3.4.5-20060117-1.tar.gz + binutils-2.16.91-20060119-1.tar.gz + w32api-3.6.tar.gz + mingw-runtime-3.9.tar.gz + mingw32-make-3.80.0-3.tar.gz + gdb-6.3-2.exe + mingw-utils-0.3.tar.gz + + MSys packages: + -------------- + MSYS-1.0.10.exe + bash-2.05b-MSYS.tar.bz2 + msys-autoconf-2.59.tar.bz2 + msys-automake-1.8.2.tar.bz2 + msys-libtool-1.5.tar.bz2 + msysDTK-1.0.1.exe diff --git a/configure.in b/configure.in index f7fcc41..36702ac 100644 --- a/configure.in +++ b/configure.in @@ -43,16 +43,20 @@ AC_ARG_ENABLE(spidev, AM_CONDITIONAL(ENABLE_SPIDEV, test "$ENABLE_SPIDEV" == "1") OPENCT_MSG=no -if test "x${ENABLE_OPENCT}" = "xyes"; then - PKG_CHECK_MODULES(OPENCT, [libopenct], [ - OPENCT_MSG=yes - AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) - ], [ - OPENCT_MSG=no - ]) - AC_SUBST(OPENCT_CFLAGS) - AC_SUBST(OPENCT_LIBS) -fi +AC_PROVIDE_IFELSE([PKG_CHECK_MODULES)], [ + if test "x${ENABLE_OPENCT}" = "xyes"; then + PKG_CHECK_MODULES(OPENCT, [libopenct], [ + OPENCT_MSG=yes + AC_DEFINE(HAVE_OPENCT, 1, [Have OpenCT libraries and header files]) + ], [ + OPENCT_MSG=no + ]) + AC_SUBST(OPENCT_CFLAGS) + AC_SUBST(OPENCT_LIBS) + fi ], [ + AC_SUBST(OPENCT_CFLAGS) + AC_SUBST(OPENCT_LIBS) + ]) AM_CONDITIONAL(HAVE_OPENCT, test "x$OPENCT_MSG" = "xyes") AC_ARG_WITH(firmware, diff --git a/src/Makefile.am b/src/Makefile.am index 996d7ba..45036b1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,7 +22,7 @@ MISC=rfid_access_mifare_classic.c if ENABLE_WIN32 WIN32=usleep.c libusb_dyn.c -AM_LDLAGS_WIN32=-mno-cygwin -lwinmm +AM_LDFLAGS_WIN32=-mno-cygwin -lwinmm AM_CFLAGS_WIN32=-mno-cygwin librfid_la_LIBADD = -lwinmm endif -- cgit v1.2.3