-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfigure.ac
222 lines (184 loc) · 5.99 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
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
220
221
222
dnl configure.ac for teg
AC_PREREQ([2.53])
AC_INIT([Tenes Empanadas Graciela], [0.13.0], [teg.github@mailbox.org], [teg])
AM_INIT_AUTOMAKE(subdir-objects)
AC_CONFIG_SRCDIR([.astylerc])
AC_CONFIG_MACRO_DIR([macros])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
# Locate various programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_LN_S
AX_CXX_COMPILE_STDCXX(17, [ext])
CXXLIBS="-lstdc++fs"
AC_SUBST(CXXLIBS)
dnl
dnl Common libraries for the server, client & robot
dnl
PKG_CHECK_MODULES(TEG_COMMONLIBS, glib-2.0)
PKG_CHECK_MODULES(XML, libxml-2.0)
AC_SUBST(TEG_COMMONLIBS_CFLAGS)
AC_SUBST(TEG_COMMONLIBS_LIBS)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
AC_SUBST(MSGFMT_OPTS)
dnl Evaluate options. Example:
AC_ARG_ENABLE(debug,
[ --enable-debug[=no/minimum/yes]
turn on debugging [default=minimum]],,
enable_debug=minimum
)
AC_ARG_ENABLE(warnings-as-errors,
AS_HELP_STRING([--enable-warnings-as-errors],
[Turn compiler warnings into errors.]))
CFLAGS="$CFLAGS -fsigned-char"
CXXFLAGS="$CXXFLAGS -fsigned-char"
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -DDEBUG"
else
if test "x$enable_debug" = "xno"; then
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
fi
AC_ARG_WITH(readline,
[ --with-readline support fancy command line editing in server],
WITH_READLINE=$withval, dnl yes/no - required to use / never use
WITH_READLINE="maybe" dnl maybe - use if found [default]
)
GLIB_GSETTINGS
PKG_CHECK_MODULES(TEG_LIBGNOME, goocanvas-2.0)
AC_SUBST(TEG_LIBGNOME_CFLAGS)
AC_SUBST(TEG_LIBGNOME_LIBS)
CLIENT_CFLAGS="$CLIENT_CFLAGS $TEG_COMMONLIBS_CFLAGS"
CLIENT_LIBS="$CLIENT_LIBS $TEG_COMMONLIBS_LIBS"
AC_SUBST(CLIENT_CFLAGS)
AC_SUBST(CLIENT_LIBS)
dnl I18n support
GETTEXT_PACKAGE=teg
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Gettext package name])
ALL_LINGUAS="es fr de gl pl it pt pt_BR hu_HU"
AM_PATH_GLIB_2_0
AM_GNU_GETTEXT_VERSION([0.19])
AM_GNU_GETTEXT([external])
dnl DATADIRNAME is generated by AM_GNU_GETTEXT;
dnl note this has to match the path installed by po/Makefile
LOCALEDIR="${prefix}/${DATADIRNAME}/locale"
AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR", [Localisation files location])
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall -Wno-unused-parameter"
fi
if test "x$enable_warnings_as_errors" = "xyes" ; then
CFLAGS="$CFLAGS -Werror"
CXXFLAGS="$CXXFLAGS -Werror"
fi
dnl check pthreads
AC_CHECK_LIB(pthread, pthread_create,
[AC_DEFINE([HAVE_PTHREADS], 1, [Check for pthreads availability])
SERVER_LIBS="-lpthread $SERVER_LIBS"
SERVER_CFLAGS="-D_REENTRANT $SERVER_CFLAGS"
])
dnl The use of AC_CHECK_FUNC is to avoid wrong libs on IRIX.
AC_CHECK_FUNC(gethostbyname)
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname, SERVER_LIBS="-lnsl $SERVER_LIBS")
fi
AC_CHECK_FUNC(connect)
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect, SERVER_LIBS="-lsocket $SERVER_LIBS")
fi
dnl looking for readline library and header
if test "$WITH_READLINE" = "yes"; then
AC_CHECK_LIB(readline, rl_callback_handler_install,
[SERVER_LIBS="-lreadline $SERVER_LIBS"
AC_DEFINE_UNQUOTED([HAVE_LIBREADLINE], 1, [Check for readline availability])],
AC_MSG_ERROR([Specified --with-readline but did not find library.]),
$SERVER_LIBS)
AC_CHECK_HEADER(readline/readline.h, ,
AC_MSG_ERROR([Specified --with-readline; found library but not header file. You may need to install a readline development package.]))
elif test "$WITH_READLINE" = "maybe"; then
AC_CHECK_HEADER(readline/readline.h, have_readline_h=1, have_readline_h=0)
if test "$have_readline_h" = "1"; then
AC_CHECK_LIB(readline, rl_callback_handler_install,
[SERVER_LIBS="-lreadline $SERVER_LIBS"
AC_DEFINE_UNQUOTED([HAVE_LIBREADLINE], 1, [Check for readline availability])
], , $SERVER_LIBS)
fi
fi
SERVER_CFLAGS="$SERVER_CFLAGS $TEG_COMMONLIBS_CFLAGS"
SERVER_LIBS="$SERVER_LIBS $TEG_COMMONLIBS_LIBS"
AC_SUBST(SERVER_CFLAGS)
AC_SUBST(SERVER_LIBS)
dnl Checks for inet_ntop function. If this test fails, you can resurrect the
dnl code which got removed with the commit of this comment.
AC_CHECK_LIB(c, inet_ntop, [], [AC_MSG_ERROR("Can't find the required inet_ntop function.")])
AC_CHECK_LIB(nls,main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(arpa/inet.h netdb.h netinet/in.h pwd.h sys/ioctl.h \
sys/select.h sys/signal.h sys/socket.h sys/termio.h \
sys/time.h sys/types.h sys/uio.h termios.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(fdopen gethostname getpwuid gettimeofday select \
strerror strlcat strlcpy strstr usleep vsnprintf)
dnl We would AC_CHECK_FUNCS for socket as well, except it is complicated
dnl by the fact that the -lsocket is in X_EXTRA_LIBS and/or SERVER_LIBS,
dnl and not in LIBS.
dnl This has to be last library
if test -n "$WITH_EFENCE"; then
AC_CHECK_LIB(efence, malloc, [
if test "x$LIBS" = "x"; then
LIBS = -lefence
else
LIBS="$LIBS -lefence"
fi])
fi
if test -r .gitignore ; then
SLEEP=true
else
SLEEP=sleep
fi
dnl Chequear si tiene empanadas.
AC_MSG_CHECKING([whether you have Empanadas de carne criolla])
$SLEEP 1
AC_MSG_RESULT(Super!)
AC_MSG_CHECKING([whether you have Empanadas de verdura])
$SLEEP 1
AC_MSG_RESULT(Cool!)
AC_MSG_CHECKING([whether you have Empanadas de jamon y queso])
$SLEEP 1
AC_MSG_RESULT(Buenichimo!)
AC_MSG_CHECKING([whether you have Empanadas de carne picante])
$SLEEP 1
AC_MSG_RESULT(Yeah!)
AC_CONFIG_FILES([
Makefile
po/Makefile.in
po/Makefile
client/teg_pix/Makefile
client/themes/Makefile
client/themes/TEG/Makefile
client/themes/teg_classic/Makefile
client/themes/m2/Makefile
docs/Makefile
docs/gnome-help/Makefile
docs/gnome-help/C/Makefile
docs/gnome-help/pl/Makefile
])
AC_OUTPUT
dnl Status Output
dnl =============
echo ""
echo "Are you ready for the Empanada Experience ?"
echo "Type \`make'"
echo ""