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