From ca6078403d99ba0b6ffae7627780d54fdd81dbb5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 12 Feb 2012 17:40:05 +0100 Subject: autofoo: support for different platforms --- configure.ac | 23 +++++++++++++++++++++++ src/Makefile.am | 15 +++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index cf4a872..91f70bb 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,29 @@ PKG_CHECK_MODULES(libplist, libplist >= 0.15) PKG_CHECK_MODULES(libzip, libzip >= 0.8) PKG_CHECK_MODULES(libcurl, libcurl >= 7.0) +GLOBAL_CFLAGS="" +AC_LDADD="" +AC_LDFLAGS="" +case "$host_os" in + darwin*) + AC_LDADD="-lusb-1.0" + ;; + linux*) + AC_LDADD="-lusb-1.0" + ;; + mingw32) + GLOBAL_CFLAGS+="-DWIN32 -D__LITTLE_ENDIAN__=1" + AC_LDFLAGS+="-static-libgcc" + AC_LDADD="-lsetupapi" + ;; + *) + ;; +esac + +AC_SUBST(GLOBAL_CFLAGS) +AC_SUBST(AC_LDFLAGS) +AC_SUBST(AC_LDADD) + AC_CONFIG_FILES(Makefile src/Makefile) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 93b0d98..a6c653f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,23 +1,22 @@ -#libirecovery_CFLAGS = -I/usr/local/include -#libirecovery_LIBS = -L/usr/local/lib -lusb-1.0 - AM_CFLAGS = \ $(GLOBAL_CFLAGS) \ $(libimobiledevice_CFLAGS) \ $(libplist_CFLAGS) \ $(libzip_CFLAGS) \ - $(libcurl_CFLAGS) \ - #$(libirecovery_CFLAGS) + $(libcurl_CFLAGS) AM_LDFLAGS =\ + $(AC_LDFLAGS) \ $(libimobiledevice_LIBS) \ $(libplist_LIBS) \ $(libzip_LIBS) \ - $(libcurl_LIBS) \ - #$(libirecovery_LIBS) + $(libcurl_LIBS) + +AM_LDADD = $(AC_LDADD) bin_PROGRAMS = idevicerestore idevicerestore_SOURCES = idevicerestore.c common.c tss.c img3.c ipsw.c normal.c dfu.c recovery.c restore.c asr.c libirecovery.c limera1n.c download.c idevicerestore_CFLAGS = $(AM_CFLAGS) -idevicerestore_LDFLAGS = $(AM_LDFLAGS) -lusb-1.0 +idevicerestore_LDFLAGS = $(AM_LDFLAGS) +idevicerestore_LDADD = $(AM_LDADD) -- cgit v1.1-32-gdbae