File: configure.ac

package info (click to toggle)
artha 1.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,968 kB
  • sloc: sh: 11,309; ansic: 6,200; makefile: 59
file content (219 lines) | stat: -rw-r--r-- 6,566 bytes parent folder | download | duplicates (2)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.50])

m4_define([MAJOR_VER], 1)
m4_define([MINOR_VER], 0)
m4_define([BUILD_VER], 3)

AC_INIT([Artha],[MAJOR_VER.MINOR_VER.BUILD_VER],[legends2k@yahoo.com],[artha],[http://artha.sourceforge.net/])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD

AM_INIT_AUTOMAKE([-Wall -Werror check-news dist-bzip2 gnu])

# Checks for programs.
AM_PROG_CC_C_O
AM_PROG_AR
AC_LANG([C])
AC_LANG_CONFTEST(
[AC_LANG_SOURCE([[const char hw[] = "Hello, World\n";]])])

# define the usage of pkg-config
PKG_PROG_PKG_CONFIG


# Checks for libraries.

# Check for wordnet-dev and wordnet (>=3.0)
AC_CHECK_HEADER([wn.h], , [
AC_MSG_ERROR([
You must have wordnet development headers (wordnet-dev) to build.
(http://wordnet.princeton.edu/download).
Refer INSTALL file for further details.])
])

# check for wordnet (libwordnet.a)
# if not found WN (building WordNet from source gives libWN.a)
# if not found wn (in some distros it's all small case)
# then check other possible combinations; if none was found exit
AC_CHECK_LIB([wordnet], [wninit], [WORDNET_LIB=-lwordnet], [
	AC_CHECK_LIB([WN], [wninit], [WORDNET_LIB=-lWN], [
		AC_CHECK_LIB([wn], [wninit], [WORDNET_LIB=-lwn], [
			AC_CHECK_LIB([WordNet], [wninit], [WORDNET_LIB=-lWordNet], [
				AC_CHECK_LIB([WORDNET], [wninit], [WORDNET_LIB=-lWORDNET], [
						echo "You must have WordNet library installed to build.";
						echo "(http://wordnet.princeton.edu/download)";
						exit 1
					])
				])
			])
		])
	])
AC_SUBST([WORDNET_LIB])


# GtkComboBox with entry only since 2.24 only, hence check for GTK+-2.0 >= 2.24
# check for GTK+ and GLib
PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.24 glib-2.0 >= 2.22], , [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
You must have GTK+ 2.0 (version 2.24 or above) and GLib 2.0 (version 2.22 
or above) development headers installed to build.

If you have these installed already you may need to install pkg-config so 
that they can be located.
])])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])

LT_PREREQ([2.2])
LT_INIT
case $build_os in
	*cygwin* | *mingw*)
		build_mach=[windows]
		AC_DEFINE([WINVER],[0x0501],[Build machine is Windows XP])
		AC_DEFINE([_WIN32_WINDOWS],[WINVER],[Build machine is Windows XP])
        AC_DEFINE([_WIN32_WINNT],[_WIN32_WINDOWS],[Build machine is Windows XP])
		AC_DEFINE_UNQUOTED([APP_VERSION],[MAJOR_VER, MINOR_VER, BUILD_VER, 0],[app. executable version])
		m4_define([DLL_MAJOR_VER],1)
		m4_define([DLL_MINOR_VER],1)
		m4_define([DLL_BUILD_VER],0)
		AC_DEFINE_UNQUOTED([DLL_VERSION],[DLL_MAJOR_VER, DLL_MINOR_VER, DLL_BUILD_VER, 0],[libnotify dll version as DWORD])
		AC_DEFINE([DLL_VERSION_STR],["DLL_MAJOR_VER.DLL_MINOR_VER.DLL_BUILD_VER.0"],[libnotify dll version string])
		dll_ver=DLL_MAJOR_VER:DLL_MINOR_VER:DLL_BUILD_VER
		AC_SUBST([dll_ver])
		_LT_SET_OPTIONS([LT_INIT],[win32-dll],[disable-static])
		LT_LANG([Windows Resource])
		;;
	*)
		build_mach=[posix]
		;;
