diff options
| author | 2012-07-17 00:22:29 +0200 | |
|---|---|---|
| committer | 2012-07-17 00:22:29 +0200 | |
| commit | 954c5504a03a061ff43ec6c5334f342bd919badd (patch) | |
| tree | 6f8cbdc8c846d62128bc33e851e370a3b65de0e7 /configure.ac | |
| parent | 0e4fb99549e0a1b4f5330598ec30a222e0fb75cc (diff) | |
| download | libirecovery-954c5504a03a061ff43ec6c5334f342bd919badd.tar.gz libirecovery-954c5504a03a061ff43ec6c5334f342bd919badd.tar.bz2 | |
changed build system to autofoo. previous Makefile is now Makefile.shared
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..a5afb57 --- /dev/null +++ b/configure.ac | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | # -*- Autoconf -*- | ||
| 2 | # Process this file with autoconf to produce a configure script. | ||
| 3 | |||
| 4 | AC_PREREQ(2.61) | ||
| 5 | AC_INIT(libirecovery, 0.1.0, nospam@nowhere.com) | ||
| 6 | AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) | ||
| 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) | ||
| 8 | AC_CONFIG_SRCDIR([src/]) | ||
| 9 | AC_CONFIG_HEADERS([config.h]) | ||
| 10 | AC_CONFIG_MACRO_DIR([m4]) | ||
| 11 | |||
| 12 | dnl libtool versioning | ||
| 13 | # +1 : 0 : +1 == adds new functions to the interface | ||
| 14 | # +1 : 0 : 0 == changes or removes functions (changes include both | ||
| 15 | # changes to the signature and the semantic) | ||
| 16 | # ? :+1 : ? == just internal changes | ||
| 17 | # CURRENT : REVISION : AGE | ||
| 18 | LIBIRECOVERY_SO_VERSION=0:0:0 | ||
| 19 | |||
| 20 | AC_SUBST(LIBIRECOVERY_SO_VERSION) | ||
| 21 | |||
| 22 | # Checks for programs. | ||
| 23 | AC_PROG_CC | ||
| 24 | AC_PROG_CXX | ||
| 25 | AM_PROG_CC_C_O | ||
| 26 | AC_PROG_LIBTOOL | ||
| 27 | |||
| 28 | # Checks for libraries. | ||
| 29 | ACCFLAGS= | ||
| 30 | ACLDFLAGS= | ||
| 31 | ACLIBS= | ||
| 32 | |||
| 33 | #echo $host_os | ||
| 34 | case "$host_os" in | ||
| 35 | darwin*) | ||
| 36 | ACCFLAGS+="-I\$(top_srcdir)/include -I/usr/local/include -I/opt/local/include" | ||
| 37 | ACLDFLAGS+="-L/usr/lib -L/usr/local/lib -L/opt/local/lib" | ||
| 38 | ACLIBS+="-lusb-1.0 -framework CoreFoundation -framework IOKit" | ||
| 39 | ;; | ||
| 40 | linux*) | ||
| 41 | ACCFLAGS+="-fPIC -O3 -I\$(top_srcdir)/include -I/usr/include -I/usr/local/include" | ||
| 42 | ACLDFLAGS+="-L/usr/lib -L/usr/local/lib" | ||
| 43 | ACLIBS+="-lusb-1.0" | ||
| 44 | ;; | ||
| 45 | mingw32*) | ||
| 46 | ACCFLAGS+="-O3 -DWIN32 -I$(top_srcdir)/include -Ic:/mingw/include" | ||
| 47 | ACLDFLAGS+="-static-libgcc -Lc:/mingw/lib -Lc:/mingw/bin" | ||
| 48 | ACLIBS+="-lkernel32 -lmsvcrt -lsetupapi" | ||
| 49 | ;; | ||
| 50 | cygwin*) | ||
| 51 | CC=gcc-3 | ||
| 52 | ACCFLAGS+="-O3 -DWIN32 -mno-cygwin -I$(top_srcdir)/include -I/usr/include" | ||
| 53 | ACLDFLAGS+="-static-libgcc -L/lib -L/usr/lib -L/bin" | ||
| 54 | ACLIBS+="-lkernel32 -lmsvcrt -lsetupapi" | ||
| 55 | ;; | ||
| 56 | *) | ||
| 57 | |||
| 58 | ;; | ||
| 59 | esac | ||
| 60 | |||
| 61 | IRECOVERY_LIBS=-lreadline | ||
| 62 | AC_SUBST(IRECOVERY_LIBS) | ||
| 63 | |||
| 64 | # Checks for header files. | ||
| 65 | AC_HEADER_STDC | ||
| 66 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) | ||
| 67 | |||
| 68 | # Checks for typedefs, structures, and compiler characteristics. | ||
| 69 | AC_C_CONST | ||
| 70 | AC_TYPE_SIZE_T | ||
| 71 | AC_TYPE_SSIZE_T | ||
| 72 | AC_TYPE_UINT16_T | ||
| 73 | AC_TYPE_UINT32_T | ||
| 74 | AC_TYPE_UINT8_T | ||
| 75 | |||
| 76 | # Checks for library functions. | ||
| 77 | AC_FUNC_MALLOC | ||
| 78 | AC_FUNC_REALLOC | ||
| 79 | AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) | ||
| 80 | |||
| 81 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") | ||
| 82 | AC_SUBST(GLOBAL_CFLAGS) | ||
| 83 | |||
| 84 | LIBIRECOVERY_CFLAGS=$ACCFLAGS | ||
| 85 | LIBIRECOVERY_CFLAGS+=$GLOBAL_CFLAGS | ||
| 86 | LIBIRECOVERY_LDFLAGS=$ACLDFLAGS | ||
| 87 | LIBIRECOVERY_LIBS=$ACLIBS | ||
| 88 | |||
| 89 | AC_SUBST(LIBIRECOVERY_CFLAGS) | ||
| 90 | AC_SUBST(LIBIRECOVERY_LDFLAGS) | ||
| 91 | AC_SUBST(LIBIRECOVERY_LIBS) | ||
| 92 | |||
| 93 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | ||
| 94 | |||
| 95 | AC_OUTPUT([ | ||
| 96 | Makefile | ||
| 97 | src/Makefile | ||
| 98 | include/Makefile | ||
| 99 | libirecovery.pc | ||
| 100 | ]) | ||
| 101 | |||
| 102 | echo " | ||
| 103 | Configuration for $PACKAGE $VERSION: | ||
| 104 | ------------------------------------------- | ||
| 105 | |||
| 106 | Install prefix: .........: $prefix | ||
| 107 | |||
| 108 | Now type 'make' to build $PACKAGE $VERSION, | ||
| 109 | and then 'make install' for installation. | ||
| 110 | " | ||
