1AC_INIT(Xnee,3.19,bug-xnee@gnu.org)
2AC_CONFIG_AUX_DIR(./autotools/)
3AM_INIT_AUTOMAKE
4#AB_INIT
5
6
7AC_PROG_INSTALL
8AC_PROG_CC
9AC_LANG_C
10AC_PROG_MAKE_SET
11#AC_PROG_RANLIB
12AC_PATH_X
13AC_PATH_XTRA
14AC_FUNC_VPRINTF
15AC_CHECK_HEADERS(stdarg.h varargs.h, break)
16AC_EXEEXT
17AC_PATH_PROG(AWK,awk)
18AC_PATH_PROG(BASH,bash,sh)
19AC_PATH_PROG(PKGCFG,pkg-config,,)
20AC_PATH_PROG(CONVERT,convert,,)
21AC_PATH_PROG(MAKEINFO,makeinfo,,)
22AC_PATH_PROG(GTKCONF,gtk-config)
23
24#AC_DISABLE_SHARED
25AC_PROG_LIBTOOL
26
27# Add X libs
28LIBS="$LIBS $X_LIBS"
29
30
31AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
32AC_CHECK_LIB(c, sem_init, LIBSEMA="CCC", [AC_CHECK_LIB(pthread, sem_init, LIBSEMA="-lpthread")])
33AC_CHECK_LIB(Xtst, XTestFakeMotionEvent, LIBXTST="-lXtst",[AC_CHECK_LIB(Xext,XTestFakeMotionEvent , LIBXTST="-lXext")])
34
35GENERATION_DIRS=""
36
37if test "x$LIBXTST" = "x" ;
38then
39    echo ""
40    echo " **** ERROR **** "
41    echo ""
42    echo "Could not locate the needed X11 extensions:"
43    echo ""
44    echo "   RECORD"
45    echo "   XTest"
46    echo ""
47    echo "Make sure you have them installed before building Xnee"
48    echo ""
49    echo "  ... on Debian based distros do: apt-get install libxtst-dev"
50    echo " "
51    exit 1
52fi
53
54
55AC_ARG_ENABLE(gui,
56    [  --enable-gui       build the GUI frontend to Xnee],
57    [case "${enableval}" in
58	yes) buildgui=true ;;
59	no)  buildgui=false ;;
60	*) AC_MSG_ERROR(bad value ${enableval} for --disable-gui) ;;
61	    esac],[buildgui=true])
62
63AC_ARG_ENABLE(gnome-applet,
64    [  --enable-gnome-applet   build the Gnome Panel frontend to Xnee (obsoleted)],
65    [case "${enableval}" in
66	yes) buildgapplet=true ;;
67	no)  buildgapplet=false ;;
68	*) AC_MSG_ERROR(bad value ${enableval} for --disable-gnome-applet) ;;
69	    esac],[buildgapplet=false])
70
71AC_ARG_ENABLE(doc,
72    [  --enable-doc       (re)build Xnee documentation],
73    [case "${enableval}" in
74	yes) builddoc=true ;;
75	no)  builddoc=false ;;
76	*) AC_MSG_ERROR(bad value ${enableval} for --disable-doc) ;;
77	    esac],[builddoc=false])
78
79AC_ARG_ENABLE(man,
80    [  --enable-man       (re)build Xnee man pages],
81    [case "${enableval}" in
82	yes) buildman=true ;;
83	no)  buildman=false ;;
84	*) AC_MSG_ERROR(bad value ${enableval} for --disable-man) ;;
85	    esac],[buildman=false])
86
87AC_ARG_ENABLE(doconly,
88    [  --enable-doconly       build Xnee documentation only],
89    [case "${enableval}" in
90	yes) doconly=true ;;
91	no)  doconly=false ;;
92	*) AC_MSG_ERROR(bad value ${enableval} for --disable-doconly) ;;
93	    esac],[doconly=false])
94
95AC_ARG_ENABLE(xinput2,
96    [  --enable-xinput2       build Xnee with support for XInput2],
97    [case "${enableval}" in
98	yes) use_xi2=true ;;
99	no)  use_xi2=false ;;
100	*) AC_MSG_ERROR(bad value ${enableval} for --disable-xinput2) ;;
101	    esac],[use_xi2=true])
102
103AC_ARG_ENABLE(cli,
104    [  --enable-cli       build Xnee command line tool],
105    [case "${enableval}" in
106	yes) buildcli=true ;;
107	no)  buildcli=false ;;
108	*) AC_MSG_ERROR(bad value ${enableval} for --disable-cli) ;;
109	    esac],[buildcli=true])
110
111AC_ARG_ENABLE(lib,
112    [  --enable-lib       install Xnee library (libxnee)],
113    [case "${enableval}" in
114	yes) buildlib=true ;;
115	no)  buildlib=false ;;
116	*) AC_MSG_ERROR(bad value ${enableval} for --disable-lib) ;;
117	    esac],[buildlib=false])
118
119AC_ARG_ENABLE(static-programs,
120    [  --enable-static-programs     make the Xnee programs static (defaults to static)],
121    [case "${enableval}" in
122	yes) makestatic=true ;;
123	no)  makestatic=false ;;
124	*) AC_MSG_ERROR(bad value ${enableval} for --disable-static-programs) ;;
125	    esac],[makestatic=true])
126
127
128AC_ARG_ENABLE(xosd,
129    [  --enable-xosd       build Xnee with XOSD support],
130    [case "${enableval}" in
131	yes) xosd=true ;;
132	no)  xosd=false ;;
133	*) AC_MSG_ERROR(bad value ${enableval} for --disable-xosd) ;;
134	    esac],[xosd=true])
135
136AC_ARG_ENABLE(verbose,
137    [  --enable-verbose       build Xnee with no verbose mode support],
138    [case "${enableval}" in
139	yes) verbose=true ;;
140	no)  verbose=false ;;
141	*) AC_MSG_ERROR(bad value ${enableval} for --disable-verbose) ;;
142	    esac],[verbose=true])
143
144AC_ARG_ENABLE(buffer_verbose,
145    [  --enable-buffer_verbose  build xnee without support for buffer printouts],
146    [case "${enableval}" in
147	yes) buffer_verbose=true ;;
148	no)  buffer_verbose=false ;;
149	*) AC_MSG_ERROR(bad value ${enableval} for --disable-buffer_verbose) ;;
150	    esac],[buffer_verbose=false])
151
152AC_ARG_ENABLE(gcov,
153    [  --enable-gcov           build xnee with support for gcov],
154    [case "${enableval}" in
155	yes) gcov=true ;;
156	no)  gcov=false ;;
157	*) AC_MSG_ERROR(bad value ${enableval} for --enable-gcov) ;;
158	    esac],[gcov=false])
159
160AC_ARG_ENABLE(gprof,
161    [  --enable-gprof          build xnee with support for gprof],
162    [case "${enableval}" in
163	yes) gprof=true ;;
164	no)  gprof=false ;;
165	*) AC_MSG_ERROR(bad value ${enableval} for --enable-gprof) ;;
166	    esac],[gprof=false])
167
168AC_ARG_ENABLE(pedantic,
169    [  --enable-pedantic          build xnee with support for pedantic compiling],
170    [case "${enableval}" in
171	yes) pedantic=true ;;
172	no)  pedantic=false ;;
173	*) AC_MSG_ERROR(bad value ${enableval} for --enable-pedantic) ;;
174	    esac],[pedantic=false])
175
176AC_ARG_ENABLE(paranoid-pedantic,
177    [  --enable-paranoid-pedantic          build xnee with support for paranoid pedantic compiling],
178    [case "${enableval}" in
179	yes) para_pedantic=true ;;
180	no)  para_pedantic=false ;;
181	*) AC_MSG_ERROR(bad value ${enableval} for --enable-paranoid-pedantic) ;;
182	    esac],[para_pedantic=false])
183
184
185AM_CONDITIONAL(BUILDGUI, test x$buildgui = xtrue)
186AM_CONDITIONAL(BUILDPNEE, test x$buildgapplet = xtrue)
187AM_CONDITIONAL(BUILDDOC, test x$builddoc = xtrue)
188AM_CONDITIONAL(BUILDMAN, test x$buildman = xtrue)
189AM_CONDITIONAL(VERBOSE, test x$verbose = xtrue)
190AM_CONDITIONAL(GCOV, test x$gcov = xtrue)
191AM_CONDITIONAL(GPROF, test x$gprof = xtrue)
192AM_CONDITIONAL(PEDANTIC,    test x$pedantic = xtrue)
193AM_CONDITIONAL(BUF_VERBOSE, test x$buffer_verbose = xtrue)
194AM_CONDITIONAL(XOSD, test x$xosd = xtrue)
195AM_CONDITIONAL(DOCONLY, test x$doconly = xtrue)
196AM_CONDITIONAL(BUILD_STATIC, test x$makestatic = xtrue)
197AM_CONDITIONAL(NOT_INSTALL_LIBS, test x$buildlib = xfalse)
198AM_CONDITIONAL(XNEE_XINPUT_SUPPORT, test x$use_xi2 = xtrue)
199
200if test x$verbose = xtrue ;
201then
202    VERBOSE_FLAG=-DUSE_VERBOSE
203else
204    VERBOSE_FLAG=-DNO_VERBOSE
205fi
206
207if test x$gcov = xtrue ;
208then
209    GCOV_FLAG=-fprofile-arcs -ftest-coverage
210    CFLAGS=
211else
212    GCOV_FLAG=
213fi
214
215if test x$gprof = xtrue ;
216then
217    GPROF_FLAG=-pg
218    CFLAGS=
219else
220    GPROF_FLAG=
221fi
222
223if test x$buffer_verbose = xtrue ;
224then
225    BUF_VERBOSE_FLAG=-DUSE_BUF_VERBOSE
226else
227    BUF_VERBOSE_FLAG=-DNO_BUF_VERBOSE
228fi
229
230if test x$pedantic = xtrue ;
231then
232    PEDANTIC_FLAGS= -W -Wall -pedantic -pedantic-errors  -Werror
233else
234    PEDANTIC_FLAGS=
235fi
236
237if test x$para_pedantic = xtrue ;
238then
239    PEDANTIC_FLAGS=
240else
241    PEDANTIC_FLAGS=
242fi
243
244
245AM_CONDITIONAL(XNEE_XINPUT_SUPPORT, test x$use_xi2 = xtrue)
246if test x$use_xi2 = xtrue;
247then
248    AC_CHECK_LIB(Xtst, XIQueryPointer, LIBXI="",[AC_CHECK_LIB(Xi, XIQueryPointer, LIBXI="-lXi")])
249    AC_CHECK_HEADERS(X11/extensions/XInput2.h, HAS_XI2="true",HAS_XI2="false",)
250    XNEE_XINPUT_SUPPORT_FLAGS=-DXNEE_XINPUT_SUPPORT
251else
252    XNEE_XINPUT_SUPPORT_FLAGS=
253fi
254
255
256
257dnl Forward some variables to the makefiles
258AC_SUBST(LIBDL)
259AC_SUBST(LIBSEMA)
260X11_LIBS="-lX11 $LIBXTST $LIBXI"
261AC_SUBST(X11_LIBS)
262
263
264AM_MAINTAINER_MODE
265AM_CONFIG_HEADER(config.h)
266
267CLI_DIR=
268LIB_DIR=
269DOC_DIR=
270GUI_DIR=
271
272
273check_program()
274{
275    PROG_VAR_TO_CHECK=$1
276    PROG_TO_CHECK=$2
277
278    if test "x$PROG_VAR_TO_CHECK" = "x"
279    then
280	MISSING_PROGRAMS="$MISSING_PROGRAMS $PROG_TO_CHECK"
281    fi
282}
283
284DEBS_TO_INSTALL=""
285check_doc_program()
286{
287    PROG_VAR_TO_CHECK=$1
288    PROG_TO_CHECK=$2
289    DEBS=$3
290
291    if test "x$PROG_VAR_TO_CHECK" = "x"
292    then
293	DOC_NOT_BUILT_WARNING=true
294	MISSING_PROGRAMS="$MISSING_PROGRAMS $PROG_TO_CHECK"
295	DEBS_TO_INSTALL="$DEBS_TO_INSTALL $DEBS"
296    fi
297}
298
299give_deb_hint()
300{
301    if test "x$DEBS_TO_INSTALL" != "x"
302    then
303	echo "  **       If you are using a Debian based distro "
304	echo "  **       (e.g Trisquel, Debian, Gnewsense, Ubuntu), try:"
305	echo "               apt-get install $DEBS_TO_INSTALL"
306	echo "  **"
307    fi
308}
309
310
311
312help_on_missing_progrs()
313{
314    PROG=$1
315    DISABLE_OPT=$2
316    echo "  ** Suggested solutions:"
317    echo "  **    1) Build Xnee without $PROG,"
318    echo "  **      ./configure $DISABLE_OPT"
319    echo "  **"
320    echo "  **    2) Install the missing programs/packages"
321    give_deb_hint
322    echo "  **    3) If the programs/packages are installed (and not found) make sure they can be found in the PATH or other environment variable"
323    echo "  **"
324}
325
326if test x$buildgapplet = xtrue || test x$buildgui = xtrue  || test x$builddoc = xtrue  ;
327then
328    check_doc_program "$CONVERT" "convert" "imagemagick"
329fi
330
331
332
333if test x$buildgapplet = xtrue || test x$buildgui = xtrue  ;
334then
335    AC_PATH_PROG(PKGCFG,pkg-config,,)
336    check_doc_program "$PKGCFG" "pkg-config" "pkg-config"
337
338    if test "x$PKGCFG" = "x"
339    then
340
341	echo "  ********** ERROR **********"
342	echo "  ** pnee and/or gnee can't be built ** "
343	echo "  **   ..it is obsoleted and not cuurently supported"
344	echo "  ** "
345	echo "  ** The following program/package is missing:"
346	echo "  **    pkg-config"
347	echo "  ** "
348	DEBS_TO_INSTALL="pkg-config"
349	help_on_missing_progrs "pnee and gnee" "--disable-gnome-applet --disable-gui "
350	echo "  ** "
351	echo "  ********** ERROR **********"
352	exit 1
353    fi
354fi
355
356PIXMAP_DIR=pixmap
357
358if test x$buildgapplet = xtrue || test x$buildgui = xtrue  ;
359then
360
361    AC_ISC_POSIX
362    AC_PROG_CC
363    AM_PROG_CC_STDC
364    AC_HEADER_STDC
365    AC_PATH_XTRA
366    GTK_ERR=0
367    GTK_MODULES=""
368    GTK2_MODULE="gtk+-2.0 "
369    GTK2_VERSION="2.0.0"
370
371    gtk_CFLAGS=`$PKGCFG --cflags $GTK2_MODULE `
372    gtk_LIBS=`$PKGCFG --libs $GTK2_MODULE `
373
374
375    AC_SUBST(gtk_CFLAGS)
376    AC_SUBST(gtk_LIBS)
377
378    if `$PKGCFG --exists $GTK2_MODULE >= $GTK2_VERSION `
379    then
380	GTK_MODULES="$GTK2_MODULE"
381	GTK_ERR=1
382    fi
383
384
385    GNOMEUI2_MODULE="libgnomeui-2.0"
386    GNOMEUI2_VERSION="2.0.0"
387
388
389    if `$PKGCFG --exists  $GNOMEUI2_MODULE >= $GNOMEUI2_VERSION`
390    then
391	GTK_MODULES="$GTK_MODULES $GNOMEUI2_MODULE"
392	GTK_ERR=1
393    fi
394
395    libgnomeui_CFLAGS=`$PKGCFG --cflags $GNOMEUI2_MODULE `
396    libgnomeui_LIBS=`$PKGCFG --libs $GNOMEUI2_MODULE `
397
398
399    AC_SUBST(libgnomeui_CFLAGS)
400    AC_SUBST(libgnomeui_LIBS)
401
402    PIXMAP_DIR=pixmap
403
404
405    if test x$buildgapplet = xtrue ;
406    then
407
408      if test x$GTKCONF = x ;
409      then
410  	echo " **************************************** "
411  	echo " * WARNING, missing program: gtk-config *"
412  	echo " **************************************** "
413  	echo ""
414  	echo "     On Debian based distros, install sth like: libgtk2.0-dev"
415  	echo ""
416  	echo "However, I will try my best to continue without gtk-config. "
417  	echo "Will not be able to check for gtk/gnome header files properly"
418  	echo "On most platforms this implies no problem"
419  	echo ""
420      else
421        GTK_PREFIX=`$GTKCONF --prefix`
422        GTK_INC_PATH=$GTK_PREFIX/include/$GNOMEUI2_MODULE/
423        GNOME_H_FILE=$GTK_INC_PATH/gnome.h
424
425        ls -l $GNOME_H_FILE 2>/dev/null >/dev/null
426
427        MISSING_GNOME_H=$?
428
429        if test x$MISSING_GNOME_H != x0  ;
430        then
431  	  echo "Missing GNOME header file (gnome.h), you need to install development packages"
432	  echo "On a Debian based distro system do:"
433  	  echo ""
434  	  echo "     sudo apt-get install libgnome2-dev"
435  	  echo ""
436echo  	  exit 1
437        fi
438      fi
439
440  fi
441fi
442
443
444
445if test x$buildgui = xtrue ;
446then
447    dnl	GETTEXT_PACKAGE=gnee
448    dnl	AC_SUBST(GETTEXT_PACKAGE)
449    dnl	AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package])
450
451    dnl Add the languages which your application supports here.
452    dnl	ALL_LINGUAS=""
453    dnl	AM_GLIB_GNU_GETTEXT
454    GUI_DIR=gnee
455
456else
457    GUI_DIR=
458fi
459
460if test x$buildgapplet = xtrue;
461then
462
463    dnl	GETTEXT_PACKAGE=pnee
464    dnl	AC_SUBST(GETTEXT_PACKAGE)
465    dnl	AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext package])
466
467    dnl Add the languages which your application supports here.
468    dnl	ALL_LINGUAS=""
469    dnl	AM_GLIB_GNU_GETTEXT
470    GNOME_APPLET_DIR=pnee
471else
472    GNOME_APPLET_DIR=
473fi
474
475if test x$buildcli = xtrue
476then
477    CLI_DIR=cnee
478else
479    CLI_DIR=
480fi
481
482
483LIB_DIR=libxnee
484if test x$buildlib = xtrue ;
485then
486    WANTED_LIBXNEE=libxnee.la
487    AC_SUBST(WANTED_LIBXNEE)
488else
489    if test x$makestatic = xfalse ;
490    then
491	echo "  ********** ERROR **********"
492	echo " You can't build the programs dynamic "
493	echo " and not install the libs $makestatic"
494	echo "  ********** ERROR **********"
495	exit 1
496    fi
497    WANTED_LIBXNEE=libxnee.la
498    AC_SUBST(WANTED_LIBXNEE)
499fi
500
501
502check_xinput2()
503{
504    if test x$use_xi2 = xtrue ;
505	then
506	if test x$HAS_XI2 = xfalse ;
507	    then
508	    echo "XInput2 not found"
509	    echo "To compile GNU Xnee you have to:"
510	    echo "  *  Install XInput2 (development package)"
511	    echo "or"
512	    echo "  *  Disable XInput2 support in GNU Xnee:"
513	    echo "         ./configure --disable-xinput2"
514	    echo " "
515	    exit 1
516	fi
517   fi
518}
519
520check_xinput2
521
522
523dnl if test x$builddoc = xtrue ;
524dnl then
525dnl 	DOC_DIR=doc
526dnl else
527dnl 	DOC_DIR=
528dnl fi
529
530
531FOO_DIR=foo
532if test x$doconly = xtrue ;
533then
534    buildgui=false
535    buildlib=false
536    buildcli=false
537    builddoc=false
538    LIB_DIR=
539    CLI_DIR=
540    GUI_DIR=
541    FOO_DIR=bar
542    DOC_DIR=doc
543    DOC_MAKEFILES=
544fi
545
546DOC_DIR=doc
547
548
549show_doc_program()
550{
551    PROG_VAR_TO_CHECK=$1
552    PROG_TO_CHECK=$2
553    MESS=$3
554    if test "x$PROG_VAR_TO_CHECK" = "x"
555    then
556	echo "       ***** $PROG_TO_CHECK missing, $MESS"
557    else
558	echo "       $PROG_TO_CHECK  - $PROG_VAR_TO_CHECK"
559    fi
560}
561
562DOC_NOT_BUILT_WARNING=false
563MISSING_PROGRAMS=""
564
565
566
567
568
569DOC_TARGETS="info txt"
570if test x$builddoc = xtrue ;
571then
572    AC_PATH_PROG(DIA,dia,,)
573    check_doc_program "$DIA" "dia" "dia"
574
575    AC_PATH_PROG(TEXI2HTML,texi2html,,)
576    check_doc_program "$TEXI2HTML" "texi2html" "texi2html"
577
578#	AC_PATH_PROG(DVI2PS,dvi2ps,,)
579#	check_doc_program "$DVI2PS" "dvi2ps" "dvi2ps"
580
581    AC_PATH_PROG(DVIPDF,dvipdf,,)
582    check_doc_program "$DVIPDF" "dvipdf" "dvipdf"
583
584    AC_PATH_PROG(PDF2PS,pdf2ps,,)
585    check_doc_program "$PDF2PS" "pdf2ps" ""
586
587    AC_PATH_PROG(PS2PDF,ps2pdf,ps2pdf14,)
588    check_doc_program "$PS2PDF" "ps2pdf" "gs-common"
589
590    AC_PATH_PROG(TEXI2PDF,texi2pdf,,)
591    check_doc_program "$TEXI2PDF" "texi2pdf" ""
592
593    AC_PATH_PROG(EPSTOPDF,epstopdf,,)
594    check_doc_program "$EPSTOPDF" "epstopdf" "texlive-extra-utils texlive-font-utils"
595
596#	AC_PATH_PROG(DOXYGEN,doxygen,,)
597#	check_doc_program "$DOXYGEN" "doxygen"  "doxygen"
598
599    check_doc_program "$MAKEINFO" "makeinfo" " texinfo"
600
601
602    if test x$DOC_NOT_BUILT_WARNING = xtrue ;
603    then
604	echo " "
605	echo "  ********** ERROR **********"
606	echo "  ** Documents can't be built ** "
607	echo "  ** "
608	echo "  ** The following programs are missing:"
609	for i in $MISSING_PROGRAMS
610	do
611	    echo "  **    $i "
612	done
613	echo "  ** "
614	help_on_missing_progrs documentation "--disable-doc"
615	echo "  ** "
616	echo "  ********** ERROR **********"
617	DOC_DIR=""
618	DOC_TARGETS=""
619	builddoc=false
620	doconly=false
621	CNEE_INFO=""
622	echo "...  configuration failed"
623	exit 1
624    else
625	DOC_TARGETS="images html info txt pdf ps"
626	CNEE_INFO="cnee.info"
627    fi
628else
629
630    if test x$buildman = xtrue;
631    then
632	check_doc_program "$MAKEINFO" "makeinfo" "texi2html texinfo "
633
634        if test x$DOC_NOT_BUILT_WARNING = xtrue ;
635        then
636	 echo " "
637	 echo "  ********** ERROR **********"
638	 echo "  ** Man page(s) and images can't be built ** "
639	 echo "  ** "
640	 echo "  ** The following programs are missing:"
641	 for i in $MISSING_PROGRAMS
642	 do
643	    echo "  **    $i "
644	 done
645	 echo "  ** "
646	 help_on_missing_progrs documentation "--disable-doc"
647         echo "  ** "
648	 echo "  ********** ERROR **********"
649	 DOC_DIR=""
650	 DOC_TARGETS=""
651	 builddoc=false
652	 doconly=false
653	 CNEE_INFO=""
654	 echo "...  configuration failed"
655	 exit 1
656        else
657	 DOC_TARGETS="info"
658	 CNEE_INFO="cnee.info"
659        fi
660    fi
661fi
662
663
664AC_SUBST(CONVERT)
665AC_SUBST(DOC_TARGETS)
666AC_SUBST(GUI_DIR)
667AC_SUBST(GNOME_APPLET_DIR)
668AC_SUBST(CLI_DIR)
669AC_SUBST(LIB_DIR)
670AC_SUBST(DOC_DIR)
671AC_SUBST(PIXMAP_DIR)
672AC_SUBST(FOO_DIR)
673AC_SUBST(CNEE_INFO)
674AC_SUBST(XNEE_DOC_DIR)
675
676MAKEFILES_TO_GEN=""
677MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN Makefile examples/Makefile sessions/Makefile share/Makefile"
678
679EXCLUDED_COMPONENTS=""
680INCLUDED_COMPONENTS=""
681add_excl()
682{
683    EXCLUDED_COMPONENTS="${EXCLUDED_COMPONENTS}\n        $1"
684}
685
686add_incl()
687{
688    INCLUDED_COMPONENTS="${INCLUDED_COMPONENTS}\n        $1"
689}
690
691if test x$doconly = xtrue || test x$builddoc = xtrue  ;
692then
693    MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN doc/Makefile"
694    add_incl "doc"
695else
696    add_excl "doc (docs are already included in dist file)"
697fi
698
699if test x$buildlib = xtrue ;
700then
701    dnl         MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN libxnee/Makefile libxnee/test/Makefile libxnee/src/Makefile"
702    MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN libxnee/Makefile libxnee/src/Makefile "
703    dnl	add_incl "libxnee"
704    dnl else
705    dnl	add_excl "libxnee"
706
707fi
708
709if test x$buildgui = xtrue || test x$buildgapplet = xtrue  ;
710then
711    if test x$GTK_ERR != x0  ;
712    then
713	echo "  ********** ERROR **********"
714	echo "  ** pnee and/or gnee can't be built ** "
715	echo "  ** "
716	echo "  ** The following program/package is missing:"
717	echo "  **   $GTK_MODULES "
718	echo "  ** "
719	DEBS_TO_INSTALL="$GTK_MODULES"
720	help_on_missing_progrs "pnee and gnee" "--diable-gui --disable-gnome-applet"
721	echo "  ** "
722	echo "  ********** ERROR **********"
723	exit 1
724    fi
725
726
727
728fi
729
730if test x$buildcli = xtrue ;
731then
732    MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN cnee/Makefile cnee/src/Makefile"
733    add_incl "cli"
734else
735    add_excl "cli"
736fi
737
738if test x$buildgui = xtrue ;
739then
740    MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN gnee/Makefile gnee/src/Makefile"
741    add_incl "gnee"
742else
743    add_excl "gnee"
744fi
745
746
747if test x$buildgapplet = xtrue ;
748then
749#	AM_GCONF_SOURCE_2
750    PANEL_APPLET_DIR="${libdir}/gnome-panel"
751    PANEL_SERVER_DIR="${libdir}/bonobo/servers"
752    AC_SUBST(PANEL_SERVER_DIR)
753    AC_SUBST(PANEL_APPLET_DIR)
754#    AC_PATH_PROG(GCONFTOOL, gconftool-2)
755    PANEL_APPLET=libpanelapplet-4.0
756    PANEL_FLAGS=`$PKGCFG --cflags $PANEL_APPLET`
757    PANEL_LD_FLAGS=`$PKGCFG  --libs $PANEL_APPLET`
758    $PKGCFG $PANEL_APPLET
759    if test x$? != x0 ;
760    then
761	echo "  ********** ERROR **********"
762	echo "  ** pnee can't be built ** "
763	echo "  ** "
764	echo "  ** The following programs/packages are missing:"
765	echo "  **    $PANEL_APPLET"
766	echo "  ** "
767	DEBS_TO_INSTALL=" libpanel-applet-4-dev"
768	help_on_missing_progrs pnee "--disable-gnome-applet"
769	echo "  ** "
770	echo "  ********** ERROR **********"
771echo	exit 1
772    fi
773    AC_SUBST(PANEL_FLAGS)
774    AC_SUBST(PANEL_LD_FLAGS)
775#        AC_OUTPUT([ pnee/Makefile pnee/src/Makefile  pnee/pixmaps/Makefile ])
776    MAKEFILES_TO_GEN="$MAKEFILES_TO_GEN pnee/Makefile pnee/data/Makefile pnee/src/Makefile pnee/pixmaps/Makefile"
777    add_incl "pnee"
778else
779    add_excl "pnee"
780fi
781
782
783
784AC_SUBST(MAKEFILES_TO_GEN)
785echo "Making the following Makefiles:"
786echo "  $MAKEFILES_TO_GEN"
787#AC_OUTPUT([ $MAKEFILES_TO_GEN ])
788dnl libxnee/test/Makefile
789AC_OUTPUT([ Makefile libxnee/Makefile libxnee/src/Makefile examples/Makefile libxnee/test/Makefile sessions/Makefile share/Makefile doc/Makefile cnee/Makefile cnee/src/Makefile gnee/Makefile gnee/src/Makefile gnee/man/Makefile pnee/Makefile pnee/src/Makefile pnee/pics/Makefile  pnee/man/Makefile  pnee/data/Makefile  pixmap/Makefile man/Makefile  ])
790
791#
792# Final words
793#
794#
795#
796echo " "
797echo " "
798echo " Configuration of Xnee finished "
799echo " ============================== "
800echo "    PACKAGE              $PACKAGE"
801echo "    VERSION              $VERSION"
802echo " "
803echo "   Xnee Developer flags"
804echo "   -------------------------------------"
805echo "    VERBOSE_FLAG         $VERBOSE_FLAG"
806echo "    GCOV_FLAG            $GCOV_FLAG"
807echo "    GPROF_FLAG           $GPROF_FLAG"
808echo "    BUF_VERBOSE_FLAG     $BUF_VERBOSE_FLAG"
809echo "    PEDANTIC_FLAGS       $PEDANTIC_FLAGS"
810echo "    XNEE_XINPUT_SUPPORT_FLAGS $XNEE_XINPUT_SUPPORT_FLAGS"
811echo "    LIBDL                $LIBDL"
812echo "    LIBSEMA              $LIBSEMA"
813echo "    X11_LIBS             $X11_LIBS"
814echo "    PANEL_SERVER_DIR     $PANEL_SERVER_DIR"
815echo "    PANEL_APPLET_DIR     $PANEL_APPLET_DIR"
816echo "    PIXMAP_DIR           $PIXMAP_DIR"
817echo "    CONVERT              $CONVERT"
818#echo "    GUI_DIR              $GUI_DIR"
819#echo "    GNOME_APPLET_DIR     $GNOME_APPLET_DIR"
820#echo "    CLI_DIR              $CLI_DIR"
821#echo "    LIB_DIR              $LIB_DIR"
822#echo "    DOC_DIR              $DOC_DIR"
823echo " "
824if test x$builddoc = xtrue ;
825then
826    echo "   Programs used to build documentation and/or guis "
827    echo "   -----------------------------------------------------"
828    show_doc_program "$DIA" "dia"  "Can't generate pictures from dia sources"
829    show_doc_program "$CONVERT" "convert"  "Can't convert image formats"
830    show_doc_program "$TEXI2HTML" "texi2html"  "can't generate html pages"
831#	show_doc_program "$DVI2PS" "dvi2ps"   "can't generate ps "
832    show_doc_program "$DVIPDF" "dvipdf"   "can't generate pdf from dvi "
833    show_doc_program "$PS2PDF" "ps2pdf"  "can't generate pdf"
834    show_doc_program "$EPSTOPDF" "epstopdf"  "can't generate pdf"
835    show_doc_program "$CONVERT" "convert"  "can't generate convert between formats"
836    show_doc_program "$MAKEINFO" "makeinfo"  "can't make info pages"
837fi
838
839if test x$buildgapplet = xtrue || test x$buildgui = xtrue  ;
840then
841    echo "   Programs used to build guis "
842    echo "   -----------------------------------------------------"
843    show_doc_program "$PKGCFG"   "pkg-config"  "can't get meta info from installed packages"
844    show_doc_program "$GTKCONF"   "gtk-config"  "can't check for header files..."
845fi
846echo ""
847echo "   Building the following components "
848echo "   -------------------------------------"
849printf "    $INCLUDED_COMPONENTS"
850echo " "
851echo " "
852if test "x$EXCLUDED_COMPONENTS" != "x" ;
853then
854    echo "   Excluding the following components "
855    echo "   -------------------------------------"
856    printf "    $EXCLUDED_COMPONENTS"
857    echo " "
858fi
859echo ""
860echo "   Static or dynamic linking for programs ($makestatic)"
861echo "   -------------------------------------"
862echo "BUILD_STATIC:  $BUILD_STATIC"
863if test "x$BUILD_STATIC" != "x" ;
864then
865    echo "        dynamic"
866else
867    echo "        static"
868fi
869echo ""
870echo "   Support for XInput2"
871echo "   -------------------------------------"
872if test "x$XNEE_XINPUT_SUPPORT_FLAGS" = "x" ;
873then
874    echo "        disabled"
875else
876    echo "        enabled"
877fi
878echo " "
879echo "   Settings ok?"
880echo "   -------------------------------------"
881echo "    If the settings are not ok, configure again"
882echo "       ./configure <your options>"
883echo " "
884echo "    To list all the configure options: "
885echo "       ./configure --help"
886echo " "
887echo "   Compile and install"
888echo "   -------------------------------------"
889echo "    If the above settings are ok, proceed with the build:"
890echo "       make"
891echo "    and (perhaps as root)"
892echo "       make install"
893echo " "
894
895