Merge remote-tracking branch 'origin/master' into for-steve
[sxemacs] / configure.ac
1 dnl SXEmacs config script for autoconf >=2.60
2 dnl -------------------------------------------------------------------------
3 dnl Overrides of standard autoconf macros.
4
5 m4_include([sxemacs_version.m4])
6
7 dnl -------------------------------------------------------------------------
8 dnl Autoconf startup.
9 dnl -------------------------------------------------------------------------
10
11 AC_PREREQ([2.62])
12 AC_INIT([SXEmacs], [SXEM4CS_VERSION], [http://issues.sxemacs.org/])
13 AC_CONFIG_HEADER([src/config.h])
14 AC_CONFIG_SRCDIR([src/lisp.h])
15 AC_CONFIG_AUX_DIR([.])
16 AC_CONFIG_MACRO_DIR([m4])
17
18 dnl -------------------------------------------------------------------------
19 dnl Local copyright notices.
20 dnl -------------------------------------------------------------------------
21
22 AC_COPYRIGHT(
23 [#### Configuration script for SXEmacs.  Largely divergent from FSF.
24 #### Guess values for system-dependent variables and create Makefiles.
25 #### Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
26 #### Copyright (C) 1993-1995 Board of Trustees, University of Illinois.
27 #### Copyright (C) 1996, 1997 Sun Microsystems, Inc.
28 #### Copyright (C) 1995, 1996, 2002, 2003, 2004 Ben Wing.
29 #### Copyright (C) 2000, 2001 Martin Buchholz.
30 #### Copyright (C) 1998, 1999 J. Kean Johnston.
31 #### Copyright (C) 2005 Malcolm Purvis.
32 #### Copyright (C) 2005, 2006, 2007 Steve Youngs.
33 #### Copyright (C) 2006, 2007, 2008 Sebastian Freundt.
34 #### Copyright (C) 2007, 2010, 2011, 2012 Nelson Ferreira
35
36 ### Don't edit this script!
37 ### This script was automatically generated by the `autoconf' program
38 ### from the file `./configure.ac'.
39 ### To rebuild it, execute the command
40 ###     autoconf
41 ### in the this directory.
42
43 ### This file is part of SXEmacs.
44
45 ### SXEmacs is free software: you can redistribute it and/or modify
46 ### it under the terms of the GNU General Public License as published by
47 ### the Free Software Foundation, either version 3 of the License, or
48 ### (at your option) any later version.
49
50 ### SXEmacs is distributed in the hope that it will be useful,
51 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
52 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
53 ### GNU General Public License for more details.
54
55 ### You should have received a copy of the GNU General Public License
56 ### along with this program.  If not, see <http://www.gnu.org/licenses/>.
57
58 ### Parts of SXEmacs are also distributed under a BSD-like licence.
59 ### Check file headers for more information.
60
61 ### For usage, run `./configure --help'
62 ### For more detailed information on building and installing SXEmacs,
63 ### read the file `INSTALL'.
64 ###
65 ### If configure succeeds, it leaves its status in config.status.
66 ### A log of configuration tests can be found in config.log.
67 ### If configure fails after disturbing the status quo,
68 ###     config.status is removed.
69 ])
70
71 AC_REVISION([SXEM4CS_GIT_VERSION])
72
73
74 dnl Build Options
75 dnl =============
76 OG_OPTION_GROUP(Build Options)
77
78 OG_ARG_WITH([prefix],
79         AS_HELP_STRING([--with-prefix@<:@=ARG@:>@],
80                 [Whether to compile the value of --prefix into the executable.]),
81         [yes], [YES (DO compile prefix into the executable)])
82
83 OG_ARG_WITH([sitemoduledir],
84         AS_HELP_STRING([--with-sitemoduledir=DIR],
85                 [Directory for loadable modules that are not part of
86                 the SXEmacs core distribution (3rd party emodules).]),
87         [none], [$prefix/lib/sxemacs/$build/site-modules], [og_any],
88         [AC_DEFINE([SITEMODULEDIR_USER_DEFINED], [1],
89                 [sitemoduledir has been specified on the configure line.])],
90         [with_sitemoduledir='${libdir}/${PROGNAME}/${configuration}/site-modules'])
91
92 OG_ARG_WITH([site-includes],
93         AS_HELP_STRING([--with-site-includes=PATH],
94                 [Colon separated list of _extra_ include directories
95                 to search for headers.]),
96         [none], [None], [og_any])
97
98 OG_ARG_WITH([site-libraries],
99         AS_HELP_STRING([--with-site-libraries=PATH],
100                 [Colon separated list of extra lib directories to
101                 search for libraries. (Default: None)]),
102         [none], [None], [og_any])
103
104 OG_ARG_WITH([site-prefixes],
105         AS_HELP_STRING([--with-site-prefixes=PATH],
106                 [Colon separated list of extra prefix directories to
107                 search for headers and libraries.  Sometimes this can
108                 be used instead of specifying both
109                 --with-site-includes and
110                 --with-site-libraries.]),
111         [none], [None], [og_any])
112
113 OG_ARG_WITH([lispdir],
114         AS_HELP_STRING([--with-lispdir=DIR],
115                 [Where to install core lisp files.]),
116         [none], [$prefix/lib/sxemacs-$version/lisp], [og_any],
117         [AC_DEFINE([LISPDIR_USER_DEFINED], [1],
118                 [lispdir has been specified on the configure line.])],
119         [with_lispdir='${datadir}/${instvardir}/lisp'])
120
121 OG_ARG_WITH([archlibdir],
122         AS_HELP_STRING([--with-archlibdir=DIR],
123                 [Directory for arch-dependent files.]),
124         [none], [$prefix/lib/sxemacs-$version/$build], [og_any],
125         [AC_DEFINE([ARCHLIBDIR_USER_DEFINED], [1],
126                 [archlibdir has been specified on the configure line.])],
127         [with_archlibdir='${libdir}/${instvardir}/${configuration}'])
128
129 OG_ARG_WITH([moduledir],
130         AS_HELP_STRING([--with-moduledir=DIR],
131                 [Directory for loadable modules.]),
132         [none], [$prefix/lib/sxemacs-$version/$build/modules], [og_any],
133         [AC_DEFINE([MODULEDIR_USER_DEFINED], [1],
134                 [moduledir has been specified on the configure line.])],
135         [with_moduledir='${libdir}/${instvardir}/${configuration}/modules'])
136
137 OG_ARG_WITH([etcdir],
138         AS_HELP_STRING([--with-etcdir=DIR],
139                 []),
140         [none], [$prefix/lib/sxemacs-$version/etc], [og_any],
141         [AC_DEFINE([ETCDIR_USER_DEFINED], [1],
142                 [etcdir has been specified on the configure line.])],
143         [with_etcdir='${datadir}/${instvardir}/etc'])
144
145 OG_ARG_WITH([infopath],
146         AS_HELP_STRING([--with-infopath=PATH],
147                 [Colon separated list of directories to use as
148                 the info search path. This is not normally needed.]),
149         [none], [None], [og_any],
150         [AC_DEFINE([INFOPATH_USER_DEFINED], [1],
151                 [inforpath has been specified on the configure line.])], [])
152
153 OG_ARG_WITH([docdir],
154         AS_HELP_STRING([--with-docdir=DIR],
155                 [Where it store certain doc files (not info or man).]),
156         [none], [$prefix/lib/sxemacs-$version/$build], [og_any],
157         [AC_DEFINE([DOCDIR_USER_DEFINED], [1],
158                 [docdir has been specified on the configure line.])],
159         [with_docdir='${archlibdir}'])
160
161 OG_ARG_WITH([site-runtime-libraries],
162         AS_HELP_STRING([--with-site-runtime-libraries=PATH],
163                 [Colon separated list of directories to search for
164                 libraries at run time.  This isn't normally needed.]),
165         [none], [None], [og_any])
166
167 OG_ARG_WITH([module-path],
168         AS_HELP_STRING([--with-module-path=PATH],
169                 [Search path to the emodules directories.
170                 A colon separated list of directories. Normally, there is
171                 no need to set this.]),
172         [none], [None], [og_any],
173         [AC_DEFINE([MODULE_PATH_USER_DEFINED], [1],
174                 [module-path has been specified on the configure line.])],
175         [])
176
177 OG_ARG_WITH([package-prefix],
178         AS_HELP_STRING([--with-package-prefix=PATH],
179                 [What to use as a prefix to the system-wide package
180                 directories.  It doesn't affect the package directories
181                 under ~/.sxemacs, and is totally ignored if
182                 --with-package-path is set.
183                 Normally, you would not need to set this.]),
184         [none], [None], [og_any],
185         [AC_DEFINE([PACKAGE_PREFIX_USER_DEFINED], [1],
186                 [package-prefix has been specified on the configure line.])],
187         [])
188
189 OG_ARG_WITH([package-path],
190         AS_HELP_STRING([--with-package-path=PATH],
191                 [Search path to the package directories.
192                 This path is made up of 3 separate "path elements",
193                 each element is a colon separated list of directories,
194                 with the boundary between elements being a double
195                 colon.  The 3 path elements are for "early", "late",
196                 and "last" package directories.  If only a single
197                 element is specified it is "late".  Example:
198                 early1:early2::late1:late2::last1:last2.  Setting this
199                 overrides --with-package-prefix.  Normally, there is
200                 no need to set this.]),
201         [none], [None], [og_any],
202         [AC_DEFINE([PACKAGE_PATH_USER_DEFINED], [1],
203                 [package-path has been specified on the configure line.])],
204         [])
205
206 dnl stupid option, innit?
207 OG_ARG_WITH([quick-build],
208         AS_HELP_STRING([--with-quick-build],
209                 [Speed up the build cycle by leaving out steps where
210                 SXEmacs will still work (more or less) without them.
211                 Potentially dangerous if you don't know what you're
212                 doing. This (1) doesn't garbage-collect after loading
213                 each file during dumping, (2) doesn't automatically
214                 rebuild the DOC file (remove it by hand to get it
215                 rebuilt), (3) Removes config.h lisp.h and associated
216                 files from the dependency lists so changes to these
217                 files don't automatically cause all .c files
218                 to be rebuilt.]),
219         [no], [No], [])
220
221 OG_ARG_WITH([compiler],
222         AS_HELP_STRING([--with-compiler=COMPILER],
223                 [Do not use me! Use CC=<your-compiler> instead!
224                 C compiler to use.
225                 Note: SXEmacs _CANNOT_ be built with a C++ compiler.]),
226         [none], [None], [og_any], [
227                 OG_WARN_OBSOLETE_OPTION([--with-compiler], [CC=<your-cc>])])
228
229 OG_ARG_WITH([cflags],
230         AS_HELP_STRING([--with-cflags],
231                 [Do not use me! Use CFLAGS=<your flags> instead!
232                 Compiler flags (such as -O); setting this overrides
233                 all default compiler flags except those that control
234                 warnings. Most people wouldn't need to set
235                 this.]),
236         [none], [None], [og_any], [
237                 OG_WARN_OBSOLETE_OPTION([--with-cflags], [CFLAGS=<your flags>])])
238
239 OG_ARG_WITH([cflags-warning],
240         AS_HELP_STRING([--with-cflags-warning],
241                 [Do not use me! I will disappear soon!]),
242         [none], [None], [og_any])
243
244 OG_ARG_WITH([cpp],
245         AS_HELP_STRING([--with-cpp],
246                 [Do not use me! Use CPP=<your-cpp> instead!]),
247         [none], [None], [og_any], [
248                 OG_WARN_OBSOLETE_OPTION([--with-cpp], [CPP=<your-cpp>])
249                 CPP="$with_cpp"])
250
251 OG_ARG_WITH([cppflags],
252         AS_HELP_STRING([--with-cppflags],
253                 [Do not use me! Use CPPFLAGS=<your flags> instead!]),
254         [none], [None], [og_any], [
255                 OG_WARN_OBSOLETE_OPTION([--with-cppflags], [CPPFLAGS=<your flags>])
256                 CPPFLAGS="$with_cppflags"])
257
258 OG_ARG_WITH([libs],
259         AS_HELP_STRING([--with-libs],
260                 [Do not use me! Use LIBS=<your libs> instead!]),
261         [none], [None], [og_any], [
262                 OG_WARN_OBSOLETE_OPTION([--with-libs], [LIBS=<your libs>])
263                 LIBS="$with_libs"])
264
265 OG_ARG_WITH([ldflags],
266         AS_HELP_STRING([--with-ldflags],
267                 [Do not use me! Use LDFLAGS=<your flags> instead!]),
268         [none], [None], [og_any], [
269                 OG_WARN_OBSOLETE_OPTION([--with-ldflags], [LDFLAGS=<your flags>])
270                 LDFLAGS="$with_ldflags"])
271
272 OG_ARG_WITH([ridiculously-aggressive-optimisations],
273         AS_HELP_STRING([--with-ridiculously-aggressive-optimisations],
274                 [Whether to try all possible optimisations]),
275         [no], [No])
276
277 OG_ARG_WITH([maximum-warning-output],
278         AS_HELP_STRING([--with-maximum-warning-output],
279                 [Whether to output as many warnings as possible]),
280         [no], [No])
281
282
283 dnl Internal Options
284 dnl ================
285 OG_OPTION_GROUP(Internal Options)
286
287 OG_ARG_WITH([dynamic],
288         AS_HELP_STRING([--with-dynamic],
289                 [Link dynamically if supported by system.
290                 'NO' forces static linking.]),
291         [auto], [Autodetect])
292
293 OG_ARG_WITH([rel-alloc],
294         AS_HELP_STRING([--with-rel-alloc],
295                 [Relocating allocator for buffers.]),
296         [default], [Autodetect])
297
298 OG_ARG_WITH([dlmalloc],
299         AS_HELP_STRING([--with-dlmalloc],
300                 [Use Doug Lea's malloc.]),
301         [default], [Autodetect])
302
303 OG_ARG_WITH([debug-malloc],
304         AS_HELP_STRING([--with-debug-malloc],
305                 [Use a debugging malloc.]),
306         [no], [NO])
307
308 OG_ARG_WITH([system-malloc],
309         AS_HELP_STRING([--with-system-malloc],
310                 [Use a system malloc instead of GNU.]),
311         [default], [YES if using quantify or purify; NO otherwise])
312
313 OG_ARG_WITH([regex-malloc],
314         AS_HELP_STRING([--with-regex-malloc],
315                 [Use malloc for regex failure stack.]),
316         [yes], [YES])
317
318 OG_ARG_WITH([ffi],
319         AS_HELP_STRING([--with-ffi],
320                 [Compile in experimental support for
321                 Foreign Function Interface.]),
322         [yes], [YES])
323
324 OG_ARG_WITH([module-support],
325         AS_HELP_STRING([--with-module-support],
326                 [Compile in experimental support for dynamically
327                 loaded libraries (Dynamic Shared Objects).]),
328         [yes], [YES if shared libraries are supported])
329
330 OG_MULTIARG_WITH([modules], [dnl
331         AS_HELP_STRING([--with-modules], [
332                 Which modules to compile and install.])],
333         [all], [all], [dnl
334         OG_MULTIARG_ITEM([ase], [ase], [algebraic structures])
335         OG_MULTIARG_ITEM([cl], [cl], [fast Common Lisp implementation])
336 ])
337
338 OG_MULTIARG_WITH([static-modules], [dnl
339         AS_HELP_STRING([--with-static-modules], [
340                 Which modules to compile as archives to link their
341                 functionality statically into the SXEmacs binary.])
342         AS_HELP_STRING([], [
343                 You should regard this as a proof of concept.])],
344         [none], [NONE], [dnl
345         OG_MULTIARG_ITEM([ase], [ase], [algebraic structures])
346         OG_MULTIARG_ITEM([cl], [cl], [fast Common Lisp implementation])
347 ])
348
349 OG_MULTIARG_WITH([ent], [dnl
350         AS_HELP_STRING([--with-ent], [
351                 Compile in support for enhanced number types,
352                 using internal and external libraries.])],
353         [none int fpfloat indef gmp], [int fpfloat indef gmp], [dnl
354         OG_MULTIARG_ITEM([int], [int], [native integer arithmetics])
355         OG_MULTIARG_ITEM([fpfloat], [fpfloat], [native fixed precision floats])
356         OG_MULTIARG_ITEM([indef], [indef], [native abstract indefinites])
357         OG_MULTIARG_ITEM([gmp], [GMP], [GNU multiprecision library])
358         OG_MULTIARG_ITEM([mpfr], [MPFR], [Multiprecision Floats with correct Rounding])
359         OG_MULTIARG_ITEM([mpc], [MPC], [Multiprecision Complex numbers (C/R)])
360         OG_MULTIARG_ITEM([pseug], [pseudoG], [native Gaussian Numbers (Z+Z)])
361         OG_MULTIARG_ITEM([pseuc], [pseudoC], [native Complex Numbers (C/R)])
362         OG_MULTIARG_ITEM([quatern], [Quaternions], [native Quaternions (Z+Z+Z+Z)])
363         OG_MULTIARG_ITEM([ecm], [ECM], [factorisations per Elliptic Curve Method])
364         OG_MULTIARG_MUTEX([mpz], [Arbitrary precision integers], [gmp mp])
365         OG_MULTIARG_MUTEX([complex], [Complex numbers as in C/R], [mpc pseuc])
366 ])
367
368 OG_MULTIARG_WITH([ase], [dnl
369         AS_HELP_STRING([--with-ase], [
370                 Compile in support for algebraic structures based on ENT,
371                 using internal and external libraries.])],
372         [none], [none], [dnl
373         OG_MULTIARG_ITEM([cart], [cartesian], [Cartesian Products of ENT and ASE objects])
374         OG_MULTIARG_ITEM([dig], [digraph], [Directed 2-ary Graphs with Colours])
375         OG_MULTIARG_ITEM([intv], [interval], [Intervals of comparable or normed ENT and ASE objects])
376         OG_MULTIARG_ITEM([metric], [metric], [Metric Spaces])
377         OG_MULTIARG_ITEM([nbhood], [neighbourhood], [Neighbourhoods of comparable or normed ENT and ASE objects])
378         OG_MULTIARG_ITEM([perm], [permutation], [Permutations])
379         OG_MULTIARG_ITEM([resclass], [resclass], [Residue Class Rings and Classes])
380 ])
381
382 OG_ARG_WITH([compre],
383         AS_HELP_STRING([--with-compre],[
384                 Provide exhaustive caching of compiled regexps. This will
385                 mean that frequently used regexps will be faster to use
386                 since the compile step will not be needed after first use.]),
387         [yes], [By default do cache compiled regexps.])
388
389 OG_MULTIARG_WITH([experimental-features], [dnl
390         AS_HELP_STRING([--with-experimental-features], [
391                 Activate experimental code, that is code which is
392                 considered useful but whose effects in conjunction with
393                 the variety of elisp projects cannot be foreseen.])
394         AS_HELP_STRING([], [
395                 During the beta phase of SXEmacs all experimental code
396                 will be unconditionally enabled.  However, if you plan
397                 to use this SXEmacs in a production environment you
398                 can switch off some portions.])],
399         [all nobdwgc], [ALL but bdwgc], [dnl
400         OG_MULTIARG_ITEM([bdwgc], [bdwgc], [the Boehm-Demers-Weiser collector])
401         OG_MULTIARG_ITEM([asyneq], [asyneq], [asynchronous event queues])
402 ])
403         dnl stop that pom stuff
404         dnl OG_MULTIARG_ITEM([pom], [pom], [thread-safe objects])
405
406 OG_ARG_WITH([event-driver],
407         AS_HELP_STRING([--with-event-driver], [
408                 Which event routines to use.
409                 Events control the way how external `sources' are
410                 incorporated into SXEmacs.  Sources hereby are user inputs,
411                 such as key strokes, mouse moves, pedalling, slapping the
412                 monitor, etc.; but there are manifold further sources, such as
413                 process signals, data on a socket, focussing an X window,
414                 lapsing a timeout, and so forth.])
415 AS_HELP_STRING([], [
416                 An event driver can cope with all (or most) of these in a
417                 uniform and abstract way.  SXEmacs can either be driven
418                 using its built-in event handlers, or using one of the
419                 external systems.]),
420         [auto], [Autodetect], [auto built-in libevent liboop glib])
421
422
423 dnl Debugging Options
424 dnl ================
425 OG_OPTION_GROUP(Debugging Options)
426
427 OG_ARG_WITH([debug],
428         AS_HELP_STRING([--with-debug],
429                 [Compile with extra debugging code.
430                 This will turn on: --with-assertions
431                 and --with-memory-usage-stats.]),
432         [yes], [YES for beta; NO for release])
433
434 OG_ARG_WITH([memory-usage-stats],
435         AS_HELP_STRING([--with-memory-usage-stats],
436                 [Compile with support for statistics about memory usage at runtime.]),
437         [yes], [YES for beta])
438
439 OG_MULTIARG_WITH([error-checking], [dnl
440         AS_HELP_STRING([--with-error-checking=TYPE], [
441                 Compile with internal error-checking added.])
442         AS_HELP_STRING([], [
443                 WARNING: Causes noticeable loss of speed!])],
444         [all], [ALL for beta; NONE otherwise], [dnl
445         OG_MULTIARG_ITEM([extents], [extents], [checks on extents])
446         OG_MULTIARG_ITEM([types], [types], [checks on types])
447         OG_MULTIARG_ITEM([gc], [gc], [checks on garbage collection])
448         OG_MULTIARG_ITEM([malloc], [malloc], [checks on memory allocation])
449         OG_MULTIARG_ITEM([byte_code], [byte_code], [checks on byte compiled code])
450         OG_MULTIARG_ITEM([bufpos], [bufpos], [checks on buffer position])
451         OG_MULTIARG_ITEM([glyphs], [glyphs], [checks on glyph data])
452         OG_MULTIARG_ITEM([stack], [stack], [checks on stack barriers])
453         OG_MULTIARG_ITEM([malldbg], [malldbg], [malloc debugging code])
454 ])
455
456 OG_ARG_WITH([purify],
457         AS_HELP_STRING([--with-purify],
458                 [Add support for memory debugging using Purify.]),
459         [no], [NO])
460
461 OG_ARG_WITH([quantify],
462         AS_HELP_STRING([--with-quantify],
463                 [Add support for performance debugging using Quantify.]),
464         [no], [NO])
465
466
467 dnl Window System Features
468 dnl ======================
469 OG_OPTION_GROUP(Window System Features)
470
471 OG_ARG_WITH([toolbars],
472         AS_HELP_STRING([--with-toolbars],
473                 [Compile in toolbar support.]),
474         [yes], [YES])
475
476 OG_ARG_WITH([external-widget],
477         AS_HELP_STRING([--with-external-widget],
478                 [Enable the "external widget" interface,
479                 which allows a SXEmacs frame to appear as a widget in
480                 another application.
481                 To date, we haven't heard of anyone who has actually done this.
482                 Consider this EXPERIMENTAL.]),
483         [no], [NO])
484
485 OG_ARG_WITH([menubars],
486         AS_HELP_STRING([--with-menubars=TYPE],
487                 [Type of menubars to use.  The Lucid menubars emulate
488                 Motif (mostly) but are faster.]),
489         [lucid], [Lucid], [lucid no])
490
491 OG_ARG_WITH([scrollbars],
492         AS_HELP_STRING([--with-scrollbars=TYPE],
493                 [Type of scrollbars to use.
494                 *WARNING*  The Motif scrollbars are currently broken.]),
495         [lucid], [Lucid], [lucid motif athena no])
496
497 OG_ARG_WITH([dialogs],
498         AS_HELP_STRING([--with-dialogs=TYPE],
499                 [Type of dialog boxes to use.  Athena dialogs will
500                  be used if Athena can be found.]),
501         [athena], [], [athena motif no])
502
503 OG_ARG_WITH([widgets],
504         AS_HELP_STRING([--with-widgets=TYPE],
505                 [Type of native widgets to use.  Athena widgets will
506                 be used if Athena can be found.]),
507         [athena], [], [athena motif no])
508
509 OG_ARG_WITH([athena],
510         AS_HELP_STRING([--with-athena=TYPE],
511                 [Type of Athena widgets to use.]),
512         [auto], [Autodetect], [auto xaw 3d next 95 xpm no])
513
514 OG_ARG_WITH([xim],
515         AS_HELP_STRING([--with-xim],
516                 [Type of Mule input method to use.]),
517         [auto], [Autodetect], [yes no xlib motif])
518
519 OG_ARG_WITH([wmcommand],
520         AS_HELP_STRING([--with-wmcommand],
521                 [Compile with realized leader window which will
522                 keep the WM_COMMAND property.]),
523         [yes], [YES])
524
525 OG_ARG_WITH([xmu],
526         AS_HELP_STRING([--with-xmu],
527                 [For those unfortunates whose vendors don't ship Xmu.]),
528         [auto], [Autodetect])
529
530 OG_ARG_WITH([xfs],
531         AS_HELP_STRING([--with-xfs],
532                 [Compile with XFontSet support for internationalized
533                 menubar.  Incompatible with `--with-xim=motif'.
534                 `--with-menubars=lucid' (the default) is desirable.]),
535         [no], [NO])
536
537 dnl TTY Options
538 dnl ================
539 OG_OPTION_GROUP(TTY options)
540
541 OG_ARG_WITH([tty],
542         AS_HELP_STRING([--with-tty],
543                 [Add support for ttys.]),
544         [auto], [Autodetect])
545
546 OG_ARG_WITH([ncurses],
547         AS_HELP_STRING([--with-ncurses],
548                 [Use the ncurses library for tty support.]),
549         [auto], [Autodetect])
550
551 OG_ARG_WITH([curses],
552         AS_HELP_STRING([--with-curses],
553                 [Use the curses library for tty support.]),
554         [auto], [Autodetect])
555
556 OG_ARG_WITH([terminfo],
557         AS_HELP_STRING([--with-terminfo],
558                 [Use the terminfo library for tty support.]),
559         [auto], [Autodetect])
560
561 OG_ARG_WITH([termlib],
562         AS_HELP_STRING([--with-termlib],
563                 [Use the termlib library for tty support.]),
564         [auto], [Autodetect])
565
566 OG_ARG_WITH([termcap],
567         AS_HELP_STRING([--with-termcap],
568                 [Use the termcap library for tty support.]),
569         [auto], [Autodetect])
570
571
572 OG_ARG_WITH([gpm],
573         AS_HELP_STRING([--with-gpm],
574                 [Compile in GPM mouse support for ttys.]),
575         [auto], [Autodetect])
576
577
578 dnl Database Options
579 dnl ================
580 OG_OPTION_GROUP(Database options)
581
582 OG_MULTIARG_WITH([database], [dnl
583         AS_HELP_STRING([--with-database=TYPE],
584                 [Compile with database support.])],
585         [auto], [Autodetect], [dnl
586         OG_MULTIARG_ITEM([berkdb], [berkdb], [Berkeley DB support])
587         OG_MULTIARG_ITEM([dbm], [dbm], [DBM database support])
588         OG_MULTIARG_ITEM([gdbm], [gdbm], [GNU DBM support])
589 ])
590
591 OG_ARG_WITH([ldap],
592         AS_HELP_STRING([--with-ldap],
593                 [Compile with support for the LDAP protocol.]),
594         [no], [NO])
595
596 OG_ARG_WITH([postgresql],
597         AS_HELP_STRING([--with-postgresql],
598                 [Compile with support for the PostgreSQL RDBMS.]),
599         [yes], [Autodetect])
600
601
602 dnl Multimedia Options
603 dnl ==================
604 OG_OPTION_GROUP(Multimedia options)
605
606 OG_MULTIARG_WITH([image], [dnl
607         AS_HELP_STRING([--with-image=TYPE],
608                 [Compile with image support.])],
609         [auto], [Autodetect all image support], [dnl
610         OG_MULTIARG_ITEM([gif], [GIF], [GIF image format])
611         OG_MULTIARG_ITEM([xpm], [XPM], [X PixMap image format])
612         OG_MULTIARG_ITEM([png], [PNG], [Portable Network Graphic format])
613         OG_MULTIARG_ITEM([jpeg], [JPEG], [jpeg image format])
614         OG_MULTIARG_ITEM([tiff], [TIFF], [TIFF image format])
615         OG_MULTIARG_ITEM([xface], [xface], [base64 encoded xbm])
616 ])
617
618 OG_MULTIARG_WITH([sound], [dnl
619         AS_HELP_STRING([--with-sound=TYPE],
620                 [Compile with sound support.])],
621         [auto], [Autodetect all sound support (except Pulse)], [dnl
622         OG_MULTIARG_ITEM([alsa], [ALSA], [kernel-based linux sound standard])
623         OG_MULTIARG_ITEM([ao], [ao], [generic audio output layer])
624         OG_MULTIARG_ITEM([esd], [ESD], [Enlightenment Sound Daemon])
625         OG_MULTIARG_ITEM([jack], [Jack], [a low-latency audio server])
626         OG_MULTIARG_ITEM([nas], [NAS], [Network Audio System])
627         OG_MULTIARG_ITEM([oss], [OSS], [Open Sound System])
628 ])
629
630 OG_ARG_WITH([pulseaudio],
631         AS_HELP_STRING([--with-pulseaudio],
632                 [Compile with support for the PulseAudio audio server.
633                 This has been turned off by default because of too many
634                 bugs in recent versions of PA.  Use at your own risk,
635                 YMMV, and all that.]),
636         [no], [NO])
637
638 OG_MULTIARG_WITH([media], [dnl
639         AS_HELP_STRING([--with-media=TYPE],
640                 [Compile with media stream support.])],
641         [auto], [Autodetect all media stream support libraries], [dnl
642         OG_MULTIARG_ITEM([ffmpeg], [FFmpeg], [media streams handled by ffmpeg])
643         OG_MULTIARG_ITEM([internal], [internal], [media streams handled internally])
644         OG_MULTIARG_ITEM([mad], [Mad], [media streams handled by mad])
645         OG_MULTIARG_ITEM([sndfile], [sndfile], [media streams handled by sndfile])
646         OG_MULTIARG_ITEM([sox], [SoX], [media streams handled by sox])
647         OG_MULTIARG_ITEM([magic], [magic], [file/libmagic support])
648 ])
649
650
651 dnl Cryptography Options
652 dnl ====================
653 OG_OPTION_GROUP(Cryptography options)
654
655 OG_ARG_WITH([openssl],
656         AS_HELP_STRING([--with-openssl],
657                 [Compile in experimental support for
658                 OpenSSL libcrypto and libssl.]),
659         [yes], [YES])
660
661 OG_ARG_WITH([gnutls],
662         AS_HELP_STRING([--with-gnutls],
663                 [Compile in experimental support for
664                 GnuTLS transport security.]),
665         [no], [NO])
666
667
668 dnl Networking Options
669 dnl ==================
670 OG_OPTION_GROUP(Networking options)
671
672 OG_ARG_WITH([dnet],
673         AS_HELP_STRING([--with-dnet],
674                 [Compile with support for DECnet.]),
675         [no], [NO])
676
677 OG_ARG_WITH([socks],
678         AS_HELP_STRING([--with-socks],
679                 [Compile with support for SOCKS (an Internet proxy).]),
680         [auto], [Autodetect])
681
682 OG_ARG_WITH([ipv6-cname],
683         AS_HELP_STRING([--with-ipv6-cname],
684                 [Try IPv6 information first when canonicalizing host names.
685                 This option has no effect unless system supports
686                 getaddrinfo(3) and getnameinfo(3).]),
687         [no], [NO])
688
689 OG_ARG_WITH([pop],
690         AS_HELP_STRING([--with-pop],
691                 [Support POP for mail retrieval.]),
692         [no], [NO])
693
694 OG_ARG_WITH([kerberos],
695         AS_HELP_STRING([--with-kerberos],
696                 [Support Kerberos-authenticated POP.]),
697         [no], [NO])
698
699 OG_ARG_WITH([hesiod],
700         AS_HELP_STRING([--with-hesiod],
701                 [Support Hesiod to get the POP server host.]),
702         [no], [NO])
703
704
705 dnl File-related Options
706 dnl ====================
707 OG_OPTION_GROUP(File-related options)
708
709 OG_ARG_WITH([clash-detection],
710         AS_HELP_STRING([--with-clash-detection],
711                 [Use lock files to detect multiple edits
712                 of the same file.]),
713         [no], [NO])
714
715 OG_ARG_WITH([mail-locking],
716         AS_HELP_STRING([--with-mail-locking=TYPE],
717                 [Specify the locking to be used by movemail to prevent
718                 concurrent updates of mail spool files. Valid types
719                 are `lockf'  `flock'  `file'  `locking'  `pop' or `mmdf'.]),
720         [auto], [Autodetect], [lockf flock file locking mmdf pop no])
721
722
723 dnl Internationalisation Options
724 dnl ============================
725 OG_OPTION_GROUP(Internationalisation options)
726
727 OG_ARG_WITH([mule],
728         AS_HELP_STRING([--with-mule],
729                 [Compile with Mule (MUlti-Lingual Emacs) support
730                 needed to support non-Latin-1 (including Asian)
731                 languages.]),
732         [yes], [YES])
733
734 OG_ARG_WITH([canna],
735         AS_HELP_STRING([--with-canna],
736                 [Compile with support for Canna (a Japanese input method
737                 used in conjunction with Mule support).]),
738         [auto], [Autodetect when Mule is enabled])
739
740 OG_ARG_WITH([wnn],
741         AS_HELP_STRING([--with-wnn],
742                 [Compile with support for Wnn (a multi-language input
743                 method used in conjunction with Mule support).]),
744         [auto], [Autodetect when Mule is enabled])
745
746 OG_ARG_WITH([wnn6],
747         AS_HELP_STRING([--with-wnn6],
748                 [Compile with support for the commercial package Wnn6.]),
749         [auto], [Autodetect when Mule is enabled])
750
751
752
753 dnl dnl Other Options
754 dnl dnl =============
755 dnl OG_OPTION_GROUP(Other options)
756 dnl
757
758 ## -------------------------------------------------------------------------
759 ## Check for users who regularly forget about running autoconf
760 ## -------------------------------------------------------------------------
761 AS_IF([test -f "$0.ac" -a "$0.ac" -nt "$0"],
762    AC_MSG_ERROR([What are you doing? RUN autoreconf NOW!!!]))
763
764 #
765 # Turn off core generation. We are already verifying the program fails, no need
766 # poluting the workspace. Of course if you are a SXEmacs developer you may want
767 # to comemnt this on occasion :-)
768 ulimit -c 0
769
770 ## initialise our nestable msg funs
771 SXE_INIT_MSG_LEVEL
772
773 dnl Small snippet to make echo -n work on solaris
774 ECHO_N= ECHO_C=
775 case `echo -n x` in
776 -n*)
777         case `echo 'x\c'` in
778         *c*)
779                 ;;
780         *)
781                 ECHO_C='\c'
782                 ;;
783         esac
784         ;;
785 *)
786         ECHO_N='-n'
787         ;;
788 esac
789
790
791 echo
792 echo "Preparing the build chain"
793 echo "========================="
794
795 ## We should brag about ourselves, no?
796 AC_DEFINE([XEMACS], [1], [Pretend to be an XEmacs])
797 AC_DEFINE([SXEMACS], [1], [Why not? It's the truth!])
798
799 dnl -------------------------------------------------------------------------
800 dnl Command line argument processing.
801 dnl -------------------------------------------------------------------------
802 dnl Check for bogus options
803 dnl -------------------------------------------------------------------------
804 SXE_CHECK_COMMAND_LINE
805
806 AM_INIT_AUTOMAKE([foreign -Wall])
807 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
808 SXE_CHECK_BUILDCHAIN
809 AC_SUBST(EGREP)
810
811 progname=$0
812 progbasename=$(basename $progname)
813 progdirname=$(dirname $progname)
814
815 ## Build Options
816 ## =============
817
818 echo
819 echo "Build and System Specific Options"
820 echo "================================="
821
822 SXE_EXPLORE_BUILD_ENVIRONMENT
823
824 dnl ----------------------------------------
825 dnl Find out which version of SXEmacs this is
826 dnl ----------------------------------------
827 AC_CHECK_PROG([have_git], [git], [yes], [no])
828 AC_MSG_CHECKING([for SXEmacs version])
829 AC_MSG_RESULT([SXEmacs SXEM4CS_VERSION])
830 dnl Must do the following first to determine verbosity for AC_DEFINE
831 AS_IF([test -n "[]SXEM4CS_BETA_P[]"],beta=yes,beta=no)
832 : "${extra_verbose=$beta}"
833
834 AC_MSG_CHECKING([for SXEmacs patchlevel])
835 CURDIR=$(pwd)
836 cd "$sxe_srcdir"
837 AS_IF([test "$have_git" = "yes"], 
838             [sxemacs_git_version=`git describe | head -1`])
839 AS_IF([test -z "$sxemacs_git_version"],
840         sxemacs_git_version="[]SXEM4CS_GIT_VERSION[]")
841 AC_MSG_RESULT([$sxemacs_git_version])
842 version="$sxemacs_git_version"
843 cd "$CURDIR"
844 main_version="$sxemacs_git_version"
845 AC_DEFINE_UNQUOTED([EMACS_MAJOR_VERSION], [SXEM4CS_MAJOR_VERSION], [Description here!])
846 AC_DEFINE_UNQUOTED([EMACS_MINOR_VERSION], [SXEM4CS_MINOR_VERSION], [Description here!])
847 old_version=[]SXEM4CS_VERSION[]
848 if test -n "[]SXEM4CS_BETA_VERSION[]"; then
849         AC_MSG_CHECKING([if we are a beta version])
850         if test "$beta" = "yes"; then
851                 AC_MSG_RESULT([yes])
852                 AC_DEFINE_UNQUOTED([EMACS_BETA_VERSION], [SXEM4CS_BETA_VERSION],
853                         [Description here!])
854         else
855                 AC_MSG_RESULT([no])
856                 AC_DEFINE_UNQUOTED([EMACS_PATCH_LEVEL], [SXEM4CS_BETA_VERSION],
857                         [Description here!])
858         fi
859 fi
860 AC_DEFINE_UNQUOTED([SXEMACS_CODENAME], ["[]SXEM4CS_CODENAME[]"], [Description here!])
861 AC_DEFINE_UNQUOTED([EMACS_VERSION], ["$version"], [Description here!])
862 AC_DEFINE_UNQUOTED([SXEMACS_GIT_VERSION], ["$sxemacs_git_version"],
863         [Description here!])
864
865 PROGNAME=sxemacs
866
867 AC_DEFINE_UNQUOTED([EMACS_PROGNAME], ["$PROGNAME"], [Description here!])
868
869 ## build stuff in lib-src unconditionally
870 SXE_APPEND([lib-src], [MAKE_SUBDIR])
871 SXE_APPEND([lib-src], [INSTALL_ARCH_DEP_SUBDIR])
872
873 ## C compiler build chain
874 AC_USE_SYSTEM_EXTENSIONS
875 AC_LANG([C])
876 AS_MESSAGE([Let's look for the entire C build chain])
877 SXE_CHECK_CC
878 SXE_CHECK_CFLAGS
879
880 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
881
882 ## check machine chars
883 AS_MESSAGE([Let's have a detailed glance at your machine])
884 SXE_PROC_CPUID
885 SXE_PROC_VENDORID
886 SXE_NPROCESSORS
887 SXE_CHECK_PROC_GOODNESS
888
889
890 ## Debugging Options
891 ## =================
892 ## echo
893 ## echo "Debugging Options"
894 ## echo "================="
895
896 dnl ----------------------------------
897 dnl Error checking and debugging flags
898 dnl ----------------------------------
899 dnl Error checking default to "yes" in beta versions, to "no" in releases.
900 dnl Same goes for --enable-debug and --extra-verbosity.
901 if test "$with_error_checking_extents" = yes; then
902         have_error_checking_extents="yes"
903         AC_DEFINE([ERROR_CHECK_EXTENTS], [1], [Description here!])
904         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
905 fi
906 if test "$with_error_checking_types" = yes; then
907         have_error_checking_types="yes"
908         AC_DEFINE([ERROR_CHECK_TYPECHECK], [1], [Description here!])
909         AC_DEFINE_UNQUOTED([type_checking_assert(assertion)],
910                 [assert (assertion)], [
911                 Make sure that all X... macros are dereferencing the correct type,
912                 and that all XSET... macros (as much as possible) are setting the
913                 correct type of structure.  Highly recommended for all
914                 development work.])
915         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
916 else
917         AC_DEFINE_UNQUOTED([type_checking_assert(assertion)], [], [])
918 fi
919 if test "$with_error_checking_bufpos" = yes; then
920         have_error_checking_bufpos="yes"
921         AC_DEFINE([ERROR_CHECK_BUFPOS], [1], [Description here!])
922         AC_DEFINE_UNQUOTED([bufpos_checking_assert(assertion)],
923                 [assert (assertion)], [dnl
924                 Make sure valid buffer positions are passed to BUF_* macros])
925         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
926 else
927         AC_DEFINE_UNQUOTED([bufpos_checking_assert(assertion)], [], [])
928 fi
929 if test "$with_error_checking_gc" = yes; then
930         have_error_checking_gc="yes"
931         AC_DEFINE([ERROR_CHECK_GC], [1], [Description here!])
932         AC_DEFINE_UNQUOTED([gc_checking_assert(assertion)],
933                 [assert (assertion)], [dnl
934                 Attempt to catch bugs related to garbage collection
935                 (e.g. not GCPRO'ing)])
936         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
937 else
938         AC_DEFINE_UNQUOTED([gc_checking_assert(assertion)], [], [])
939 fi
940 if test "$with_error_checking_malloc" = yes; then
941         have_error_checking_malloc="yes"
942         AC_DEFINE([ERROR_CHECK_MALLOC], [1], [Description here!])
943         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
944 fi
945 if test "$with_error_checking_byte_code"  = yes; then
946         have_error_checking_byte_code="yes"
947         AC_DEFINE([ERROR_CHECK_BYTE_CODE], [1], [Description here!])
948         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
949 fi
950 if test "$with_error_checking_glyphs" = yes; then
951         have_error_checking_glyphs="yes"
952         AC_DEFINE([ERROR_CHECK_GLYPHS], [1], [Description here!])
953         AC_DEFINE([USE_ASSERTIONS], [1], [Description here!])
954 fi
955
956 dnl enable_debug=yes must be set when error checking is present.  This should be
957 dnl fixed up.
958 dnl with_debug implies other options
959 if test "${with_debug:=$beta}" = "yes"; then
960         with_memory_usage_stats=yes
961         SXE_ADD_CRUFT_OBJS([debug.o])
962         SXE_ADD_CRUFT_OBJS([tests.o])
963         AC_DEFINE([DEBUG_SXEMACS], [1], [Description here!])
964 fi
965 if test "$with_memory_usage_stats" = "yes"; then
966         AC_DEFINE([MEMORY_USAGE_STATS], [1], [Description here!])
967 fi
968
969
970
971 dnl --------------------------------------------------------------
972 dnl $opsys detection complete; defaults depending on $opsys follow
973 dnl --------------------------------------------------------------
974
975
976 dnl --------------------------------------------------------------
977 dnl WooHoo! pdump is ON always and everywhere! --SY.
978 dnl --------------------------------------------------------------
979 with_pdump=yes
980
981 if test "$with_dynamic" != "no"; then
982         case "$opsys" in
983         hpux* | sunos4* )
984                 with_dynamic=no
985                 ;;
986         *)
987                 with_dynamic=yes
988                 ;;
989         esac
990 fi
991 if test "$with_dynamic" = "yes"; then
992         case "$opsys" in
993         hpux* | sunos4* | sco5 )
994                 opsys="${opsys}-shr"
995                 ;;
996         decosf* )
997                 ld_call_shared="-call_shared"
998                 ;;
999         darwin* )
1000                 AC_DEFINE([DLSYM_NEEDS_UNDERSCORE], [1], [Description here!])
1001                 if test "x$have_ld_no_pie" != "x"; then
1002                         SXE_PREPEND_LINKER_FLAG([-no_pie], [ld_switch_site])
1003                 fi
1004                 ;;
1005         esac
1006 else dnl "$with_dynamic" = "no"
1007         case "$opsys" in
1008         sol2 )
1009                 echo "Static linking is not supported on Solaris 2."
1010                 echo "Rerun configure without specifying --without-dynamic."
1011                 exit 1
1012                 ;;
1013         linux )
1014                 ld_call_shared="-Bstatic"
1015                 ;;
1016         decosf* )
1017                 ld_call_shared="-non_shared"
1018                 ;;
1019         darwin* )
1020                 AC_DEFINE([DLSYM_NEEDS_UNDERSCORE], [1], [Description here!])
1021                 if test "x$have_ld_no_pie" != "x"; then
1022                         SXE_PREPEND_LINKER_FLAG([-no_pie], [ld_switch_site])
1023                 fi
1024                 ;;
1025         esac
1026 fi
1027
1028 dnl Tools configuration
1029 case "$opsys" in
1030 aix* )
1031         NON_GNU_CC=xlc
1032         ;;      dnl Use xlc by default on AIX
1033 darwin )
1034         RANLIB="ranlib -c"
1035         ;;  dnl Avoid link error in lwlib-config.c
1036         ## this needs rework I think because RANLIB is provided by LT_INIT anyway
1037 esac
1038
1039 stack_trace_eye_catcher=\
1040 `echo ${PROGNAME}_${version}_${ac_cv_build} | sed 'y!@/.-!____!'`
1041 AC_DEFINE_UNQUOTED([STACK_TRACE_EYE_CATCHER], [$stack_trace_eye_catcher],
1042         [Just a very looong string to make traces more readable.])
1043
1044 dnl --------------------------------------------------
1045 dnl Determine the compiler, set up for feature testing
1046 dnl --------------------------------------------------
1047
1048 if test "$with_clash_detection" != "no"; then
1049         AC_DEFINE([CLASH_DETECTION], [1], [Description here!])
1050         SXE_ADD_CRUFT_OBJS([filelock.o])
1051 fi
1052
1053
1054 dnl what exactly do we determine here? and where is it used?
1055 dnl dnl Determine GCC version.
1056 dnl if test "$GCC" = "yes"; then
1057 dnl     AC_RUN_IFELSE([AC_LANG_SOURCE([[
1058 dnl int main ()
1059 dnl {
1060 dnl #if __GNUC__ >= 3
1061 dnl     return 11;
1062 dnl #else
1063 dnl     return 0;
1064 dnl #endif
1065 dnl }]])], [:], [dnl
1066 dnl case "$?" in
1067 dnl 11)
1068 dnl     echo "You appear to be using GCC version 3 or above."
1069 dnl     __GCC3=yes
1070 dnl     ;;
1071 dnl esac], [__GCC3=no])
1072 dnl fi
1073
1074 dnl We don't do AC_PROG_CC for SXEMACS_CC; if we can't trust these people....
1075 : ${SXEMACS_CC:="$CC"}
1076
1077 dnl Figure out what C preprocessor to use.
1078
1079 dnl On Sun systems, people sometimes set up the variable CPP
1080 dnl with a value that is a directory, not an executable at all.
1081 dnl Detect that case, and ignore that value.
1082 test -n "$CPP" -a -d "$CPP" && CPP=
1083
1084 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
1085
1086 dnl --------------------------------------------------------------------
1087 dnl Compiler feature macros
1088 dnl --------------------------------------------------------------------
1089
1090
1091 dnl --------------------------------------------------------------------
1092 dnl Extract some information from the operating system and machine files
1093 dnl --------------------------------------------------------------------
1094
1095 echo "Extracting information from the machine- and system-dependent headers..."
1096
1097 SXE_CHECK_MACHARCH
1098 SXE_EXTRACT_MACHARCH_INFO
1099
1100 dnl s&m files shouldn't be required to define anything, or even to exist.
1101 dnl So we default SYSTEM_TYPE to the obvious documented standard, `uname -s`,
1102 dnl appropriately emacsulated.
1103 if test -z "$system_type"; then
1104         AC_DEFINE_UNQUOTED([SYSTEM_TYPE],
1105                 ["`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"],
1106                 [Description here!])
1107 fi
1108
1109 dnl If the s&m files don't define a system-specific dumper, simply use pdump.
1110 dnl Sometime in the future, we'll remove all definitions of UNEXEC
1111 dnl from all the s&m files.
1112 test -z "$unexec" && with_pdump=yes
1113
1114 if test "$with_pdump" = "yes"; then
1115         ordinary_link="yes"
1116         ld="${ordinary_ld}"
1117         start_files=
1118         libs_standard=
1119         unexec=
1120         lib_gcc=
1121 fi
1122
1123 dnl dnl For debugging...
1124 dnl SXE_PRINT_VAR([libs_machine libs_system libs_termcap libs_standard
1125 dnl     objects_machine objects_system c_switch_machine c_switch_system
1126 dnl     ld_switch_machine ld_switch_system unexec ld_switch_shared
1127 dnl     ld lib_gcc ld_text_start_addr start_files ordinary_link
1128 dnl     have_terminfo mail_use_flock mail_use_lockf]) && echo ""
1129
1130 dnl bitch at build attempt on win32 machines
1131 case "$opsys" in mingw* | cygwin*)
1132         SXE_DIE("Invalid operation system. Cannot build on win32 machines.")
1133 esac
1134
1135 dnl Non-ordinary link usually requires -lc
1136 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
1137
1138 ## perform compiler specific things
1139 SXE_DO_CC_HACKS
1140 ## machine specific extensions
1141 SXE_CHECK_SIMD_EXTENSIONS
1142
1143 ## some linker flags that might come in handy
1144 SXE_CHECK_LDFLAGS
1145
1146 ## suffices to be defined late, for instance here
1147 SXE_CHECK_PARSER_LEXER
1148
1149 if test "$with_pdump" != "yes"; then
1150         ## GNU ld now defaults to combreloc, which screws up unexec,
1151         ## but not pdump.
1152         ## Note that it's OK if the GNU style long option causes
1153         ## non-GNU ld to barf a usage message, that's often good
1154         ## enough.  Please report it, though.
1155         ## #### Should make this Solaris-friendly.
1156         ## Link with -z nocombreloc for now.
1157         SXE_CHECK_LD_ZFLAG([nocombreloc])
1158         if test "$sxe_cv_ld__z_nocombreloc" = "yes"; then
1159                 SXE_PREPEND_LINKER_FLAG([-z nocombreloc], [ld_switch_site])
1160         fi
1161 fi
1162
1163 dnl Inform compiler that certain flags are meant for the linker
1164 SXE_PROTECT_LINKER_FLAGS(ld_switch_system)
1165 SXE_PROTECT_LINKER_FLAGS(ld_switch_machine)
1166 SXE_PROTECT_LINKER_FLAGS(ld_switch_site)
1167 SXE_PROTECT_LINKER_FLAGS(LDFLAGS)
1168 SXE_PROTECT_LINKER_FLAGS(ld_call_shared)
1169
1170 dnl Add s&m-determined objects to link line
1171 test -n "$objects_machine" && SXE_ADD_CORE_OBJS($objects_machine)
1172 test -n "$objects_system"  && SXE_ADD_CORE_OBJS($objects_system)
1173 test "$with_pdump" = "yes" && SXE_ADD_CORE_OBJS(dumper.o)
1174
1175
1176 dnl Feed s&m crud to src/Makefile
1177
1178 dnl Linux/powerpc needs the following magic for some reason
1179 dnl [Not needed with YellowDog 2.3 and causes link problems with YellowDog 3.0,
1180 dnl the two most popular PowerPC distributions.]
1181 dnl test "$machine$opsys" = "powerpclinux" && start_flags="-T $sxe_srcdir/src/ppc.ldscript"
1182
1183 AC_LANG(C)
1184 if test "$unexec" = "unexaix.o"; then
1185 dnl AIX needs various hacks to make static linking work.
1186   if   test "$with_dynamic" = "no"; then
1187   start_flags="-Wl,-bnso,-bnodelcsect"
1188   test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}"
1189   for f in "/lib/syscalls.exp" "/lib/threads.exp"; do
1190     if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi
1191   done
1192   for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do