Debian Codegraph @

m4/acinclude.m4

raw
1 dnl setup codeblocks for current target
2 dnl copied and adapted from Ogre3D (www.ogre3d.org)
3
4 AC_DEFUN([CODEBLOCKS_GET_PLATFORM],
5 [CODEBLOCKS_PLATFORM=gtk
6 AC_ARG_WITH(platform,
7 AC_HELP_STRING([--with-platform=PLATFORM],
8 [the platform to build, win32, macosx or gtk(default)]),
9 CODEBLOCKS_PLATFORM=$withval,
10 CODEBLOCKS_PLATFORM=gtk)
11
12
13 PLATFORM_CFLAGS=""
14 PLATFORM_LIBS=""
15
16 dnl Do the extra checks per type here
17 case $CODEBLOCKS_PLATFORM in
18 gtk)
19 PLATFORM_CFLAGS="-I/usr/X11R6/include"
20 PLATFORM_LIBS="-L/usr/X11R6/lib -lX11"
21 ;;
22 win32)
23 PLATFORM_CFLAGS=""
24 PLATFORM_LIBS="-lgdi32"
25 ;;
26 macosx)
27 PLATFORM_CFLAGS=""
28 PLATFORM_LIBS=""
29 ;;
30 esac
31
32 AC_SUBST(PLATFORM_CFLAGS)
33 AC_SUBST(PLATFORM_LIBS)
34 AC_SUBST(CODEBLOCKS_PLATFORM)
35 ])
36
37 AC_DEFUN([CODEBLOCKS_SETUP_FOR_TARGET],
38 [case $host in
39 *-*-cygwin* | *-*-mingw*)
40 AC_SUBST(SHARED_FLAGS, "-shared -no-undefined -Xlinker --export-all-symbols")
41 AC_SUBST(PLUGIN_FLAGS, "-shared -no-undefined -avoid-version")
42 AC_CHECK_TOOL(RC, windres)
43 nt=true
44 ;;
45 *-*-darwin*) dnl including macosx
46 AC_SUBST(SHARED_FLAGS, "-dynamic")
47 AC_SUBST(PLUGIN_FLAGS, "-bundle -avoid-version")
48 darwin=true
49 ;;
50 *) dnl default to standard linux
51 AC_SUBST(SHARED_FLAGS, "-shared")
52 AC_SUBST(PLUGIN_FLAGS, "-shared -avoid-version")
53 linux=true
54 ;;
55 esac
56 dnl you must arrange for every AM_conditional to run every time configure runs
57 AM_CONDITIONAL(CODEBLOCKS_NT, test x$nt = xtrue)
58 AM_CONDITIONAL(CODEBLOCKS_LINUX, test x$linux = xtrue)
59 AM_CONDITIONAL(CODEBLOCKS_DARWIN, test x$darwin = xtrue )
60 ])
61
62 dnl copied, renamed and fixed to work on older autoconf's from autoconf-archive AX_CHECK_LINK_FLAG
63 AC_DEFUN([CODEBLOCKS_CHECK_LINK_FLAG],
64 [
65 m4_version_prereq([2.64], dnl for _AC_LANG_PREFIX and AS_VAR_IF
66 [
67 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
68 AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
69 ax_check_save_flags=$LDFLAGS
70 LDFLAGS="$LDFLAGS $4 $1"
71 AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
72 [AS_VAR_SET(CACHEVAR,[yes])],
73 [AS_VAR_SET(CACHEVAR,[no])])
74 LDFLAGS=$ax_check_save_flags])
75 AS_VAR_IF(CACHEVAR,yes,
76 [m4_default([$2], :)],
77 [m4_default([$3], :)])
78 AS_VAR_POPDEF([CACHEVAR])dnl
79 ],
80 [
81 AC_MSG_NOTICE([autoconf-version < 2.64, not checking for linker-flags "$1"])
82 ])
83 ])dnl CODEBLOCKS_CHECK_LINK_FLAG
84
85
86 dnl check whether to enable debugging
87 AC_DEFUN([CODEBLOCKS_CHECK_DEBUG],
88 [
89 AC_MSG_CHECKING(whether to enable debugging)
90 debug_default="no"
91 AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug], [turn on debugging (default is OFF)])],,
92 enable_debug=$debug_default)
93 if test "x$enable_debug" = "xyes"; then
94 CFLAGS="-g $CFLAGS"
95 CXXFLAGS="-g $CXXFLAGS"
96 CPPFLAGS="-DDEBUG -DcbDEBUG $CPPFLAGS"
97 AC_MSG_RESULT(yes)
98 else
99 AS_IF([test "x$enable_flags_setting" = "xyes"],[
100 CFLAGS="-O2 -ffast-math $CFLAGS"
101 CXXFLAGS="-O2 -ffast-math $CXXFLAGS"
102 ], [
103 : ${CFLAGS=""}
104 : ${CXXFLAGS=""}
105 ])
106 AC_MSG_RESULT(no)
107 fi
108
109 CPPFLAGS="-DCB_AUTOCONF $CPPFLAGS"
110 ])
111
112 AC_DEFUN([CB_GCC_VERSION], [
113 GCC_FULL_VERSION=""
114 GCC_MAJOR_VERSION=""
115 GCC_MINOR_VERSION=""
116 GCC_PATCH_VERSION=""
117 if test "x$GCC" = "xyes" ; then
118 AC_CACHE_CHECK([gcc version],[cb_cv_gcc_version],[
119 cb_cv_gcc_version="`$CC -dumpversion`"
120 if test "x$cb_cv_gcc_version" = "x"; then
121 cb_cv_gcc_version=""
122 fi
123 ])
124 GCC_FULL_VERSION=$cb_cv_gcc_version
125 GCC_MAJOR_VERSION=$(echo $GCC_FULL_VERSION | cut -d'.' -f1)
126 GCC_MINOR_VERSION=$(echo $GCC_FULL_VERSION | cut -d'.' -f2)
127 GCC_PATCH_VERSION=$(echo $GCC_FULL_VERSION | cut -d'.' -f3)
128 fi
129 AC_SUBST([GCC_VERSION])
130 AC_SUBST([GCC_MAJOR_VERSION])
131 AC_SUBST([GCC_MINOR_VERSION])
132 AC_SUBST([GCC_PATCH_VERSION])
133 ])
134
135 dnl check what settings to enable
136 AC_DEFUN([CODEBLOCKS_ENABLE_SETTINGS],
137 [
138 AC_MSG_CHECKING(whether to build the source formatter plugin)
139 astyle_default="yes"
140 AC_ARG_ENABLE(source-formatter, [AC_HELP_STRING([--enable-source-formatter], [build the source formatter plugin (default YES)])],,
141 enable_astyle=$astyle_default)
142 AM_CONDITIONAL([BUILD_ASTYLE], [test "x$enable_astyle" = "xyes"])
143 if test "x$enable_astyle" = "xyes"; then
144 AC_MSG_RESULT(yes)
145 else
146 AC_MSG_RESULT(no)
147 fi
148
149 AC_MSG_CHECKING(whether to build the autosave plugin)
150 autosave_default="yes"
151 AC_ARG_ENABLE(autosave, [AC_HELP_STRING([--enable-autosave], [build the autosave plugin (default YES)])],,
152 enable_autosave=$autosave_default)
153 AM_CONDITIONAL([BUILD_AUTOSAVE], [test "x$enable_autosave" = "xyes"])
154 if test "x$enable_autosave" = "xyes"; then
155 AC_MSG_RESULT(yes)
156 else
157 AC_MSG_RESULT(no)
158 fi
159
160 AC_MSG_CHECKING(whether to build the class wizard plugin)
161 cw_default="yes"
162 AC_ARG_ENABLE(class-wizard, [AC_HELP_STRING([--enable-class-wizard], [build the class wizard plugin (default YES)])],,
163 enable_cw=$cw_default)
164 AM_CONDITIONAL([BUILD_CLASSWIZARD], [test "x$enable_cw" = "xyes"])
165 if test "x$enable_cw" = "xyes"; then
166 AC_MSG_RESULT(yes)
167 else
168 AC_MSG_RESULT(no)
169 fi
170
171 AC_MSG_CHECKING(whether to build the code completion plugin)
172 cc_default="yes"
173 AC_ARG_ENABLE(code-completion, [AC_HELP_STRING([--enable-code-completion], [build the code completion plugin (default YES)])],,
174 enable_cc=$cc_default)
175 AM_CONDITIONAL([BUILD_CODECOMPLETION], [test "x$enable_cc" = "xyes"])
176 if test "x$enable_cc" = "xyes"; then
177 AC_MSG_RESULT(yes)
178 else
179 AC_MSG_RESULT(no)
180 fi
181
182 AC_MSG_CHECKING(whether to build the compiler plugin)
183 gcc_default="yes"
184 AC_ARG_ENABLE(compiler, [AC_HELP_STRING([--enable-compiler], [build the compiler plugin (default YES)])],,
185 enable_gcc=$gcc_default)
186 AM_CONDITIONAL([BUILD_COMPILER], [test "x$enable_gcc" = "xyes"])
187 if test "x$enable_gcc" = "xyes"; then
188 AC_MSG_RESULT(yes)
189 else
190 AC_MSG_RESULT(no)
191 fi
192
193 AC_MSG_CHECKING(whether to build the debugger plugin)
194 dbg_default="yes"
195 AC_ARG_ENABLE(debugger, [AC_HELP_STRING([--enable-debugger], [build the debugger plugin (default YES)])],,
196 enable_dbg=$dbg_default)
197 AM_CONDITIONAL([BUILD_DEBUGGER], [test "x$enable_dbg" = "xyes"])
198 if test "x$enable_dbg" = "xyes"; then
199 AC_MSG_RESULT(yes)
200 else
201 AC_MSG_RESULT(no)
202 fi
203
204 AC_MSG_CHECKING(whether to build the default MIME handler plugin)
205 mime_default="yes"
206 AC_ARG_ENABLE(mime-handler, [AC_HELP_STRING([--enable-mime-handler], [build the default MIME handler plugin (default YES)])],,
207 enable_mime=$mime_default)
208 AM_CONDITIONAL([BUILD_MIMEHANDLER], [test "x$enable_mime" = "xyes"])
209 if test "x$enable_mime" = "xyes"; then
210 AC_MSG_RESULT(yes)
211 else
212 AC_MSG_RESULT(no)
213 fi
214
215 AC_MSG_CHECKING(whether to build the displayevents plugin)
216 dsplayevents_default="yes"
217 AC_ARG_ENABLE(displayevents, [AC_HELP_STRING([--enable-displayevents], [build the displayevents plugin (default YES)])],,
218 enable_displayevents=$displayevents_default)
219 AM_CONDITIONAL([BUILD_DISPLAYEVENTS], [test "x$enable_displayevents" = "xyes"])
220 if test "x$enable_displayevents" = "xyes"; then
221 AC_MSG_RESULT(yes)
222 else
223 AC_MSG_RESULT(no)
224 fi
225
226 AC_MSG_CHECKING(whether to build the open files list plugin)
227 openfiles_default="yes"
228 AC_ARG_ENABLE(open-files-list, [AC_HELP_STRING([--enable-open-files-list], [build the open files list plugin (default YES)])],,
229 enable_openfiles=$openfiles_default)
230 AM_CONDITIONAL([BUILD_OPENFILESLIST], [test "x$enable_openfiles" = "xyes"])
231 if test "x$enable_openfiles" = "xyes"; then
232 AC_MSG_RESULT(yes)
233 else
234 AC_MSG_RESULT(no)
235 fi
236
237 AC_MSG_CHECKING(whether to build the occurrences highlighting plugin)
238 occurrenceshighlighting_default="yes"
239 AC_ARG_ENABLE(occurrences-highlighting, [AC_HELP_STRING([--enable-occurrences-highlighting], [build the occurrences highlighting plugin (default YES)])],,
240 enable_occurrenceshighlighting=$occurrenceshighlighting_default)
241 AM_CONDITIONAL([BUILD_OCCURRENCESHIGHLIGHTING], [test "x$enable_occurrenceshighlighting" = "xyes"])
242 if test "x$enable_occurrenceshighlighting" = "xyes"; then
243 AC_MSG_RESULT(yes)
244 else
245 AC_MSG_RESULT(no)
246 fi
247
248 AC_MSG_CHECKING(whether to build the foreign projects importer plugin)
249 pimport_default="yes"
250 AC_ARG_ENABLE(projects-importer, [AC_HELP_STRING([--enable-projects-importer], [build the foreign projects importer plugin (default YES)])],,
251 enable_pimport=$pimport_default)
252 AM_CONDITIONAL([BUILD_PROJECTSIMPORTER], [test "x$enable_pimport" = "xyes"])
253 if test "x$enable_pimport" = "xyes"; then
254 AC_MSG_RESULT(yes)
255 else
256 AC_MSG_RESULT(no)
257 fi
258
259 AC_MSG_CHECKING(whether to build the scripted wizard plugin)
260 prw_default="yes"
261 AC_ARG_ENABLE(scripted-wizard, [AC_HELP_STRING([--enable-scripted-wizard], [build the scripted wizard plugin (default YES)])],,
262 enable_prw=$prw_default)
263 AM_CONDITIONAL([BUILD_SCRIPTEDWIZARD], [test "x$enable_prw" = "xyes"])
264 if test "x$enable_prw" = "xyes"; then
265 AC_MSG_RESULT(yes)
266 else
267 AC_MSG_RESULT(no)
268 fi
269
270 AC_MSG_CHECKING(whether to build the to-do plugin)
271 todo_default="yes"
272 AC_ARG_ENABLE(todo, [AC_HELP_STRING([--enable-todo], [build the to-do plugin (default YES)])],,
273 enable_todo=$todo_default)
274 AM_CONDITIONAL([BUILD_TODO], [test "x$enable_todo" = "xyes"])
275 if test "x$enable_todo" = "xyes"; then
276 AC_MSG_RESULT(yes)
277 else
278 AC_MSG_RESULT(no)
279 fi
280
281 AC_MSG_CHECKING(whether to build the abbreviations plugin)
282 abbreviations_default="yes"
283 AC_ARG_ENABLE(abbreviations, [AC_HELP_STRING([--enable-abbreviations], [build the abbreviations plugin (default YES)])],,
284 enable_abbreviations=$abbreviations_default)
285 AM_CONDITIONAL([BUILD_ABBREVIATIONS], [test "x$enable_abbreviations" = "xyes"])
286 if test "x$enable_abbreviations" = "xyes"; then
287 AC_MSG_RESULT(yes)
288 else
289 AC_MSG_RESULT(no)
290 fi
291
292 AC_MSG_CHECKING(whether to keep prebuild windows dll's in dist-tarball)
293 keep_dlls_default="yes"
294 AC_ARG_ENABLE(keep-dlls, [AC_HELP_STRING([--enable-keep-dlls], [keep prebuild windows dll's in dist-tarball (default YES)])],,
295 enable_keep_dlls=$keep_dlls_default)
296 AM_CONDITIONAL([KEEP_DLLS], [test "x$enable_keep_dlls" = "xyes"])
297 if test "x$enable_keep_dlls" = "xyes"; then
298 AC_MSG_RESULT(yes)
299 else
300 AC_MSG_RESULT(no)
301 fi
302
303 AC_MSG_CHECKING(whether to integrate fortran-plugin in dist-tarball)
304 enable_fortran_default="yes"
305 AC_ARG_ENABLE(fortran, [AC_HELP_STRING([--enable-fortran], [integrate (external) fortran plugin in dist-tarball (default YES), NOTE: it will not be build automatically])],,
306 enable_fortran=$enable_fortran_default)
307 AM_CONDITIONAL([ENABLE_FORTRAN], [test "x$enable_fortran" = "xyes"])
308 if test "x$enable_fortran" = "xyes"; then
309 AC_MSG_RESULT(yes)
310 else
311 AC_MSG_RESULT(no)
312 fi
313
314 AC_MSG_CHECKING(whether to use gtk-notebook as default notebook)
315 gtk_notebook_default="yes"
316 AC_ARG_ENABLE(gtk-notebook, [AC_HELP_STRING([--enable-gtk-notebook], [use gtk-notebook as default notebook (default YES)])],,
317 enable_gtk_notebook=$gtk_notebook_default)
318 AM_CONDITIONAL([GTK_NOTEBOOK], [test "x$enable_gtk_notebook" = "xyes"])
319 if test "x$enable_gtk_notebook" = "xyes"; then
320 AC_MSG_RESULT(yes)
321 else
322 AC_MSG_RESULT(no)
323 fi
324
325 AC_MSG_CHECKING(whether to CodeBlocks installer documentation directory found)
326 if test -f "windows_installer/Documentation/manual_codeblocks_en.chm" ; then
327 AM_CONDITIONAL([CODEBLOCKS_INSTALLERDOCS_FOUND], true)
328 AC_MSG_RESULT(yes)
329 else
330 AM_CONDITIONAL([CODEBLOCKS_INSTALLERDOCS_FOUND], false)
331 AC_MSG_RESULT(no)
332 fi
333
334 case $host in
335 *-*-cygwin* | *-*-mingw*)
336 AC_MSG_CHECKING(whether to build the xp-manifest plugin)
337 xpmanifest_default="yes"
338 AC_ARG_ENABLE(xpmanifest, [AC_HELP_STRING([--enable-xpmanifest], [build the xp-manifest plugin (default YES)])],,
339 enable_xpmanifest=$xpmanifest_default)
340 AM_CONDITIONAL([BUILD_MANIFEST], [test "x$enable_xpmanifest" = "xyes"])
341 if test "x$enable_xpmanifest" = "xyes"; then
342 AC_MSG_RESULT(yes)
343 else
344 AC_MSG_RESULT(no)
345 fi
346 ;;
347 *)
348 AM_CONDITIONAL([BUILD_MANIFEST], [false])
349 ;;
350 esac
351
352 AC_DEFUN([BUILD_CONTRIB_NONE], [
353 AM_CONDITIONAL([BUILD_AUTOVERSIONING], [false])
354 AM_CONDITIONAL([BUILD_BROWSETRACKER], [false])
355 AM_CONDITIONAL([BUILD_BYOGAMES], [false])
356 AM_CONDITIONAL([BUILD_CBKODERS], [false])
357 AM_CONDITIONAL([BUILD_CODESNIPPETS], [false])
358 AM_CONDITIONAL([BUILD_CODESTAT], [false])
359 AM_CONDITIONAL([BUILD_COPYSTRINGS], [false])
360 AM_CONDITIONAL([BUILD_CSCOPE], [false])
361 AM_CONDITIONAL([BUILD_DOXYBLOCKS], [false])
362 AM_CONDITIONAL([BUILD_DRAGSCROLL], [false])
363 AM_CONDITIONAL([BUILD_EDITORCONFIG], [false])
364 AM_CONDITIONAL([BUILD_EDITORTWEAKS], [false])
365 AM_CONDITIONAL([BUILD_ENVVARS], [false])
366 AM_CONDITIONAL([BUILD_FILEMANAGER], [false])
367 AM_CONDITIONAL([BUILD_HEADERFIXUP], [false])
368 AM_CONDITIONAL([BUILD_HELP], [false])
369 AM_CONDITIONAL([BUILD_KEYBINDER], [false])
370 AM_CONDITIONAL([BUILD_LIBFINDER], [false])
371 AM_CONDITIONAL([BUILD_NASSISHNEIDERMAN], [false])
372 AM_CONDITIONAL([BUILD_PROFILER], [false])
373 AM_CONDITIONAL([BUILD_PROJECTOPTIONSMANIPULATOR], [false])
374 AM_CONDITIONAL([BUILD_REGEX], [false])
375 AM_CONDITIONAL([BUILD_REOPENEDITOR], [false])
376 AM_CONDITIONAL([BUILD_RNDGEN], [false])
377 AM_CONDITIONAL([BUILD_CLANGD_CLIENT], [false])
378 AM_CONDITIONAL([BUILD_EXPORTER], [false])
379 AM_CONDITIONAL([BUILD_SMARTINDENT], [false])
380 AM_CONDITIONAL([BUILD_SPELLCHECKER], [false])
381 AM_CONDITIONAL([BUILD_SYMTAB], [false])
382 AM_CONDITIONAL([BUILD_THREADSEARCH], [false])
383 AM_CONDITIONAL([BUILD_TOOLSPLUS], [false])
384 AM_CONDITIONAL([BUILD_VALGRIND], [false])
385 AM_CONDITIONAL([BUILD_WXCONTRIB], [false])
386 AM_CONDITIONAL([BUILD_WXSMITH], [false])
387 AM_CONDITIONAL([BUILD_WXSMITHCONTRIB], [false])
388 AM_CONDITIONAL([BUILD_WXSMITHAUI], [false])
389 AM_CONDITIONAL([BUILD_HEXEDITOR], [false])
390 AM_CONDITIONAL([BUILD_INCSEARCH], [false])
391 AM_CONDITIONAL([BUILD_MOUSESAP], [false])
392 AM_CONDITIONAL([BUILD_CCCC], [false])
393 AM_CONDITIONAL([BUILD_CPPCHECK], [false])
394 ])
395
396 AC_DEFUN([BUILD_CONTRIB_ALL], [
397 AM_CONDITIONAL([BUILD_AUTOVERSIONING], [true])
398 AM_CONDITIONAL([BUILD_BROWSETRACKER], [true])
399 AM_CONDITIONAL([BUILD_BYOGAMES], [true])
400 AM_CONDITIONAL([BUILD_CBKODERS], [true])
401 AM_CONDITIONAL([BUILD_CODESNIPPETS], [true])
402 AM_CONDITIONAL([BUILD_CODESTAT], [true])
403 AM_CONDITIONAL([BUILD_COPYSTRINGS], [true])
404 AM_CONDITIONAL([BUILD_CSCOPE], [true])
405 AM_CONDITIONAL([BUILD_DOXYBLOCKS], [true])
406 AM_CONDITIONAL([BUILD_DRAGSCROLL], [true])
407 AM_CONDITIONAL([BUILD_EDITORCONFIG], [true])
408 AM_CONDITIONAL([BUILD_EDITORTWEAKS], [true])
409 AM_CONDITIONAL([BUILD_ENVVARS], [true])
410 AM_CONDITIONAL([BUILD_FILEMANAGER], [true])
411 AM_CONDITIONAL([BUILD_HEADERFIXUP], [true])
412 AM_CONDITIONAL([BUILD_HELP], [true])
413 AM_CONDITIONAL([BUILD_KEYBINDER], [true])
414 AM_CONDITIONAL([BUILD_LIBFINDER], [true])
415 AM_CONDITIONAL([BUILD_NASSISHNEIDERMAN], [true])
416 AM_CONDITIONAL([BUILD_PROJECTOPTIONSMANIPULATOR], [true])
417 AM_CONDITIONAL([BUILD_PROFILER], [true])
418 AM_CONDITIONAL([BUILD_REGEX], [true])
419 AM_CONDITIONAL([BUILD_REOPENEDITOR], [true])
420 AM_CONDITIONAL([BUILD_RNDGEN], [true])
421 AM_CONDITIONAL([BUILD_CLANGD_CLIENT], [true])
422 AM_CONDITIONAL([BUILD_EXPORTER], [true])
423 AM_CONDITIONAL([BUILD_SMARTINDENT], [true])
424 AM_CONDITIONAL([BUILD_SPELLCHECKER], [true])
425 AM_CONDITIONAL([BUILD_SYMTAB], [true])
426 AM_CONDITIONAL([BUILD_THREADSEARCH], [true])
427 AM_CONDITIONAL([BUILD_TOOLSPLUS], [true])
428 AM_CONDITIONAL([BUILD_VALGRIND], [true])
429 AM_CONDITIONAL([BUILD_WXCONTRIB], [true])
430 AM_CONDITIONAL([BUILD_WXSMITH], [true])
431 AM_CONDITIONAL([BUILD_WXSMITHCONTRIB], [true])
432 AM_CONDITIONAL([BUILD_WXSMITHAUI], [true])
433 AM_CONDITIONAL([BUILD_HEXEDITOR], [true])
434 AM_CONDITIONAL([BUILD_INCSEARCH], [true])
435 AM_CONDITIONAL([BUILD_MOUSESAP], [true])
436 AM_CONDITIONAL([BUILD_CCCC], [true])
437 AM_CONDITIONAL([BUILD_CPPCHECK], [true])
438 ])
439
440 # default to 'none'
441 BUILD_CONTRIB_NONE
442
443 AC_MSG_CHECKING(which (if any) contrib plugins to build)
444 AC_ARG_WITH(contrib-plugins,
445 [ --with-contrib-plugins=<list> compile contrib plugins in <list>. ]
446 [ plugins may be separated with commas. ]
447 [ "all", "yes" or just "--with-contrib-plugins" compiles all contrib plugins ]
448 [ "all,-help" or "yes,-help" compiles all contrib plugins except the help plugin ]
449 [ "none", "no", "--without-contrib-plugins" or skipping the parameter at all, ]
450 [ compiles none of the contrib-plugins ]
451 [ Plugin names are: AutoVersioning, BrowseTracker, byogames, Cccc, CppCheck, cbkoders, codesnippets, ]
452 [ codestat, copystrings, Cscope, DoxyBlocks, dragscroll, EditorConfig, EditorTweaks, envvars, exporter, ]
453 [ FileManager, headerfixup, help, hexeditor, incsearch, keybinder, libfinder, MouseSap, ]
454 [ NassiShneiderman, ProjectOptionsManipulator, profiler, regex, ReopenEditor, rndgen, clangd_client, smartindent, spellchecker, ]
455 [ symtab, ThreadSearch, ToolsPlus, Valgrind, wxcontrib, wxsmith, wxsmithcontrib, wxsmithaui ],
456 plugins="$withval", plugins="none")
457
458 plugins=`echo $plugins | sed 's/,/ /g'`
459 for plugin in $plugins
460 do
461 case "$plugin" in
462 all|yes)
463 BUILD_CONTRIB_ALL
464 ;;
465 AutoVersioning)
466 AM_CONDITIONAL([BUILD_AUTOVERSIONING], [true])
467 ;;
468 BrowseTracker)
469 AM_CONDITIONAL([BUILD_BROWSETRACKER], [true])
470 ;;
471 byogames)
472 AM_CONDITIONAL([BUILD_BYOGAMES], [true])
473 ;;
474 cbkoders)
475 AM_CONDITIONAL([BUILD_CBKODERS], [true])
476 ;;
477 codesnippets)
478 AM_CONDITIONAL([BUILD_CODESNIPPETS], [true])
479 ;;
480 codestat)
481 AM_CONDITIONAL([BUILD_CODESTAT], [true])
482 ;;
483 copystrings)
484 AM_CONDITIONAL([BUILD_COPYSTRINGS], [true])
485 ;;
486 Cscope)
487 AM_CONDITIONAL([BUILD_CSCOPE], [true])
488 ;;
489 DoxyBlocks)
490 AM_CONDITIONAL([BUILD_DOXYBLOCKS], [true])
491 ;;
492 dragscroll)
493 AM_CONDITIONAL([BUILD_DRAGSCROLL], [true])
494 ;;
495 EditorConfig)
496 AM_CONDITIONAL([BUILD_EDITORCONFIG], [true])
497 ;;
498 EditorTweaks)
499 AM_CONDITIONAL([BUILD_EDITORTWEAKS], [true])
500 ;;
501 envvars)
502 AM_CONDITIONAL([BUILD_ENVVARS], [true])
503 ;;
504 FileManager)
505 AM_CONDITIONAL([BUILD_FILEMANAGER], [true])
506 ;;
507 headerfixup)
508 AM_CONDITIONAL([BUILD_HEADERFIXUP], [true])
509 ;;
510 help)
511 AM_CONDITIONAL([BUILD_HELP], [true])
512 ;;
513 keybinder)
514 AM_CONDITIONAL([BUILD_KEYBINDER], [true])
515 ;;
516 libfinder)
517 AM_CONDITIONAL([BUILD_LIBFINDER], [true])
518 ;;
519 NassiShneiderman)
520 AM_CONDITIONAL([BUILD_NASSISHNEIDERMAN], [true])
521 ;;
522 ProjectOptionsManipulator)
523 AM_CONDITIONAL([BUILD_PROJECTOPTIONSMANIPULATOR], [true])
524 ;;
525 profiler)
526 AM_CONDITIONAL([BUILD_PROFILER], [true])
527 ;;
528 regex)
529 AM_CONDITIONAL([BUILD_REGEX], [true])
530 ;;
531 ReopenEditor)
532 AM_CONDITIONAL([BUILD_REOPENEDITOR], [true])
533 ;;
534 rndgen)
535 AM_CONDITIONAL([BUILD_RNDGEN], [true])
536 ;;
537 clangd_client)
538 AM_CONDITIONAL([BUILD_CLANGD_CLIENT], [true])
539 ;;
540 exporter)
541 AM_CONDITIONAL([BUILD_EXPORTER], [true])
542 ;;
543 smartindent)
544 AM_CONDITIONAL([BUILD_SMARTINDENT], [true])
545 ;;
546 spellchecker)
547 AM_CONDITIONAL([BUILD_SPELLCHECKER], [true])
548 ;;
549 symtab)
550 AM_CONDITIONAL([BUILD_SYMTAB], [true])
551 ;;
552 ThreadSearch)
553 AM_CONDITIONAL([BUILD_THREADSEARCH], [true])
554 ;;
555 ToolsPlus)
556 AM_CONDITIONAL([BUILD_TOOLSPLUS], [true])
557 ;;
558 Valgrind)
559 AM_CONDITIONAL([BUILD_VALGRIND], [true])
560 ;;
561 wxcontrib)
562 AM_CONDITIONAL([BUILD_WXCONTRIB], [true])
563 ;;
564 wxsmith)
565 AM_CONDITIONAL([BUILD_WXSMITH], [true])
566 ;;
567 wxsmithcontrib)
568 AM_CONDITIONAL([BUILD_WXSMITHCONTRIB], [true])
569 ;;
570 wxsmithaui)
571 AM_CONDITIONAL([BUILD_WXSMITHAUI], [true])
572 ;;
573 hexeditor)
574 AM_CONDITIONAL([BUILD_HEXEDITOR], [true])
575 ;;
576 incsearch)
577 AM_CONDITIONAL([BUILD_INCSEARCH], [true])
578 ;;
579 MouseSap)
580 AM_CONDITIONAL([BUILD_MOUSESAP], [true])
581 ;;
582 Cccc)
583 AM_CONDITIONAL([BUILD_CCCC], [true])
584 ;;
585 CppCheck)
586 AM_CONDITIONAL([BUILD_CPPCHECK], [true])
587 ;;
588 -AutoVersioning)
589 AM_CONDITIONAL([BUILD_AUTOVERSIONING], [false])
590 ;;
591 -BrowseTracker)
592 AM_CONDITIONAL([BUILD_BROWSETRACKER], [false])
593 ;;
594 -byogames)
595 AM_CONDITIONAL([BUILD_BYOGAMES], [false])
596 ;;
597 -cbkoders)
598 AM_CONDITIONAL([BUILD_CBKODERS], [false])
599 ;;
600 -codesnippets)
601 AM_CONDITIONAL([BUILD_CODESNIPPETS], [false])
602 ;;
603 -codestat)
604 AM_CONDITIONAL([BUILD_CODESTAT], [false])
605 ;;
606 -copystrings)
607 AM_CONDITIONAL([BUILD_COPYSTRINGS], [false])
608 ;;
609 -Cscope)
610 AM_CONDITIONAL([BUILD_CSCOPE], [false])
611 ;;
612 -DoxyBlocks)
613 AM_CONDITIONAL([BUILD_DOXYBLOCKS], [false])
614 ;;
615 -dragscroll)
616 AM_CONDITIONAL([BUILD_DRAGSCROLL], [false])
617 ;;
618 -EditorConfig)
619 AM_CONDITIONAL([BUILD_EDITORCONFIG], [false])
620 ;;
621 -EditorTweaks)
622 AM_CONDITIONAL([BUILD_EDITORTWEAKS], [false])
623 ;;
624 -envvars)
625 AM_CONDITIONAL([BUILD_ENVVARS], [false])
626 ;;
627 -FileManager)
628 AM_CONDITIONAL([BUILD_FILEMANAGER], [false])
629 ;;
630 -headerfixup)
631 AM_CONDITIONAL([BUILD_HEADERFIXUP], [false])
632 ;;
633 -help)
634 AM_CONDITIONAL([BUILD_HELP], [false])
635 ;;
636 -keybinder)
637 AM_CONDITIONAL([BUILD_KEYBINDER], [false])
638 ;;
639 -libfinder)
640 AM_CONDITIONAL([BUILD_LIBFINDER], [false])
641 ;;
642 -NassiShneiderman)
643 AM_CONDITIONAL([BUILD_NASSISHNEIDERMAN], [false])
644 ;;
645 -profiler)
646 AM_CONDITIONAL([BUILD_PROFILER], [false])
647 ;;
648 -regex)
649 AM_CONDITIONAL([BUILD_REGEX], [false])
650 ;;
651 -ReopenEditor)
652 AM_CONDITIONAL([BUILD_REOPENEDITOR], [false])
653 ;;
654 -rndgen)
655 AM_CONDITIONAL([BUILD_RNDGEN], [false])
656 ;;
657 -clangd_client)
658 AM_CONDITIONAL([BUILD_CLANGD_CLIENT], [false])
659 ;;
660 -exporter)
661 AM_CONDITIONAL([BUILD_EXPORTER], [false])
662 ;;
663 -smartindent)
664 AM_CONDITIONAL([BUILD_SMARTINDENT], [false])
665 ;;
666 -spellchecker)
667 AM_CONDITIONAL([BUILD_SPELLCHECKER], [false])
668 ;;
669 -symtab)
670 AM_CONDITIONAL([BUILD_SYMTAB], [false])
671 ;;
672 -ThreadSearch)
673 AM_CONDITIONAL([BUILD_THREADSEARCH], [false])
674 ;;
675 -ToolsPlus)
676 AM_CONDITIONAL([BUILD_TOOLSPLUS], [false])
677 ;;
678 -Valgrind)
679 AM_CONDITIONAL([BUILD_VALGRIND], [false])
680 ;;
681 -wxcontrib)
682 AM_CONDITIONAL([BUILD_WXCONTRIB], [false])
683 ;;
684 -wxsmith)
685 AM_CONDITIONAL([BUILD_WXSMITH], [false])
686 ;;
687 -wxsmithcontrib)
688 AM_CONDITIONAL([BUILD_WXSMITHCONTRIB], [false])
689 ;;
690 -wxsmithaui)
691 AM_CONDITIONAL([BUILD_WXSMITHAUI], [false])
692 ;;
693 -hexeditor)
694 AM_CONDITIONAL([BUILD_HEXEDITOR], [false])
695 ;;
696 -incsearch)
697 AM_CONDITIONAL([BUILD_INCSEARCH], [false])
698 ;;
699 -MouseSap)
700 AM_CONDITIONAL([BUILD_MOUSESAP], [false])
701 ;;
702 -Cccc)
703 AM_CONDITIONAL([BUILD_CCCC], [false])
704 ;;
705 -CppCheck)
706 AM_CONDITIONAL([BUILD_CPPCHECK], [false])
707 ;;
708 none|no)
709 ;;
710 *)
711 echo
712 echo "Error: Unknown contrib plugin $plugin." >&2
713 echo " Note: the names are case-sensitive!" >&2
714 echo " Try $[0] --help for exact spelling." >&2
715 exit 1
716 ;;
717 esac
718 done
719 AC_MSG_RESULT($plugins)
720
721
722 AC_SUBST(BUILD_AUTOVERSIONING)
723 AC_SUBST(BUILD_BROWSETRACKER)
724 AC_SUBST(BUILD_BYOGAMES)
725 AC_SUBST(BUILD_CBKODERS)
726 AC_SUBST(BUILD_CCCC)
727 AC_SUBST(BUILD_CODESNIPPETS)
728 AC_SUBST(BUILD_CODESTAT)
729 AC_SUBST(BUILD_COPYSTRINGS)
730 AC_SUBST(BUILD_CPPCHECK)
731 AC_SUBST(BUILD_CSCOPE)
732 AC_SUBST(BUILD_DOXYBLOCKS)
733 AC_SUBST(BUILD_DRAGSCROLL)
734 AC_SUBST(BUILD_EDITORCONFIG)
735 AC_SUBST(BUILD_EDITORTWEAKS)
736 AC_SUBST(BUILD_ENVVARS)
737 AC_SUBST(BUILD_FILEMANAGER)
738 AC_SUBST(BUILD_HEADERFIXUP)
739 AC_SUBST(BUILD_HELP)
740 AC_SUBST(BUILD_HEXEDITOR)
741 AC_SUBST(BUILD_INCSEARCH)
742 AC_SUBST(BUILD_KEYBINDER)
743 AC_SUBST(BUILD_LIBFINDER)
744 AC_SUBST(BUILD_MOUSESAP)
745 AC_SUBST(BUILD_NASSISHNEIDERMAN)
746 AC_SUBST(BUILD_PROFILER)
747 AC_SUBST(BUILD_REGEX)
748 AC_SUBST(BUILD_REOPENEDITOR)
749 AC_SUBST(BUILD_RNDGEN)
750 AC_SUBST(BUILD_CLANGD_CLIENT)
751 AC_SUBST(BUILD_EXPORTER)
752 AC_SUBST(BUILD_SYMTAB)
753 AC_SUBST(BUILD_SMARTINDENT)
754 AC_SUBST(BUILD_SPELLCHECKER)
755 AC_SUBST(BUILD_THREADSEARCH)
756 AC_SUBST(BUILD_TOOLSPLUS)
757 AC_SUBST(BUILD_VALGRIND)
758 AC_SUBST(BUILD_WXCONTRIB)
759 AC_SUBST(BUILD_WXSMITH)
760 AC_SUBST(BUILD_WXSMITHCONTRIB)
761 AC_SUBST(BUILD_WXSMITHAUI)
762
763 GCC_PCH=0
764 PCH_FLAGS=
765 pch_default="yes"
766 AM_CONDITIONAL([PRECOMPILE_HEADERS], [false])
767 AC_ARG_ENABLE(pch, [AC_HELP_STRING([--enable-pch], [use precompiled headers if available (default YES)])],,
768 enable_pch=$pch_default)
769 if test "x$enable_pch" = "x" -o "x$enable_pch" = "xyes" ; then
770 if test "x$GCC" = "xyes"; then
771 dnl test if we have gcc-3.4:
772 AC_MSG_CHECKING([if the compiler supports precompiled headers])
773 AC_TRY_COMPILE([],
774 [
775 #if !defined(__GNUC__) || !defined(__GNUC_MINOR__)
776 #error "no pch support"
777 #endif
778 #if (__GNUC__ < 3)
779 #error "no pch support"
780 #endif
781 #if (__GNUC__ == 3) && \
782 ((!defined(__APPLE_CC__) && (__GNUC_MINOR__ < 4)) || \
783 ( defined(__APPLE_CC__) && (__GNUC_MINOR__ < 3)))
784 #error "no pch support"
785 #endif
786 ],
787 [
788 AC_MSG_RESULT([yes])
789 GCC_PCH=1
790 PCH_FLAGS="-DCB_PRECOMP"
791 CPPFLAGS="${CPPFLAGS} ${PCH_FLAGS}"
792 CXXFLAGS="${CXXFLAGS} -Winvalid-pch"
793 ],
794 [
795 AC_MSG_RESULT([no])
796 ])
797 AM_CONDITIONAL([PRECOMPILE_HEADERS], [test $GCC_PCH = 1])
798 fi
799 fi
800
801 ])
802
803 # _AM_PROG_TAR(FORMAT)
804 # --------------------
805 # Check how to create a tarball in format FORMAT.
806 # FORMAT should be one of `v7', `ustar', or `pax'.
807 #
808 # Substitute a variable $(am__tar) that is a command
809 # writing to stdout a FORMAT-tarball containing the directory
810 # $tardir.
811 # tardir=directory && $(am__tar) > result.tar
812 #
813 # Substitute a variable $(am__untar) that extract such
814 # a tarball read from stdin.
815 # $(am__untar) < result.tar
816 AC_DEFUN([_AM_PROG_TAR],
817 [# Always define AMTAR for backward compatibility.
818 AM_MISSING_PROG([AMTAR], [tar])
819 m4_if([$1], [v7],
820 [am__tar='${AMTAR} chf - "$$tardir"'; am__untar='${AMTAR} xf -'],
821 [m4_case([$1], [ustar],, [pax],,
822 [m4_fatal([Unknown tar format])])
823 AC_MSG_CHECKING([how to create a $1 tar archive])
824 # Loop over all known methods to create a tar archive until one works.
825 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
826 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
827 # Do not fold the above two line into one, because Tru64 sh and
828 # Solaris sh will not grok spaces in the rhs of `-'.
829 for _am_tool in $_am_tools
830 do
831 case $_am_tool in
832 gnutar)
833 for _am_tar in tar gnutar gtar;
834 do
835 AM_RUN_LOG([$_am_tar --version]) && break
836 done
837 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
838 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
839 am__untar="$_am_tar -xf -"
840 ;;
841 plaintar)
842 # Must skip GNU tar: if it does not support --format= it doesn't create
843 # ustar tarball either.
844 (tar --version) >/dev/null 2>&1 && continue
845 am__tar='tar chf - "$$tardir"'
846 am__tar_='tar chf - "$tardir"'
847 am__untar='tar xf -'
848 ;;
849 pax)
850 am__tar='pax -L -x $1 -w "$$tardir"'
851 am__tar_='pax -L -x $1 -w "$tardir"'
852 am__untar='pax -r'
853 ;;
854 cpio)
855 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
856 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
857 am__untar='cpio -i -H $1 -d'
858 ;;
859 none)
860 am__tar=false
861 am__tar_=false
862 am__untar=false
863 ;;
864 esac
865
866 # If the value was cached, stop now. We just wanted to have am__tar
867 # and am__untar set.
868 test -n "${am_cv_prog_tar_$1}" && break
869
870 # tar/untar a dummy directory, and stop if the command works
871 rm -rf conftest.dir
872 mkdir conftest.dir
873 echo GrepMe > conftest.dir/file
874 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
875 rm -rf conftest.dir
876 if test -s conftest.tar; then
877 AM_RUN_LOG([$am__untar <conftest.tar])
878 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
879 fi
880 done
881 rm -rf conftest.dir
882
883 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
884 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
885 AC_SUBST([am__tar])
886 AC_SUBST([am__untar])
887 ]) # _AM_PROG_TAR