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