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
|
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
223
224
225
226
227
228
229
230
231
232
233
234
|
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
AC_PATH_PROGS(BSHELL, ksh zsh bash, no)
if test "$BSHELL" = no; then
AC_MSG_ERROR(cannot compile - please install either Kornshell93, BASH or ZShell first.)
fi
fi
# Check if we need to build any GUI
GTK="false"
FLTK="false"
FLTK="false"
USEGTK="false"
GTK4="false"
GTK3="false"
GTK2="false"
AC_ARG_ENABLE([gui-gtk],
[AS_HELP_STRING([--enable-gui-gtk],[Build the GTK version of BaconGUI])],
[GTK="true"])
[AS_HELP_STRING([--enable-gui-gtk],[Build a GTK version of BaconGUI])],
[USEGTK="true"])
AC_ARG_ENABLE([gui-fltk],
[AS_HELP_STRING([--enable-gui-fltk],[Build the FLTK version of BaconGUI])],
[FLTK="true"])
# Default is GTK version of BaConGUI
if test "$GTK" = true -o "$FLTK" = false; then
AC_SEARCH_LIBS(gtk_init, [gtk-3], [GTK="true"], [], [])
if test "$GTK" = false; then
AC_SEARCH_LIBS(gtk_init, [gtk-x11-2.0], [GTK="true"], [], [])
if test "$GTK" = false; then
AC_MSG_NOTICE(No GTK found on this system.)
if test "$USEGTK" = true -o "$FLTK" = false; then
AC_CHECK_PROG(PKG_CONFIG, pkg-config, found, missing)
if test "$PKG_CONFIG" = missing; then
USEGTK="false"
else
AC_MSG_CHECKING(Check if GTK4 and supporting GtkSourceView5 and Webkit5 libraries are installed)
GTK4=`pkg-config --silence-errors --libs gtk4`
SRC4=`pkg-config --silence-errors --libs gtksourceview-5`
WEB4=`pkg-config --silence-errors --libs webkit2gtk-5.0`
if test -z "$GTK4" -o -z "$SRC4" -o -z "$WEB4"; then
AC_MSG_RESULT(not found.)
GTK4="false"
AC_MSG_CHECKING(Check if GTK3 and supporting GtkSourceView4 and Webkit4 libraries are installed)
GTK3=`pkg-config --silence-errors --libs gtk+-3.0`
SRC3=`pkg-config --silence-errors --libs gtksourceview-4`
WEB3=`pkg-config --silence-errors --libs webkit2gtk-4.0`
if test -z "$GTK3" -o -z "$SRC3" -o -z "$WEB3"; then
AC_MSG_RESULT(not found.)
GTK3="false"
AC_MSG_CHECKING(Check if GTK2 and supporting GtkSourceView3 and Webkit2 libraries are installed)
GTK2=`pkg-config --silence-errors --libs gtk+-2.0`
SRC2=`pkg-config --silence-errors --libs gtksourceview-3.0`
WEB2=`pkg-config --silence-errors --libs webkit2gtk-2.0`
if test -z "$GTK2" -o -z "$SRC2" -o -z "$WEB2"; then
AC_MSG_RESULT(not found.)
GTK2="false"
USEGTK="false"
else
AC_MSG_RESULT(found.)
GTK2="true"
USEGTK="true"
fi
else
AC_MSG_RESULT(found.)
GTK3="true"
USEGTK="true"
fi
else
AC_MSG_RESULT(found.)
GTK4="true"
USEGTK="true"
fi
fi
fi
# No GTK found? Then verify presence of FLTK library
if test "$GTK" = false -o "$FLTK" = true; then
if test "$USEGTK" = false -o "$FLTK" = true; then
AC_CHECK_PROG(FLTK_CONFIG, fltk-config, found, missing)
if test "$FLTK_CONFIG" = found; then
AC_MSG_CHECKING(FLTK major version)
FL_MAJOR_VERSION=`fltk-config --version | cut -d. -f1`
if test "$FL_MAJOR_VERSION" -lt 1; then
FLTK="false"
AC_MSG_RESULT(too low)
|
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
-
+
+
+
-
-
+
+
+
+
+
+
+
+
|
AC_SUBST(CFLAGS)
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(STRIP)
AC_SUBST(BSHELL)
AC_SUBST(LIBS)
AC_SUBST(GTK)
AC_SUBST(GTK4)
AC_SUBST(GTK3)
AC_SUBST(GTK2)
AC_SUBST(FLTK)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
# Print results
echo
echo "Congratulations, all requirements are met!"
echo
echo "- Makefile created."
echo "- Using '${BSHELL}' to compile BaCon."
if test "$GTK" = true; then
echo "- Creating BaConGUI for GTK."
if test "$GTK4" = true; then
echo "- Creating BaConGUI for GTK4."
fi
if test "$GTK3" = true; then
echo "- Creating BaConGUI for GTK3."
fi
if test "$GTK2" = true; then
echo "- Creating BaConGUI for GTK2."
fi
if test "$FLTK" = true; then
echo "- Creating BaConGUI for FLTK."
fi
echo
echo "Now run 'make' and 'make install' to build and install BaCon."
echo
|