site: end of line message, adesklets is not dead.
[adesklets.git] / configure.ac
blob5b3f9eddee593cc8a93d70780e2ef792ee6b6115
1 nl Initialize autoconf and automake
2 AC_INIT
3 AC_CONFIG_SRCDIR(src/main.c)
4 AC_PREREQ(2.52)
5 AM_INIT_AUTOMAKE(adesklets,0.6.2)
6 AM_MAINTAINER_MODE
8 dnl Language selection
9 AC_LANG(C)
11 dnl Locate required external software
12 AC_PROG_CPP
13 if test "x$CPP" != 'x'; then
15 AC_SUBST(CPP)
17 AC_PROG_CC
18 AM_PROG_LEX
19 if test "x$LEX" != 'xflex'; then
20 AC_MSG_WARN([
21 -----------------------------------------------------
22 `flex' was not found on your system. If you encounter
23 problems recompiling a `l' file, please try `flex' 
24 first. You can get it from any GNU archive site. 
25 You will not need `flex' as long as you do not 
26 modify `l' files.
27 ----------------------------------------------------])
29 AC_PROG_YACC
30 if test "x$YACC" != "xbison -y"; then
31 AC_MSG_WARN([
32 -----------------------------------------------------
33 Nor `byacc' or `yacc' parsers had been used
34 for developing adesklets. If you encounter problems
35 recompiling a `y' file, please try `bison' instead. 
36 You can get it from any GNU archive site. You will 
37 not need `bison' as long as you do not modify 
38 `y' files.
39 -----------------------------------------------------])
41 AC_PROG_INSTALL
43 dnl Check for python support
44 withval=
45 AC_ARG_WITH(python-support,
46 [  --without-python-support   
47                           do not install adesklets python package
48                           Do not set this option unless you have
49                           good reasons])
50 : ${withval:=yes}
51 if test x$withval = "xyes"; then
52 withval=
53 AC_ARG_WITH(python-force-detection,
54 [  --with-python-force-detection
55                           bypass all the python version check mechanism. 
56                           When using this, make sure you have a version
57                           greater or egal to python 2.3 installed 
58                           as 'python' in your path [default=no]])
59 : ${withval:=no}
60 if test x$withval = "xno"; then
61 AM_PATH_PYTHON([2.3])
62 else
63 AM_PATH_PYTHON()
65 AC_PYTHON_DEVEL
66 withval=
67 AC_ARG_WITH(python-install-submission-scripts,
68 [  --with-python-install-submission-scripts
69                           install in the path the submission-related scripts
70                           from submit/ in the $PREFIX/bin program path.
71                           Useful for desklets author [default=no]])
72 : ${withval:=no}
73 if test x$withval = "xyes"; then
74 AM_CONDITIONAL(PYTHON_INSTALL_SUBMISSION_SCRIPTS, true)
75 else
76 AM_CONDITIONAL(PYTHON_INSTALL_SUBMISSION_SCRIPTS, false)
78 AC_CHECK_FUNCS(sigprocmask,
79 [HAVE_SIGPROCMASK="#define HAVE_SIGPROCMASK 1", SIGPROC=yes],
80 [HAVE_SIGPROCMASK="#undef HAVE_SIGPROCMASK"])
81 else
82 HAVE_SIGPROCMASK="#undef HAVE_SIGPROCMASK"
84 AC_SUBST(HAVE_SIGPROCMASK)
85 AM_CONDITIONAL(PYTHON_SUPPORT, test "x$PYTHON" != "x")
86 AM_CONDITIONAL(PYTHON_INSTALL_SUBMISSION_SCRIPTS, true)
88 dnl Check for Perl support
89 withval=
90 AC_ARG_WITH(perl-support,
91 [  --without-perl-support  do not install adesklets Perl package
92                           Do not set this option unless you have
93                           good reasons])
94 : ${withval:=yes}
95 perl_ok=false
96 if test x$withval = "xyes"; then
97 AC_PATH_PROG(PERL, perl)
98 AC_PROG_PERL_VERSION(5.8.2,
99         AC_PROG_PERL_MODULES(IPC::Open3, perl_ok=true),
100         AC_MSG_WARN(['Perl >= 5.8.2 could not be found']))
102 AM_CONDITIONAL(PERL_SUPPORT,$perl_ok)
104 dnl help2man presence
105 AC_PATH_PROG(HELP2MAN, help2man)
106 AM_CONDITIONAL(HELP2MAN_SUPPORT, test "x$HELP2MAN" != "x")
108 dnl htmltidy presence
109 AC_PATH_PROG(TIDY,tidy)
111 dnl doxygen presence
112 AC_PATH_PROG(DOXYGEN,doxygen)
113 AM_CONDITIONAL(DOXYGEN_SUPPORT, test "x$DOXYGEN" != "x")
115 dnl makeinfo support:
116 dnl Also test the presence of the full documentation package
117 AM_CONDITIONAL(MAKEINFO_SUPPORT, 
118 test "x$MAKEINFO:" != "x" && test -f doc/Makefile.am)
120 dnl Try to enforce ISO C (iso9899 1999)
121 dnl This will more likely work
122 dnl only with gcc. In fact,
123 dnl expect for variadic macros, this program
124 dnl should be ansi C (ISO C90).
125 TMP_CFLAGS="$CFLAGS"
126 CFLAGS="$CFLAGS -std=c99 -pedantic -Wall"
127 AC_MSG_CHECKING([for ISO C99 warnings generation])
128 AC_TRY_COMPILE(
130 int 
131 main(void) 
133    return 0L;
135 AC_MSG_RESULT([yes]),
136 AC_MSG_RESULT([no])
137 CFLAGS="$TMP_CFLAGS"
140 dnl Define source to be BSD compliant (ISO C, POSIX, and 4.3BSD)
141 AC_DEFINE(_BSD_SOURCE,1,[Source is BSD compliant (ISO C, POSIX and 4.3BSD)])
142 if test "x`uname`" = xNetBSD; then
143 dnl NetBSD (at least version 1.6.1) is following the standard less closely than 
144 dnl the other... Hence, we declare the source specifically as _POSIX_SOURCE 
145 dnl instead of the newer _POSIX_C_SOURCE 199309
146 AC_DEFINE(_POSIX_SOURCE,1,[Source is POSIX 1 compliant (IEEE Std 1003.1)])
147 else
148 dnl For some unspecified reason, it as been reported than FreeBSD [5|6|7].x 
149 dnl doesn't like those POSIX keywords either
150 UNAME_REDUX=`uname -r -s | sed 's/\..*//' 2> /dev/null`
151 if test "$UNAME_REDUX" != 'FreeBSD 5' && \
152    test "$UNAME_REDUX" != 'FreeBSD 6' && \
153    test "$UNAME_REDUX" != 'FreeBSD 7'
154 then
155 AC_DEFINE(_POSIX_C_SOURCE,199309,[Source is POSIX 4 compliant (IEEE Std 1003.1b)])
159 dnl Check for system header files
160 AC_HEADER_STDC
161 AC_CHECK_HEADERS(stdio.h stdarg.h errno.h fcntl.h signal.h time.h math.h sys/time.h sys/types.h sys/stat.h grp.h pwd.h libgen.h dirent.h iconv.h)
163 dnl Enable debugging
164 dnl This will filter out optimisation switch (-O[s0-9]) 
165 dnl for gcc compiler
166 AC_ARG_ENABLE(
167   debug, [  --enable-debug        enable debugging symbols and supplementary 
168                           messages generation in final binary])
170 : ${enableval="no"}
171 AC_MSG_CHECKING([for debugging symbols generation])
172 if test x$enableval = "xyes"; then
173    AC_MSG_RESULT([yes])
174    AC_DEFINE(DEBUG, 1, [Debug mode is on if defined.])
175    CFLAGS="$CFLAGS -g"
176    DEBUG=yes
177 else
178    AC_MSG_RESULT([no])
179    CFLAGS=`echo "$CFLAGS" | sed 's/^-g$//; s/^-g@<:@@<:@:space:@:>@@:>@\+// ; s/@<:@@<:@:space:@:>@@:>@\+-g$//; s/@<:@@<:@:space:@:>@@:>@\+-g@<:@@<:@:space:@:>@@:>@\+/ /'`
182 dnl SIGKILL timeout setting
183 enableval=
184 AC_MSG_CHECKING([for sigkill timeout])
185 AC_ARG_ENABLE(sigkill-timeout,
186 [  --enable-sigkill-timeout=SEC
187                           timeout (in seconds) before sending `kill'
188                           signal to parent process in case of restart 
189                           if `term' has no effect [default=5]])
190 : ${enableval:=5}
191 test $enableval -gt 0 2> /dev/null || {
192 AC_MSG_RESULT([no])
193 AC_MSG_ERROR([Given sigkill timeout was not understood])
195 AC_MSG_RESULT([yes])
196 AC_DEFINE_UNQUOTED(SIGKILL_TIMEOUT,$enableval,
197 [Delay between SIGTERM ans SIGKILL to parent process in case of restart.])
199 dnl X polling frequency setting
200 enableval=
201 period=
202 AC_MSG_CHECKING([for polling frequency])
203 AC_ARG_ENABLE(x-polling-frequency,
204 [  --enable-x-polling-frequency=FREQ
205                           default frequency (in hertz) for polling the X server
206                           for events. Lower values leads to less responsive,
207                           but less CPU hungry desklets [default=50]])
208 : ${enableval:=50}
209 X_POLLING_FREQ=$enableval
210 test $enableval -gt 0 2> /dev/null || {
211 AC_MSG_RESULT([no])
212 AC_MSG_ERROR([Positive, integer value is required as x-polling-frequency])
215 AC_CHECK_PROG(EXISTS,bc,yes,no)
216 if test $enableval -ne 50; then
217 if test x$EXISTS = "xyes"; then
218    period=`echo "1000000 / $enableval" | bc`
219 else
220    AC_MSG_WARN([Could not find the `bc' calculator to perform arithmetic 
221 computation of X server polling period value. Default 50 Hz is assumed.])
224 : ${period:=20000}
225 AC_DEFINE_UNQUOTED(X_POLLING_PERIOD,$period,
226 [Default polling period (in 10e-6 seconds) of stdin between two cycles of events loop.])
227 X_POLLING_PERIOD=$period
228 AC_SUBST(X_POLLING_FREQ)
230 dnl Lock files directory setting
231 enableval=
232 AC_MSG_CHECKING([for lock files directory setting])
233 AC_ARG_ENABLE(lockfiles-dir,
234 [  --enable-lockfiles-dir=DIR
235                           directory to put lock files in [default=/tmp]])
236 : ${enableval:=/tmp}
237 test -d $enableval || {
238 AC_MSG_RESULT([no])
239 AC_MSG_ERROR([Given lock files directory does not exist on your system])
241 AC_MSG_RESULT([yes])
242 AC_DEFINE_UNQUOTED(LOCKFILES_DIR,"$enableval",
243 [Directory to put lock files in.])
244 LOCKFILES_DIR=$enableval
245 AC_SUBST(LOCKFILES_DIR)
247 dnl Control modifier on context menu
248 enableval=
249 AC_MSG_CHECKING([for control modifier on context menu])
250 AC_ARG_ENABLE(control-on-context-menu,
251 [  --enable-control-on-context-menu
252                           force CTRL to be pressed to fire context menu
253                           [default=no]])
254 : ${enableval:=no}
255 if test x$enableval != "xno" ; then
256 AC_MSG_RESULT([yes])
257 AC_DEFINE(CONTROL_ON_CONTEXT_MENU, 1,
258 [Force CTRL to be pressed to fire context menu])
259 else
260 AC_MSG_RESULT([no])
263 dnl Legacy Window Manager detection code
264 enableval=
265 AC_MSG_CHECKING([for legacy fake root window detection code])
266 AC_ARG_ENABLE(legacy-fake-root-window-detection,
267 [  --enable-legacy-fake-root-window-detection
268                           Use the old code to detect fake root windows
269                           [default=no]])
270 : ${enableval:=no}
271 if test x$enableval != "xno" ; then
272 AC_MSG_RESULT([yes])
273 AC_DEFINE(WM_DETECTION_OLD_STYLE, 1,
274 [Use former fake root window detection code])
275 else
276 AC_MSG_RESULT([no])
279 dnl Legacy pseudo transparency
280 enableval=
281 AC_MSG_CHECKING([for legacy pseudo transparency])
282 AC_ARG_ENABLE(legacy-pseudo-transparency,
283 [  --enable-legacy-pseudo-transparency
284                           Use the old code implementing pseudo-transparency
285                           grabbing [default=no]])
286 : ${enableval:=no}
287 if test x$enableval != "xno" ; then
288 AC_MSG_RESULT([yes])
289 AC_DEFINE(FAKE_TRANSPARENCY_OLD_STYLE, 1,
290 [Use former pseudo transparency code])
291 else
292 AC_MSG_RESULT([no])
295 dnl New frontend driver
296 enableval=
297 AC_MSG_CHECKING([for frontend shell driver])
298 AC_ARG_ENABLE(frontend-shell-driver,
299 [  --disable-frontend-shell-driver
300                           Do not invoke the frontend shell-based driver 
301                           for adesklets [default=no]])
302 : ${enableval:=yes}
303 if test x$enableval != "xyes" ; then
304 AM_CONDITIONAL(FRONTEND_SHELL_SUPPORT, test 1 -eq 0)
305 AC_MSG_RESULT([no])
306 else
307 AC_DEFINE(FRONTEND_SHELL_DRIVER, 1,
308 [Enable the frontend shell driver mecanism])
309 AM_CONDITIONAL(FRONTEND_SHELL_SUPPORT, test 1 -eq 1)
310 AC_MSG_RESULT([yes])
313 dnl Collect various system informations strings,
314 dnl for embedding into final executable
315 EXISTS=
316 WELCOME1="\"$PACKAGE $VERSION"
317 AC_CHECK_PROG(EXISTS,date,yes)
318 if test x$EXISTS = "xyes"; then
319    WELCOME1="$WELCOME1 ("`date | sed 's/@<:@@<:@:space:@:>@@:>@\+/ /g'`")"
320 else
321    WELCOME1="$WELCOME1 (unknown time)"
323 EXISTS=
324 AC_CHECK_PROG(EXISTS,uname,yes)
325 if test x$EXISTS = "xyes"; then
326    if uname -rs &> /dev/null; then
327       WELCOME1="$WELCOME1, on "`uname -rs`"\""
328    else
329       WELCOME1="$WELCOME1, on an unknown OS\""
330    fi
331 else
332    WELCOME1="$WELCOME1, on an unknown OS\""
334 AC_DEFINE_UNQUOTED(WELCOME_LINE_1, $WELCOME1, [Welcome message, first line.])
335 dnl Note: @<:@ and @:>@ are respective quadrigraphs for `[' and `]'
336 ${CC} --version &> /dev/null && \
337       WELCOME2="\"${CC} "`${CC} --version | sed -n '1 s/^@<:@^0-9@:>@*//p'`"\""
338 : ${WELCOME2:=\"${CC} unknown version\"}
339 AC_DEFINE_UNQUOTED(WELCOME_LINE_2, $WELCOME2, [Welcome message, second line.])
341 dnl Check for math
342 AC_CHECK_LIB(m, floor, HaveLibMath=yes)
343 if test x$HaveLibMath = "xyes" ; then
344    LIBS="$LIBS -lm"
347 dnl Variables save: all changes to CFLAGS, LIBS and LDFLAGS beyond
348 dnl this point will be wiped
349 TMP_CFLAGS="$CFLAGS"
350 TMP_LIBS="$LIBS"
351 TMP_LDFLAGS="$LDFLAGS"
353 dnl Check for readline
354 AC_CHECK_LIB(ncurses, tputs, HaveLibTermcap=yes; LibTermcap=ncurses,
355    AC_CHECK_LIB(termcap, tputs, HaveLibTermcap=yes; LibTermcap=termcap,
356       AC_CHECK_LIB(curses, tputs, HaveLibTermcap=yes; LibTermcap=curses,
357                    HaveLibTermcap=no)))
358 if test $HaveLibTermcap = "yes" ; then
359    LIBS="$LIBS -l$LibTermcap"
360 else
361    AC_MSG_ERROR([Could not find terminal management library for readline
362 (either ncurses, termcap or curses).])
364 AC_CHECK_LIB(readline,readline,
365   READLINE_LIBS="-l$LibTermcap -lreadline",
366   AC_MSG_ERROR([Could not find the readline library]),
367   $LFLAGS)
368 LIBS="$TMP_LIBS"
370 dnl Check for libhistory support
371 withval=
372 AC_ARG_WITH(history,
373 [  --without-history       remove history support in interactive use
374                           of the interpreter])
375 : ${withval:=yes}
376 if test x$withval = "xyes"; then
377 AC_CHECK_LIB(history,add_history,
378         READLINE_LIBS="$READLINE_LIBS -lhistory";
379         HaveLibHistory=history,
380         AC_CHECK_LIB(readline,add_history,
381         HaveLibHistory=readline,
382         HaveLibHistory=no,
383         $READLINE_LIBS),
384         $READLINE_LIBS)
386 if test $HaveLibHistory = "no"; then
387 AC_MSG_WARN([Could not find GNU history library in the system])
388 else
389 AC_DEFINE(HAVE_READLINE_HISTORY_H,1,
390         [Define to 1 if you have the <readline/history.h> header file.])
391 AC_CHECK_LIB($HaveLibHistory,free_history_entry,
392         AC_DEFINE(HAVE_FREE_HISTORY_ENTRY,1,
393         [Define to 1 if you have the `free_history_entry' function.]),,
394         $READLINE_LIBS)
397 AC_MSG_CHECKING([for history max command lenght])
398 enableval=
399 AC_ARG_ENABLE(history-max-command-lenght,
400 [  --enable-history-max-command-lenght=LEN
401                           maximum string lenght (in characters) that a single
402                           command can have and still be kept in history 
403                           (a lenght of zero meaning no limits) [default=256]])
404 : ${enableval:=256}
406 if test $enableval -ge 0 ; then
407 AC_MSG_RESULT([yes])
408 AC_DEFINE_UNQUOTED(HISTORY_MAX_COMMAND_LENGHT,$enableval,
409 [maximum history string lenght.])
410 else
411 AC_MSG_RESULT([no])
412 AC_MSG_ERROR([history max command lenght must be positive or null])
416 AC_SUBST(READLINE_LIBS) 
418 dnl Check for 8 bit characters support forcing
419 enableval=
420 AC_ARG_ENABLE(force-extended-characters-input,
421 [  --enable-force-extended-characters-input
422                           force input and ouput of unescaped 
423                           height bits characters through GNU readline, 
424                           regardless of the inputrc settings [default=no]])
425 : ${enableval:=no}
426 if ! test x$enableval = "xno" ; then
427 AC_DEFINE(FORCE_EXTENDED_CHARACTERS_INPUT,1,
428 [force 8 bit characters support in GNU readline])
431 dnl Check for fontconfig
432 withval=
433 AC_ARG_WITH(fontconfig,
434 [  --without-fontconfig    remove fontconfig support enabling automatic 
435                           detection of all truetype fonts already available
436                           on the machine])
437 : ${withval:=yes}
438 if test x$withval = "xyes"; then
439 AC_PATH_PROG(PKG_CONFIG, pkg-config)
440 if ! test x$PKG_CONFIG = "x" ; then
441    if $PKG_CONFIG --exists fontconfig 2> /dev/null; then
442       FONTCONFIG_LIBS=`pkg-config --libs fontconfig`
443       FONTCONFIG_CFLAGS=`pkg-config --cflags fontconfig`
444    fi
446 if test x$FONTCONFIG_LIBS = "x"; then
447    FONTCONFIG_LIBS=-lfontconfig
449 LIBS="$LIBS $FONTCONFIG_LIBS"
450 CFLAGS="$CFLAGS $FONTCONFIG_CFLAGS"
451 AC_MSG_CHECKING([for fontconfig])
452 AC_TRY_LINK(
453 #include <fontconfig/fontconfig.h>
454 , FcInit(),
455 AC_MSG_RESULT([yes])
456 AC_DEFINE(HAVE_FONTCONFIG_FONTCONFIG_H,1,[Define to 1 if you have the <fontconfig/fontconfig.h> header file.])
458 AC_MSG_CHECKING([For fontconfig FcFini()])
459 AC_TRY_LINK(
460 #include <fontconfig/fontconfig.h>
461 , FcFini(),
462 AC_MSG_RESULT([yes])
463 AC_DEFINE(HAVE_FONTCONFIG_FCFINI,1,[Define to 1 if FcFini() call exists])
465 AC_MSG_RESULT([no]))
468 AC_MSG_RESULT([no])
469 FONTCONFIG_LIBS=
470 FONTCONFIG_CFLAGS=
471 AC_MSG_WARN([
472 -----------------------------------------------------
473 `fontconfig' was not found on your system. 
474 Although `adesklets' will work anyway system-wide 
475 automatic font detection will not occur: 
476 it is therefore quite possible that only the 
477 default font provided with the package will display.
478 -----------------------------------------------------]))
479 AC_SUBST(FONTCONFIG_LIBS)
480 AC_SUBST(FONTCONFIG_CFLAGS)
481 LIBS="$TMP_LIBS"
482 CFLAGS="$TMP_CFLAGS"
485 dnl Check for fork() system call
486 AC_CHECK_FUNCS(fork,,
487 AC_MSG_ERROR([Could not find the fork() system call]))
489 dnl Check for X headers and libraries
490 AC_PATH_X
492 if test x$no_x != "xyes"; then
494 if test x$x_includes != "x" ; then
495    X_CFLAGS="-I$x_includes"
496    CFLAGS="$CFLAGS $X_CFLAGS"   
499 if test x$x_libraries != "x" ; then
500    X_LIBS="-L$x_libraries"
501    LDFLAGS="$LDFLAGS $X_LIBS"
504 dnl Check for required functions in -lX11
505 AC_CHECK_LIB(X11, XOpenDisplay,
506   X_LIBS="$X_LIBS -lX11"
507   LIBS="$LIBS -lX11",
508   AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
510 AC_DEFINE(X_DISPLAY_SUPPORT,1,[Define to 1 if the X Window System is supported, 0 otherwise.])                
511 else
512 AC_DEFINE(X_DISPLAY_SUPPORT,0,[Define to 1 if the X Window System is supported, 0 otherwise.])
513    X_CFLAGS=
514    X_LIBS=
515 AC_DEFINE(X_DISPLAY_MISSING,,[Defined if the X headers were not found])
517 AC_SUBST(X_CFLAGS)
518 AC_SUBST(X_LIBS)
520 dnl Imlib2 detection
521 withval=
522 AC_ARG_WITH(imlib2,
523         [  --with-imlib2=DIR       use imlib2 in <DIR>],
524         [CFLAGS="$CFLAGS -I$withval/include"
525         LIBS="-L$withval/lib $LIBS"])
527 AC_PATH_GENERIC_MODIFIED(imlib2, 1.1.2,,
528   AC_MSG_ERROR([Cannot find imlib2: Is imlib2-config in the path?]),
529   1.2.0,,
530   AC_MSG_WARN([
531 -----------------------------------------------------
532 $PACKAGE should work with your version of imlib2...
533 But for better results you are _warmly_ encouraged 
534 to try out version 1.2.0 or above;
535 known bugs are still lurking in dark corners 
536 with what you have installed: beware strange problems 
537 with dynamic image filters for instance!  
538 -----------------------------------------------------]))
540 LIBS="$LIBS -lImlib2"
541 dnl CFLAGS="$CFLAGS $IMLIB2_CFLAGS"
543 AC_MSG_CHECKING([for imlib2 program linking with ad-hoc flags])
544 AC_TRY_LINK(
545 #ifndef X_DISPLAY_MISSING
546         #include <X11/Xlib.h>
547         #include <X11/Xutil.h>
548         #include <X11/Xos.h>
549         #include <X11/Xatom.h>
550 #endif  
551         #include <Imlib2.h>
552 ,       Imlib_Image image;
553         image = imlib_load_image("toto.png");
554 #ifndef X_DISPLAY_MISSING
555         imlib_context_set_display(NULL);
556 #endif
558         AC_MSG_RESULT([yes])
559         IMLIB2_CFLAGS=""
560         IMLIB2_LIBS="-lImlib2",
561         AC_MSG_RESULT([no])
562         CFLAGS="$TMP_CFLAGS $IMLIB2_CFLAGS"
563         LIBS="$TMP_LIBS $IMLIB2_LIBS"
564         AC_MSG_CHECKING([for imlib2 program linking])
565         AC_TRY_LINK(
566 #ifndef X_DISPLAY_MISSING
567         #include <X11/Xlib.h>
568         #include <X11/Xutil.h>
569         #include <X11/Xos.h>
570         #include <X11/Xatom.h>
571 #endif  
572         #include <Imlib2.h>
573 ,       Imlib_Image image;
574         image = imlib_load_image("toto.png");
575 #ifndef X_DISPLAY_MISSING
576         imlib_context_set_display(NULL);
577 #endif
579         AC_MSG_RESULT([yes]),
580         AC_MSG_RESULT([no])
581         AC_MSG_ERROR([Cannot link Imlib2 program.
582 If you specified you did not want X support this can be caused
583 by your Imlib2 installment being configured so it needs it
584 or conversely. In that case reinstall Imlib2 with proper
585 --enable-x11-support parameter (as from enlightement CVS)
586 before retrying to configure this package.])))
588 AC_SUBST(IMLIB2_CFLAGS)
589 AC_SUBST(IMLIB2_LIBS)
592 dnl Test for uint typedef
593 AC_MSG_CHECKING([for uint typedef in standard library])
594 AC_TRY_COMPILE(
595 #ifdef HAVE_SYS_TYPES_H
596         #include <sys/types.h>
597 #endif
598 #ifdef HAVE_UNISTD_H
599         #include <unistd.h>
600 #endif
601 ,       uint i,
602         AC_MSG_RESULT([yes]),
603         AC_MSG_RESULT([no])
604         AC_DEFINE(UINT_NOT_DEFINED,1,
605                   [Define to 1 if compability type uint is not detected.])      
608 dnl Important variables reset
609 CFLAGS="$TMP_CFLAGS"
610 LIBS="$TMP_LIBS"
611 LDFLAGS="$TMP_LDFLAGS"
613 dnl PKGDATADIR definition
614 dnl PKGDATADIR is only well constructed in make context,
615 dnl so let's put this AFTER all tests.
616 CFLAGS="$CFLAGS"' -DPKGDATADIR=\"$(pkgdatadir)\"'
618 dnl Output files
619 AM_CONFIG_HEADER(src/config.h)
620 AC_OUTPUT(Makefile
621 src/Makefile
622 data/Makefile
623 utils/Makefile
624 doc/Makefile
625 doc/adesklets_checkin.1
626 doc/adesklets_submit.1
627 doc/htmldoc.sh
628 doc/imlib2/Makefile
629 scripting/Makefile
630 scripting/protoize.sh
631 scripting/python/Makefile
632 scripting/python/config.h
633 scripting/python/setup.py
634 scripting/perl/Makefile
635 scripting/perl/Makefile.PL
636 scripting/perl/updateproto.pl
637 utils/adesklets_frontend.sh
640 dnl Change script(s) permissions
641 chmod +x scripting/protoize.sh scripting/perl/updateproto.pl \
642       doc/htmldoc.sh utils/adesklets_frontend.sh
644 dnl Final warning, if needed
645 if test x$DEBUG = "xyes"; then
646 AC_MSG_WARN([
647 -----------------------------------------------------
648 you choosed to make a `debug' compilation: this will
649 generate a significantly bigger executable
650 that produces on stderr (by default) a lot of outputs 
651 unwanted during normal use; set up the ADESKLETS_LOG 
652 environment variable to a filename the interpreter 
653 can safely suffix with a pid related extension
654 than truncate to collect all debug outputs 
655 there instead. Be also aware that all optimisation 
656 settings (-O flags in CFLAGS) are discarded when 
657 enabling this.
658 -----------------------------------------------------])
660 if test x$no_x = "xyes"; then
661 AC_MSG_WARN([
662 -----------------------------------------------------
663 you choosed to perform an `X Window less' build - 
664 which means you will eventually end up with 
665 a strictly command line program free of all
666 dependencies on xlib. If it is not what you intended 
667 please reconfigure. For this to work you do need first
668 to configure your Imlib2 incantation for not using
669 X Window itself.
670 -----------------------------------------------------
674 if test x$PYTHON != "x" ; then
675 if test x$SIGPROC != "xyes" ; then
676 AC_MSG_WARN([
677 -----------------------------------------------------
678 your system does not seem to support reliable POSIX
679 signal calls such as `sigprocmask', `sigpending' or
680 `sigsuspend'. Although this does not affect $PACKAGE
681 directly, it seriously impedes python ability
682 to handle things well through its package. 
683 To our knowledge, no modern UNIX platforms lack 
684 those system calls...
685 -----------------------------------------------------