author | Myhailo Danylenko <isbear@ukrpost.net> |
Tue, 01 May 2012 02:09:34 +0300 | |
changeset 26 | 65d81aec6691 |
parent 24 | 7bb7fb2c1822 |
child 29 | 335662766a88 |
permissions | -rw-r--r-- |
22 | 1 |
# HG changeset patch |
26
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
2 |
# Parent 56b136a36dbc14a9c173f78350b00a73734b20cb |
22 | 3 |
|
26
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
4 |
diff -r 56b136a36dbc mcabber/CMakeLists.txt |
22 | 5 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
26
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
6 |
+++ b/mcabber/CMakeLists.txt Mon Apr 30 23:39:07 2012 +0300 |
22 | 7 |
@@ -0,0 +1,196 @@ |
8 |
+## Copyright 2010 Myhailo Danylenko |
|
9 |
+# This file is part of mcabber. |
|
10 |
+# |
|
11 |
+# mcabber is free software: you can redistribute it and/or modify |
|
12 |
+# it under the terms of the GNU General Public License as published by |
|
13 |
+# the Free Software Foundation, either version 2 of the License, or |
|
14 |
+# (at your option) any later version. |
|
15 |
+# |
|
16 |
+# This program is distributed in the hope that it will be useful, |
|
17 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
19 |
+# GNU General Public License for more details. |
|
20 |
+# |
|
21 |
+# You should have received a copy of the GNU General Public License |
|
22 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
23 |
+ |
|
24 |
+cmake_minimum_required(VERSION 2.6) |
|
25 |
+project(mcabber C) |
|
26 |
+set(PROJECT_VERSION "0.10.2-dev") |
|
27 |
+ |
|
28 |
+## User settable options |
|
29 |
+option(DEBUG "Enable debugging output" OFF) |
|
30 |
+option(USE_SIGWINCH "Compile with SIGWINCH handler" OFF) |
|
31 |
+option(XEP0022 "Enable obsolete Message Events (XEP-0022)" OFF) |
|
32 |
+option(ENABLE_MODULES "Enable dynamic module loading" ON) |
|
33 |
+option(WANT_LIBIDN "Compile with libidn support" ON) |
|
34 |
+option(WANT_GPGME "Compile with PGP support (libgpgme required)" ON) |
|
35 |
+option(WANT_OTR "Compile with OTR support" OFF) |
|
36 |
+option(WANT_ENCHANT "Use enchant for spell-checking" OFF) |
|
37 |
+option(WANT_ASPELL "Use aspell for spell-checking" OFF) |
|
38 |
+ |
|
39 |
+set(MCABBER_BRANCH "experimental") |
|
40 |
+set(MCABBER_VERSION ${PROJECT_VERSION}) |
|
41 |
+ |
|
42 |
+## Check for build dependencies |
|
43 |
+find_package(PkgConfig REQUIRED) |
|
44 |
+ |
|
45 |
+## Glib |
|
46 |
+pkg_check_modules(GLIB REQUIRED glib-2.0>=2.14.0) |
|
47 |
+if (ENABLE_MODULES) |
|
48 |
+ pkg_check_modules(GMODULE REQUIRED gmodule-2.0) |
|
49 |
+endif() |
|
50 |
+ |
|
51 |
+## Loudmouth |
|
52 |
+pkg_check_modules(LM REQUIRED loudmouth-1.0>=1.4.2) |
|
53 |
+include(CheckSymbolExists) |
|
54 |
+set(CMAKE_REQUIRED_INCLUDES ${LM_INCLUDE_DIRS}) |
|
55 |
+set(CMAKE_REQUIRED_LIBRARIES ${LM_LIBRARIES}) |
|
56 |
+set(CMAKE_REQUIRESD_FLAGS ${LM_LDFLAGS} ${LM_CFLAGS}) |
|
57 |
+check_symbol_exists(lm_connection_unregister_reply_handler loudmouth/loudmouth.h HAVE_LM_CONNECTION_UNREGISTER_REPLY_HANDLER) |
|
58 |
+ |
|
59 |
+## Libidn |
|
60 |
+if(WANT_LIBIDN) |
|
61 |
+ pkg_check_modules(LIBIDN libidn) |
|
62 |
+ if(LIBIDN_FOUND) |
|
63 |
+ set(HAVE_LIBIDN TRUE) |
|
64 |
+ endif() |
|
65 |
+endif() |
|
66 |
+ |
|
67 |
+## Ncursesw / Ncurses / Curses |
|
68 |
+pkg_check_modules(NCURSESW ncursesw) |
|
69 |
+if(NCURSESW_FOUND) |
|
70 |
+ pkg_check_modules(PANELW REQUIRED panelw) |
|
71 |
+ set(HAVE_UNICODE TRUE) |
|
72 |
+else() |
|
73 |
+ pkg_check_modules(NCURSES ncurses) |
|
74 |
+ if(NCURSES_FOUND) |
|
75 |
+ pkg_check_modules(PANEL REQUIRED panel) |
|
76 |
+ set(HAVE_UNICODE FALSE) |
|
77 |
+ else() |
|
78 |
+ find_package(Curses) |
|
79 |
+ # FIXME |
|
80 |
+ endif() |
|
81 |
+endif() |
|
82 |
+# we do not use curses, and we check for waddnwstr in both libs to determine HAVE_UNICODE |
|
83 |
+# check for ESCDELAY by just linking HAVE_ESCDELAY |
|
84 |
+ |
|
85 |
+if(WANT_GPGME) |
|
86 |
+# provides own gpgme-config O_o |
|
87 |
+ set(HAVE_GPGME TRUE) |
|
88 |
+endif() |
|
89 |
+ |
|
90 |
+if(WANT_OTR) |
|
91 |
+# gcrypt provides own libgcrypt-config O_o |
|
92 |
+# libotr have nothing :( |
|
93 |
+ set(OTR TRUE) |
|
94 |
+endif() |
|
95 |
+ |
|
96 |
+if(WANT_ENCHANT) |
|
97 |
+ pkg_check_modules(ENCHANT enchant) |
|
98 |
+ if(ENCHANT_FOUND) |
|
99 |
+ set(WITH_ENCHANT TRUE) |
|
100 |
+ endif() |
|
101 |
+elseif(WANT_ASPELL) |
|
102 |
+ find_package(ASPELL) |
|
103 |
+ if(ASPELL_FOUND) |
|
104 |
+ set(WITH_ASPELL TRUE) |
|
105 |
+ endif() |
|
106 |
+# aspell_{include_dir,libraries,definitions} |
|
107 |
+endif() |
|
108 |
+ |
|
109 |
+#include(CheckIncludeFile) |
|
110 |
+#set(CMAKE_REQUIRED_INCLUDES ${MCABBER_INCLUDE_DIRS}) |
|
111 |
+#check_include_file(mcabber/disco.h HAVE_MCABBER_DISCO_H) |
|
112 |
+# message(SEND_ERROR "Disco module headers not found") |
|
113 |
+ |
|
114 |
+link_directories(${GLIB_LIBRARY_DIRS} |
|
115 |
+ ${GMODULE_LIBRARY_DIRS} |
|
116 |
+ ${LM_LIBRARY_DIRS} |
|
117 |
+ ${LIBIDN_LIBRARY_DIRS} |
|
118 |
+ ${ENCHANT_LIBRARY_DIRS} |
|
119 |
+ ${NCURSESW_LIBRARY_DIRS} |
|
120 |
+ ${NCURSES_LIBRARY_DIRS}) |
|
121 |
+ |
|
122 |
+## Define targets |
|
123 |
+add_executable(mcabber mcabber/main.c ) # FIXME |
|
124 |
+if(ENABLE_MODULES) |
|
125 |
+# Put these into per-project dirs? |
|
126 |
+ add_library(beep MODULE modules/beep/beep.c) |
|
127 |
+ add_library(eventcmd MODULE modules/beep/eventcmd.c mcabber/extcmd.c) |
|
128 |
+ add_library(fifo MODULE modules/fifo/fifo_module.c mcabber/fifo.c) |
|
129 |
+ add_library(urlregex MODULE modules/urlregex/urlregex.c) |
|
130 |
+ add_library(xttitle MODULE modules/xttitle/xttitle.c) |
|
131 |
+endif() |
|
132 |
+ |
|
133 |
+## Compiler setup |
|
134 |
+configure_file(config.h.in config.h) |
|
135 |
+include_directories(SYSTEM ${GLIB_INCLUDE_DIRS} |
|
136 |
+ ${GMODULE_INCLUDE_DIRS} |
|
137 |
+ ${LM_INCLUDE_DIRS} |
|
138 |
+ ${LIBIDN_INCLUDE_DIRS} |
|
139 |
+ ${ENCHANT_INCLUDE_DIRS} |
|
140 |
+ ${NCURSESW_INCLUDE_DIRS} |
|
141 |
+ ${NCURSES_INCLUDE_DIRS}) |
|
142 |
+target_link_libraries(mcabber ${LUA_LIBRARIES} ${GLIB_LIBRARIES}) |
|
143 |
+target_link_libraries(mcabber ${GLIB_LIBRARIES} |
|
144 |
+ ${GMODULE_LIBRARIES} |
|
145 |
+ ${LM_LIBRARIES} |
|
146 |
+ ${LIBIDN_LIBRARIES} |
|
147 |
+ ${ENCHANT_LIBRARIES} |
|
148 |
+ ${NCURSESW_LIBRARIES} |
|
149 |
+ ${NCURSES_LIBRARIES}) |
|
150 |
+include_directories(${mcabber_SOURCE_DIR} ${mcabber_BINARY_DIR}) |
|
151 |
+# PREFIX "" # for module libraries |
|
152 |
+set_target_properties(mcabber PROPERTIES |
|
153 |
+ COMPILE_FLAGS "-Wall") |
|
154 |
+ |
|
155 |
+## Extra targets |
|
156 |
+# add_custom_command(OUTPUT ${mcabber_BINARY_DIR}/mcabber.html COMMAND ${mcabber_SOURCE_DIR}/docgen.pl ${mcabber_SOURCES} > ${mcabber_BINARY_DIR}/mcabber.html DEPENDS ${mcabber_SOURCE_DIR}/docgen.pl ${mcabber_SOURCES} WORKING_DIRECTORY ${mcabber_SOURCE_DIR}) |
|
157 |
+# add_custom_target(doc ALL DEPENDS ${mcabber_BINARY_DIR}/mcabber.html) |
|
158 |
+# add_custom_target(test COMMAND env "LUA_PATH=${mcabber_SOURCE_DIR}/?.lua;${LUA_PATH}" "LUA_CPATH=${mcabber_SOURCE_DIR}/?.so;${mcabber_BINARY_DIR}/?.so;${LUA_CPATH}" lua ${mcabber_SOURCE_DIR}/test.lua DEPENDS mcabber VERBATIM) |
|
159 |
+ |
|
160 |
+## Packaging information |
|
161 |
+set(CPACK_PACKAGE_NAME liblua5.1-mcabber) # XXX |
|
162 |
+set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
|
163 |
+set(CPACK_PACKAGE_VENDOR "McKael") |
|
164 |
+set(CPACK_PACKAGE_CONTACT "Mikael BERTHE <mikael@lilotux.net>") |
|
165 |
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "small Jabber (XMPP) console client") |
|
166 |
+set(CPACK_PACKAGE_DESCRIPTION_FILE ${mcabber_SOURCE_DIR}/README) |
|
167 |
+set(CPACK_RESOURCE_FILE_LICENSE ${mcabber_SOURCE_DIR}/COPYING) |
|
168 |
+set(CPACK_RESOURCE_FILE_README ${mcabber_SOURCE_DIR}/README) |
|
169 |
+set(CPACK_RESOURCE_FILE_WELCOME ${mcabber_SOURCE_DIR}/README) |
|
170 |
+set(CPACK_SOURCE_GENERATOR TBZ2) |
|
171 |
+set(CPACK_GENERATOR DEB CACHE TEXT "Binary package generator, eg DEB, RPM, TGZ, NSIS...") |
|
172 |
+set(CPACK_DEBIAN_PACKAGE_SECTION libs) |
|
173 |
+# XXX: tmp=`tempfile`; obj=${mcabber_BINARY_DIR}/mcabber.so; ldd $obj > $tmp; objdump -p $obj | \grep NEEDED | sed -e 's/.*NEEDED *//' | xargs -I "{}" grep -F "{}" $tmp | sed -e 's/.*=> *\(\S*\).*/\1/' | xargs dpkg -S | cut -d : -f 1 | sort -u ; \rm $tmp |
|
174 |
+set(CPACK_DEBIAN_PACKAGE_DEPENDS "") |
|
175 |
+find_program(DPKG_EXECUTABLE dpkg) |
|
176 |
+if(DPKG_EXECUTABLE) |
|
177 |
+ execute_process(COMMAND ${DPKG_EXECUTABLE} --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
178 |
+else() |
|
179 |
+ set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386 CACHE TEXT "Architecture of package") |
|
180 |
+endif() |
|
181 |
+set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") |
|
182 |
+# XXX: Set package name directly to get rid of -Sources? |
|
183 |
+set(CPACK_SOURCE_IGNORE_FILES "/\\\\..*;\\\\.swp;~$;/build/;\\\\.tar\\\\.;\\\\.deb;\\\\.so") |
|
184 |
+include(CPack) |
|
185 |
+ |
|
186 |
+## Set up installer |
|
187 |
+install(TARGETS mcabber DESTINATION bin) |
|
188 |
+if(ENABLE_MODULES) |
|
189 |
+ install(FILES mcabber/*.h DESTINATION include/mcabber) # FIXME |
|
190 |
+ install(TARGETS beep eventcmd fifo urlregex xttitle DESTINATION lib/mcabber) |
|
191 |
+ install(FILES mcabber.pc DESTINATION lib/pkgconfig) # XXX should we install it into share? |
|
192 |
+endif() |
|
193 |
+install(DIRECTORY doc/help/cs doc/help/de doc/help/en doc/help/fr doc/help/it doc/help/nl doc/help/pl doc/help/ru doc/help/uk DESTINATION share/mcabber/help) |
|
194 |
+install(FILES mcabberrc.example DESTINATION share/doc/${CPACK_PACKAGE_NAME}/examples) |
|
195 |
+install(FILES AUTHORS README TODO ChangeLog.api doc/HOWTO_modules.txt doc/README_PGP.txt DESTINATION share/doc/${CPACK_PACKAGE_NAME}) |
|
196 |
+install(FILES doc/mcabber.1.html doc/manpage.css DESTINATION share/doc/${CPACK_PACKAGE_NAME}/html) |
|
197 |
+# guide |
|
198 |
+install(FILES ChangeLog DESTINATION share/doc/${CPACK_PACKAGE_NAME} RENAME changelog) |
|
199 |
+install(FILES COPYING DESTINATION share/doc/${CPACK_PACKAGE_NAME} RENAME copyright) |
|
200 |
+install(FILES doc/mcabber.1 DESTINATION share/man/man1) |
|
201 |
+ |
|
202 |
+## The End ## vim: se ts=4 sw=4: ## |
|
203 |
+ |
|
26
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
204 |
diff -r 56b136a36dbc mcabber/configure.ac |
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
205 |
--- a/mcabber/configure.ac Mon Apr 30 23:38:36 2012 +0300 |
65d81aec6691
Resync to mainstream, drop extend-caps
Myhailo Danylenko <isbear@ukrpost.net>
parents:
24
diff
changeset
|
206 |
+++ b/mcabber/configure.ac Mon Apr 30 23:39:07 2012 +0300 |
22 | 207 |
@@ -36,9 +36,8 @@ |
208 |
|
|
209 |
# Checks for header files. |
|
210 |
AC_HEADER_STDC |
|
211 |
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h netdb.h netinet/in.h stddef.h \ |
|
212 |
- stdlib.h string.h strings.h sys/socket.h sys/time.h \ |
|
213 |
- syslog.h termios.h wchar.h wctype.h localcharset.h]) |
|
214 |
+AC_CHECK_HEADERS([fcntl.h locale.h stdlib.h string.h sys/time.h \ |
|
215 |
+ termios.h wchar.h wctype.h localcharset.h]) |
|
216 |
AC_CHECK_HEADERS([unistd.h], , AC_MSG_ERROR([Missing header file])) |
|
217 |
AC_VAR_TIMEZONE_EXTERNALS |
|
218 |
|
|
219 |
@@ -59,10 +58,8 @@ |
|
220 |
AC_TYPE_SIGNAL |
|
221 |
AC_FUNC_STRFTIME |
|
222 |
AC_FUNC_VPRINTF |
|
223 |
-AC_CHECK_FUNCS([alarm arc4random bzero gethostbyname gethostname inet_ntoa \ |
|
224 |
- isascii memmove memset modf select setlocale socket strcasecmp \ |
|
225 |
- strchr strdup strncasecmp strrchr strstr strcasestr vsnprintf \ |
|
226 |
- iswblank]) |
|
227 |
+AC_CHECK_FUNCS([arc4random memset setlocale strcasecmp strchr strncasecmp \ |
|
228 |
+ strrchr strstr strcasestr iswblank]) |
|
229 |
|
|
230 |
|
|
231 |
AC_CHECK_DECLS([strptime],,, |