ObjXMPP  Check-in [93bb18bcbf]

Overview
Comment:Add support for building as a .framework
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 93bb18bcbfa9f912a93a4d70dee71cc40d4b1b51c130acbbfb0c756df4615390
User & Date: js 2018-01-21 22:44:58
Context
2018-01-21
22:46
Remove Xcode project check-in: bf3524b981 user: js tags: trunk
22:44
Add support for building as a .framework check-in: 93bb18bcbf user: js tags: trunk
22:34
Update buildsys check-in: 4b47674079 user: js tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to configure.ac.

19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37




38
39
40
41
42
43
44
AC_PROG_LN_S
AC_PROG_INSTALL

CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS $($OBJFW_CONFIG --cppflags)"
OBJCFLAGS="$OBJCFLAGS -Wall $($OBJFW_CONFIG --objcflags)"
LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags)"
LIBS="$LIBS $($OBJFW_CONFIG --libs)"


AX_CHECK_COMPILER_FLAGS(-Watomic-properties,
	[OBJCFLAGS="$OBJCFLAGS -Watomic-properties"])
AX_CHECK_COMPILER_FLAGS(-Wdocumentation,
	[OBJCFLAGS="$OBJCFLAGS -Wdocumentation"])

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}")




])
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
	AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
])







|
>











>
>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
AC_PROG_LN_S
AC_PROG_INSTALL

CPP="$OBJCPP"
CPPFLAGS="$CPPFLAGS $OBJCPPFLAGS $($OBJFW_CONFIG --cppflags)"
OBJCFLAGS="$OBJCFLAGS -Wall $($OBJFW_CONFIG --objcflags)"
LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags)"
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"])

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
	AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
])
83
84
85
86
87
88
89
90

91
92
93
94
95
96
97
	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!)
])

PKG_CHECK_MODULES(libidn, [libidn >= 0.25], [
	CPPFLAGS="$CPPFLAGS $libidn_CFLAGS"
	LIBS="$LIBS $libidn_LIBS"







|
>







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
	AC_MSG_RESULT(yes)
	AC_DEFINE(HAVE_RES_NDESTROY, 1, [Whether we have res_ndestroy])
], [
	AC_MSG_RESULT(no)
])

AC_CHECK_LIB(objopenssl, main, [
	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], [
	CPPFLAGS="$CPPFLAGS $libidn_CFLAGS"
	LIBS="$LIBS $libidn_LIBS"

Changes to extra.mk.in.

1
2






OBJXMPP_SHARED_LIB = @OBJXMPP_SHARED_LIB@
OBJXMPP_STATIC_LIB = @OBJXMPP_STATIC_LIB@








>
>
>
>
>
>
1
2
3
4
5
6
7
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@

Changes to src/Makefile.

1
2
3
4

5
6
7
8
9
10
11
include ../extra.mk

SHARED_LIB = ${OBJXMPP_SHARED_LIB}
STATIC_LIB = ${OBJXMPP_STATIC_LIB}

LIB_MAJOR = 0
LIB_MINOR = 0

SRCS = XMPPAuthenticator.m	\
       XMPPCallback.m		\
       XMPPConnection.m		\
       XMPPContact.m		\




>







1
2
3
4
5
6
7
8
9
10
11
12
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		\
       XMPPConnection.m		\
       XMPPContact.m		\
35
36
37
38
39
40
41


	   ObjXMPP.h		\
	   XMPPStorage.h

include ../buildsys.mk

CPPFLAGS += -I.. -DHAVE_CONFIG_H
LD = ${OBJC}









>
>
36
37
38
39
40
41
42
43
44
	   ObjXMPP.h		\
	   XMPPStorage.h

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}

Changes to tests/Makefile.



1
2
3
4
5
6
7
8


PROG_NOINST = tests${PROG_SUFFIX}
SRCS = test.m

include ../buildsys.mk

CPPFLAGS += -I../src
LIBS := -L../src -lobjxmpp ${LIBS}
LD = ${OBJC}
>
>






|

1
2
3
4
5
6
7
8
9
10
include ../extra.mk

PROG_NOINST = tests${PROG_SUFFIX}
SRCS = test.m

include ../buildsys.mk

CPPFLAGS += -I../src
LIBS := -L../src -lobjxmpp ${OBJOPENSSL_LIBS} ${OBJFW_LIBS} ${LIBS}
LD = ${OBJC}