This repository has been archived by the owner on Dec 9, 2020. It is now read-only.
/
configure.ac
146 lines (123 loc) · 4.3 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# *- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# Hurray for <http://www-src.lip6.fr/homepages/Alexandre.Duret-Lutz/autotools.html>
AC_PREREQ([2.59])
AC_INIT([centerim5],
m4_esyscmd([misc/git-version-gen .tarball-version]),
[http://sourceforge.net/projects/centerim])
# prevent AC_PROG_CC, AC_PROG_CXX from initializing CFLAGS and CXXFLAGS
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_GNU_SOURCE
########################
# Checks for programs. #
########################
AC_PROG_CC
AC_PROG_CC_C99
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_LIBTOOL
#########################
# Checks for libraries. #
#########################
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
# libpurple
# v2.7.0 is needed because of purple_account_get_name_for_display(), this
# version was released on 2010-05-13 and is available in both Debian Stable
# (squeeze) and CentOS 6
# find . \( -name \*.cpp -o -name \*.h \) -print0 | xargs -0 sed -n 's/.*\(purple_[^( ]*\)(.*/\1/p' | sort | uniq | less
PKG_CHECK_MODULES([PURPLE], [purple >= 2.7.0])
AC_SUBST([PURPLE_CFLAGS])
AC_SUBST([PURPLE_LIBS])
# glib
# v2.16.0 is needed because of g_markup_parse_context_get_element_stack(),
# this version was released on 2009-03-13
# find . \( -name \*.cpp -o -name \*.h \) -print0 | xargs -0 sed -n 's/.*\(g_[^ (]*\)(.*/\1/p' | sort | uniq | less
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.16.0])
AC_SUBST([GLIB_CFLAGS])
AC_SUBST([GLIB_LIBS])
# libsigc++
# v2.2.0 was released on 2008-02-22
PKG_CHECK_MODULES([SIGC], [sigc++-2.0 >= 2.2.0])
AC_SUBST([SIGC_CFLAGS])
AC_SUBST([SIGC_LIBS])
# ncursesw
AC_PATH_LIB_LIBCONFIG
AC_PATH_LIB([ncursesw], , [ncurses.h], [ncursesw5-config], , , [
AC_MSG_RESULT([no])
AC_ERROR([You must have the ncursesw library and developement headers installed to build.])
])
############################
# Checks for header files. #
############################
##################################################################
# Checks for typedefs, structures, and compiler characteristics. #
##################################################################
#################################
# Checks for library functions. #
#################################
###############################
# Set default compiler flags. #
###############################
AC_ARG_ENABLE([strict], [AC_HELP_STRING([--enable-strict],
[enable extra compiler warnings during build])])
if test "$GCC" = yes; then
AS_IF([test "$enable_strict" = yes],
[CFLAGS="-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -pedantic $CFLAGS"
CXXFLAGS="-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -pedantic -Wno-long-long $CXXFLAGS"])
fi
###########
# Options #
###########
AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],
[compile with debugging support])])
# TODO provide correct switches for other compilers too
if test "$GCC" = yes; then
AS_IF([test "$enable_debug" = yes],
[CFLAGS="-ggdb -O0 $CFLAGS"
CXXFLAGS="-ggdb -O0 $CXXFLAGS"],
[CFLAGS="-O2 $CFLAGS"
CXXFLAGS="-O2 $CXXFLAGS"])
fi
AC_SUBST([CFLAGS])
AC_SUBST([CXXFLAGS])
AS_IF([test "$enable_debug" = yes],
[AC_DEFINE([DEBUG], [1], [Define if debugging is enabled.])])
dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
dnl =================================
dnl Interpolate the VALUE in loop until it doesn't change,
dnl and set the result to $RESULT.
dnl WARNING: It's easy to get an infinite loop with some unsane input.
AC_DEFUN([adl_RECURSIVE_EVAL],
[_lcl_receval="$1"
$2=`(test "$prefix" = NONE && prefix="$ac_default_prefix"
test "$exec_prefix" = NONE && exec_prefix="$prefix"
_lcl_receval_old=''
while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
_lcl_receval_old="[$]_lcl_receval"
eval _lcl_receval="\"[$]_lcl_receval\""
done
echo "[$]_lcl_receval")`])
adl_RECURSIVE_EVAL([$localedir], [localedir_eval])
AC_DEFINE_UNQUOTED([LOCALEDIR], ["$localedir_eval"],
[Define to the locale directory.])
########################
# Create output files. #
########################
AC_CONFIG_FILES([Makefile
cppconsui/Makefile
doc/Makefile
doc/doxygen-cppconsui.conf
misc/Makefile
po/Makefile.in
src/Makefile
tests/Makefile])
AC_OUTPUT