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