Index: .hgignore ================================================================== --- .hgignore +++ .hgignore @@ -6,10 +6,11 @@ .deps aclocal.m4 autom4te.cache build buildsys.mk +config.h.in config.log config.status configure docs extra.mk Index: ObjXMPP.xcodeproj/project.pbxproj ================================================================== --- ObjXMPP.xcodeproj/project.pbxproj +++ ObjXMPP.xcodeproj/project.pbxproj @@ -414,10 +414,11 @@ DYLIB_CURRENT_VERSION = 0; FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_RES_NDESTROY; GCC_VERSION = 4.2; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( "-lcrypto", "-L/opt/local/lib", @@ -437,10 +438,11 @@ DYLIB_COMPATIBILITY_VERSION = 0; DYLIB_CURRENT_VERSION = 0; FRAMEWORK_VERSION = A; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREPROCESSOR_DEFINITIONS = HAVE_RES_NDESTROY; GCC_VERSION = 4.2; INFOPLIST_FILE = Info.plist; OTHER_LDFLAGS = ( "-lcrypto", "-L/opt/local/lib", Index: autogen.sh ================================================================== --- autogen.sh +++ autogen.sh @@ -1,3 +1,4 @@ #!/bin/sh aclocal -I m4 || exit 1 autoconf || exit 1 +autoheader || exit 1 Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -61,10 +61,22 @@ [LIBS="$save_libs -lbind" AC_TRY_LINK([#include ], [res_nsearch(&_res, "test", 0, 0, (void *)0, 0);], [AC_MSG_RESULT([in -lbind])], [AC_MSG_ERROR(not found)])])])]) + +AC_MSG_CHECKING([for res_ndestroy]) +AC_TRY_LINK([ + #include +], [ + res_ndestroy(&_res) +], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RES_NDESTROY, 1, [Whether we have res_ndestroy]) +], [ + AC_MSG_RESULT(no) +]) AC_CHECK_LIB(objopenssl, main, [ LIBS="$LIBS -lobjopenssl -lcrypto" ], [ AC_MSG_ERROR(You need ObjOpenSSL installed!) @@ -90,6 +102,7 @@ AC_SUBST(CPP) AC_SUBST(CPPFLAGS) AC_SUBST(PACKAGE, ObjXMPP) AC_CONFIG_FILES([buildsys.mk extra.mk]) +AC_CONFIG_HEADERS(config.h) AC_OUTPUT Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -23,6 +23,7 @@ namespaces.h \ ObjXMPP.h include ../buildsys.mk +CPPFLAGS += -I.. -DHAVE_CONFIG_H LD = ${OBJC} Index: src/XMPPAuthenticator.m ================================================================== --- src/XMPPAuthenticator.m +++ src/XMPPAuthenticator.m @@ -17,10 +17,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPAuthenticator.h" @implementation XMPPAuthenticator - initWithAuthcid: (OFString*)authcid_ Index: src/XMPPConnection.m ================================================================== --- src/XMPPConnection.m +++ src/XMPPConnection.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #define XMPP_CONNECTION_M #include Index: src/XMPPExceptions.m ================================================================== --- src/XMPPExceptions.m +++ src/XMPPExceptions.m @@ -17,10 +17,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPExceptions.h" @implementation XMPPException + newWithClass: (Class)class_ Index: src/XMPPIQ.m ================================================================== --- src/XMPPIQ.m +++ src/XMPPIQ.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "namespaces.h" #import "XMPPIQ.h" @implementation XMPPIQ Index: src/XMPPJID.m ================================================================== --- src/XMPPJID.m +++ src/XMPPJID.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #import "XMPPJID.h" #import "XMPPExceptions.h" Index: src/XMPPMessage.m ================================================================== --- src/XMPPMessage.m +++ src/XMPPMessage.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPMessage.h" #import "namespaces.h" @implementation XMPPMessage Index: src/XMPPPLAINAuth.m ================================================================== --- src/XMPPPLAINAuth.m +++ src/XMPPPLAINAuth.m @@ -17,10 +17,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPPLAINAuth.h" #import "XMPPExceptions.h" @implementation XMPPPLAINAuth Index: src/XMPPPresence.m ================================================================== --- src/XMPPPresence.m +++ src/XMPPPresence.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPPresence.h" #import "namespaces.h" @implementation XMPPPresence Index: src/XMPPRoster.m ================================================================== --- src/XMPPRoster.m +++ src/XMPPRoster.m @@ -17,10 +17,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #import "XMPPRoster.h" #import "XMPPRosterItem.h" Index: src/XMPPRosterItem.m ================================================================== --- src/XMPPRosterItem.m +++ src/XMPPRosterItem.m @@ -17,10 +17,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPRosterItem.h" @implementation XMPPRosterItem + rosterItem Index: src/XMPPSCRAMAuth.m ================================================================== --- src/XMPPSCRAMAuth.m +++ src/XMPPSCRAMAuth.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include Index: src/XMPPSRVLookup.m ================================================================== --- src/XMPPSRVLookup.m +++ src/XMPPSRVLookup.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include #include #include @@ -237,11 +241,13 @@ entryWithResourceRecord: resourceRecord handle: handle]]; } } @finally { [self freeMemory: answer]; +#ifdef HAVE_RES_NDESTROY res_ndestroy(&resState); +#endif } [pool release]; } Index: src/XMPPStanza.m ================================================================== --- src/XMPPStanza.m +++ src/XMPPStanza.m @@ -18,10 +18,14 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #import "XMPPStanza.h" #import "XMPPJID.h" #import "namespaces.h"