summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-12-06 10:36:14 +0100
committerGravatar Matt Colyer2009-12-06 13:58:40 -0800
commit3bb7d9596e9b852b2e13185386cc0b71c952e84d (patch)
tree31dee21d6b27d8b626aebeaf5650db0fffda4d53
parent15b9f3451e20ccb4f9c6cdadc0dd75bc72246360 (diff)
downloadlibimobiledevice-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.ac47
-rw-r--r--m4/ac_pkg_swig.m48
-rw-r--r--m4/ax_swig_enable_cxx.m44
-rw-r--r--swig/Makefile.am3
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
46AC_FUNC_REALLOC 46AC_FUNC_REALLOC
47AC_CHECK_FUNCS([strcasecmp strdup strerror strndup]) 47AC_CHECK_FUNCS([strcasecmp strdup strerror strndup])
48 48
49python_bindings=yes
50AC_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])
55if test "$build_swig" = "true" -a "$SWIG" != "false" ; then
56 SWIG_SUB=swig
57else
58 SWIG_SUB=
59 python_bindings=no
60fi
61
62AM_CONDITIONAL([HAVE_SWIG],[test "x$SWIG_SUB" = "xswig"])
63
64AC_SUBST([DEV_SUB])
65
66
49AC_ARG_ENABLE([dev-tools], 67AC_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
60else 79else
61 DEV_SUB= 80 DEV_SUB=
81 building_dev_tools=no
62fi 82fi
63 83
64AM_CONDITIONAL([ENABLE_DEVTOOLS],[test "x$DEV_SUB" = "xdev"]) 84AM_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])
73if test "$no_debug_code" = true; then 93if 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])
96else
97 building_debug_code=yes
75fi 98fi
76 99
77AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter") 100AS_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
107m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 130m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
108 131
109AC_OUTPUT(Makefile src/Makefile include/Makefile fdi/Makefile dev/Makefile tools/Makefile swig/Makefile libiphone-1.0.pc) 132AC_OUTPUT([
133Makefile
134src/Makefile
135include/Makefile
136fdi/Makefile
137dev/Makefile
138tools/Makefile
139swig/Makefile
140libiphone-1.0.pc
141])
142
143echo "
144Configuration 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 @@
64AC_DEFUN([AC_PROG_SWIG],[ 64AC_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])
47AC_DEFUN([AX_SWIG_ENABLE_CXX],[ 47AC_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 @@
1INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir) 1INCLUDES = -I$(top_srcdir)/include $(libplist_CFLAGS) $(SWIG_PYTHON_CPPFLAGS) -I$(oldincludedir)
2 2
3if HAVE_SWIG
3BUILT_SOURCES = iphone_wrap.cxx 4BUILT_SOURCES = iphone_wrap.cxx
4SWIG_SOURCES = iphone.i 5SWIG_SOURCES = iphone.i
5 6
@@ -29,3 +30,5 @@ _iphone_la_LIBADD = $(top_builddir)/src/libiphone.la $(libplistmm_LIBS)
29iphone_wrap.cxx : $(SWIG_SOURCES) 30iphone_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
33endif # HAVE_SWIG
34