diff options
| author | 2009-12-06 10:36:14 +0100 | |
|---|---|---|
| committer | 2009-12-06 13:58:40 -0800 | |
| commit | 3bb7d9596e9b852b2e13185386cc0b71c952e84d (patch) | |
| tree | 31dee21d6b27d8b626aebeaf5650db0fffda4d53 | |
| parent | 15b9f3451e20ccb4f9c6cdadc0dd75bc72246360 (diff) | |
| download | libimobiledevice-3bb7d9596e9b852b2e13185386cc0b71c952e84d.tar.gz libimobiledevice-3bb7d9596e9b852b2e13185386cc0b71c952e84d.tar.bz2 | |
Updated autofoo stuff; swig is now optional and can be disabled.
Use --without-swig to prevent building the swig extensions even if swig
is installed.
[#93 state:resolved]
Signed-off-by: Matt Colyer <matt@colyer.name>
| -rw-r--r-- | configure.ac | 47 | ||||
| -rw-r--r-- | m4/ac_pkg_swig.m4 | 8 | ||||
| -rw-r--r-- | m4/ax_swig_enable_cxx.m4 | 4 | ||||
| -rw-r--r-- | swig/Makefile.am | 3 |
4 files changed, 56 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 7c59171..32a55f7 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -46,6 +46,24 @@ AC_FUNC_MALLOC | |||
| 46 | AC_FUNC_REALLOC | 46 | AC_FUNC_REALLOC |
| 47 | AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) | 47 | AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) |
| 48 | 48 | ||
| 49 | python_bindings=yes | ||
| 50 | AC_ARG_WITH([swig], | ||
| 51 | [AS_HELP_STRING([--without-swig], | ||
| 52 | [build Python bindings using swig (default is yes)])], | ||
| 53 | [build_swig=false], | ||
| 54 | [build_swig=true]) | ||
| 55 | if test "$build_swig" = "true" -a "$SWIG" != "false" ; then | ||
| 56 | SWIG_SUB=swig | ||
| 57 | else | ||
| 58 | SWIG_SUB= | ||
| 59 | python_bindings=no | ||
| 60 | fi | ||
| 61 | |||
| 62 | AM_CONDITIONAL([HAVE_SWIG],[test "x$SWIG_SUB" = "xswig"]) | ||
| 63 | |||
| 64 | AC_SUBST([DEV_SUB]) | ||
| 65 | |||
| 66 | |||
| 49 | AC_ARG_ENABLE([dev-tools], | 67 | AC_ARG_ENABLE([dev-tools], |
| 50 | [AS_HELP_STRING([--enable-dev-tools], | 68 | [AS_HELP_STRING([--enable-dev-tools], |
| 51 | [build development helper tools (default is no)])], | 69 | [build development helper tools (default is no)])], |
| @@ -57,8 +75,10 @@ if test "$build_dev_tools" = true; then | |||
| 57 | [], | 75 | [], |
| 58 | [AC_MSG_ERROR([Please install readline development headers])] | 76 | [AC_MSG_ERROR([Please install readline development headers])] |
| 59 | ) | 77 | ) |
| 78 | building_dev_tools=yes | ||
| 60 | else | 79 | else |
| 61 | DEV_SUB= | 80 | DEV_SUB= |
| 81 | building_dev_tools=no | ||
| 62 | fi | 82 | fi |
| 63 | 83 | ||
| 64 | AM_CONDITIONAL([ENABLE_DEVTOOLS],[test "x$DEV_SUB" = "xdev"]) | 84 | AM_CONDITIONAL([ENABLE_DEVTOOLS],[test "x$DEV_SUB" = "xdev"]) |
| @@ -71,7 +91,10 @@ AC_ARG_ENABLE([debug-code], | |||
| 71 | [no_debug_code=false], | 91 | [no_debug_code=false], |
| 72 | [no_debug_code=true]) | 92 | [no_debug_code=true]) |
| 73 | if test "$no_debug_code" = true; then | 93 | if test "$no_debug_code" = true; then |
| 94 | building_debug_code=no | ||
| 74 | AC_DEFINE(STRIP_DEBUG_CODE,1,[Strip debug reporting code]) | 95 | AC_DEFINE(STRIP_DEBUG_CODE,1,[Strip debug reporting code]) |
| 96 | else | ||
| 97 | building_debug_code=yes | ||
| 75 | fi | 98 | fi |
| 76 | 99 | ||
| 77 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") | 100 | AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") |
| @@ -106,4 +129,26 @@ AC_SUBST(LFS_CFLAGS) | |||
| 106 | 129 | ||
| 107 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | 130 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
| 108 | 131 | ||
| 109 | AC_OUTPUT(Makefile src/Makefile include/Makefile fdi/Makefile dev/Makefile tools/Makefile swig/Makefile libiphone-1.0.pc) | 132 | AC_OUTPUT([ |
| 133 | Makefile | ||
| 134 | src/Makefile | ||
| 135 | include/Makefile | ||
| 136 | fdi/Makefile | ||
| 137 | dev/Makefile | ||
| 138 | tools/Makefile | ||
| 139 | swig/Makefile | ||
| 140 | libiphone-1.0.pc | ||
| 141 | ]) | ||
| 142 | |||
| 143 | echo " | ||
| 144 | Configuration for $PACKAGE $VERSION: | ||
| 145 | ------------------------------------------- | ||
| 146 | |||
| 147 | Install prefix: .........: $prefix | ||
| 148 | Debug code ..............: $building_debug_code | ||
| 149 | Dev tools ...............: $building_dev_tools | ||
| 150 | Python bindings .........: $python_bindings | ||
| 151 | |||
| 152 | Now type 'make' to build $PACKAGE $VERSION, | ||
| 153 | and then 'make install' for installation. | ||
| 154 | " | ||
diff --git a/m4/ac_pkg_swig.m4 b/m4/ac_pkg_swig.m4 index 738f69d..97244bc 100644 --- a/m4/ac_pkg_swig.m4 +++ b/m4/ac_pkg_swig.m4 | |||
| @@ -64,8 +64,8 @@ | |||
| 64 | AC_DEFUN([AC_PROG_SWIG],[ | 64 | AC_DEFUN([AC_PROG_SWIG],[ |
| 65 | AC_PATH_PROG([SWIG],[swig]) | 65 | AC_PATH_PROG([SWIG],[swig]) |
| 66 | if test -z "$SWIG" ; then | 66 | if test -z "$SWIG" ; then |
| 67 | AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org]) | 67 | AC_MSG_WARN([cannot find 'swig' program. You should look at http://www.swig.org] or install your distribution specific swig package.) |
| 68 | SWIG='echo "Error: SWIG is not installed. You should look at http://www.swig.org" ; false' | 68 | SWIG=false |
| 69 | elif test -n "$1" ; then | 69 | elif test -n "$1" ; then |
| 70 | AC_MSG_CHECKING([for SWIG version]) | 70 | AC_MSG_CHECKING([for SWIG version]) |
| 71 | [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] | 71 | [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] |
| @@ -107,7 +107,7 @@ AC_DEFUN([AC_PROG_SWIG],[ | |||
| 107 | -o $available_minor -ne $required_minor \ | 107 | -o $available_minor -ne $required_minor \ |
| 108 | -o $available_patch -lt $required_patch ; then | 108 | -o $available_patch -lt $required_patch ; then |
| 109 | AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) | 109 | AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version. You should look at http://www.swig.org]) |
| 110 | SWIG='echo "Error: SWIG version >= $1 is required. You have '"$swig_version"'. You should look at http://www.swig.org" ; false' | 110 | SWIG=false |
| 111 | else | 111 | else |
| 112 | AC_MSG_NOTICE([SWIG executable is '$SWIG']) | 112 | AC_MSG_NOTICE([SWIG executable is '$SWIG']) |
| 113 | SWIG_LIB=`$SWIG -swiglib` | 113 | SWIG_LIB=`$SWIG -swiglib` |
| @@ -115,7 +115,7 @@ AC_DEFUN([AC_PROG_SWIG],[ | |||
| 115 | fi | 115 | fi |
| 116 | else | 116 | else |
| 117 | AC_MSG_WARN([cannot determine SWIG version]) | 117 | AC_MSG_WARN([cannot determine SWIG version]) |
| 118 | SWIG='echo "Error: Cannot determine SWIG version. You should look at http://www.swig.org" ; false' | 118 | SWIG=false |
| 119 | fi | 119 | fi |
| 120 | fi | 120 | fi |
| 121 | AC_SUBST([SWIG_LIB]) | 121 | AC_SUBST([SWIG_LIB]) |
diff --git a/m4/ax_swig_enable_cxx.m4 b/m4/ax_swig_enable_cxx.m4 index 722caeb..c1eca8c 100644 --- a/m4/ax_swig_enable_cxx.m4 +++ b/m4/ax_swig_enable_cxx.m4 | |||
| @@ -47,5 +47,7 @@ AU_ALIAS([SWIG_ENABLE_CXX], [AX_SWIG_ENABLE_CXX]) | |||
| 47 | AC_DEFUN([AX_SWIG_ENABLE_CXX],[ | 47 | AC_DEFUN([AX_SWIG_ENABLE_CXX],[ |
| 48 | AC_REQUIRE([AC_PROG_SWIG]) | 48 | AC_REQUIRE([AC_PROG_SWIG]) |
| 49 | AC_REQUIRE([AC_PROG_CXX]) | 49 | AC_REQUIRE([AC_PROG_CXX]) |
| 50 | SWIG="$SWIG -c++" | 50 | if test "$SWIG" != "false"; then |
| 51 | SWIG="$SWIG -c++" | ||
| 52 | fi | ||
| 51 | ]) | 53 | ]) |
diff --git a/swig/Makefile.am b/swig/Makefile.am index a38534d..ef87733 100644 --- a/swig/Makefile.am +++ b/swig/Makefile.am | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir) | 1 | INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir) |
| 2 | 2 | ||
| 3 | if HAVE_SWIG | ||
| 3 | BUILT_SOURCES = iphone_wrap.cxx | 4 | BUILT_SOURCES = iphone_wrap.cxx |
| 4 | SWIG_SOURCES = iphone.i | 5 | SWIG_SOURCES = iphone.i |
| 5 | 6 | ||
| @@ -29,3 +30,5 @@ _iphone_la_LIBADD = $(top_builddir)/src/libiphone.la $(libplistmm_LIBS) | |||
| 29 | iphone_wrap.cxx : $(SWIG_SOURCES) | 30 | iphone_wrap.cxx : $(SWIG_SOURCES) |
| 30 | $(SWIG) $(SWIG_PYTHON_OPT) $(INCLUDES) -I$(top_srcdir)/src -o $@ $< | 31 | $(SWIG) $(SWIG_PYTHON_OPT) $(INCLUDES) -I$(top_srcdir)/src -o $@ $< |
| 31 | 32 | ||
| 33 | endif # HAVE_SWIG | ||
| 34 | |||
