Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -21,11 +21,12 @@ CPP="$OBJCPP" CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS $($OBJFW_CONFIG --cppflags)" OBJCFLAGS="$OBJCFLAGS -Wall $($OBJFW_CONFIG --objcflags)" LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags)" -LIBS="$LIBS $($OBJFW_CONFIG --libs)" +AC_SUBST(OBJFW_LIBS, "$LIBS $($OBJFW_CONFIG --libs)") +AC_SUBST(OBJFW_FRAMEWORK_LIBS, "$LIBS $($OBJFW_CONFIG --framework-libs)") AX_CHECK_COMPILER_FLAGS(-Watomic-properties, [OBJCFLAGS="$OBJCFLAGS -Watomic-properties"]) AX_CHECK_COMPILER_FLAGS(-Wdocumentation, [OBJCFLAGS="$OBJCFLAGS -Wdocumentation"]) @@ -33,10 +34,14 @@ AC_ARG_ENABLE(shared, AS_HELP_STRING([--disable-shared], [do not build shared library])) AS_IF([test x"$enable_shared" != x"no"], [ BUILDSYS_SHARED_LIB AC_SUBST(OBJXMPP_SHARED_LIB, "${LIB_PREFIX}objxmpp${LIB_SUFFIX}") + + BUILDSYS_FRAMEWORK([ + AC_SUBST(OBJXMPP_FRAMEWORK, "ObjXMPP.framework") + ]) ]) AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library])) AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [ AC_PATH_TOOL(AR, ar) AC_PROG_RANLIB @@ -85,11 +90,12 @@ ], [ AC_MSG_RESULT(no) ]) AC_CHECK_LIB(objopenssl, main, [ - LIBS="$LIBS -lobjopenssl -lcrypto" + AC_SUBST(OBJOPENSSL_LIBS, "-lobjopenssl -lcrypto") + AC_SUBST(OBJOPENSSL_FRAMEWORK_LIBS, "-framework ObjOpenSSL -lcrypto") ], [ AC_MSG_ERROR(You need ObjOpenSSL installed!) ]) PKG_CHECK_MODULES(libidn, [libidn >= 0.25], [ Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -1,2 +1,8 @@ OBJXMPP_SHARED_LIB = @OBJXMPP_SHARED_LIB@ OBJXMPP_STATIC_LIB = @OBJXMPP_STATIC_LIB@ +OBJXMPP_FRAMEWORK = @OBJXMPP_FRAMEWORK@ + +OBJFW_FRAMEWORK_LIBS = @OBJFW_FRAMEWORK_LIBS@ +OBJFW_LIBS = @OBJFW_LIBS@ +OBJOPENSSL_FRAMEWORK_LIBS = @OBJOPENSSL_FRAMEWORK_LIBS@ +OBJOPENSSL_LIBS = @OBJOPENSSL_LIBS@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -1,9 +1,10 @@ include ../extra.mk SHARED_LIB = ${OBJXMPP_SHARED_LIB} STATIC_LIB = ${OBJXMPP_STATIC_LIB} +FRAMEWORK = ${OBJXMPP_FRAMEWORK} LIB_MAJOR = 0 LIB_MINOR = 0 SRCS = XMPPAuthenticator.m \ XMPPCallback.m \ @@ -37,5 +38,7 @@ include ../buildsys.mk CPPFLAGS += -I.. -DHAVE_CONFIG_H LD = ${OBJC} +FRAMEWORK_LIBS := ${OBJOPENSSL_FRAMEWORK_LIBS} ${OBJFW_FRAMEWORK_LIBS} ${LIBS} +LIBS := ${OBJOPENSSL_LIBS} ${OBJFW_LIBS} ${LIBS} Index: tests/Makefile ================================================================== --- tests/Makefile +++ tests/Makefile @@ -1,8 +1,10 @@ +include ../extra.mk + PROG_NOINST = tests${PROG_SUFFIX} SRCS = test.m include ../buildsys.mk CPPFLAGS += -I../src -LIBS := -L../src -lobjxmpp ${LIBS} +LIBS := -L../src -lobjxmpp ${OBJOPENSSL_LIBS} ${OBJFW_LIBS} ${LIBS} LD = ${OBJC}