94d3f6c12dbe5ea3bd26a70773f6b2c53d9756be
[oweals/cde.git] / cde / configure.ac
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])
5 LT_INIT
6 AC_PREFIX_DEFAULT(/usr/dt)
7
8 AC_ENABLE_STATIC([no])
9
10 PKG_PROG_PKG_CONFIG
11
12 dnl todo: determine what version of autoconf we depend on
13 dnl AC_PREREQ()
14
15 AC_CANONICAL_HOST
16 AC_CANONICAL_BUILD
17
18 dnl global CDE versioning
19
20 CDE_VERSION_MAJOR=2
21 CDE_VERSION_MINOR=3
22 CDE_VERSION_MICRO=0
23
24 AC_SUBST(CDE_VERSION_MAJOR)
25 AC_SUBST(CDE_VERSION_MINOR)
26 AC_SUBST(CDE_VERSION_MICRO)
27
28 dnl SOURCE_DEFINES - start with CDE project default
29 SOURCE_CPP_DEFINES="-DANSICPP -DMULTIBYTE -DNLS16"
30
31 dnl CPP_COMPILER_FLAGS - CPP/C/C++ compiler flags
32 CPP_COMPILER_FLAGS=""
33
34 dnl CXX_COMPILER_FLAGS - C++ compiler flags
35 CXX_COMPILER_FLAGS=""
36
37 dnl C_COMPILER_FLAGS - C compiler flags
38 C_COMPILER_FLAGS=""
39
40
41 dnl These OS version checks are deprecated and should be replaced with
42 dnl feature checks where appropriate
43
44 build_linux=no
45 bsd=no
46 build_freebsd=no
47 build_openbsd=no
48 build_netbsd=no
49 build_solaris=no
50 build_hpux=no
51 build_aix=no
52
53 dnl For now, we need to fake the OSMAJORVERSION, OSMINORVERSION.  In Linux
54 dnl this never mattered anyway as it was always the kernel version.  We will
55 dnl choose defaults here.  These need to be removed in the code in favor
56 dnl of actual checks for functionality. So this should be considered
57 dnl temporary.
58
59 OSMAJORVERSION=4
60 OSMINORVERSION=15
61
62 dnl locations of libs/includes if not in 'standard' places like on
63 dnl linux
64 MOTIF_LIB=""
65 MOTIF_INC=""
66
67 case "${host_os}" in
68         linux*)
69                 build_linux=yes
70                 OSMAJORVERSION=4
71                 OSMINORVERSION=15
72                 SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \
73 -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE"
74                 CPP_COMPILER_FLAGS="-fno-strict-aliasing -Wno-write-strings \
75 -Wno-unused-result"
76                  ;;
77         freebsd*)
78                 build_freebsd=yes
79                 bsd=yes
80                 OSMAJORVERSION=10
81                 OSMINORVERSION=0
82                 ;;
83         openbsd*)
84                 build_openbsd=yes
85                 bsd=yes
86                 OSMAJORVERSION=6
87                 OSMINORVERSION=2
88                 ;;
89         netbsd*)
90                 build_netbsd=yes
91                 bsd=yes
92                 OSMAJORVERSION=8
93                 OSMINORVERSION=0
94                 ;;
95         solaris*|sun*)
96                 build_solaris=yes
97                 OSMAJORVERSION=5
98                 OSMINORVERSION=10
99                 ;;
100         aix*)
101                 build_aix=yes
102                 ;;
103         hpux*)
104                 build_hpux=yes
105                 ;;
106 esac
107
108 AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
109 AM_CONDITIONAL([BSD], [test "$build_bsd" = "yes"])
110 AM_CONDITIONAL([FREEBSD], [test "$build_freebsd" = "yes"])
111 AM_CONDITIONAL([OPENBSD], [test "$build_openbsd" = "yes"])
112 AM_CONDITIONAL([NETBSD], [test "$build_netbsd" = "yes"])
113 AM_CONDITIONAL([SOLARIS], [test "$build_solaris" = "yes"])
114 AM_CONDITIONAL([AIX], [test "$build_aix" = "yes"])
115 AM_CONDITIONAL([HPUX], [test "$build_hpux" = "yes"])
116
117 dnl Add osmajor/minor version to cppflags.
118 OSVERSION="-DOSMAJORVERSION=$OSMAJORVERSION -DOSMINORVERSION=$OSMINORVERSION"
119
120 dnl set CSRG_BASED define for the BSD's
121 if test "$bsd" = "yes"
122 then
123         SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DCSRG_BASED"
124         MOTIF_LIB="-L/usr/local/lib -R/usr/local/lib"
125         MOTIF_INC="-I/usr/local/include -I/usr/X11R6/include/freetype2"
126 fi
127
128 is_x86_64=no
129 is_i386=no
130 is_sparc=no
131 is_mips=no
132 is_arm=no
133 is_ppc=no
134
135 case "${host_cpu}" in
136         i[3456]86*)
137                 is_i386=yes
138                 ;;
139         x86_64* | amd64*)
140                 is_x86_64=yes
141                 ;;
142         arm*)
143                 is_arm=yes
144                 ;;
145         mips*)
146                 is_mips=yes
147                 ;;
148         sparc*)
149                 is_sparc=yes
150                 ;;
151         ppc* | powerpc*)
152                 is_ppc=yes
153                 ;;
154 esac
155
156 AM_CONDITIONAL([I386], [test "$is_i386" = yes])
157 AM_CONDITIONAL([X86_64], [test "$is_x86_64" = yes])
158 AM_CONDITIONAL([ARM], [test "$is_arm" = yes])
159 AM_CONDITIONAL([SPARC], [test "$is_sparc" = yes])
160 AM_CONDITIONAL([MIPS], [test "is_mips" = yes])
161 AM_CONDITIONAL([PPC], [test "is_ppc" = yes])
162
163 dnl our main libraries
164 dnl we use single quotes so that $top_buildir is evaluated in the makefiles,
165 dnl not here.
166 AC_SUBST(LIBTT, '$(top_builddir)/lib/tt/lib/libtt.la')
167 AC_SUBST(LIBXIN, '$(top_builddir)/lib/DtXinerama/libDtXinerama.la')
168 AC_SUBST(LIBWIDGET, '$(top_builddir)/lib/DtWidget/libDtWidget.la')
169 AC_SUBST(LIBTERM, '$(top_builddir)/lib/DtTerm/libDtTerm.la')
170 AC_SUBST(LIBSVC, '$(top_builddir)/lib/DtSvc/libDtSvc.la')
171 AC_SUBST(LIBSEARCH, '$(top_builddir)/lib/DtSearch/lbiDtSearch.la')
172 AC_SUBST(LIBPRINT, '$(top_builddir)/lib/DtPrint/libDtPrint.la')
173 AC_SUBST(LIBMRM, '$(top_builddir)/lib/DtMrm/libDtMrm.la')
174 AC_SUBST(LIBMMDB, '$(top_builddir)/lib/DtMmdb/libDtMmdb.la')
175 AC_SUBST(LIBHELP, '$(top_builddir)/lib/DtHelp/libDtHelp.la')
176 AC_SUBST(LIBCSA, '$(top_builddir)/lib/csa/libcsa.la')
177
178 AC_SUBST(DTCLIENTLIBS, '$(LIBPRINT) $(LIBHELP) $(LIBWIDGET) $(LIBSVC) \
179 $(LIBTT) $(LIBXIN)')
180
181 dnl set up come convenience replacements for global include dirs
182 AC_SUBST(DT_INCDIR, '-I$(top_builddir)/include/Dt')
183 AC_SUBST(DTI_INCDIR, '-I$(top_builddir)/include/DtI')
184 AC_SUBST(TT_INCDIR, '-I$(top_builddir)/include/Tt')
185 AC_SUBST(XM_INCDIR, '-I$(top_builddir)/include/Xm')
186 AC_SUBST(CSA_INCDIR, '-I$(top_builddir)/include/csa')
187 AC_SUBST(SPC_INCDIR, '-I$(top_builddir)/include/SPC')
188
189 AC_ARG_ENABLE(japanese, [--build-japanese    Build Japanese (default=no)])
190 AM_CONDITIONAL([JAPANESE], [test "build_japanese" = "yes"])
191
192 AC_ARG_ENABLE(german, [--build-german    Build German    (default=no)])
193 AM_CONDITIONAL([GERMAN], [test "build_german" = "yes"])
194
195 AC_ARG_ENABLE(italian, [--build-italian    Build Italian    (default=no)])
196 AM_CONDITIONAL([ITALIAN], [test "build_italian" = "yes"])
197
198 AC_ARG_ENABLE(french, [--build-french    Build French    (default=no)])
199 AM_CONDITIONAL([FRENCH], [test "build_french" = "yes"])
200
201 AC_ARG_ENABLE(spanish, --build-spanish    Build Spanish    (default=no)])
202 AM_CONDITIONAL([SPANISH], [test "build_spanish" = "yes"])
203
204 dnl hmmm...
205 RM="rm -f"
206 AC_SUBST(RM)
207 CP="cp -f"
208 AC_SUBST(CP)
209
210 dnl these should be configurable someday...
211 CDE_INSTALLATION_TOP="$ac_default_prefix"
212 CDE_LOGFILES_TOP=/var/dt
213 CDE_CONFIGURATION_TOP=/etc/dt
214 CDE_USER_TOP=.dt
215
216 AC_SUBST(CDE_INSTALLATION_TOP)
217 AC_SUBST(CDE_CONFIGURATION_TOP)
218 AC_SUBST(CDE_LOGFILES_TOP)
219 AC_SUBST(CDE_USER_TOP)
220
221 AC_PROG_CC
222 AC_PROG_CXX
223
224 AC_PROG_CPP
225
226 dnl we need a real preprocessor, not gcc -E.  We will call it GENCPP.
227 dnl We will go with BSD's tradcpp here...  This is used for
228 dnl pre-processing during building of CDE - in the way imake used to
229 dnl do.  This is not a replacement for cpp, used at runtime by
230 dnl software such as tt_type_comp.
231 AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp')
232
233 AM_PROG_LIBTOOL
234 AC_PROG_YACC
235 AM_PROG_LEX
236 AC_PROG_INSTALL
237 AC_PROG_LN_S
238 AC_PROG_MAKE_SET
239 AC_PROG_SED
240 AC_PROG_AWK
241 AC_PROG_GREP
242
243 dnl AC_PROG_AR
244 AC_PROG_RANLIB
245
246 AC_C_CONST
247 AC_C_BIGENDIAN
248 AC_C_INLINE
249 AC_C_CHAR_UNSIGNED
250 AC_C_STRINGIZE
251 AC_C_FLEXIBLE_ARRAY_MEMBER
252 AC_SYS_POSIX_TERMIOS
253
254 AX_PTHREAD
255
256 AC_PROG_CC_C99
257
258 AC_PATH_X
259 AC_PATH_XTRA
260
261 AC_FUNC_FORK
262
263 dnl programs with full paths
264
265 AC_PATH_PROG(KSH, ksh)
266 AC_PATH_PROG(XRDB, xrdb)
267 dnl we need to use cpp for some things, like tooltalk and other
268 dnl runtime uses.  So look for the system's cpp.  NOTE: this is NOT
269 dnl the CPP (gcc -E) set by AC_PROG_CPP.  At this point I don't know
270 dnl if we should even bother looking for that as we can't really use
271 dnl it.
272 AC_PATH_PROG(CPP_PROGRAM, cpp, ,
273        [/lib:/usr/bin:/usr/ccs/lib/:/usr/lib:/usr/libexec:/opt/langtools/lbin:$PATH])
274
275 dnl programs
276 AC_CHECK_PROGS(BDFTOPCF, bdftopcf)
277 AC_CHECK_PROGS(MKFONTDIR, mkfontdir)
278 AC_CHECK_PROGS(GZIP, gzip)
279 AC_CHECK_PROGS(M4, m4)
280 AC_CHECK_PROGS(RPCGEN, rpcgen)
281 AC_CHECK_PROGS(GENCAT, gencat)
282
283 dnl headers
284 AC_HEADER_STDC
285 AC_CHECK_HEADERS([locale.h])
286
287 dnl libraries
288 AC_CHECK_LIB(m, cosf)
289 AC_CHECK_LIB(crypt, crypt)
290 dnl this should be configurable, for now it is required
291 AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
292                 [SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DUSE_XINERAMA"],
293                 [AC_MSG_ERROR([libXinerama not found])], $X_LIBS)
294
295 dnl Special check for tirpc...
296 AC_CHECK_LIB(tirpc, svc_register,
297       [CFLAGS="${CFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
298        CXXFLAGS="${CXXFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
299        TIRPCLIB=-ltirpc])
300 AC_SUBST(TIRPCLIB)
301
302 dnl Setup XTOOLLIB - we do it in this specific order to avoid ordering
303 dnl issues
304 XTOOLLIB=""
305 AC_CHECK_LIB(X11, XOpenDisplay, [XTOOLLIB="-lX11"], , $X_LIBS)
306 AC_CHECK_LIB(Xau, XauReadAuth, [XTOOLLIB="-lXau ${XTOOLLIB}"], , $X_LIBS)
307 AC_CHECK_LIB(Xt, XtInitialize, [XTOOLLIB="-lXt ${XTOOLLIB}"], , $X_LIBS)
308 AC_CHECK_LIB(ICE, IceCloseConnection, [XTOOLLIB="-lICE ${XTOOLLIB}"], , $X_LIBS)
309 AC_CHECK_LIB(SM, SmcOpenConnection, [XTOOLLIB="-lSM ${XTOOLLIB}"], , $X_LIBS)
310 AC_CHECK_LIB(Xm, XmTextSetString, [XTOOLLIB="-lXm ${XTOOLLIB}"], , [$MOTIF_LIB $X_LIBS])
311 XTOOLLIB="$X_LIBS $MOTIF_LIB ${XTOOLLIB}"
312 AC_SUBST([XTOOLLIB])
313
314 dnl set CPPFLAGS, CFLAGS, and CXXFLAGS.
315 dnl The Autoconf manual says that these are user variables and
316 dnl shouldn't be modified.  It suggests that you create a special
317 dnl variable and presumably add those to your Makefile.am files.  We
318 dnl have 192 of these currently, so... The user will just have to
319 dnl deal, or modify them here directly.
320 CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS} ${OSVERSION}"
321 CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}"
322 CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}"
323 LIBS="${LIBS} ${PTHREAD_LIBS}"
324
325 dnl All of the makefiles we need to generate go here...
326 AC_CONFIG_FILES([
327 Makefile
328
329 util/Makefile
330 util/tradcpp/Makefile
331
332 lib/Makefile
333
334 lib/DtXinerama/Makefile
335
336 lib/tt/Makefile
337 lib/tt/mini_isam/Makefile
338 lib/tt/slib/Makefile
339 lib/tt/lib/Makefile
340 lib/tt/lib/api/Makefile
341 lib/tt/lib/api/dnd/Makefile
342 lib/tt/lib/api/c/Makefile
343 lib/tt/lib/tttk/Makefile
344 lib/tt/lib/db/Makefile
345 lib/tt/lib/mp/Makefile
346 lib/tt/lib/util/Makefile
347 lib/tt/bin/Makefile
348 lib/tt/bin/shell/Makefile
349 lib/tt/bin/ttauth/Makefile
350 lib/tt/bin/scripts/Makefile
351 lib/tt/bin/tttar/Makefile
352 lib/tt/bin/tt_type_comp/Makefile
353 lib/tt/bin/tttrace/Makefile
354 lib/tt/bin/dbck/Makefile
355 lib/tt/bin/ttdbserverd/Makefile
356 lib/tt/bin/ttsession/Makefile
357
358 lib/DtSvc/Makefile
359
360 lib/DtSearch/Makefile
361 lib/DtSearch/raima/Makefile
362
363 lib/DtWidget/Makefile
364
365 lib/DtHelp/Makefile
366 lib/DtHelp/il/Makefile
367
368 lib/DtPrint/Makefile
369
370 lib/DtTerm/Term/Makefile
371 lib/DtTerm/Makefile
372 lib/DtTerm/TermView/Makefile
373 lib/DtTerm/util/Makefile
374 lib/DtTerm/TermPrim/Makefile
375
376 lib/DtMrm/Makefile
377
378 lib/csa/Makefile
379
380 programs/Makefile
381
382 programs/backdrops/Makefile
383
384 programs/palettes/Makefile
385
386 programs/icons/Makefile
387
388 programs/dthelp/Makefile
389 programs/dthelp/dthelpgen/Makefile
390 programs/dthelp/dthelpprint/Makefile
391 programs/dthelp/parser/pass1/helptag/Makefile
392 programs/dthelp/parser/pass1/Makefile
393 programs/dthelp/parser/pass1/eltdef/Makefile
394 programs/dthelp/parser/pass1/build/Makefile
395 programs/dthelp/parser/Makefile
396 programs/dthelp/parser/canon1/Makefile
397 programs/dthelp/parser/pass2/Makefile
398 programs/dthelp/dthelpview/Makefile
399
400 programs/dsdm/Makefile
401
402 programs/dtmail/Makefile
403 programs/dtmail/dtmail/Makefile
404 programs/dtmail/MotifApp/Makefile
405 programs/dtmail/dtmailpr/Makefile
406 programs/dtmail/libDtMail/Makefile
407 programs/dtmail/libDtMail/RFC/Makefile
408 programs/dtmail/libDtMail/Common/Makefile
409
410 programs/dtpad/Makefile
411
412 programs/dtfile/Makefile
413 programs/dtfile/dtcopy/Makefile
414
415 programs/dtwm/Makefile
416
417 programs/dtlogin/Makefile
418 programs/dtlogin/config/Makefile
419
420 programs/dtsession/Makefile
421
422 programs/dthello/Makefile
423
424 programs/dtstyle/Makefile
425
426 programs/dtexec/Makefile
427
428 programs/dtdbcache/Makefile
429
430 programs/dticon/Makefile
431
432 programs/dtterm/Makefile
433
434 programs/dtcalc/Makefile
435
436 programs/dtaction/Makefile
437
438 programs/dtspcd/Makefile
439
440 programs/dtscreen/Makefile
441
442 programs/dtcm/Makefile
443 programs/dtcm/libDtCmP/Makefile
444 programs/dtcm/server/Makefile
445 programs/dtcm/dtcm/Makefile
446
447 programs/dtsearchpath/Makefile
448 programs/dtsearchpath/libCliSrv/Makefile
449 programs/dtsearchpath/dtsp/Makefile
450 programs/dtsearchpath/dtappg/Makefile
451
452 programs/dtappintegrate/Makefile
453
454 programs/dtprintegrate/Makefile
455
456 programs/dtconfig/Makefile
457 programs/dtconfig/sun/Makefile
458
459 programs/dtcreate/Makefile
460
461 programs/dtprintinfo/Makefile
462
463 programs/fontaliases/Makefile
464 programs/fontaliases/bdf/Makefile
465 programs/fontaliases/linux/Makefile
466 programs/fontaliases/linux/C/Makefile
467 programs/fontaliases/linux/en_US.UTF-8/Makefile
468 programs/fontaliases/sun/Makefile
469 programs/fontaliases/sun/C/Makefile
470 programs/fontaliases/netbsd/Makefile
471 programs/fontaliases/netbsd/C/Makefile
472 programs/fontaliases/openbsd/Makefile
473 programs/fontaliases/openbsd/C/Makefile
474 programs/fontaliases/freebsd/Makefile
475 programs/fontaliases/freebsd/C/Makefile
476
477 programs/dtdspmsg/Makefile
478
479 programs/dtimsstart/Makefile
480
481 programs/dtpdm/Makefile
482
483 programs/dtsr/Makefile
484
485 programs/dtpdmd/Makefile
486
487 programs/types/Makefile
488
489 programs/tttypes/Makefile
490
491 programs/util/Makefile
492 programs/util/dttypes/Makefile
493
494 programs/dtopen/Makefile
495
496 programs/localized/Makefile
497 programs/localized/util/Makefile
498 programs/localized/C/Makefile
499 programs/localized/C/app-defaults/Makefile
500 programs/localized/C/config/Makefile
501 programs/localized/C/backdrops/Makefile
502 programs/localized/C/types/Makefile
503 programs/localized/C/palettes/Makefile
504 programs/localized/C/msg/Makefile
505 programs/localized/de_DE.UTF-8/Makefile
506 programs/localized/de_DE.UTF-8/app-defaults/Makefile
507 programs/localized/de_DE.UTF-8/config/Makefile
508 programs/localized/de_DE.UTF-8/backdrops/Makefile
509 programs/localized/de_DE.UTF-8/types/Makefile
510 programs/localized/de_DE.UTF-8/palettes/Makefile
511 programs/localized/de_DE.UTF-8/msg/Makefile
512 programs/localized/fr_FR.UTF-8/Makefile
513 programs/localized/fr_FR.UTF-8/app-defaults/Makefile
514 programs/localized/fr_FR.UTF-8/config/Makefile
515 programs/localized/fr_FR.UTF-8/backdrops/Makefile
516 programs/localized/fr_FR.UTF-8/types/Makefile
517 programs/localized/fr_FR.UTF-8/palettes/Makefile
518 programs/localized/fr_FR.UTF-8/msg/Makefile
519 programs/localized/it_IT.UTF-8/Makefile
520 programs/localized/it_IT.UTF-8/app-defaults/Makefile
521 programs/localized/it_IT.UTF-8/config/Makefile
522 programs/localized/it_IT.UTF-8/backdrops/Makefile
523 programs/localized/it_IT.UTF-8/types/Makefile
524 programs/localized/it_IT.UTF-8/palettes/Makefile
525 programs/localized/it_IT.UTF-8/msg/Makefile
526 programs/localized/es_ES.UTF-8/Makefile
527 programs/localized/es_ES.UTF-8/app-defaults/Makefile
528 programs/localized/es_ES.UTF-8/config/Makefile
529 programs/localized/es_ES.UTF-8/backdrops/Makefile
530 programs/localized/es_ES.UTF-8/types/Makefile
531 programs/localized/es_ES.UTF-8/palettes/Makefile
532 programs/localized/es_ES.UTF-8/msg/Makefile
533
534 ])
535
536 AC_OUTPUT
537