esac
AC_SUBST([LIBTOOL_DEPS])

# begin of POSIX specific config
if test "$build_mach" = "posix"; then

# check if dbus-1 alone is enough or dbus-glib-1 alone is enough
PKG_CHECK_MODULES([libdbus], [dbus-1 >= 0.60 dbus-glib-1 >= 0.60], 
[AC_DEFINE([DBUS_AVAILABLE], [], [Dbus dev. headers are present])], [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
You must have the dbus and dbus-glib-1 (version 0.60 or above) 
development headers installed!

If it is installed already, you may need to install pkg-config so 
that they can be located.
])
])

AC_SUBST([libdbus_CFLAGS])
AC_SUBST([libdbus_LIBS])


# Checks for header files.
AC_PATH_X

if test "$no_x" = "yes"; then
	AC_MSG_ERROR([X11 libraries are required to build.])
fi


AC_CHECK_HEADERS([X11/Xlib.h X11/Xatom.h], [ AC_DEFINE([X11_AVAILABLE], [], [Xlib dev. headers are present]) ], [
AC_MSG_ERROR([
Xlib Development headers not found!
You need X11 development headers to build.])
])

fi
# end of POSIX specific config

AC_DEFUN([AC_DEFINE_DIR], [
  prefix_NONE=
  exec_prefix_NONE=
  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}.  Thus we have to use `eval' twice.
  eval ac_define_dir="\"[$]$2\""
  eval ac_define_dir="\"$ac_define_dir\""
  AC_SUBST($1, "$ac_define_dir")
  AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
  test "$prefix_NONE" && prefix=NONE
  test "$exec_prefix_NONE" && exec_prefix=NONE
])

AM_CONDITIONAL([POSIX],[test "$build_mach" = "posix"])

# get the target directory's path and get it defined in config.h
AM_COND_IF([POSIX],
[
AC_DEFINE_DIR([APP_DIR], [datadir/AC_PACKAGE_TARNAME], [Path where app. files are placed])
# get the target directory's path and get it defined in config.h
icon_dir=pixmaps
AC_SUBST([ICON_SUB_PATH], [$icon_dir])
AC_DEFINE_DIR([ICON_DIR], [datadir/"$icon_dir"], [Path where icon files are placed])
],
[
AC_DEFINE([APP_DIR], ["."], [Path where app. files are placed])
AC_DEFINE([ICON_DIR], ["."], [Path where app. files are placed])
])

AC_CHECK_FUNCS([strcmp strlen memset], , [
AC_MSG_ERROR([
Failed to find function(s) strcmp or strlen!
These standard C library functions are required to build.
])
])


# Enable debugging argument option. Possible values = yes, messages or verbose
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [enable debugging (default = no)]), [ac_debug="$enableval"])
if test "$ac_debug" = "yes"; then
	AC_DEFINE(DEBUG_LEVEL, 1, [Application debugging enabled])
elif test "$ac_debug" = "messages"; then
	AC_DEFINE(DEBUG_LEVEL, 2, [Debugging enabled both in application and WNI])
elif test "$ac_debug" = "verbose"; then
	AC_DEFINE(DEBUG_LEVEL, 3, [Verbose Debugging enabled both in application and WNI])
else
	ac_debug="no"
fi

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_STDBOOL
AC_C_INLINE
AC_FUNC_MALLOC

# define ssize_t needed by suggestions.h on Windows
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT8_T


AC_CONFIG_SRCDIR([src/wni.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile data/Makefile src/Makefile])
AC_OUTPUT


# display message, if all the above was successful
AC_MSG_RESULT([
Artha is now configured!

  Installation directory:	${prefix}

  To build and install Artha:

    make
    make install (root previlages required)

  Once installed, type `artha` to run.

    Refer INSTALL file for further details.
])