Permalink
Browse files

Cleanup Cmake and add autoconf build system

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
  • Loading branch information...
1 parent 9ea5cc4 commit 748c26c93d50002fbcbe405da13481b096aac921 @dgoulet dgoulet committed Nov 2, 2012
View
@@ -1,9 +1,29 @@
*.o
*.so
-term.h
-statusbar.h
-mainwindows.h
-.exrc
*.swp
-cscope.files
-cscope.out
+*.o
+*.swo
+*.pyc
+Makefile
+.libs/
+.deps/
+*~
+*.la
+*.lo
+Makefile.in
+*.loT
+*.info
+*.bz2
+*.tar
+configure
+aclocal.m4
+autom4te.cache/
+config.h
+config.h.in
+config.log
+config.status
+stamp-h1
+libtool
+tags
+
+config/
View
@@ -1,105 +0,0 @@
-#
-# K&R (sort-of)
-#
-# minor modifications
-#
-
-indent_with_tabs = 2 # 1=indent to level only, 2=indent with tabs
-input_tab_size = 8 # original tab size
-output_tab_size = 8 # new tab size
-indent_columns = output_tab_size
-indent_label = 2 # pos: absolute col, neg: relative column
-#indent_var_def_cont = true
-#indent_continue = 4
-indent_class = true
-
-# indent_align_string = False # align broken strings
-# indent_brace = 0
-
-nl_enum_brace = remove # "enum {" vs "enum \n {"
-nl_union_brace = remove # "union {" vs "union \n {"
-nl_struct_brace = remove # "struct {" vs "struct \n {"
-nl_do_brace = remove # "do {" vs "do \n {"
-nl_if_brace = remove # "if () {" vs "if () \n {"
-nl_for_brace = remove # "for () {" vs "for () \n {"
-nl_else_brace = remove # "else {" vs "else \n {"
-nl_while_brace = remove # "while () {" vs "while () \n {"
-nl_switch_brace = remove # "switch () {" vs "switch () \n {"
-# nl_func_var_def_blk = 1
-# nl_before_case = 1
-nl_fcall_brace = add # "foo() {" vs "foo()\n{"
-nl_fdef_brace = add # "int foo() {" vs "int foo()\n{"
-# nl_after_return = TRUE
-nl_brace_while = remove
-nl_brace_else = remove
-nl_squeeze_ifdef = TRUE
-
-# Don't split one-line braced statements inside a class xx { } body
-nl_class_leave_one_liners = true # false/true
-# Don't split one-line function definitions - 'int foo() { return 0; }'
-nl_func_leave_one_liners = true # false/true
-# Whether to collapse empty blocks between '{' and '}'
-nl_collapse_empty_body = true # false/true
-# ^^
-
-# mod_paren_on_return = add # "return 1;" vs "return (1);"
-# mod_full_brace_if = add # "if (a) a--;" vs "if (a) { a--; }"
-# mod_full_brace_for = add # "for () a--;" vs "for () { a--; }"
-# mod_full_brace_do = add # "do a--; while ();" vs "do { a--; } while ();"
-# mod_full_brace_while = add # "while (a) a--;" vs "while (a) { a--; }"
-
-sp_before_semi = remove
-sp_paren_paren = remove # space between (( and ))
-sp_return_paren = remove # "return (1);" vs "return(1);"
-sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
-sp_before_sparen = force # "if (" vs "if("
-sp_after_sparen = force # "if () {" vs "if (){"
-sp_after_cast = remove # "(int) a" vs "(int)a"
-sp_inside_braces = force # "{ 1 }" vs "{1}"
-sp_inside_braces_struct = force # "{ 1 }" vs "{1}"
-sp_inside_braces_enum = force # "{ 1 }" vs "{1}"
-sp_inside_paren = remove # "( 1 )" vs "(1)"
-sp_inside_fparen = remove # "( 1 )" vs "(1)" - functions
-sp_inside_sparen = remove # "( 1 )" vs "(1)" - if/for/etc
-# sp_type_func = ignore
-sp_assign = force
-sp_arith = force
-sp_bool = force
-sp_compare = force
-sp_after_comma = force
-sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
-sp_func_call_paren = remove # "foo (" vs "foo("
-sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
-
-# align_with_tabs = FALSE # use tabs to align
-# align_on_tabstop = FALSE # align on tabstops
-# align_enum_equ_span = 4
-# align_nl_cont = TRUE
-# align_var_def_span = 2
-# align_var_def_inline = TRUE
-# align_var_def_star = TRUE
-# align_var_def_colon = TRUE
-# align_assign_span = 1
-# align_struct_init_span = 3
-# align_var_struct_span = 3
-# align_right_cmt_span = 3
-# align_pp_define_span = 3
-# align_pp_define_gap = 4
-# align_number_left = TRUE
-# align_typedef_span = 5
-# align_typedef_gap = 3
-
-# cmt_star_cont = TRUE
-
-eat_blanks_before_close_brace = TRUE
-eat_blanks_after_open_brace = TRUE
-
-# Try to limit code width to N number of columns
-code_width = 78 # number
-cmt_width = 80 # number
-
-# Whether to fully split long 'for' statements at semi-colons
-ls_for_split_full = false # false/true
-
-# Whether to fully split long function protos/calls at commas
-ls_func_split_full = false # false/true
View
No changes.
View
@@ -1,229 +0,0 @@
-#
-# Off-the-Record Messaging (OTR) modules for IRC
-# Copyright (C) 2008 Uli Meis <a.sporto+bee@gmail.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
-#
-
-PROJECT(irc-otr)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
-IF(COMMAND cmake_policy)
- cmake_policy(SET CMP0003 NEW)
-ENDIF(COMMAND cmake_policy)
-
-SET(CMAKE_MODULE_PATH
- ${PROJECT_SOURCE_DIR}/cmake-extensions/
- ${PROJECT_BINARY_DIR})
-
-INCLUDE(cmake-extensions/cscope.cmake)
-INCLUDE(cmake-extensions/Git.cmake)
-INCLUDE(CheckFunctionExists)
-INCLUDE(CheckIncludeFile)
-INCLUDE(CheckIncludeFiles)
-INCLUDE(tarballdefs.cmake OPTIONAL)
-
-# get version from git
-
-IF(NOT IRCOTR_VERSION)
- IF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
- MESSAGE(FATAL_ERROR "Cannot determine the irc-otr version since this is "
- "not a git checkout. Please set IRCOTR_VERSION, e.g.
- cmake -DIRCOTR_VERSION=mydistro-0.1
- or
- cmake -DIRCOTR_VERSION=mydistro-git-<git-commit>")
- ENDIF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
- FIND_GIT_TAGORCOMMIT(${PROJECT_SOURCE_DIR} IRCOTR_VERSION)
- IF(NOT IRCOTR_VERSION)
- MESSAGE(FATAL_ERROR
- "Couldn't determine version. Please run cmake -DIRCOTR_VERSION=...")
- ENDIF(NOT IRCOTR_VERSION)
-ENDIF(NOT IRCOTR_VERSION)
-
-MESSAGE(STATUS "Building irc-otr version ${IRCOTR_VERSION}")
-
-# PkgConfig. Only available since 2.4.7, fetch if unavailable so people with
-# older cmake can run this
-
-FIND_PACKAGE(PkgConfig QUIET)
-
-IF(NOT PKG_CONFIG_FOUND)
- MESSAGE(STATUS "Couldn't find the pkg-config cmake module. Seems you're
- running cmake < 2.4.7. Will try to fetch the module from 2.4.7...")
- FIND_PACKAGE(Wget REQUIRED)
- EXECUTE_PROCESS(COMMAND "bash" "-c"
- "${WGET_EXECUTABLE} '-O' '-' \\
- 'http://www.cmake.org/files/v2.4/cmake-2.4.7.tar.gz' | \\
- tar xz cmake-2.4.7/Modules/FindPkgConfig.cmake && \\
- mv cmake-2.4.7/Modules/FindPkgConfig.cmake . && \\
- rmdir -p cmake-2.4.7/Modules"
- RESULT_VARIABLE PKGCONF_RET)
- IF(NOT PKGCONF_RET EQUAL 0)
- MESSAGE(FATAL_ERROR "Couldnt download cmake module for pkg-config")
- ENDIF(NOT PKGCONF_RET EQUAL 0)
- FIND_PACKAGE(PkgConfig REQUIRED)
-ENDIF(NOT PKG_CONFIG_FOUND)
-
-# GLIB
-
-pkg_check_modules(GLIB REQUIRED glib-2.0)
-
-# Python
-
-FIND_PACKAGE(PythonInterp)
-IF(NOT PYTHON_EXECUTABLE)
- MESSAGE(FATAL_ERROR "Couldn't find a python interpreter")
-ENDIF(NOT PYTHON_EXECUTABLE)
-
-# LIBOTR
-
-FIND_PACKAGE(LibOTR REQUIRED)
-IF (LIBOTR_VERSION LESS "3.1.0")
- MESSAGE(FATAL_ERROR "Need libotr version >= 3.1.0 (fragmentation)")
-ENDIF (LIBOTR_VERSION LESS "3.1.0")
-IF (LIBOTR_VERSION LESS "4.0.0")
- MESSAGE(STATUS "libotr<4, no Q&A authentication support")
- SET(LIBOTR3 ON)
-ENDIF (LIBOTR_VERSION LESS "4.0.0")
-
-# LIBGCRYPT. A dependency of libotr and therefore one of ours.
-
-FIND_PACKAGE(LibGcrypt REQUIRED)
-
-# includes
-
-SET(IRCOTR_INCLUDE_DIRS
- ${PROJECT_SOURCE_DIR}
- ${PROJECT_BINARY_DIR}
- ${GLIB_INCLUDE_DIRS}
- ${LIBOTR_INCLUDE_DIRS})
-
-SET(CMAKE_REQUIRED_INCLUDES ${IRCOTR_INCLUDE_DIRS})
-SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H ${LIBGCRYPT_CFLAGS})
-
-
-include_directories(${IRCOTR_INCLUDE_DIRS})
-
-# gregex.h
-# available since 2.13 AFAIK
-# optional for html stripping and nick ignoring
-
-CHECK_INCLUDE_FILE(glib/gregex.h HAVE_GREGEX_H)
-
-# check for strsignal
-
-CHECK_FUNCTION_EXISTS(strsignal HAVE_STRSIGNAL)
-
-# generate io-config.h
-
-CONFIGURE_FILE(io-config.h.in io-config.h)
-
-# defs
-
-IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE debug)
-ENDIF(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_C_FLAGS_DEBUG -g)
-
-MESSAGE(STATUS "This is a ${CMAKE_BUILD_TYPE} build")
-
-ADD_DEFINITIONS(-DHAVE_CONFIG_H -Wall ${LIBGCRYPT_CFLAGS})
-
-# generate otr-formats.{c,h}
-
-ADD_CUSTOM_COMMAND(OUTPUT
- otr-formats.c
- xchat-formats.c
- DEPENDS makeformats.py formats.txt README
- COMMAND
- ${PYTHON_EXECUTABLE}
- ${PROJECT_SOURCE_DIR}/makeformats.py
- ${PROJECT_SOURCE_DIR}/formats.txt
- ${PROJECT_SOURCE_DIR}/README
- )
-
-
-add_custom_target(otrformats DEPENDS otr-formats.c)
-
-# Now that took some time to figure out...
-
-IF(APPLE)
- SET(APPLE_LDFLAGS "-single_module -undefined dynamic_lookup")
-ENDIF(APPLE)
-
-FOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
- SET(MAIN_LDFLAGS "${MAIN_LDFLAGS} ${X}")
-ENDFOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
-
-FIND_PATH(IRSSI_INCLUDE_DIR NAMES irssi/src/core/module.h)
-MARK_AS_ADVANCED(IRSSI_INCLUDE_DIR)
-
-FIND_PATH(WEECHAT_INCLUDE_DIR NAMES weechat/weechat-plugin.h
- PATHS ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
-MARK_AS_ADVANCED(WEECHAT_INCLUDE_DIR)
-
-FIND_PATH(XCHAT_INCLUDE_DIR NAMES xchat/xchat-plugin.h)
-MARK_AS_ADVANCED(XCHAT_INCLUDE_DIR)
-
-IF(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
- SET(W_IRSSI ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "xchat-[^/]*$")
- SET(W_XCHAT ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "weechat-[^/]*$")
- SET(W_WEECHAT ON)
-ELSEIF(CMAKE_SOURCE_DIR MATCHES "bitlbee-[^/]*$")
- SET(W_BITLBEE ON)
-ELSE(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
- IF(IRSSI_INCLUDE_DIR)
- SET(W_IRSSI ON)
- ENDIF(IRSSI_INCLUDE_DIR)
- IF(XCHAT_INCLUDE_DIR)
- SET(W_XCHAT ON)
- ENDIF(XCHAT_INCLUDE_DIR)
- IF(WEECHAT_INCLUDE_DIR)
- SET(W_WEECHAT ON)
- ENDIF(WEECHAT_INCLUDE_DIR)
- IF(BITLBEE_INCLUDE_DIR)
- SET(W_BITLBEE ON)
- ENDIF(BITLBEE_INCLUDE_DIR)
-ENDIF(CMAKE_SOURCE_DIR MATCHES "irssi-[^/]*$")
-
-OPTION(WANT_IRSSI "build irssi plugin" ${W_IRSSI})
-OPTION(WANT_XCHAT "build xchat plugin" ${W_XCHAT})
-OPTION(WANT_WEECHAT "build weechat plugin" ${W_WEECHAT})
-OPTION(WANT_BITLBEE "build bitlbee plugin" ${W_BITLBEE})
-
-IF(WANT_IRSSI)
- add_subdirectory(irssi)
-ENDIF(WANT_IRSSI)
-IF(WANT_XCHAT)
- add_subdirectory(xchat)
-ENDIF(WANT_XCHAT)
-IF(WANT_WEECHAT)
- add_subdirectory(weechat)
-ENDIF(WANT_WEECHAT)
-IF(WANT_BITLBEE)
- add_subdirectory(bitlbee)
-ENDIF(WANT_BITLBEE)
-
-# cscope
-
-FILE(GLOB CSANDHS *.c *.h)
-ADD_CSCOPE_TARGET("${CSANDHS}" "${IRCOTR_INCLUDE_DIRS}")
-
-# Source tarball
-ADD_CUSTOM_TARGET(src-tarball
- ${PROJECT_SOURCE_DIR}/mksrcpackage.sh ${PROJECT_SOURCE_DIR}
- ${IRCOTR_VERSION})
View
@@ -1,17 +0,0 @@
-You can let cmake generate a package for you. But don't expect it to be in
-full conformance with your distribution.
-
-You'll need cmake >= 2.6. In theory, all you should have to do is:
-
- $ cmake -DCMAKE_INSTALL_TYPE=package-deb /path/to/src
- $ sudo make package
-
-For an RPM it should be package-rpm and for TGZ...you can imagine.
-
-I'm not sure yet if the RPMs/DEBs generated by cmake/CPack are 100% OK. You can
-tweak the settings in Packaging-{RPM,DEB}.cmake. If you wanna see how CPack does
-it and what variables affect it, check out:
-
- /usr/share/cmake/Modules/CPackDeb.cmake
- /usr/share/cmake/Modules/CPackRPM.cmake
-
View
@@ -0,0 +1,8 @@
+AM_CFLAGS = $(PACKAGE_CFLAGS)
+
+ACLOCAL_AMFLAGS = -I config
+
+SUBDIRS = src
+
+dist_doc_DATA = LICENSE \
+ ChangeLog
Oops, something went wrong.

0 comments on commit 748c26c

Please sign in to comment.