1 AC_INIT([cde-desktop], [2.3.1], [jon@radscan.com])
2 AC_CONFIG_HEADERS([include/autotools_config.h])
3 AC_CONFIG_MACRO_DIRS([m4])
4 AM_INIT_AUTOMAKE([foreign subdir-objects])
6 dnl These must be up here for the compiler search list to actually work
7 AC_PROG_CC([cc gcc clang])
8 AC_PROG_CXX([c++ g++ clang++])
11 AC_PREFIX_DEFAULT(/usr/dt)
13 AC_ENABLE_STATIC([no])
17 dnl todo: determine what version of autoconf we depend on
23 dnl global CDE versioning
29 AC_SUBST(CDE_VERSION_MAJOR)
30 AC_SUBST(CDE_VERSION_MINOR)
31 AC_SUBST(CDE_VERSION_MICRO)
33 dnl SOURCE_DEFINES - start with CDE project default
34 SOURCE_CPP_DEFINES="-DANSICPP -DMULTIBYTE -DNLS16"
36 dnl CPP_COMPILER_FLAGS - CPP/C/C++ compiler flags
39 dnl CXX_COMPILER_FLAGS - C++ compiler flags
42 dnl C_COMPILER_FLAGS - C compiler flags
46 dnl These OS version checks are deprecated and should be replaced with
47 dnl feature checks where appropriate
58 dnl For now, we need to fake the OSMAJORVERSION, OSMINORVERSION. In Linux
59 dnl this never mattered anyway as it was always the kernel version. We will
60 dnl choose defaults here. These need to be removed in the code in favor
61 dnl of actual checks for functionality. So this should be considered
67 dnl locations of libs/includes if not in 'standard' places like on
68 dnl linux (/usr/...). We build these up based on where X11 is, and
69 dnl other things as we go along.
78 SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \
79 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE"
80 CPP_COMPILER_FLAGS="-fno-strict-aliasing -Wno-write-strings \
114 AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
115 AM_CONDITIONAL([BSD], [test "$bsd" = "yes"])
116 AM_CONDITIONAL([FREEBSD], [test "$build_freebsd" = "yes"])
117 AM_CONDITIONAL([OPENBSD], [test "$build_openbsd" = "yes"])
118 AM_CONDITIONAL([NETBSD], [test "$build_netbsd" = "yes"])
119 AM_CONDITIONAL([SOLARIS], [test "$build_solaris" = "yes"])
120 AM_CONDITIONAL([AIX], [test "$build_aix" = "yes"])
121 AM_CONDITIONAL([HPUX], [test "$build_hpux" = "yes"])
123 dnl Add osmajor/minor version to cppflags.
124 OSVERSION="-DOSMAJORVERSION=$OSMAJORVERSION -DOSMINORVERSION=$OSMINORVERSION"
126 dnl set CSRG_BASED define for the BSD's. Also, they use /usr/local
127 dnl for a lot of things, so add that to the INCS and LIBS
128 if test "$bsd" = "yes"
130 SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DCSRG_BASED"
131 EXTRA_INCS="-I/usr/local/include ${EXTRA_INCS}"
132 EXTRA_LIBS="-L/usr/local/lib ${EXTRA_LIBS}"
142 case "${host_cpu}" in
163 AM_CONDITIONAL([I386], [test "$is_i386" = yes])
164 AM_CONDITIONAL([X86_64], [test "$is_x86_64" = yes])
165 AM_CONDITIONAL([ARM], [test "$is_arm" = yes])
166 AM_CONDITIONAL([SPARC], [test "$is_sparc" = yes])
167 AM_CONDITIONAL([MIPS], [test "is_mips" = yes])
168 AM_CONDITIONAL([PPC], [test "is_ppc" = yes])
170 dnl our main libraries
171 dnl we use single quotes so that $top_buildir is evaluated in the makefiles,
173 AC_SUBST(LIBTT, '$(top_builddir)/lib/tt/lib/libtt.la')
174 AC_SUBST(LIBXIN, '$(top_builddir)/lib/DtXinerama/libDtXinerama.la')
175 AC_SUBST(LIBWIDGET, '$(top_builddir)/lib/DtWidget/libDtWidget.la')
176 AC_SUBST(LIBTERM, '$(top_builddir)/lib/DtTerm/libDtTerm.la')
177 AC_SUBST(LIBSVC, '$(top_builddir)/lib/DtSvc/libDtSvc.la')
178 AC_SUBST(LIBSEARCH, '$(top_builddir)/lib/DtSearch/lbiDtSearch.la')
179 AC_SUBST(LIBPRINT, '$(top_builddir)/lib/DtPrint/libDtPrint.la')
180 AC_SUBST(LIBMRM, '$(top_builddir)/lib/DtMrm/libDtMrm.la')
181 AC_SUBST(LIBMMDB, '$(top_builddir)/lib/DtMmdb/libDtMmdb.la')
182 AC_SUBST(LIBHELP, '$(top_builddir)/lib/DtHelp/libDtHelp.la')
183 AC_SUBST(LIBCSA, '$(top_builddir)/lib/csa/libcsa.la')
185 AC_SUBST(DTCLIENTLIBS, '$(LIBPRINT) $(LIBHELP) $(LIBWIDGET) $(LIBSVC) \
188 dnl set up come convenience replacements for global include dirs
189 AC_SUBST(DT_INCDIR, '-I$(top_builddir)/include/Dt')
190 AC_SUBST(DTI_INCDIR, '-I$(top_builddir)/include/DtI')
191 AC_SUBST(TT_INCDIR, '-I$(top_builddir)/include/Tt')
192 AC_SUBST(XM_INCDIR, '-I$(top_builddir)/include/Xm')
193 AC_SUBST(CSA_INCDIR, '-I$(top_builddir)/include/csa')
194 AC_SUBST(SPC_INCDIR, '-I$(top_builddir)/include/SPC')
196 AC_ARG_ENABLE([german],
197 AS_HELP_STRING([--enable-german], [Build German locale (default=no)]),
198 [enable_de="yes"], [enable_de=""]
200 AM_CONDITIONAL([GERMAN], [test -n "$enable_de"])
202 AC_ARG_ENABLE([italian],
203 AS_HELP_STRING([--enable-italian], [Build Italian locale (default=no)]),
204 [enable_it="yes"], [enable_it=""]
206 AM_CONDITIONAL([ITALIAN], [test -n "$enable_it"])
208 AC_ARG_ENABLE([french],
209 AS_HELP_STRING([--enable-french], [Build French locale (default=no)]),
210 [enable_fr="yes"], [enable_fr=""]
212 AM_CONDITIONAL([FRENCH], [test -n "$enable_fr"])
214 AC_ARG_ENABLE([spanish],
215 AS_HELP_STRING([--enable-spanish], [Build Spanish locale (default=no)]),
216 [enable_es="yes"], [enable_es=""]
218 AM_CONDITIONAL([SPANISH], [test -n "$enable_es"])
220 AC_ARG_ENABLE([japanese],
221 AS_HELP_STRING([--enable-japanese], [Build Japanese locale (default=no, never tested)]),
222 [enable_jp="yes"], [enable_jp=""]
224 AM_CONDITIONAL([JAPANESE], [test -n "$enable_jp"])
233 dnl these should be configurable someday...
234 CDE_INSTALLATION_TOP="$ac_default_prefix"
235 CDE_LOGFILES_TOP=/var/dt
236 CDE_CONFIGURATION_TOP=/etc/dt
239 AC_SUBST(CDE_INSTALLATION_TOP)
240 AC_SUBST(CDE_CONFIGURATION_TOP)
241 AC_SUBST(CDE_LOGFILES_TOP)
242 AC_SUBST(CDE_USER_TOP)
244 dnl This variable will contain a list of programs that were not found,
245 dnl but are required to build CDE. At the end, if the variable is
246 dnl non-empty, an error message will be printed, listing the missing
247 dnl programs. We don't bother with the simple expected commands like
254 dnl we need a real preprocessor, not gcc -E. We will call it GENCPP.
255 dnl We will go with BSD's tradcpp here... This is used for
256 dnl pre-processing during building of CDE - in the way imake used to
257 dnl do. This is not a replacement for cpp, used at runtime by
258 dnl software such as tt_type_comp.
259 AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp')
263 dnl make sure it's installed
265 if test -z "$ac_cv_prog_YACC"; then
266 MISSING_PROGS="[bison or byacc] ${MISSING_PROGS}"
270 if test -z "$ac_cv_prog_LEX"; then
271 MISSING_PROGS="[flex or lex] ${MISSING_PROGS}"
289 AC_C_FLEXIBLE_ARRAY_MEMBER
299 dnl Add X11 goodies here
300 EXTRA_LIBS="${X_LIBS} ${EXTRA_LIBS}"
301 EXTRA_INCS="${X_CFLAGS} ${EXTRA_INCS}"
305 dnl programs with full paths
307 dnl - KSH, some systems call it as ksh93
308 AC_PATH_PROG(KSH, ksh)
309 if test -z "$ac_cv_path_KSH"; then
310 AC_PATH_PROG(KSH, ksh93)
311 if test -z "$ac_cv_path_KSH"; then
312 MISSING_PROGS="[ksh or ksh93] ${MISSING_PROGS}"
316 AC_PATH_PROG(XRDB, xrdb)
317 if test -z "$ac_cv_path_XRDB"; then
318 MISSING_PROGS="xrdb ${MISSING_PROGS}"
321 dnl we need to use cpp for some things, like tooltalk and other
322 dnl runtime uses. So look for the system's cpp. NOTE: this is NOT
323 dnl the CPP (gcc -E) set by AC_PROG_CPP. At this point I don't know
324 dnl if we should even bother looking for that as we can't really use
326 AC_PATH_PROG(CPP_PROGRAM, cpp, ,
327 [/lib:/usr/bin:/usr/ccs/lib/:/usr/lib:/usr/libexec:/opt/langtools/lbin:$PATH])
328 if test -z "$ac_cv_path_CPP_PROGRAM"; then
329 MISSING_PROGS="cpp ${MISSING_PROGS}"
332 dnl major external program dependencies
333 AC_CHECK_PROGS(BDFTOPCF, bdftopcf)
334 if test -z "$ac_cv_prog_BDFTOPCF"; then
335 MISSING_PROGS="bdftopcf ${MISSING_PROGS}"
337 AC_CHECK_PROGS(MKFONTDIR, mkfontdir)
338 if test -z "$ac_cv_prog_MKFONTDIR"; then
339 MISSING_PROGS="mkfontdir ${MISSING_PROGS}"
341 AC_CHECK_PROGS(GZIP, gzip)
342 if test -z "$ac_cv_prog_GZIP"; then
343 MISSING_PROGS="gzip ${MISSING_PROGS}"
345 AC_CHECK_PROGS(M4, m4)
346 if test -z "$ac_cv_prog_M4"; then
347 MISSING_PROGS="m4 ${MISSING_PROGS}"
349 AC_CHECK_PROGS(RPCGEN, rpcgen)
350 if test -z "$ac_cv_prog_RPCGEN"; then
351 MISSING_PROGS="rpcgen ${MISSING_PROGS}"
353 AC_CHECK_PROGS(GENCAT, gencat)
354 if test -z "$ac_cv_prog_GENCAT"; then
355 MISSING_PROGS="gencat ${MISSING_PROGS}"
360 AC_CHECK_HEADERS([locale.h])
363 AC_CHECK_LIB(m, cosf)
364 AC_CHECK_LIB(crypt, crypt)
365 dnl this should be configurable, for now it is required
366 AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
367 [SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DUSE_XINERAMA"],
368 [AC_MSG_ERROR([libXinerama not found])], $X_LIBS)
370 dnl Special check for tirpc...
371 AC_CHECK_LIB(tirpc, svc_register,
372 [CFLAGS="${CFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
373 CXXFLAGS="${CXXFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
378 AC_CHECK_LIB(jpeg, jpeg_read_header, [JPEGLIB="-ljpeg"],
379 [AC_MSG_ERROR([libjpeg not found, please install it])],
380 [${EXTRA_INCS} ${EXTRA_LIBS}])
383 dnl Setup XTOOLLIB - we do it in this specific order to avoid ordering
386 AC_CHECK_LIB(X11, XOpenDisplay, [XTOOLLIB="-lX11"], ,
387 [${EXTRA_INCS} ${EXTRA_LIBS}])
388 AC_CHECK_LIB(Xau, XauReadAuth, [XTOOLLIB="-lXau ${XTOOLLIB}"], ,
389 [${EXTRA_INCS} ${EXTRA_LIBS}])
390 AC_CHECK_LIB(Xt, XtInitialize, [XTOOLLIB="-lXt ${XTOOLLIB}"], ,
391 [${EXTRA_INCS} ${EXTRA_LIBS}])
392 AC_CHECK_LIB(ICE, IceCloseConnection, [XTOOLLIB="-lICE ${XTOOLLIB}"], ,
393 [${EXTRA_INCS} ${EXTRA_LIBS}])
394 AC_CHECK_LIB(SM, SmcOpenConnection, [XTOOLLIB="-lSM ${XTOOLLIB}"], ,
395 [${EXTRA_INCS} ${EXTRA_LIBS}])
396 AC_CHECK_LIB(Xm, XmTextSetString, [XTOOLLIB="-lXm ${XTOOLLIB}"], ,
397 [${EXTRA_INCS} ${EXTRA_LIBS}])
399 XTOOLLIB="${EXTRA_INCS} ${EXTRA_LIBS} ${X_EXTRA_LIBS} ${XTOOLLIB}"
402 dnl Check for freetype libraries/headers
403 AC_CHECK_TOOLS([FREETYPE_CONFIG], [freetype-config])
404 if test -z "$FREETYPE_CONFIG"; then
405 dnl freetype-config not available try pkg-config
407 AC_CHECK_TOOLS([FREETYPE_CONFIG], [pkg-config])
408 if test -z "$FREETYPE_CONFIG"; then
409 AC_MSG_ERROR([Missing freetype-config or pkg-config. Install freetype development headers and library.])
412 dnl check specific package is available
413 PKG_CHECK_MODULES([FREETYPE_CHECK], [freetype2])
415 FREETYPE_CFLAGS=`$FREETYPE_CONFIG freetype2 --cflags`
416 AC_SUBST(FREETYPE_CFLAGS)
417 FREETYPE_LIBS=`$FREETYPE_CONFIG freetype2 --libs`
418 AC_SUBST(FREETYPE_LIBS)
420 dnl freetype-config is available
422 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
423 AC_SUBST(FREETYPE_CFLAGS)
424 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
425 AC_SUBST(FREETYPE_LIBS)
428 dnl check MISSING_PROGS - error out here if there's stuff in it.
430 if test -n "$MISSING_PROGS"; then
431 AC_MSG_ERROR([Please install the following REQUIRED programs: ${MISSING_PROGS}])
436 dnl set CPPFLAGS, CFLAGS, and CXXFLAGS.
437 dnl The Autoconf manual says that these are user variables and
438 dnl shouldn't be modified. It suggests that you create a special
439 dnl variable and presumably add those to your Makefile.am files. We
440 dnl have 192 of these currently, so... The user will just have to
441 dnl deal, or modify them here directly.
442 CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS} ${OSVERSION}"
443 CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${EXTRA_INCS} ${PTHREAD_CFLAGS}"
444 CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${EXTRA_INCS} ${PTHREAD_CFLAGS}"
445 LIBS="${EXTRA_LIBS} ${LIBS} ${PTHREAD_LIBS}"
447 dnl All of the makefiles we need to generate go here...
452 util/tradcpp/Makefile
456 lib/DtXinerama/Makefile
459 lib/tt/mini_isam/Makefile
462 lib/tt/lib/api/Makefile
463 lib/tt/lib/api/dnd/Makefile
464 lib/tt/lib/api/c/Makefile
465 lib/tt/lib/tttk/Makefile
466 lib/tt/lib/db/Makefile
467 lib/tt/lib/mp/Makefile
468 lib/tt/lib/util/Makefile
470 lib/tt/bin/shell/Makefile
471 lib/tt/bin/ttauth/Makefile
472 lib/tt/bin/scripts/Makefile
473 lib/tt/bin/tttar/Makefile
474 lib/tt/bin/tt_type_comp/Makefile
475 lib/tt/bin/tttrace/Makefile
476 lib/tt/bin/dbck/Makefile
477 lib/tt/bin/ttdbserverd/Makefile
478 lib/tt/bin/ttsession/Makefile
482 lib/DtSearch/Makefile
483 lib/DtSearch/raima/Makefile
485 lib/DtWidget/Makefile
488 lib/DtHelp/il/Makefile
492 lib/DtTerm/Term/Makefile
494 lib/DtTerm/TermView/Makefile
495 lib/DtTerm/util/Makefile
496 lib/DtTerm/TermPrim/Makefile
504 programs/backdrops/Makefile
506 programs/palettes/Makefile
508 programs/icons/Makefile
510 programs/dsdm/Makefile
512 programs/dtmail/Makefile
513 programs/dtmail/dtmail/Makefile
514 programs/dtmail/MotifApp/Makefile
515 programs/dtmail/dtmailpr/Makefile
516 programs/dtmail/libDtMail/Makefile
517 programs/dtmail/libDtMail/RFC/Makefile
518 programs/dtmail/libDtMail/Common/Makefile
520 programs/dtpad/Makefile
522 programs/dtfile/Makefile
523 programs/dtfile/dtcopy/Makefile
525 programs/dtwm/Makefile
527 programs/dtlogin/Makefile
528 programs/dtlogin/config/Makefile
530 programs/dtsession/Makefile
532 programs/dthello/Makefile
534 programs/dtstyle/Makefile
536 programs/dtexec/Makefile
538 programs/dtdbcache/Makefile
540 programs/dticon/Makefile
542 programs/dtterm/Makefile
544 programs/dtcalc/Makefile
546 programs/dtaction/Makefile
548 programs/dtspcd/Makefile
550 programs/dtscreen/Makefile
552 programs/dtcm/Makefile
553 programs/dtcm/libDtCmP/Makefile
554 programs/dtcm/server/Makefile
555 programs/dtcm/dtcm/Makefile
557 programs/dtsearchpath/Makefile
558 programs/dtsearchpath/libCliSrv/Makefile
559 programs/dtsearchpath/dtsp/Makefile
560 programs/dtsearchpath/dtappg/Makefile
562 programs/dtappintegrate/Makefile
564 programs/dtprintegrate/Makefile
566 programs/dtconfig/Makefile
567 programs/dtconfig/sun/Makefile
569 programs/dtcreate/Makefile
571 programs/dtprintinfo/Makefile
573 programs/fontaliases/Makefile
574 programs/fontaliases/bdf/Makefile
575 programs/fontaliases/linux/Makefile
576 programs/fontaliases/linux/C/Makefile
577 programs/fontaliases/linux/en_US.UTF-8/Makefile
578 programs/fontaliases/sun/Makefile
579 programs/fontaliases/sun/C/Makefile
580 programs/fontaliases/netbsd/Makefile
581 programs/fontaliases/netbsd/C/Makefile
582 programs/fontaliases/openbsd/Makefile
583 programs/fontaliases/openbsd/C/Makefile
584 programs/fontaliases/freebsd/Makefile
585 programs/fontaliases/freebsd/C/Makefile
587 programs/dtdspmsg/Makefile
589 programs/dtimsstart/Makefile
591 programs/dtpdm/Makefile
593 programs/dtsr/Makefile
595 programs/dtpdmd/Makefile
597 programs/types/Makefile
599 programs/tttypes/Makefile
601 programs/util/Makefile
602 programs/util/dttypes/Makefile
604 programs/dtopen/Makefile
606 programs/localized/Makefile
607 programs/localized/util/Makefile
608 programs/localized/C/Makefile
609 programs/localized/C/app-defaults/Makefile
610 programs/localized/C/config/Makefile
611 programs/localized/C/backdrops/Makefile
612 programs/localized/C/types/Makefile
613 programs/localized/C/palettes/Makefile
614 programs/localized/C/msg/Makefile
615 programs/localized/de_DE.UTF-8/Makefile
616 programs/localized/de_DE.UTF-8/app-defaults/Makefile
617 programs/localized/de_DE.UTF-8/config/Makefile
618 programs/localized/de_DE.UTF-8/backdrops/Makefile
619 programs/localized/de_DE.UTF-8/types/Makefile
620 programs/localized/de_DE.UTF-8/palettes/Makefile
621 programs/localized/de_DE.UTF-8/msg/Makefile
622 programs/localized/fr_FR.UTF-8/Makefile
623 programs/localized/fr_FR.UTF-8/app-defaults/Makefile
624 programs/localized/fr_FR.UTF-8/config/Makefile
625 programs/localized/fr_FR.UTF-8/backdrops/Makefile
626 programs/localized/fr_FR.UTF-8/types/Makefile
627 programs/localized/fr_FR.UTF-8/palettes/Makefile
628 programs/localized/fr_FR.UTF-8/msg/Makefile
629 programs/localized/it_IT.UTF-8/Makefile
630 programs/localized/it_IT.UTF-8/app-defaults/Makefile
631 programs/localized/it_IT.UTF-8/config/Makefile
632 programs/localized/it_IT.UTF-8/backdrops/Makefile
633 programs/localized/it_IT.UTF-8/types/Makefile
634 programs/localized/it_IT.UTF-8/palettes/Makefile
635 programs/localized/it_IT.UTF-8/msg/Makefile
636 programs/localized/es_ES.UTF-8/Makefile
637 programs/localized/es_ES.UTF-8/app-defaults/Makefile
638 programs/localized/es_ES.UTF-8/config/Makefile
639 programs/localized/es_ES.UTF-8/backdrops/Makefile
640 programs/localized/es_ES.UTF-8/types/Makefile
641 programs/localized/es_ES.UTF-8/palettes/Makefile
642 programs/localized/es_ES.UTF-8/msg/Makefile
648 dnl not currently building
649 dnl programs/dthelp/Makefile
650 dnl programs/dthelp/dthelpgen/Makefile
651 dnl programs/dthelp/dthelpprint/Makefile
652 dnl programs/dthelp/parser/pass1/helptag/Makefile
653 dnl programs/dthelp/parser/pass1/Makefile
654 dnl programs/dthelp/parser/pass1/eltdef/Makefile
655 dnl programs/dthelp/parser/pass1/build/Makefile
656 dnl programs/dthelp/parser/Makefile
657 dnl programs/dthelp/parser/canon1/Makefile
658 dnl programs/dthelp/parser/pass2/Makefile
659 dnl programs/dthelp/dthelpview/Makefile