Mercurial > hg > xemacs-beta
annotate configure.ac @ 4598:8891b0477058
Merge.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 04 Feb 2009 12:35:45 +0000 |
parents | 6a6689b96f00 |
children | 79d1a0524b5f |
rev | line source |
---|---|
2651 | 1 dnl XEmacs config script for autoconf 2.5. |
2 dnl ------------------------------------------------------------------------- | |
3 dnl Overrides of standard autoconf macros. | |
4 | |
5 # AC_LANG(C) | |
6 # ---------- | |
7 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
8 m4_define([AC_LANG(C)], | |
9 [ac_ext=c | |
10 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS' | |
11 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run' | |
12 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard' | |
13 ac_cpp='$CPP '"$xe_cppflags" | |
2667 | 14 ac_compile='$CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&AS_MESSAGE_LOG_FD' |
2651 | 15 ac_link='$CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&AS_MESSAGE_LOG_FD' |
16 ac_compiler_gnu=$ac_cv_c_compiler_gnu | |
17 ]) | |
3003 | 18 dnl |
2651 | 19 dnl ------------------------------------------------------------------------- |
20 dnl Autoconf startup. | |
3003 | 21 dnl |
22 dnl Due to a dependence on the implementation of certain internal autoconf | |
23 dnl macros, die if any version other than 2.59 is used. | |
2651 | 24 AC_PREREQ(2.59)dnl |
3050 | 25 AC_INIT([XEmacs],[21.5],[xemacs-beta@xemacs.org])dnl |
26 AC_CONFIG_SRCDIR(src/lisp.h)dnl | |
3003 | 27 dnl |
2651 | 28 dnl ------------------------------------------------------------------------- |
29 dnl Local copyright notices. | |
30 | |
31 AC_COPYRIGHT( | |
3073 | 32 [Configuration script for XEmacs. Largely divergent from FSF. |
33 Guess values for system-dependent variables and create Makefiles. | |
34 | |
3418 | 35 Copyright (C) 1992-1999, 2001-2006 Free Software Foundation, Inc. |
3073 | 36 Copyright (C) 1993, 1994, 1995 Board of Trustees, University of Illinois. |
37 Copyright (C) 1996, 1997 Sun Microsystems, Inc. | |
38 Copyright (C) 1995, 1996, 2002, 2003, 2004 Ben Wing. | |
39 Copyright (C) 2000, 2001 Martin Buchholz. | |
40 Copyright (C) 1998, 1999 J. Kean Johnston. | |
41 Copyright (C) 2005 Malcolm Purvis | |
42 | |
43 Don't edit this script! | |
44 This script was automatically generated by the `autoconf' program | |
45 from the file `./configure.ac'. To rebuild it, execute the command: | |
46 | |
47 autoconf | |
48 | |
49 in the this directory. You must have autoconf version 2.59. | |
50 | |
51 This file is part of XEmacs. | |
52 | |
53 XEmacs is free software; you can redistribute it and/or modify it | |
54 under the terms of the GNU General Public License as published by | |
55 the Free Software Foundation; either version 2, or (at your | |
56 option) any later version. | |
57 | |
58 XEmacs is distributed in the hope that it will be useful, but | |
59 WITHOUT ANY WARRANTY; without even the implied warranty of | |
60 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
61 General Public License for more details. | |
62 | |
63 You should have received a copy of the GNU General Public License | |
64 along with XEmacs; see the file COPYING. If not, write to the Free | |
65 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
66 Boston, MA 02110-1301, USA. | |
67 | |
68 For usage, run `./configure --help' | |
69 For more detailed information on building and installing XEmacs, | |
70 read the file `INSTALL'. | |
71 | |
72 If configure succeeds, it leaves its status in config.status. | |
73 A log of configuration tests can be found in config.log. | |
74 If configure fails after disturbing the status quo, | |
75 config.status is removed. | |
2651 | 76 ]) |
77 | |
78 dnl ------------------------------------------------------------------------- | |
79 dnl Program name (sanitize $0) | |
80 dnl Remove any more than one leading "." element from the path name. | |
81 dnl config.status prepends another "./" at each use. This confuses | |
82 dnl move-if-change. | |
83 dnl | |
84 dnl Unfortunately, some seds (Ultrix's) don't allow you to apply * to a | |
85 dnl \( \) group. Bleah. Remove the level config.status adds, at least. | |
86 dnl | |
87 dnl If there's reason to prefer $0 over this, make sure you fix all the | |
88 dnl uses in this script!! | |
89 progname="`echo $0 | sed 's:^\./\./:\./:'`" | |
3003 | 90 dnl |
2651 | 91 dnl ------------------------------------------------------------------------- |
92 dnl Local macros | |
3003 | 93 dnl |
2651 | 94 define([USAGE_ERROR], |
95 [(echo "$progname: Usage error:" | |
96 echo " " $1 | |
3003 | 97 echo " Use \`$progname --help' to show usage.") >&2 && exit 1])dnl |
98 dnl | |
2651 | 99 dnl PRINT_VAR(var var ...) prints values of shell variables |
100 define([PRINT_VAR],[for var in patsubst([$1],[[ | |
3003 | 101 ]+],[ ]); do eval "echo \"$var = '\$$var'\""; done])dnl |
102 dnl | |
2651 | 103 dnl XE_ADD_OBJS(foo.o) |
104 define([XE_ADD_OBJS], | |
105 [extra_objs="$extra_objs [$1]" && dnl | |
106 if test "$verbose" = "yes"; then | |
107 echo " xemacs will be linked with \"[$1]\"" | |
108 fi])dnl XE_ADD_OBJS | |
3003 | 109 dnl |
2651 | 110 dnl XE_APPEND(value, varname) |
111 define([XE_APPEND], | |
112 [[$2]="$[$2] [$1]" && dnl | |
3003 | 113 if test "$verbose" = "yes"; then echo " Appending \"[$1]\" to \$[$2]"; fi])dnl |
114 dnl | |
2651 | 115 dnl XE_PREPEND(value, varname) |
116 define([XE_PREPEND], | |
117 [[$2]="[$1] $[$2]" && dnl | |
3003 | 118 if test "$verbose" = "yes"; then echo " Prepending \"[$1]\" to \$[$2]"; fi])dnl |
119 dnl | |
2651 | 120 dnl XE_DIE(message) |
3003 | 121 define([XE_DIE], [{ echo "Error:" $1 >&2; exit 1; }])dnl |
122 dnl | |
2651 | 123 dnl XE_CHECK_FEATURE_DEPENDENCY(feature1, feature2) |
124 define([XE_CHECK_FEATURE_DEPENDENCY], | |
125 [if test "$with_[$1] $with_[$2]" = "yes no"; then | |
126 USAGE_ERROR("--with-[$1] requires --with-[$2]") | |
127 elif test "$with_[$2]" = "no" ; then with_[$1]=no | |
128 elif test "$with_[$1]" = "yes"; then with_[$2]=yes | |
129 fi | |
3003 | 130 ])dnl |
131 dnl | |
2651 | 132 dnl XE_STRIP_4TH_COMPONENT(var) |
133 dnl Changes i986-pc-linux-gnu to i986-pc-linux, as God (not RMS) intended. | |
134 define([XE_STRIP_4TH_COMPONENT], | |
3003 | 135 [$1=`echo "$$1" | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`])dnl |
136 dnl | |
2651 | 137 dnl Do our best to deal with automounter brokenness |
138 dnl CANONICALIZE_PATH(varname) | |
139 define([CANONICALIZE_PATH], | |
140 [if test -d "/net"; then | |
141 if test -d "/tmp_mnt/net"; then tdir="tmp_mnt/net"; else tdir="tmp_mnt"; fi | |
142 $1=`echo "[$]$1" | \ | |
143 sed -e "s|^${tdir}/|/net/|" -e "s|^/a/|/net/|" -e "s|^/amd/|/net/|"` | |
144 fi])dnl | |
3003 | 145 dnl |
2651 | 146 dnl XE_PROTECT_LINKER_FLAGS(shell_var) |
147 define([XE_PROTECT_LINKER_FLAGS], [ | |
148 if test "$GCC" = "yes"; then | |
149 set x $[$1]; shift; [$1]="" | |
150 while test -n "[$]1"; do | |
151 case [$]1 in | |
152 -L | -l | -u ) [$1]="$[$1] [$]1 [$]2"; shift ;; | |
153 -L* | -l* | -u* | -Wl* | -pg ) [$1]="$[$1] [$]1" ;; | |
154 -Xlinker* ) ;; | |
155 * ) [$1]="$[$1] -Xlinker [$]1" ;; | |
156 esac | |
157 shift | |
158 done | |
159 fi])dnl | |
3003 | 160 dnl |
2651 | 161 dnl Allow use of either ":" or spaces for lists of directories |
162 define(COLON_TO_SPACE, | |
163 [case "$[$1]" in *:* [)] [$1]="`echo '' $[$1] | sed -e 's/^ //' -e 's/:/ /g'`";; esac])dnl | |
3003 | 164 dnl |
2651 | 165 dnl XE_ADD_RUNPATH_DIR(directory) |
166 define([XE_ADD_RUNPATH_DIR],[{ | |
167 xe_runpath_dir=$1 | |
168 dnl PRINT_VAR(ld_switch_site ld_switch_x_site runpath xe_runpath_dir LD_RUN_PATH xe_ldflags) | |
169 test "$xe_runpath_dir" != "/lib" -a \ | |
170 "$xe_runpath_dir" != "/usr/lib" -a \ | |
171 -n "`ls ${xe_runpath_dir}/*.s[[ol]] 2>/dev/null`" && \ | |
172 eval "$xe_add_unique_runpath_dir" | |
173 }])dnl | |
3003 | 174 dnl |
2651 | 175 dnl XE_COMPUTE_RUNPATH() |
176 define([XE_COMPUTE_RUNPATH],[ | |
177 if test "$add_runtime_path" = "yes" -a -n "$dash_r"; then | |
178 dnl Remove runtime paths from current ld switches | |
179 ld_switch_site=`echo '' $ld_switch_site | sed -e 's:^ ::' -e "s/$dash_r[[^ ]]*//g"` | |
180 ld_switch_x_site=`echo '' $ld_switch_x_site | sed -e 's:^ ::' -e "s/$dash_r[[^ ]]*//g"` | |
181 dnl PRINT_VAR(ld_switch_site ld_switch_x_site) | |
182 | |
183 dnl Fix up Runtime path | |
184 dnl If LD_RUN_PATH is set in environment, use that. | |
185 dnl In this case, assume user has set the right value. | |
186 runpath="" runpath_dirs="" | |
187 if test -n "$LD_RUN_PATH"; then | |
188 runpath="$LD_RUN_PATH" | |
189 elif test "$GCC" = "yes"; then | |
190 dnl Compute runpath from gcc's -v output | |
191 ld_switch_run_save="$ld_switch_run"; ld_switch_run="" | |
4588
6a6689b96f00
Adopt Martin's suggestion of "char **argv" throughout configure.ac.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4543
diff
changeset
|
192 echo "int main(int argc, char **argv) {return 0;}" > conftest.c |
2651 | 193 xe_runpath_link='${CC-cc} -o conftest -v $CFLAGS '"$xe_ldflags"' conftest.$ac_ext 2>&1 1>/dev/null' |
194 for arg in `eval "$xe_runpath_link" | grep ' -L'`; do | |
195 case "$arg" in P,* | -L* | -R* ) | |
196 for dir in `echo '' "$arg" | sed -e 's:^ ::' -e 's/^..//' -e 'y/:/ /'`; do | |
197 XE_ADD_RUNPATH_DIR("$dir") | |
198 done ;; | |
199 esac | |
200 done | |
201 ld_switch_run="$ld_switch_run_save" | |
202 rm -f conftest* | |
203 else | |
204 dnl Add all directories with .so files to runpath | |
205 for arg in $ld_switch_site $ld_switch_x_site; do | |
206 case "$arg" in -L*) XE_ADD_RUNPATH_DIR(`echo '' "$arg" | sed -e 's:^ ::' -e 's/^-L//'`);; esac | |
207 done | |
208 dnl Sometimes /opt/SUNWdt/lib is the only installed Motif available | |
3019 | 209 dnl #### this test always fails here as need_motif is null |
2651 | 210 if test "$opsys $need_motif" = "sol2 yes"; then |
211 xe_runpath_dir="/opt/SUNWdt/lib"; | |
212 eval "$xe_add_unique_runpath_dir"; | |
213 fi | |
214 fi dnl Compute $runpath | |
215 | |
216 if test -n "$runpath"; then | |
217 ld_switch_run="${dash_r}${runpath}" | |
218 XE_PROTECT_LINKER_FLAGS(ld_switch_run) | |
219 test "$verbose" = "yes" && echo "Setting runpath to $runpath" | |
220 fi | |
221 fi | |
222 ])dnl | |
3003 | 223 dnl |
2651 | 224 dnl The construct foo=`echo $w1 $w2 $w3` fails on some systems if $w1 = -e or -n |
225 dnl So we use the following instead. | |
226 dnl XE_SPACE(var, words) | |
227 define([XE_SPACE],[ | |
228 T="" | |
229 for W in $2; do if test -z "$T"; then T="$W"; else T="$T $W"; fi; done | |
230 $1="$T" | |
231 ])dnl XE_SPACE | |
3683 | 232 dnl Autoconf 2.59 and 2.60 have slightly different versions of m4_cdr that |
233 dnl return different values for an empty list. XE_CDR is a copy of the 2.60 | |
234 dnl version which will be used with both versions. | |
235 define([XE_CDR], | |
236 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], | |
237 [$#], 1, [], | |
238 [m4_dquote(m4_shift($@))])])dnl | |
3003 | 239 dnl |
240 dnl XE_MERGED_ARG(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) | |
241 dnl ------------------------------------------------------------------------ | |
242 dnl | |
243 dnl Arguments that can be specified with either --enable or --with. The | |
244 dnl majority of XEmacs arguments do not fit neatly into the division between | |
245 dnl --enable and --with, so allow those to be specified by either argument. | |
246 dnl The value is stored in both enable_FEATURE and with_FEATURE. | |
247 AC_DEFUN([XE_MERGED_ARG], | |
248 [m4_divert_once([HELP_ENABLE], [[ | |
249 Optional Features: | |
250 --with-FEATURE[=ARG] include FEATURE [ARG=yes] | |
251 --enable-FEATURE[=ARG] alias for --with-FEATURE | |
252 --without-FEATURE do not use FEATURE (same as --with-FEATURE=no) | |
253 --disable-FEATURE alias for --without-FEATURE]])dnl | |
254 m4_divert_once([HELP_ENABLE], m4_bpatsubst([[$2]],[--enable\([^ ]+\) ],[--with\1 ]))dnl | |
3764 | 255 dnl Register both forms with the option checking list. |
256 dnl Options are only checked with autoconf > 2.61. | |
257 m4_append_uniq([_AC_USER_OPTS], [enable_]m4_bpatsubst([$1], -, _), [:])dnl | |
258 m4_append_uniq([_AC_USER_OPTS], [with_]m4_bpatsubst([$1], -, _), [:])dnl | |
3003 | 259 # If --with-$1 or --without-$1 were given then copy the value to the |
260 # equivalent enable_$1 variable. | |
261 if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then | |
262 [enable_]m4_bpatsubst([$1], -, _)="[$with_]m4_bpatsubst([$1], -, _)" | |
263 fi; | |
264 # If -enable-$1 or --disable-$1 were given then copy the value to the | |
265 # equivalent with_$1 variable. | |
266 if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then | |
267 [with_]m4_bpatsubst([$1], -, _)="[$enable_]m4_bpatsubst([$1], -, _)" | |
268 fi; | |
269 # Check whether --with-$1 or --without-$1 was given. | |
270 if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then | |
271 enableval="[$with_]m4_bpatsubst([$1], -, _)" | |
272 withval="[$with_]m4_bpatsubst([$1], -, _)" | |
273 $3 | |
274 m4_ifvaln([$4], [else | |
275 $4])dnl | |
276 fi; dnl | |
277 ])dnl XE_MERGED_ARG | |
278 dnl | |
3073 | 279 dnl XE_HELP_SUBSECTION(HEADING) |
280 dnl -------------------------- | |
281 dnl | |
282 dnl Add subsection headings to the help text for XE_MERGED_ARG options. | |
283 dnl | |
284 AC_DEFUN([XE_HELP_SUBSECTION], | |
285 [m4_divert_once([HELP_ENABLE], [[ | |
286 Optional Features: | |
287 --with-FEATURE[=ARG] include FEATURE [ARG=yes] | |
288 --enable-FEATURE[=ARG] alias for --with-FEATURE | |
289 --without-FEATURE do not use FEATURE (same as --with-FEATURE=no) | |
290 --disable-FEATURE alias for --without-FEATURE]])dnl | |
291 dnl NOTE: The next eol adds a blank line before the heading. | |
292 m4_divert_once([HELP_ENABLE], [[ | |
293 $1]])dnl | |
3161 | 294 dnl Add an underscore |
3073 | 295 dnl NOTE: The next eol adds a blank line after the underscore. |
296 m4_divert_text([HELP_ENABLE], patsubst([$1], [.], [-]) | |
297 )])dnl | |
298 dnl | |
2651 | 299 dnl XEmacs keyword option support |
300 dnl ============================= | |
301 dnl | |
302 dnl A "keyword" option is one that accepts one of a number of pre-defined | |
303 dnl values. For example --with-mail-locking=flock. | |
304 dnl The descriptions below provide prototypes and little more. | |
305 dnl | |
306 dnl For more information, | |
307 dnl (Info-goto-node "(internals)The configure Script") | |
308 dnl To edit the documentation, | |
309 dnl (progn (find-file "man/internals/internals.texi")) | |
310 dnl and search for "@node The configure Script". | |
311 dnl | |
312 dnl XE_PARSE_KEYWORD_OPTION(prefix, cmdline-flag) | |
313 dnl --------------------------------------------- | |
314 dnl | |
315 dnl Internal macro to parse the option values. If an undeclared option is | |
316 dnl found then an error is generated. | |
317 dnl | |
318 define([XE_PARSE_KEYWORD_OPTION], | |
319 [_[$1]_bogus=yes | |
320 for x in XE_KEYWORD_LIST ; do | |
3003 | 321 if test $x = $with_[$1] ; then |
2651 | 322 _[$1]_bogus=no |
323 fi | |
324 done | |
325 if test "$_[$1]_bogus" = "yes" ; then | |
326 USAGE_ERROR(["The [$2] option must have one of these values: m4_translit(XE_KEYWORD_VALUES,[:],[,])."]) | |
327 fi | |
328 unset _[$1]_bogus | |
329 undefine([XE_KEYWORD_LIST])dnl | |
3003 | 330 undefine([XE_KEYWORD_VALUES])])dnl |
2651 | 331 dnl |
332 dnl XE_KEYWORD(keyword) | |
333 dnl -------------------------------- | |
334 dnl | |
335 dnl | |
336 define([XE_KEYWORD], | |
337 [m4_append([XE_KEYWORD_LIST],[$1],[ ])dnl | |
338 dnl Separate with a ':' instead of a ',' (see the parsing code above) to avoid | |
3161 | 339 dnl confusion with macro parameter lists. |
2651 | 340 m4_append([XE_KEYWORD_VALUES],[\`$1'],[:])dnl |
3003 | 341 ])dnl |
2651 | 342 dnl |
3003 | 343 dnl XE_KEYWORD_ARG(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, |
2651 | 344 dnl [XE_KEYWORD(keyword), ....]) |
345 dnl -------------------------------------------------------------------------- | |
346 dnl | |
3003 | 347 dnl Expanded version of XE_MERGED_ARG for keyword options. All the parameters |
2651 | 348 dnl are required. |
349 dnl | |
3003 | 350 define([XE_KEYWORD_ARG], |
2651 | 351 [m4_map([XE_KEYWORD],m4_shiftn(4, $@)) |
3003 | 352 XE_MERGED_ARG([$1],[$2], |
353 [XE_PARSE_KEYWORD_OPTION(patsubst([$1], -, _), [--with-$1]) | |
2651 | 354 $3 |
3003 | 355 ],[$4])])dnl |
2651 | 356 dnl |
357 dnl XEmacs complex option support | |
358 dnl ============================= | |
359 dnl | |
360 dnl A "complex option" is one that takes a number of related values. | |
361 dnl For example, we might use "--with-xft=all,nomenubars" for compatibility | |
362 dnl with XFontSet i18n of menubars. (Silly, Xft looks much better than XFS.) | |
363 dnl | |
364 dnl The descriptions below provide prototypes and little more. | |
365 dnl For more information, | |
366 dnl (Info-goto-node "(internals)The configure Script") | |
367 dnl To edit the documentation, | |
368 dnl (progn (find-file "man/internals/internals.texi")) | |
369 dnl and search for "@node The configure Script". | |
370 dnl | |
371 dnl XE_EXPAND_COMPLEX_OPTION(prefix, component, yesno) | |
372 dnl --------------------------------------------------- | |
373 dnl | |
374 dnl Internal macro create the option's shell variable containing the default | |
375 dnl value and to note the values in an option list. | |
376 dnl | |
377 define([XE_EXPAND_COMPLEX_OPTION], | |
3147 | 378 [_[$1]_[$2]_default=[$3] |
2651 | 379 m4_append([XE_COMPONENT_LIST],[$2],[ ])dnl |
380 dnl Separate with a ':' instead of a ',' (see <prefix>_default below) to avoid | |
3161 | 381 dnl confusion with macro parameter lists. |
2651 | 382 m4_append([XE_COMPONENT_DEFAULT],[m4_if([$3],no,no)[$2]],[:])dnl |
383 ])dnl | |
384 dnl | |
385 dnl XE_EXPAND_COMPLEX_OPTIONS(prefix, option_list) | |
386 dnl ---------------------------------------------- | |
387 dnl | |
388 dnl Internal macro to recursively expand all the options in the option list. | |
389 dnl | |
4475
86283c809984
autoconf 2.62 compatibility, #370
"Ville Skyttä <scop@xemacs.org>"
parents:
4455
diff
changeset
|
390 dnl m4_fst disappeared without a trace in autoconf 2.62 |
86283c809984
autoconf 2.62 compatibility, #370
"Ville Skyttä <scop@xemacs.org>"
parents:
4455
diff
changeset
|
391 m4_define([xe_fst], [$1])dnl |
2651 | 392 define([XE_EXPAND_COMPLEX_OPTIONS], |
3683 | 393 [m4_if([$2], [], [], |
4475
86283c809984
autoconf 2.62 compatibility, #370
"Ville Skyttä <scop@xemacs.org>"
parents:
4455
diff
changeset
|
394 [XE_EXPAND_COMPLEX_OPTION([$1], xe_fst($2))[]dnl |
3683 | 395 XE_EXPAND_COMPLEX_OPTIONS([$1], XE_CDR($2))])])dnl |
2651 | 396 dnl |
397 dnl XE_INIT_COMPLEX_OPTION(prefix, option_list) | |
398 dnl ------------------------------------------- | |
399 dnl | |
400 dnl Internal macro to initialise the complex option shell variables. | |
401 dnl Variables of the form <prefix>_<option> contain the default value for that | |
402 dnl option. <prefix>_types contains a space-separated list of all the options | |
403 dnl and <prefix>_default contains a comma-separated list of all the default | |
404 dnl values. | |
405 dnl | |
406 define([XE_INIT_COMPLEX_OPTION], | |
3003 | 407 [_[$1]_notfirst="" |
2651 | 408 dnl |
3147 | 409 XE_EXPAND_COMPLEX_OPTIONS($@)dnl |
2651 | 410 _[$1]_types="XE_COMPONENT_LIST" |
411 _[$1]_default="m4_translit(XE_COMPONENT_DEFAULT,[:],[,])" | |
412 dnl Undefine these macros so that they can be reused by later complex | |
413 dnl options. | |
3147 | 414 undefine([XE_COMPONENT_LIST])dnl |
415 undefine([XE_COMPONENT_DEFAULT])dnl | |
3003 | 416 ])dnl |
417 dnl | |
2651 | 418 dnl XE_PARSE_COMPLEX_OPTION(prefix, cmdline-flag) |
419 dnl --------------------------------------------- | |
420 dnl | |
421 dnl Internal macro to parse the option values. If an undeclared option is | |
3073 | 422 dnl found then an error is generated. Because something has been supplied on |
423 dnl the command line initialise all the complex options to 'no' rather than | |
3147 | 424 dnl the default. In this way --enable-complex=foo will give the expected |
3073 | 425 dnl value (no) for bar. |
2651 | 426 dnl |
3147 | 427 dnl #### I think we should add a couple more features. |
428 dnl First, at the end of XE_PARSE_COMPLEX_OPTION check for contradictory args, | |
429 dnl specifically if `all' is specified but the options are all individually | |
430 dnl disabled, or if `none' is specified but the options are all individually | |
431 dnl enabled, we should _warn_ about this situation. | |
432 dnl Second, we should provide an XE_VALIDATE_COMPLEX_OPTION macro to be used | |
433 dnl at the end of detection. If any feature is `yes' but we don't have it, | |
434 dnl then we should XE_DIE. | |
435 dnl | |
2651 | 436 define([XE_PARSE_COMPLEX_OPTION], |
3147 | 437 [dnl Initialize variables for COMPLEX_OPTION [$1]. Leading underscore or |
438 dnl single letter variables are internal to the XE_PARSE_COMPLEX_OPTION macro. | |
439 _[$1]_all_default="" | |
440 _require_[$1]="" | |
441 dnl check first arg for default spec | |
442 case "$with_[$1]" in | |
443 n | no | non | none ) _[$1]_all_default=no ;; | |
444 n,* | no,* | non,* | none,* ) _[$1]_all_default=no ;; | |
445 a | al | all | both ) _[$1]_all_default=yes ;; | |
446 a,* | al,* | all,* | both,* ) _[$1]_all_default=yes ;; | |
447 y | yes ) _require_[$1]=yes ;; | |
448 esac | |
449 dnl if first arg was a default spec, trim it | |
450 if test -n "$_[$1]_all_default$_require_[$1]"; then | |
451 _with_[$1]_args=`echo $with_[$1] | sed -e 's/^[[a-z]]*\(,\(.*\)\)\{0,1\}$/\2/'` | |
452 else | |
453 _with_[$1]_args=$with_[$1] | |
454 fi | |
455 dnl set default for each type | |
456 for y in $_[$1]_types; do | |
457 if test -n "$_[$1]_all_default" ; then | |
458 eval "with_[$1]_${y}=$_[$1]_all_default" | |
459 else | |
460 eval "with_[$1]_$y=\$_[$1]_${y}_default" | |
461 fi | |
3073 | 462 done |
3147 | 463 dnl parse the command line arg and set types found appropriately |
464 for x in `echo "$_with_[$1]_args" | sed -e 's/,/ /g'` ; do | |
2651 | 465 _[$1]_found="" |
3147 | 466 for y in $_[$1]_types; do |
467 if test "$x" = "$y"; then | |
468 _[$1]_found=yes | |
469 eval "with_[$1]_$y=yes" | |
470 elif test "$x" = "no$y"; then | |
471 _[$1]_found=yes | |
472 eval "with_[$1]_$y=no" | |
473 fi | |
474 done | |
475 test -z "$_[$1]_found" && \ | |
476 USAGE_ERROR(["\ | |
477 Invalid type list supplied. Valid types for the [$2] option are: | |
478 $_[$1]_types. | |
479 A prefix of \"no\" (eg, \"notype\" for \"type\") turns a type off. | |
480 Types not explicitly specified or negated take their defaults. | |
481 The list of defaults is \"$_[$1]_default\". Prefixing \`all' or | |
482 \`none' to the list sets all defaults to on and off respectively. | |
483 \`yes' as the sole argument is equivalent to omitting the argument."]) | |
2651 | 484 done |
3147 | 485 dnl copy values to enable_FEATURE_TYPE. Cleanup default vars. |
486 for y in $_[$1]_types; do | |
487 eval "enable_[$1]_$y=\$with_[$1]_$y" | |
488 unset _[$1]_${y}_default | |
489 done | |
490 dnl clean up | |
491 unset _[$1]_types _[$1]_default _[$1]_all_default _[$1]_use_defaults | |
492 unset _with_[$1]_args _[$1]_found x y _require_[$1] | |
3003 | 493 ])dnl |
494 dnl | |
2651 | 495 dnl XE_COMPLEX_OPTION(option, yesno) |
496 dnl -------------------------------- | |
497 dnl | |
498 dnl Declare a complex option and its default value. The value MUST be either | |
499 dnl yes or no or "" (which means maybe). | |
500 dnl | |
501 define([XE_COMPLEX_OPTION],[[$1,$2]]) | |
502 dnl | |
503 dnl XE_COMPLEX_OPTION_HELP_STRING(flag, long, short, components, libraries) | |
504 dnl ----------------------------------------------------------------------- | |
505 dnl Boilerplate help string for complex options. | |
506 dnl #### This doesn't read so well for alternative libraries like sound. | |
507 dnl | |
508 define([XE_COMPLEX_OPTION_HELP_STRING], | |
3312 | 509 [AS_HELP_STRING([$1],[Compile with support for $2. Components that can use |
2651 | 510 $3 are $4. Prefix component with `no' to disable its use of $3. Requires |
3003 | 511 $5 support. Default is $6.])])dnl |
2651 | 512 dnl |
3003 | 513 dnl XE_COMPLEX_ARG(PACKAGE, HELP-STRING, ACTION-IF-TRUE, ACTION-IF-FALSE, |
2651 | 514 dnl [XE_COMPLEX_OPTION(a,yes), ....]) |
515 dnl -------------------------------------------------------------------------- | |
516 dnl | |
3003 | 517 dnl Expanded version of XE_MERGED_ARG for complex options. All the parameters |
2651 | 518 dnl are required. |
519 dnl | |
3003 | 520 define([XE_COMPLEX_ARG], |
521 [XE_INIT_COMPLEX_OPTION(patsubst([$1], -, _), m4_shiftn(4, $@)) | |
522 XE_MERGED_ARG([$1],[$2], | |
523 [XE_PARSE_COMPLEX_OPTION(patsubst([$1], -, _), [--with-$1]) | |
2651 | 524 $3 |
3147 | 525 ],[ |
526 # set default for each type | |
3149 | 527 for y in [$_]patsubst([$1], -, _)[_types]; do |
528 eval "[with_]patsubst([$1], -, _)[_$y]=[\$_]patsubst([$1], -, _)[_${y}_default]" | |
529 eval "[enable_]patsubst([$1], -, _)[_$y]=[\$_]patsubst([$1], -, _)[_${y}_default]" | |
530 unset [_]patsubst([$1], -, _)[_${y}_default] | |
3147 | 531 done |
532 $4])])dnl | |
2651 | 533 dnl |
534 dnl ------------------------------------------------------------------------- | |
535 XE_APPEND(lib-src, MAKE_SUBDIR) | |
536 XE_APPEND(lib-src, INSTALL_ARCH_DEP_SUBDIR) | |
537 with_dragndrop_default="no" | |
538 dnl ------------------------------------------------------------------------- | |
539 dnl Command line argument processing. | |
3312 | 540 dnl Note that AS_HELP_STRING compresses whitespace, wraps, and indents the |
2651 | 541 dnl string to fit the --help display; there's no need to preformat. |
542 dnl | |
543 dnl I think these will be caught by autoconf internal checks, | |
544 dnl only --with-* are unchecked | |
545 dnl --external-widget --enable-external-widget | |
546 dnl --native-sound-lib=LIB --with-native-sound-lib | |
547 dnl --mail-locking=TYPE --with-mail-locking | |
548 dnl --rel-alloc --with-rel-alloc | |
549 dnl --use-number-lib --enable-bignum | |
550 dnl --debug --enable-debug | |
551 dnl --error-checking --enable-error-checking | |
552 dnl --memory-usage-stats --enable-memory-usage-stats | |
553 dnl --quick-build --enable-quick-build | |
554 dnl --use-union-type --enable-union-type | |
555 dnl --pdump --enable-pdump | |
556 dnl --use-kkcc --enable-kkcc | |
3003 | 557 dnl |
2651 | 558 dnl parse flags |
3073 | 559 XE_HELP_SUBSECTION([Compilation options]) |
560 XE_MERGED_ARG([compiler], | |
3312 | 561 AS_HELP_STRING([--with-compiler],[C compiler to use]), |
3073 | 562 [], []) |
563 XE_MERGED_ARG([xemacs-compiler], | |
3312 | 564 AS_HELP_STRING([--with-xemacs-compiler], |
3073 | 565 [compiler to use to compile just the xemacs executable and C modules. |
566 If you want to compile XEmacs as C++, use e.g. | |
567 `--with-xemacs-compiler=g++'. This turns on a lot of | |
568 additional error-checking.]), | |
569 [], []) | |
570 XE_MERGED_ARG([gcc], | |
3312 | 571 AS_HELP_STRING([--with-gcc],[Use GCC to compile XEmacs.]), |
3073 | 572 [], []) |
573 XE_MERGED_ARG([cflags], | |
3312 | 574 AS_HELP_STRING([--with-cflags=FLAGS], |
3073 | 575 [Compiler flags. These flags will be placed after any flags inserted for warnings, debugging or optimization; setting this does not disable the insertion of those flags. Use configure settings such as `--with-optimization=no' or `enable-debug=no' to turn them off, or override them with `--with-cflags-optimization', `--with-cflags-debugging', or `with-cflags-warning'.]), |
576 [], []) | |
577 XE_MERGED_ARG([cflags-warning], | |
3312 | 578 AS_HELP_STRING([--with-cflags-warning=FLAGS],[Override compiler flags used to control warnings. |
3073 | 579 Normally, don't set this, as XEmacs already turns on |
580 the maximum safe warning level.]), | |
581 [], []) | |
582 XE_MERGED_ARG([optimization], | |
3312 | 583 AS_HELP_STRING([--with-optimization],[Control whether compilation is optimized. By default, optimization is on in release versions and off in beta versions, since it can interfere with proper stack backtraces.]), |
3073 | 584 [], []) |
585 XE_MERGED_ARG([cflags-optimization], | |
3312 | 586 AS_HELP_STRING([--with-cflags-optimization=FLAGS], |
3073 | 587 [Override compiler flags used to control optimization. If blank, forces no optimization; if non-blank, forces optimization. Normally, don't set this; XEmacs automatically sets the maximum safe optimization flags appropriate for the compiler being invoked. If you just want to turn optimization on or off, use `with-optimization' instead.]), |
588 [], []) | |
589 XE_MERGED_ARG([cflags-debugging], | |
3312 | 590 AS_HELP_STRING([--with-cflags-debugging=FLAGS], |
3073 | 591 [Override compiler flags used to add debugging information to the executable. Normally, debugging information is added whenever possible (i.e. unless optimization is turned on and the compiler does not permit debugging and optimization simultaneously).]), |
592 [], []) | |
593 XE_MERGED_ARG([cpp], | |
3312 | 594 AS_HELP_STRING([--with-cpp],[C preprocessor to use (e.g. /usr/ccs/lib/cpp or cc -E)]), |
3073 | 595 [CPP="$with_cpp"], []) |
596 XE_MERGED_ARG([cppflags], | |
3312 | 597 AS_HELP_STRING([--with-cppflags],[C preprocessor flags (e.g. -I/foo or -Dfoo=bar)]), |
3073 | 598 [CPPFLAGS="$with_cppflags"], []) |
599 XE_MERGED_ARG([libs=LIBS], | |
3312 | 600 AS_HELP_STRING([--with-libs],[Additional libraries (e.g. -lfoo)]), |
3073 | 601 [LIBS="$with_libs"], []) |
602 XE_MERGED_ARG([ldflags=FLAGS], | |
3312 | 603 AS_HELP_STRING([--with-ldflags],[Additional linker flags (e.g. -L/foo)]), |
3073 | 604 [LDFLAGS="$with_ldflags"], []) |
605 XE_MERGED_ARG([site-includes], | |
3312 | 606 AS_HELP_STRING([--with-site-includes=PATHS],[Prepend to include search path.]), |
3073 | 607 [], []) |
608 XE_MERGED_ARG([site-libraries], | |
3312 | 609 AS_HELP_STRING([--with-site-libraries=PATHS],[Prepend to library search path.]), |
3073 | 610 [], []) |
611 XE_MERGED_ARG([site-prefixes], | |
3312 | 612 AS_HELP_STRING([--with-site-prefixes=PATHS],[Prepend to include and library search paths, with /include and /lib added. Comes after site-includes and site-libraries, if any.]), |
3073 | 613 [], []) |
614 XE_MERGED_ARG([site-runtime-libraries], | |
3312 | 615 AS_HELP_STRING([--with-site-runtime-libraries=PATHS],[Prepend to the runtime library search path]), |
3073 | 616 [], []) |
617 XE_MERGED_ARG([dynamic], | |
3312 | 618 AS_HELP_STRING([--with-dynamic],[Link dynamically if supported by system. 'No' forces static linking.]), |
3073 | 619 [], []) |
620 dnl | |
621 XE_HELP_SUBSECTION([Installation options]) | |
3003 | 622 XE_MERGED_ARG([prefix], |
3312 | 623 AS_HELP_STRING([--with-prefix=no],[Don't compile the value for `prefix' into the executable.]), |
2651 | 624 [true], [with_prefix=yes]) |
3073 | 625 XE_MERGED_ARG([netinstall], |
3312 | 626 AS_HELP_STRING([--with-netinstall],[Support for installation over the internet. |
3073 | 627 Only functional on the MS Windows platforms.]), |
628 [], [with_netinstall="no"]) | |
629 XE_MERGED_ARG([statedir], | |
3312 | 630 AS_HELP_STRING([--with-statedir=DIR],[]), |
3073 | 631 [], [with_statedir='${prefix}/lib']) |
632 XE_MERGED_ARG([lispdir], | |
3312 | 633 AS_HELP_STRING([--with-lispdir=DIR],[]), |
3073 | 634 [AC_DEFINE(LISPDIR_USER_DEFINED)], [with_lispdir='${datadir}/${instvardir}/lisp']) |
635 XE_MERGED_ARG([archlibdir], | |
3312 | 636 AS_HELP_STRING([--with-archlibdir=DIR],[]), |
3073 | 637 [AC_DEFINE(ARCHLIBDIR_USER_DEFINED)], [with_archlibdir='${libdir}/${instvardir}/${configuration}']) |
638 XE_MERGED_ARG([moduledir], | |
3312 | 639 AS_HELP_STRING([--with-moduledir=DIR],[]), |
3073 | 640 [AC_DEFINE(MODULEDIR_USER_DEFINED)], [with_moduledir='${libdir}/${instvardir}/${configuration}/modules']) |
641 XE_MERGED_ARG([etcdir], | |
3312 | 642 AS_HELP_STRING([--with-etcdir=DIR],[]), |
3073 | 643 [AC_DEFINE(ETCDIR_USER_DEFINED)], [with_etcdir='${datadir}/${instvardir}/etc']) |
644 XE_MERGED_ARG([docdir], | |
3312 | 645 AS_HELP_STRING([--with-docdir=DIR],[]), |
3073 | 646 [AC_DEFINE(DOCDIR_USER_DEFINED)], [with_docdir='${archlibdir}']) |
647 dnl | |
648 XE_HELP_SUBSECTION([Run-time path-searching options]) | |
3003 | 649 XE_MERGED_ARG([site-lisp], |
3312 | 650 AS_HELP_STRING([--with-site-lisp=no],[Allow for a site-lisp directory in the XEmacs hierarchy searched before the installation packages.]), |
2651 | 651 [true], [with_site_lisp=no]) |
3003 | 652 XE_MERGED_ARG([site-modules], |
3312 | 653 AS_HELP_STRING([--with-site-modules=no],[Disable site-modules directory in the XEmacs hierarchy, which is searched before the installation modules.]), |
2651 | 654 [], []) |
3179 | 655 XE_MERGED_ARG([early-packages], |
3312 | 656 AS_HELP_STRING([--with-early-packages=DIR],[Specify location of early/user packages (instead of ~/.xemacs; same as --with-user-packages).]), |
3179 | 657 [AC_DEFINE(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
658 XE_MERGED_ARG([user-packages], | |
3312 | 659 AS_HELP_STRING([--with-user-packages=DIR],[Specify location of early/user packages (instead of ~/.xemacs; same as --with-early-packages).]), |
3179 | 660 [AC_DEFINE(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
661 XE_MERGED_ARG([late-packages], | |
3312 | 662 AS_HELP_STRING([--with-late-packages=DIR],[Specify location of late/system packages (instead of default location; same as --with-system-packages).]), |
3179 | 663 [AC_DEFINE(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
664 XE_MERGED_ARG([system-packages], | |
3518 | 665 AS_HELP_STRING([--with-system-packages=DIR],[Specify location of late/system packages (instead of default location; same as --with-late-packages).]), |
3179 | 666 [AC_DEFINE(LATE_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
667 XE_MERGED_ARG([last-packages], | |
3312 | 668 AS_HELP_STRING([--with-last-packages=DIR],[Specify location of last/legacy packages (instead of default location; same as --with-legacy-packages).]), |
3179 | 669 [AC_DEFINE(LAST_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
670 XE_MERGED_ARG([legacy-packages], | |
4350
50889296c05c
Fix typo of "late packages" for "last packages".
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4328
diff
changeset
|
671 AS_HELP_STRING([--with-legacy-packages=DIR],[Specify location of last/legacy packages (instead of default location; same as --with-last-packages).]), |
50889296c05c
Fix typo of "late packages" for "last packages".
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4328
diff
changeset
|
672 [AC_DEFINE(LAST_PACKAGE_DIRECTORIES_USER_DEFINED)], []) |
3073 | 673 XE_MERGED_ARG([package-path], |
3312 | 674 AS_HELP_STRING([--with-package-path=PATH],[Search path for package directories.]), |
3073 | 675 [AC_DEFINE(PACKAGE_PATH_USER_DEFINED)], []) |
676 XE_MERGED_ARG([infopath], | |
3312 | 677 AS_HELP_STRING([--with-infopath=PATH],[Location of info directories]), |
3073 | 678 [AC_DEFINE(INFOPATH_USER_DEFINED)], []) |
679 dnl | |
680 XE_HELP_SUBSECTION([Window-system options]) | |
3354 | 681 dnl Enable when fontconfig support is factored out of Xft. |
682 dnl XE_MERGED_ARG([fontconfig], | |
683 dnl AS_HELP_STRING([--with-fontconfig], | |
684 dnl [Use fontconfig library to configure fonts.], | |
685 dnl [],[]) | |
3094 | 686 dnl if you change defaults, make sure to fix arg 6 of the OPTION_HELP macro. |
687 XE_COMPLEX_ARG([xft], | |
688 [XE_COMPLEX_OPTION_HELP_STRING([--with-xft], | |
689 [Xft client-side font rendering and anti-aliasing], | |
690 [Xft], | |
691 [`emacs' (buffers), `menubars', `tabs', and `gauges'], | |
692 [X11, Xft, Xrender, freetype, and fontconfig], | |
4496
772c80e0e180
with-xft defaults to xft being used with a default setting.
Mats Lidell <matsl@xemacs.org>
parents:
4475
diff
changeset
|
693 [`noemacs, nomenubars, notabs, nogauges'. |
772c80e0e180
with-xft defaults to xft being used with a default setting.
Mats Lidell <matsl@xemacs.org>
parents:
4475
diff
changeset
|
694 The default when selected is `emacs, nomenubars, notabs, nogauges'])], |
772c80e0e180
with-xft defaults to xft being used with a default setting.
Mats Lidell <matsl@xemacs.org>
parents:
4475
diff
changeset
|
695 [],[with_xft_emacs=no], |
772c80e0e180
with-xft defaults to xft being used with a default setting.
Mats Lidell <matsl@xemacs.org>
parents:
4475
diff
changeset
|
696 [XE_COMPLEX_OPTION([emacs],[yes]), |
3098 | 697 XE_COMPLEX_OPTION([menubars],[no]), |
698 XE_COMPLEX_OPTION([tabs],[no]), | |
699 XE_COMPLEX_OPTION([gauges],[no])]) | |
3003 | 700 XE_MERGED_ARG([gtk], |
3312 | 701 AS_HELP_STRING([--with-gtk],[Support GTK on the X Window System. (EXPERIMENTAL)]), |
2651 | 702 [true], [with_gtk=no]) |
3003 | 703 XE_MERGED_ARG([gnome], |
3312 | 704 AS_HELP_STRING([--with-gnome],[Support GNOME on the X Window System. (EXPERIMENTAL)]), |
2651 | 705 [true], [with_gnome=no]) |
3003 | 706 XE_MERGED_ARG([msw], |
3312 | 707 AS_HELP_STRING([--with-msw],[Support MS Windows as a window system (only under Cygwin and MinGW). `--with-msw=no' may be needed on *nix systems with Wine installed.]), |
2651 | 708 [], []) |
3073 | 709 XE_MERGED_ARG([toolbars], |
3312 | 710 AS_HELP_STRING([--enable-toolbars],[Enable toolbar support. Default: yes.]), |
2651 | 711 [], []) |
3073 | 712 XE_MERGED_ARG([wmcommand], |
3312 | 713 AS_HELP_STRING([--with-wmcommand],[Compile without realized leader window which will |
3073 | 714 keep the WM_COMMAND property.]), |
2651 | 715 [], []) |
3073 | 716 XE_KEYWORD_ARG([athena], |
3312 | 717 AS_HELP_STRING([--with-athena=TYPE],[Use TYPE Athena widgets (`xaw', `3d', `next', `95', or `xpm').]), |
3073 | 718 [],[],[xaw,3d,next,95,xpm])dnl |
719 XE_KEYWORD_ARG([menubars], | |
3312 | 720 AS_HELP_STRING([--enable-menubars=TYPE],[Use TYPE menubars ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw'). The Lucid |
3073 | 721 widgets emulate Motif (mostly) but are faster. |
722 *WARNING* The Motif menubar is currently broken. | |
723 Lucid menubars are the default.]), | |
724 [], [],[yes,no,lucid,motif,athena,gtk,msw]) | |
725 XE_KEYWORD_ARG([scrollbars], | |
3312 | 726 AS_HELP_STRING([--enable-scrollbars=TYPE],[Use TYPE scrollbars 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw'). |
3073 | 727 Lucid scrollbars are the default.]), |
728 [], [],[yes,no,lucid,motif,athena,gtk,msw]) | |
729 XE_KEYWORD_ARG([dialogs], | |
3312 | 730 AS_HELP_STRING([--enable-dialogs=TYPE],[Use TYPE dialog boxes 'yes', '`no', `lucid', `motif', `athena', `gtk', or `msw'). |
3073 | 731 There are no true Lucid dialogs; Motif dialogs will be |
732 used if Motif can be found, else Athena is used.]), | |
733 [], [],[yes,no,lucid,motif,athena,gtk,msw]) | |
734 XE_KEYWORD_ARG([widgets], | |
3312 | 735 AS_HELP_STRING([--enable-widgets=TYPE],[Use TYPE native widgets ('yes', '`no', `lucid', `motif', `athena', `gtk', or `msw'). |
3073 | 736 Other widget types are currently unsupported. |
737 There are no true Lucid widgets; Motif widgets will be | |
738 used if Motif can be found, else Athena is used.]), | |
739 [], [],[yes,no,lucid,motif,athena,gtk,msw]) | |
3003 | 740 XE_MERGED_ARG([dragndrop], |
3312 | 741 AS_HELP_STRING([--with-dragndrop],[Compile in the generic drag and drop API. This is automatically added if one of the drag and drop |
2651 | 742 protocols is found (currently CDE, OffiX, MSWindows, |
743 and GTK). | |
744 *WARNING* The Drag'n'drop support is under development | |
745 and is considered experimental.]), | |
746 [], []) | |
3003 | 747 XE_MERGED_ARG([cde], |
3312 | 748 AS_HELP_STRING([--with-cde],[Compile in support for CDE drag and drop.]), |
2651 | 749 [], []) |
3003 | 750 XE_MERGED_ARG([offix], |
3312 | 751 AS_HELP_STRING([--with-offix],[Compile in support for OffiX drag and drop. |
2651 | 752 *WARNING* If you compile in OffiX, you may not be |
753 able to use multiple X displays success- | |
754 fully. If the two servers are from | |
755 different vendors, the results may be | |
756 unpredictable.]), | |
757 [], []) | |
3073 | 758 XE_MERGED_ARG([xmu], |
3312 | 759 AS_HELP_STRING([--with-xmu],[Use Xmu utilities. Default: yes.]), |
3073 | 760 [], []) |
761 XE_MERGED_ARG([external-widget], | |
3312 | 762 AS_HELP_STRING([--enable-external-widget],[Support XEmacs server for text widgets in other applications.]), |
3073 | 763 [], []) |
764 dnl | |
765 XE_HELP_SUBSECTION([TTY (character terminal) options]) | |
766 XE_MERGED_ARG([tty], | |
3312 | 767 AS_HELP_STRING([--with-tty],[Enable TTY support. Default: yes.]), |
3073 | 768 [], []) |
769 XE_MERGED_ARG([ncurses], | |
3312 | 770 AS_HELP_STRING([--with-ncurses],[Use the ncurses library for tty support.]), |
3073 | 771 [], []) |
3003 | 772 XE_MERGED_ARG([gpm], |
3312 | 773 AS_HELP_STRING([--with-gpm],[Compile in GPM mouse support for ttys.]), |
2651 | 774 [], []) |
3073 | 775 dnl |
776 XE_HELP_SUBSECTION([Image options]) | |
3003 | 777 XE_MERGED_ARG([xpm], |
3312 | 778 AS_HELP_STRING([--with-xpm],[Compile with support for XPM images. PRACTICALLY |
2651 | 779 REQUIRED. Although this library is nonstandard and |
780 a real hassle to build, many basic things (e.g. | |
781 toolbars) depend on it, and you will run into | |
782 many problems without it.]), | |
783 [], []) | |
3073 | 784 XE_MERGED_ARG([png], |
3312 | 785 AS_HELP_STRING([--with-png],[Compile with support for PNG images. Recommended |
3073 | 786 because the images on the About page are not viewable |
787 without it.]), | |
788 [], []) | |
789 XE_MERGED_ARG([jpeg], | |
3312 | 790 AS_HELP_STRING([--with-jpeg],[Compile with support for JPEG images. Useful if |
3073 | 791 you are using a mail, news reader, or web browser |
792 in XEmacs, so that JPEG images can be displayed.]), | |
793 [], []) | |
794 XE_MERGED_ARG([tiff], | |
3312 | 795 AS_HELP_STRING([--with-tiff],[Compile with support for TIFF images. Possibly |
3073 | 796 useful, for the same reason as JPEG images.]), |
797 [], []) | |
3003 | 798 XE_MERGED_ARG([xface], |
3312 | 799 AS_HELP_STRING([--with-xface],[Compile with support for X-Face mail headers. |
2651 | 800 Requires the compface package.]), |
801 [], []) | |
3003 | 802 XE_MERGED_ARG([gif], |
3312 | 803 AS_HELP_STRING([--with-gif],[Compile without the (builtin) support for GIF images.]), |
2651 | 804 [], []) |
3073 | 805 dnl |
806 XE_HELP_SUBSECTION([Sound options]) | |
807 XE_COMPLEX_ARG([sound], | |
3312 | 808 AS_HELP_STRING([--enable-sound=TYPE],[Compile with sound support. |
3308 | 809 Valid types are `native', `alsa', `nas' and `esd'. |
3073 | 810 Prefix a type with 'no' to disable. |
811 The first type can be `none' or `all'. `none' means | |
3308 | 812 `nonative,noalsa,nonas,noesd'. `all' means |
813 `native,alsa,nas,esd'. Later options override earlier | |
814 ones for the same TYPE. The default is to autodetect | |
815 all sound support except for ESD which defaults to | |
816 off.]), | |
3073 | 817 [], |
818 [enable_sound_nas=""], | |
819 [XE_COMPLEX_OPTION([native],[""]), | |
3308 | 820 XE_COMPLEX_OPTION([alsa],[""]), |
3073 | 821 XE_COMPLEX_OPTION([nas],[""]), |
822 XE_COMPLEX_OPTION([esd],[no])]) | |
823 XE_MERGED_ARG([native-sound-lib], | |
3312 | 824 AS_HELP_STRING([--with-native-sound-lib],[Path to sound library (for systems with name conflicts).]), |
2651 | 825 [], []) |
3073 | 826 dnl |
827 XE_HELP_SUBSECTION([Internationalization options]) | |
3003 | 828 XE_MERGED_ARG([mule], |
3312 | 829 AS_HELP_STRING([--enable-mule],[Compile with Mule (Multi-Lingual Emacs) support, |
2651 | 830 needed to support non-Latin-1 (including Asian) |
831 languages.]), | |
832 [], []) | |
3073 | 833 XE_KEYWORD_ARG([xim], |
3312 | 834 AS_HELP_STRING([--with-xim==TYPE],[Enable XIM support. TYPE is `yes', `no', `xlib', or `motif']), |
3073 | 835 [],[],[yes,no,xlib,motif])dnl |
3003 | 836 XE_MERGED_ARG([canna], |
3312 | 837 AS_HELP_STRING([--with-canna],[Support the Canna Japanese input method. Requires Mule.]), |
2651 | 838 [], []) |
3003 | 839 XE_MERGED_ARG([wnn], |
3312 | 840 AS_HELP_STRING([--with-wnn],[Support the Wnn Asian language input |
2651 | 841 method. Requires Mule.]), |
842 [], []) | |
3003 | 843 XE_MERGED_ARG([wnn6], |
3312 | 844 AS_HELP_STRING([--with-wnn6],[Support the Wnn6 Asian language input |
2651 | 845 method (proprietary). Requires Mule.]), |
846 [], []) | |
3073 | 847 XE_MERGED_ARG([xfs], |
3312 | 848 AS_HELP_STRING([--with-xfs],[Enable XFontSet support for internationalized |
3094 | 849 menubar. Incompatible with `--with-xim=motif' and `--with-xft'. |
3073 | 850 `--enable-menubars=lucid' (the default) is desirable.]), |
851 [], []) | |
852 dnl | |
853 XE_HELP_SUBSECTION([File-related options]) | |
854 XE_MERGED_ARG([default-eol-detection], | |
3312 | 855 AS_HELP_STRING([--enable-default-eol-detection],[Turns on by default auto-detection of end-of-line type |
3073 | 856 when reading a file. Applies to those platforms where |
857 auto-detection is off by default (non-Mule Unix). Has | |
858 no effect otherwise.]), | |
859 [], []) | |
860 XE_MERGED_ARG([clash-detection], | |
3312 | 861 AS_HELP_STRING([--enable-clash-detection],[Disable use of lock files to detect multiple edits |
3073 | 862 of the same file.]), |
2651 | 863 [], []) |
3073 | 864 XE_MERGED_ARG([zlib], |
3312 | 865 AS_HELP_STRING([--with-zlib],[Support inflate (de)compression internally.]), |
2651 | 866 [], []) |
3073 | 867 dnl |
868 XE_HELP_SUBSECTION([Database options]) | |
869 XE_COMPLEX_ARG([database], | |
3312 | 870 AS_HELP_STRING([--enable-database=TYPE],[Compile with database support. Valid types are |
3073 | 871 `no' or a comma-separated list of one or more |
4412
2f000e022a8b
Fix misspelling of option 'gdbm'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4401
diff
changeset
|
872 of `berkdb' and either `dbm' or `gdbm'.]), |
3073 | 873 [ |
874 if test "$enable_database_dbm" = "yes" -a "$enable_database_gdbm" = "yes"; then | |
4412
2f000e022a8b
Fix misspelling of option 'gdbm'.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4401
diff
changeset
|
875 USAGE_ERROR("Only one of \`dbm' and \`gdbm' may be specified |
3073 | 876 with the \`--with-database' option.") |
877 fi | |
878 ], | |
879 [], | |
880 [XE_COMPLEX_OPTION([berkdb],[""]), | |
881 XE_COMPLEX_OPTION([dbm],[""]), | |
882 XE_COMPLEX_OPTION([gdbm],[""])]) | |
3003 | 883 XE_MERGED_ARG([ldap], |
3312 | 884 AS_HELP_STRING([--with-ldap],[Support the LDAP protocol.]), |
2651 | 885 [], []) |
3003 | 886 XE_MERGED_ARG([postgresql], |
3312 | 887 AS_HELP_STRING([--with-postgresql],[Support the PostgreSQL RDBMS.]), |
2651 | 888 [], []) |
3073 | 889 dnl |
890 XE_HELP_SUBSECTION([Mail options]) | |
891 XE_KEYWORD_ARG([mail-locking], | |
3312 | 892 AS_HELP_STRING([--with-mail-locking=TYPE],[Specify the locking to be used by movemail to prevent |
3073 | 893 concurrent updates of mail spool files. Valid types |
894 are `lockf', `flock', `file', `locking', `mmdf' or `pop'.]), | |
895 [],[],[lockf,flock,file,locking,mmdf,pop])dnl | |
3003 | 896 XE_MERGED_ARG([pop], |
3312 | 897 AS_HELP_STRING([--with-pop],[Support POP for mail retrieval.]), |
2651 | 898 [], []) |
3003 | 899 XE_MERGED_ARG([kerberos], |
3312 | 900 AS_HELP_STRING([--with-kerberos],[Support Kerberos-authenticated POP.]), |
2651 | 901 [], []) |
3003 | 902 XE_MERGED_ARG([hesiod], |
3312 | 903 AS_HELP_STRING([--with-hesiod],[Support Hesiod to get the POP server host.]), |
2651 | 904 [], []) |
3073 | 905 dnl |
906 XE_HELP_SUBSECTION([Networking options]) | |
907 XE_MERGED_ARG([tooltalk], | |
3312 | 908 AS_HELP_STRING([--with-tooltalk],[Support the ToolTalk IPC protocol.]), |
2651 | 909 [], []) |
3073 | 910 XE_MERGED_ARG([socks], |
3312 | 911 AS_HELP_STRING([--with-socks],[Compile with support for SOCKS (an Internet proxy).]), |
3073 | 912 [], []) |
913 XE_MERGED_ARG([dnet], | |
3312 | 914 AS_HELP_STRING([--with-dnet],[Compile with support for DECnet.]), |
2651 | 915 [], []) |
3003 | 916 XE_MERGED_ARG([ipv6-cname], |
3312 | 917 AS_HELP_STRING([--with-ipv6-cname],[Try IPv6 information first when canonicalizing host names. This option has no effect unless system supports getaddrinfo(3) and getnameinfo(3).]), |
2651 | 918 [], [with_ipv6_cname="no"]) |
3073 | 919 dnl |
920 XE_HELP_SUBSECTION([Memory allocation options]) | |
921 XE_MERGED_ARG([rel-alloc], | |
3312 | 922 AS_HELP_STRING([--with-rel-alloc],[Enable the relocating allocator.]), |
3073 | 923 [], [with_rel_alloc='default']) |
924 XE_MERGED_ARG([dlmalloc], | |
3312 | 925 AS_HELP_STRING([--with-dlmalloc],[Use Doug Lea's malloc implementation.]), |
3073 | 926 [], [with_dlmalloc='default']) |
927 XE_MERGED_ARG([system-malloc], | |
3312 | 928 AS_HELP_STRING([--with-system-malloc],[Use the system malloc, not the one distributed with XEmacs.]), |
3073 | 929 [], [with_system_malloc='default']) |
930 XE_MERGED_ARG([debug-malloc], | |
3312 | 931 AS_HELP_STRING([--with-debug-malloc],[Use a debugging malloc.]), |
2651 | 932 [], []) |
3003 | 933 XE_MERGED_ARG([pdump], |
3312 | 934 AS_HELP_STRING([--enable-pdump],[Enable portable LISP preloader.]), |
2651 | 935 [], []) |
3003 | 936 XE_MERGED_ARG([dump-in-exec], |
3312 | 937 AS_HELP_STRING([--enable-dump-in-exec],[Enable dumping into executable (enabled by default |
2720 | 938 for `pdump', not enabled by default in combination |
3263 | 939 with `newgc').]), |
2720 | 940 [], []) |
3073 | 941 XE_MERGED_ARG([kkcc], |
3312 | 942 AS_HELP_STRING([--enable-kkcc],[Enable experimental new GC mark algorithms.]), |
3073 | 943 [], [enable_kkcc=yes]) |
3263 | 944 |
3092 | 945 XE_MERGED_ARG([newgc], |
3312 | 946 AS_HELP_STRING([--enable-newgc],[Enable new incremental garbage collector and new allocator.]), |
3092 | 947 [], []) |
948 XE_COMPLEX_ARG([vdb], | |
3312 | 949 AS_HELP_STRING([--enable-vdb=TYPE],[Override auto-detection of |
3092 | 950 virtual-dirty-bit write-barrier implementation for the |
951 new garbage collector. TYPE must be one of "auto" (for | |
952 auto-detection), "posix", "win32", "mach", or "fake" | |
953 (uses the new garbage collector but disables | |
954 incremental collections). The default is to | |
955 use auto-detection.]), | |
956 [], [enable_vdb="auto"],[auto,posix,win32,mach,fake,no]) | |
3073 | 957 dnl |
958 XE_HELP_SUBSECTION([Emacs Lisp options]) | |
959 XE_MERGED_ARG([modules], | |
3312 | 960 AS_HELP_STRING([--enable-modules],[Compile in experimental support for dynamically |
3073 | 961 loaded libraries (Dynamic Shared Objects).]), |
962 [], []) | |
963 XE_KEYWORD_ARG([bignum], | |
3312 | 964 AS_HELP_STRING([--enable-bignum=TYPE],[Compile in support for bignums, ratios, or bigfloats |
3073 | 965 using library support. TYPE must be one of "gmp" |
966 (for GNU MP), "mp" (for BSD MP), or "no" (disabled).]), | |
967 [], [enable_bignum="no"],[no,gmp,mp]) | |
968 dnl | |
969 XE_HELP_SUBSECTION([Platform Specific options]) | |
970 XE_MERGED_ARG([workshop], | |
3312 | 971 AS_HELP_STRING([--with-workshop],[Support the Sun WorkShop (formerly Sparcworks) |
3073 | 972 development environment.]), |
973 [], []) | |
974 XE_MERGED_ARG([sparcworks], | |
3312 | 975 AS_HELP_STRING([--with-sparcworks],[Alias for --with-workshop]), |
3073 | 976 [], []) |
977 XE_MERGED_ARG([infodock], | |
3312 | 978 AS_HELP_STRING([--with-infodock],[Support the Infodock version of XEmacs. Infodock is a SourceForge project).]), |
3073 | 979 [], []) |
980 dnl | |
981 XE_HELP_SUBSECTION([Debugging options]) | |
3003 | 982 XE_MERGED_ARG([debug], |
3312 | 983 AS_HELP_STRING([--enable-debug],[Enable additional debugging information. No time cost.]), |
2651 | 984 [], []) |
3959 | 985 dnl Keep TESTS sorted to help with syncing doc to reality. |
3073 | 986 XE_COMPLEX_ARG([error-checking], |
3312 | 987 AS_HELP_STRING([--enable-error-checking=TESTS],[Compile with internal error-checking added. |
3073 | 988 Causes noticeable loss of speed. Valid TESTS |
3959 | 989 are `byte_code', `display', `extents', `gc', `glyphs', `malloc', `structures' `text', `types'.]), |
3073 | 990 [], [], |
3959 | 991 [XE_COMPLEX_OPTION([byte_code],[""]), |
992 XE_COMPLEX_OPTION([display],[""]), | |
993 XE_COMPLEX_OPTION([extents],[""]), | |
3073 | 994 XE_COMPLEX_OPTION([gc],[""]), |
3959 | 995 XE_COMPLEX_OPTION([glyphs],[""]), |
3073 | 996 XE_COMPLEX_OPTION([malloc],[""]), |
3961 | 997 XE_COMPLEX_OPTION([structures],[""]), |
3959 | 998 XE_COMPLEX_OPTION([text],[""]), |
3961 | 999 XE_COMPLEX_OPTION([types],[""])]) |
3003 | 1000 XE_MERGED_ARG([assertions], |
3312 | 1001 AS_HELP_STRING([--enable-assertions],[Compile in runtime assertions.]), |
2651 | 1002 [], []) |
3003 | 1003 XE_MERGED_ARG([memory-usage-stats], |
3312 | 1004 AS_HELP_STRING([--enable-memory-usage-stats],[Enable LISP memory usage API.]), |
2651 | 1005 [], []) |
3003 | 1006 XE_MERGED_ARG([quick-build], |
3312 | 1007 AS_HELP_STRING([--enable-quick-build],[Speed up the build cycle by leaving out steps where |
2651 | 1008 XEmacs will still work (more or less) without them. |
1009 Potentially dangerous if you don't know what you're | |
1010 doing. This (1) doesn't garbage-collect after loading | |
1011 each file during dumping, (2) doesn't | |
1012 automatically rebuild the DOC file (remove it by hand | |
1013 to get it rebuilt), (3) Removes config.h, lisp.h and | |
1014 associated files from the dependency lists, so changes | |
1015 to these files don't automatically cause all .c files | |
1016 to be rebuilt.]), | |
1017 [], []) | |
3073 | 1018 XE_MERGED_ARG([union-type], |
3312 | 1019 AS_HELP_STRING([--enable-union-type],[Use union definition of Lisp_Object type. Known to trigger bugs in some compilers.]), |
2651 | 1020 [], []) |
3073 | 1021 XE_MERGED_ARG([quantify], |
3312 | 1022 AS_HELP_STRING([--with-quantify],[Support performance debugging using Quantify.]), |
3073 | 1023 [], []) |
1024 XE_MERGED_ARG([purify], | |
3312 | 1025 AS_HELP_STRING([--with-purify],[Support memory debugging using Purify.]), |
3073 | 1026 [], []) |
2651 | 1027 dnl ------------------------------------------------------------------------- |
1028 dnl Final command line argument checks. | |
1029 | |
1030 dnl --with-quantify or --with-purify imply --with-system-malloc | |
1031 if test "$with_purify" = "yes" -o "$with_quantify" = "yes"; then | |
1032 test "$with_system_malloc" = "default" && with_system_malloc=yes | |
1033 fi | |
1034 | |
1035 dnl CDE requires tooltalk | |
1036 XE_CHECK_FEATURE_DEPENDENCY(cde, tooltalk) | |
1037 | |
3094 | 1038 dnl Xft sanity checking |
1039 dnl #### Maybe we should XE_DIE here instead? Or fix the UI so that | |
1040 dnl emacs is always implicit? (I worry that --without-xft would be weird.) | |
1041 if test \( "$with_xft_menubars" = "yes" -o "$with_xft_tabs" = "yes" \ | |
1042 -o "$with_xft_gauges" = "yes" \) -a "$with_xft_emacs" = "no"; then | |
1043 AC_MSG_WARN([Forcing --with-xft=emacs because Xft is enabled]) | |
1044 with_xft_emacs=yes | |
1045 fi | |
1046 | |
1047 dnl XFS and Xft in menubars conflict | |
1048 if test "$with_xfs" = "yes" -a "$with_xft_menubars" = "yes"; then | |
1049 USAGE_ERROR("XFS and Xft in the menubars are incompatible!") | |
1050 fi | |
1051 | |
2651 | 1052 dnl ------------------------------------------------------------------------- |
1053 dnl Local paths | |
1054 test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
1055 # Let make expand exec_prefix. | |
1056 if test "x$exec_prefix" = xNONE | |
1057 then | |
1058 exec_prefix='${prefix}' | |
1059 else | |
1060 AC_DEFINE(EXEC_PREFIX_USER_DEFINED) | |
1061 fi | |
3729 | 1062 |
1063 define([XE_EXPAND_VARIABLE], | |
1064 [$2=[$]$1 | |
1065 while true; do | |
1066 case "[$]$2" in | |
1067 *\[$]* ) eval "$2=[$]$2" ;; | |
1068 *) break ;; | |
1069 esac | |
1070 done])dnl XE_EXPAND_VARIABLE | |
1071 | |
1072 XE_EXPAND_VARIABLE(prefix,prefix_expanded) | |
1073 XE_EXPAND_VARIABLE(datadir,datadir_expanded) | |
4455
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1074 XE_EXPAND_VARIABLE(exec_prefix,exec_prefix_expanded) |
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1075 XE_EXPAND_VARIABLE(libdir,libdir_expanded) |
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1076 XE_EXPAND_VARIABLE(mandir,mandir_expanded) |
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1077 XE_EXPAND_VARIABLE(infodir,infodir_expanded) |
3729 | 1078 |
1079 if test "x$datadir_expanded" != "x$prefix_expanded/share" | |
2651 | 1080 then |
1081 AC_DEFINE(INFODIR_USER_DEFINED) | |
1082 AC_DEFINE(LISPDIR_USER_DEFINED) | |
1083 AC_DEFINE(ETCDIR_USER_DEFINED) | |
4092 | 1084 fi |
1085 | |
4455
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1086 if test "x$libdir_expanded" != "x$prefix_expanded/lib" |
2651 | 1087 then |
1088 AC_DEFINE(MODULEDIR_USER_DEFINED) | |
1089 AC_DEFINE(ARCHLIBDIR_USER_DEFINED) | |
1090 AC_DEFINE(DOCDIR_USER_DEFINED) | |
1091 fi | |
3729 | 1092 |
4455
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
1093 if test "x$infodir_expanded" != "x${prefix_expanded}/share/info" |
2651 | 1094 then |
1095 AC_DEFINE(INFODIR_USER_DEFINED) | |
1096 else | |
4118 | 1097 infodir='${datarootdir}/${instvardir}/info' |
2651 | 1098 fi |
1099 | |
1100 with_sitelispdir='${datadir}/${inststaticdir}/site-lisp' | |
1101 inststaticdir='${PROGNAME}' | |
1102 instvardir='${PROGNAME}-${version}' | |
1103 sitemoduledir='${libdir}/${inststaticdir}/site-modules' | |
1104 | |
1105 AC_SUBST(inststaticdir) | |
1106 AC_SUBST(statedir,$with_statedir) | |
1107 | |
1108 dnl ------------------------------------------------------------------------- | |
1109 | |
1110 AC_PROG_LN_S | |
1111 | |
1112 dnl Make symlinks for etc, lisp, and info directories while the path | |
1113 dnl is still relative. We do not symlink lock because someone may | |
1114 dnl have stuck the source on a read-only partition. Instead we | |
1115 dnl create it as an actual directory later on if it does not already | |
1116 dnl exist. | |
1117 for dir in lisp etc man info tests; do | |
1118 if test ! -d "$dir" ; then | |
1119 echo Making symbolic link to "$srcdir/$dir" | |
1120 ${LN_S} "$srcdir/$dir" "$dir" | |
1121 fi | |
1122 done | |
1123 | |
1124 dnl Calculate canonical name for blddir (i.e. current directory). | |
1125 dnl PWD may already be the preferable absolute name for ".", | |
1126 dnl but we can't trust it - it is sometimes inaccurate. | |
1127 absolute_pwd="`pwd`"; | |
1128 if test -n "$PWD" -a "`cd $PWD && pwd`" = "$absolute_pwd" | |
1129 then blddir="$PWD" | |
1130 else blddir="$absolute_pwd"; CANONICALIZE_PATH(blddir) | |
1131 fi | |
1132 AC_SUBST(blddir) | |
1133 | |
1134 dnl Make srcdir absolute, if not already. It is important to | |
1135 dnl avoid running the path through pwd unnecessary, since pwd can | |
1136 dnl give you automounter prefixes, which can go away. | |
1137 case "$srcdir" in | |
1138 /* ) ;; | |
1139 . ) srcdir="$blddir" ;; | |
1140 * ) srcdir="`cd $srcdir && pwd`"; CANONICALIZE_PATH(srcdir) ;; | |
1141 esac | |
1142 | |
1143 dnl Check if the source directory already has a configured system in it. | |
1144 if test `pwd` != `sh -c cd $srcdir && pwd` \ | |
1145 && test -f "$srcdir/src/config.h"; then | |
1146 (echo "$progname: WARNING: The directory tree \`$srcdir' is being used" | |
1147 echo " as a build directory right now; it has been configured in its own" | |
1148 echo " right. To configure in another directory as well, you MUST" | |
1149 echo " use GNU make. If you do not have GNU make, then you must" | |
1150 echo " now do \`make distclean' in $srcdir," | |
1151 echo " and then run $progname again.") >&2 | |
1152 extrasub='/^VPATH[[ ]]*=/c\ | |
1153 vpath %.c $(srcdir)\ | |
1154 vpath %.h $(srcdir)\ | |
1155 vpath %.y $(srcdir)\ | |
1156 vpath %.l $(srcdir)\ | |
1157 vpath %.s $(srcdir)\ | |
1158 vpath %.in $(srcdir)' | |
1159 fi | |
1160 | |
2741 | 1161 dnl ------------------------------------------------------------------------- |
1162 AC_CONFIG_AUX_DIR_DEFAULT | |
1163 AC_CANONICAL_BUILD | |
1164 dnl ------------------------------------------------------------------------- | |
1165 | |
2651 | 1166 dnl ---------------------------------------- |
1167 dnl Find out which version of XEmacs this is | |
1168 dnl ---------------------------------------- | |
4419
eb82fbb675ea
Use Mercurial changeset hash to identify build version.
Mike Sperber <sperber@deinprogramm.de>
parents:
4412
diff
changeset
|
1169 dnl This should be the same code as in Makefile.in.in |
eb82fbb675ea
Use Mercurial changeset hash to identify build version.
Mike Sperber <sperber@deinprogramm.de>
parents:
4412
diff
changeset
|
1170 cp "$srcdir/version.sh.in" "$srcdir/version.sh" |
eb82fbb675ea
Use Mercurial changeset hash to identify build version.
Mike Sperber <sperber@deinprogramm.de>
parents:
4412
diff
changeset
|
1171 if test -d "$srcdir/.hg"; then |
eb82fbb675ea
Use Mercurial changeset hash to identify build version.
Mike Sperber <sperber@deinprogramm.de>
parents:
4412
diff
changeset
|
1172 (cd "$srcdir"; hg identify | cut -d " " -f 1 >> version.sh) |
eb82fbb675ea
Use Mercurial changeset hash to identify build version.
Mike Sperber <sperber@deinprogramm.de>
parents:
4412
diff
changeset
|
1173 fi |
2651 | 1174 . "$srcdir/version.sh" || exit 1; |
1175 dnl Must do the following first to determine verbosity for AC_DEFINE | |
1176 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi | |
1177 : "${verbose=$beta}" | |
1178 version="${emacs_major_version}.${emacs_minor_version}" | |
1179 AC_DEFINE_UNQUOTED(EMACS_MAJOR_VERSION, $emacs_major_version) | |
1180 AC_DEFINE_UNQUOTED(EMACS_MINOR_VERSION, $emacs_minor_version) | |
1181 if test -n "$emacs_beta_version" ; then | |
1182 if test "$beta" = "yes"; then | |
1183 version="${version}-b${emacs_beta_version}" | |
1184 AC_DEFINE_UNQUOTED(EMACS_BETA_VERSION, $emacs_beta_version) | |
1185 else | |
1186 version="${version}.${emacs_beta_version}" | |
1187 AC_DEFINE_UNQUOTED(EMACS_PATCH_LEVEL, $emacs_beta_version) | |
1188 fi | |
1189 fi | |
1190 AC_DEFINE_UNQUOTED(XEMACS_CODENAME, "$xemacs_codename") | |
3972 | 1191 dnl for etags |
1192 verbose_version=$version | |
2651 | 1193 if test "$xemacs_extra_name" != ""; then |
1194 AC_DEFINE_UNQUOTED(XEMACS_EXTRA_NAME, "$xemacs_extra_name") | |
3972 | 1195 verbose_version="$verbose_version $xemacs_extra_name" |
2651 | 1196 fi |
1197 if test "$xemacs_release_date" != ""; then | |
1198 AC_DEFINE_UNQUOTED(XEMACS_RELEASE_DATE, "$xemacs_release_date") | |
1199 fi | |
1200 AC_DEFINE_UNQUOTED(EMACS_VERSION, "$version") | |
1201 | |
1202 if test "$with_infodock" = "yes"; then | |
1203 if test ! -f ../../ID-INSTALL; then | |
1204 echo "Cannot build InfoDock without InfoDock sources" | |
1205 with_infodock=no | |
1206 fi | |
1207 fi | |
1208 | |
1209 if test "$with_infodock" = "yes"; then | |
1210 dnl InfoDock version numbers. XEmacs will use the same style of numbering | |
1211 dnl after the release of XEmacs 21.0. | |
1212 AC_DEFINE_UNQUOTED(INFODOCK_MAJOR_VERSION, $infodock_major_version) | |
1213 AC_DEFINE_UNQUOTED(INFODOCK_MINOR_VERSION, $infodock_minor_version) | |
1214 AC_DEFINE_UNQUOTED(INFODOCK_BUILD_VERSION, $infodock_build_version) | |
1215 version=${infodock_major_version}.${infodock_minor_version}.${infodock_build_version} | |
1216 PROGNAME=infodock | |
4448
fd8a9a4d81d9
Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4401
diff
changeset
|
1217 SHEBANG_PROGNAME=infodock-script |
2651 | 1218 CPPFLAGS="$CPPFLAGS -DINFODOCK" |
1219 else | |
1220 PROGNAME=xemacs | |
4448
fd8a9a4d81d9
Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4401
diff
changeset
|
1221 SHEBANG_PROGNAME=xemacs-script |
2651 | 1222 fi |
1223 | |
4449
13ce402e1736
Call AC_SUBST on SHEBANG_PATHNAME, for #! support.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4448
diff
changeset
|
1224 AC_SUBST(SHEBANG_PROGNAME) |
2651 | 1225 |
1226 AC_DEFINE_UNQUOTED(EMACS_PROGNAME, "$PROGNAME") | |
1227 | |
4448
fd8a9a4d81d9
Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4401
diff
changeset
|
1228 AC_DEFINE_UNQUOTED(SHEBANG_PROGNAME, "${PROGNAME}-script") |
fd8a9a4d81d9
Support #!, to allow XEmacs to be called as a script interpreter.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4401
diff
changeset
|
1229 |
2651 | 1230 dnl ---------------------------------- |
1231 dnl Error checking and debugging flags | |
1232 dnl ---------------------------------- | |
1233 dnl Error checking default to "yes" in beta versions, to "no" in releases. | |
1234 dnl Same goes for --enable-debug and --extra-verbosity. | |
1235 if test -n "$emacs_is_beta"; then beta=yes; else beta=no; fi | |
1236 test "${enable_error_checking_extents:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_EXTENTS) | |
1237 test "${enable_error_checking_types:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TYPES) | |
1238 test "${enable_error_checking_text:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_TEXT) | |
1239 test "${enable_error_checking_gc:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GC) | |
1240 test "${enable_error_checking_malloc:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_MALLOC) | |
1241 test "${enable_error_checking_byte_code:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_BYTE_CODE) | |
1242 test "${enable_error_checking_glyphs:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_GLYPHS) | |
1243 test "${enable_error_checking_display:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_DISPLAY) | |
1244 test "${enable_error_checking_structures:=$beta}" = yes && AC_DEFINE(ERROR_CHECK_STRUCTURES) | |
1245 dnl enable_debug=yes must be set when error checking is present. This should be | |
1246 dnl fixed up. | |
1247 dnl enable_debug implies other options | |
1248 if test "${enable_debug:=$beta}" = "yes"; then | |
1249 enable_assertions=yes | |
1250 enable_memory_usage_stats=yes | |
1251 AC_DEFINE(DEBUG_XEMACS) | |
1252 fi | |
1253 test "$enable_assertions" = "yes" && AC_DEFINE(USE_ASSERTIONS) | |
1254 test "$enable_memory_usage_stats" = "yes" && AC_DEFINE(MEMORY_USAGE_STATS) | |
1255 | |
1256 dnl ------------------------------ | |
1257 dnl Determine the s&m files to use | |
1258 dnl ------------------------------ | |
1259 dnl Given the configuration name, set machfile and opsysfile to the | |
1260 dnl names of the m/*.h and s/*.h files we should use. | |
1261 | |
1262 dnl Canonicalize the configuration name. | |
1263 XE_STRIP_4TH_COMPONENT(ac_cv_build_alias) | |
1264 XE_STRIP_4TH_COMPONENT(ac_cv_build) | |
1265 AC_SUBST(configuration, $ac_cv_build) | |
1266 | |
1267 dnl If you add support for a new configuration, add code to this | |
1268 dnl switch statement to recognize your configuration name and select | |
1269 dnl the appropriate operating system and machine description files. | |
1270 | |
1271 dnl You would hope that you could choose an m/*.h file pretty much | |
1272 dnl based on the machine portion of the configuration name, and an s- | |
1273 dnl file based on the operating system portion. However, it turns out | |
1274 dnl that each m/*.h file is pretty manufacturer-specific - for | |
1275 dnl example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are | |
1276 dnl all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS | |
1277 dnl machines. So we basically have to have a special case for each | |
1278 dnl configuration name. | |
1279 | |
1280 dnl As far as handling version numbers on operating systems is | |
1281 dnl concerned, make sure things will fail in a fixable way. If | |
1282 dnl /etc/MACHINES says nothing about version numbers, be | |
1283 dnl prepared to handle anything reasonably. If version numbers | |
1284 dnl matter, be sure /etc/MACHINES says something about it. | |
1285 | |
1286 dnl Eric Raymond says we should accept strings like "sysvr4" to mean | |
1287 dnl "System V Release 4"; he writes, "The old convention encouraged" | |
1288 dnl "confusion between `system' and `release' levels'." | |
1289 | |
1290 machine='' opsys='' | |
1291 | |
1292 dnl Straightforward machine determination | |
1293 case "$ac_cv_build" in | |
1294 sparc-*-* ) machine=sparc ;; | |
1295 alpha*-*-* ) machine=alpha ;; | |
1296 vax-*-* ) machine=vax ;; | |
1297 mips-dec-* ) machine=pmax ;; | |
1298 mips-sgi-irix6* ) machine=iris6d ;; | |
1299 mips-sgi-* ) machine=iris4d ;; | |
1300 mips*-linux ) machine=mips ;; | |
1301 romp-ibm-* ) machine=ibmrt ;; | |
1302 rs6000-ibm-aix* ) machine=ibmrs6000 ;; | |
1303 powerpc-ibm-aix* ) machine=ibmrs6000 ;; | |
1304 powerpc*-* ) machine=powerpc ;; | |
1305 hppa-*-* ) machine=hp800 ;; | |
1306 m88k-dg-* ) machine=aviion ;; | |
1307 m68*-sony-* ) machine=news ;; | |
1308 mips-sony-* ) machine=news-risc ;; | |
1309 clipper-* ) machine=clipper ;; | |
1310 arm* ) machine=arm ;; | |
1311 ns32k-* ) machine=ns32000 ;; | |
1312 esac | |
1313 | |
1314 dnl Straightforward OS determination | |
1315 case "$ac_cv_build" in | |
1316 *-*-linux* ) opsys=linux ;; | |
1317 *-*-netbsd* ) opsys=netbsd ;; | |
1318 *-*-openbsd* ) opsys=openbsd ;; | |
1319 *-*-nextstep* ) opsys=nextstep ;; | |
1320 *-*-vms ) opsys=vms ;; | |
1321 | |
1322 dnl DEC OSF | |
1323 *-dec-osf1.3 | *-dec-osf2* ) opsys=decosf1-3 ;; | |
1324 *-dec-osf1.2 | *-dec-osf1* ) opsys=decosf1-2 ;; | |
1325 *-dec-osf3.[[2-9]] ) opsys=decosf3-2 ;; | |
1326 *-dec-osf3* ) opsys=decosf3-1 ;; | |
1327 *-dec-osf[[4-9]]* ) opsys=decosf4-0 ;; | |
1328 | |
1329 dnl DEC Ultrix | |
1330 *-*-ultrix[[0-3]].* | *-*-ultrix4.0* ) opsys=bsd4-2 ;; | |
1331 *-*-ultrix4.[[12]]* ) opsys=bsd4-3 ;; | |
1332 *-*-ultrix* ) opsys=ultrix4-3 ;; | |
1333 | |
1334 dnl AIX | |
1335 *-*-aix3.1* ) opsys=aix3-1 ;; | |
1336 *-*-aix3.2.5 ) opsys=aix3-2-5 ;; | |
1337 *-*-aix3* ) opsys=aix3-2 ;; | |
1338 *-*-aix4.0* ) opsys=aix4 ;; | |
1339 *-*-aix4.1* ) opsys=aix4-1 ;; | |
1340 *-*-aix[[4-9]]* ) opsys=aix4-2 ;; | |
1341 | |
1342 dnl Other generic OSes | |
1343 *-gnu* ) opsys=gnu ;; | |
1344 *-*-bsd4.[[01]] ) opsys=bsd4-1 ;; | |
1345 *-*-bsd4.2 ) opsys=bsd4-2 ;; | |
1346 *-*-bsd4.3 ) opsys=bsd4-3 ;; | |
1347 *-*-aos4.2 ) opsys=bsd4-2 ;; | |
1348 *-*-aos* ) opsys=bsd4-3 ;; | |
1349 *-*-sysv0 | *-*-sysvr0 ) opsys=usg5-0 ;; | |
1350 *-*-sysv2 | *-*-sysvr2 ) opsys=usg5-2 ;; | |
1351 *-*-sysv2.2 | *-*-sysvr2.2 ) opsys=usg5-2-2 ;; | |
1352 *-*-sysv3* | *-*-sysvr3* ) opsys=usg5-3 ;; | |
1353 *-*-sysv4.1* | *-*-sysvr4.1* )opsys=usg5-4 NON_GNU_CPP=/usr/lib/cpp ;; | |
1354 *-*-sysv4.[[2-9]]* | *-sysvr4.[[2-9]]* ) | |
1355 if test -z "$NON_GNU_CPP" ; then | |
1356 for prog in "/usr/ccs/lib/cpp" "/lib/cpp"; do | |
1357 if test -f "$prog"; then NON_GNU_CPP="$prog"; break; fi | |
1358 done | |
1359 fi | |
1360 opsys=usg5-4-2 ;; | |
1361 *-sysv4* | *-sysvr4* ) opsys=usg5-4 ;; | |
1362 *-*-mach_bsd4.3* ) opsys=mach-bsd4-3 ;; | |
1363 esac | |
1364 | |
1365 case "$ac_cv_build" in | |
1366 | |
1367 dnl NetBSD ports | |
1368 *-*-netbsd* ) | |
2663 | 1369 case "${ac_cv_build}" in |
2651 | 1370 i[[3-9]]86-*-netbsd*) machine=intel386 ;; |
1371 hp300-*-netbsd* | amiga-*-netbsd* | sun3-*-netbsd* | mac68k-*-netbsd* | da30-*-netbsd* | m68k-*-netbsd* ) | |
1372 dnl Yes, this is somewhat bogus. | |
1373 machine=hp9000s300 ;; | |
1374 pc532-*-netbsd* | ns32k-*-netbsd* ) machine=ns32000 ;; | |
1375 pmax-*-netbsd* | mips-*-netbsd* ) machine=pmax ;; | |
1376 esac | |
1377 ;; | |
1378 | |
1379 dnl OpenBSD ports | |
1380 *-*-openbsd* ) | |
1381 case "${ac_cv_build}" in | |
1382 i386-*-openbsd*) machine=intel386 ;; | |
1383 m68k-*-openbsd*) machine=hp9000s300 ;; | |
1384 mipsel-*-openbsd*) machine=pmax ;; | |
1385 esac | |
1386 ;; | |
1387 | |
1388 dnl Acorn RISCiX: | |
1389 arm-acorn-riscix1.1* ) machine=acorn opsys=riscix1-1 ;; | |
1390 arm-acorn-riscix1.2* | arm-acorn-riscix ) machine=acorn opsys=riscix1-2 ;; | |
1391 | |
1392 dnl Alliant machines | |
1393 fx80-alliant-* ) machine=alliant4 opsys=bsd4-2 ;; | |
1394 i860-alliant-* ) machine=alliant-2800 opsys=bsd4-3 ;; | |
1395 | |
1396 dnl Altos 3068 | |
1397 m68*-altos-sysv* ) machine=altos opsys=usg5-2 ;; | |
1398 | |
1399 dnl Amdahl UTS | |
1400 580-amdahl-sysv* ) machine=amdahl opsys=usg5-2-2 ;; | |
1401 | |
1402 dnl Apollo, Domain/OS | |
1403 m68*-apollo-* ) machine=apollo opsys=bsd4-3 ;; | |
1404 | |
1405 dnl AT&T 3b2, 3b5, 3b15, 3b20 | |
1406 we32k-att-sysv* ) machine=att3b opsys=usg5-2-2 ;; | |
1407 | |
1408 dnl AT&T 3b1 - The Mighty Unix PC! | |
1409 m68*-att-sysv* ) machine=7300 opsys=usg5-2-2 ;; | |
1410 | |
1411 dnl Bull machines | |
1412 rs6000-bull-bosx* ) machine=ibmrs6000 opsys=aix3-2 ;; # dpx20 | |
1413 m68*-bull-sysv3* ) machine=dpx2 opsys=usg5-3 ;; # dpx2 | |
1414 m68*-bull-sysv2* ) machine=sps7 opsys=usg5-2 ;; # sps7 | |
1415 | |
1416 dnl CCI 5/32, 6/32 -- see "Tahoe". | |
1417 | |
1418 dnl Celerity | |
1419 celerity-celerity-bsd* ) machine=celerity opsys=bsd4-2 ;; | |
1420 | |
1421 dnl Convex | |
1422 *-convex-bsd* | *-convex-convexos* ) | |
1423 machine=convex opsys=bsd4-3 | |
1424 NON_GNU_CPP="cc -E -P" | |
1425 ;; | |
1426 | |
1427 dnl Cubix QBx/386 | |
1428 i[[3-9]]86-cubix-sysv* ) machine=intel386 opsys=usg5-3 ;; | |
1429 | |
1430 dnl Darwin, a.k.a. MacOS X (based on Mach and Freebsd) | |
1431 *-*-darwin*) | |
1432 opsys=darwin | |
1433 ;; | |
1434 | |
1435 dnl Data General AViiON Machines | |
1436 i586-dg-dgux*R4* | i586-dg-dgux5.4.4* ) machine=aviion opsys=dgux5-4r4 ;; | |
1437 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* ) opsys=dgux5-4r3 ;; | |
1438 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* ) opsys=dgux5-4r2 ;; | |
1439 m88k-dg-dgux* ) opsys=dgux ;; | |
1440 | |
1441 dnl Motorola Delta machines | |
1442 m68k-motorola-sysv* | m68000-motorola-sysv* ) machine=delta opsys=usg5-3 ;; | |
1443 m88k-motorola-sysv4* ) | |
1444 dnl jbotte@bnr.ca says that UNIX_System_V <hostName> 4.0 R40V4.3 m88k mc88110 | |
1445 dnl needs POSIX_SIGNALS and therefore needs usg5-4-2. | |
1446 dnl I hope there are not other 4.0 versions for this machine | |
1447 dnl which really need usg5-4 instead. | |
1448 machine=delta88k opsys=usg5-4-2 | |
1449 ;; | |
1450 m88k-motorola-sysv* | m88k-motorola-m88kbcs* ) machine=delta88k opsys=usg5-3 ;; | |
1451 | |
1452 dnl Dual machines | |
1453 m68*-dual-sysv* ) machine=dual opsys=usg5-2 ;; | |
1454 m68*-dual-uniplus* ) machine=dual opsys=unipl5-2 ;; | |
1455 | |
1456 dnl Encore machines | |
1457 ns16k-encore-bsd* ) machine=ns16000 opsys=umax ;; | |
1458 | |
1459 dnl Gould Power Node and NP1 | |
1460 pn-gould-bsd4.2* ) machine=gould opsys=bsd4-2 ;; | |
1461 pn-gould-bsd4.3* ) machine=gould opsys=bsd4-3 ;; | |
1462 np1-gould-bsd* ) machine=gould-np1 opsys=bsd4-3 ;; | |
1463 | |
1464 dnl Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000 | |
1465 dnl as far as XEmacs is concerned). | |
1466 m88k-harris-cxux* ) | |
1467 dnl Build needs to be different on 7.0 and later releases | |
1468 case "`uname -r`" in | |
1469 [[56]].[[0-9]] ) machine=nh4000 opsys=cxux ;; | |
1470 [[7]].[[0-9]] ) machine=nh4000 opsys=cxux7 ;; | |
1471 esac | |
1472 NON_GNU_CPP="/lib/cpp" | |
1473 ;; | |
1474 dnl Harris ecx or gcx running CX/UX (Series 1200, Series 3000) | |
1475 m68k-harris-cxux* ) machine=nh3000 opsys=cxux ;; | |
1476 dnl Harris power pc NightHawk running Power UNIX (Series 6000) | |
1477 powerpc-harris-powerunix ) machine=nh6000 opsys=powerunix NON_GNU_CPP="cc -Xo -E -P" ;; | |
1478 | |
1479 dnl Honeywell XPS100 | |
1480 xps*-honeywell-sysv* ) machine=xps100 opsys=usg5-2 ;; | |
1481 | |
1482 dnl HP 9000 series 200 or 300 | |
1483 m68*-hp-bsd* ) machine=hp9000s300 opsys=bsd4-3 ;; | |
1484 | |
1485 dnl HP-UX | |
1486 *-hp-hpux* ) | |
1487 dnl Figure out machine and opsys orthogonally | |
1488 case "$ac_cv_build" in | |
1489 m68* ) machine=hp9000s300 ;; | |
1490 hppa* ) machine=hp800 ;; | |
1491 esac | |
1492 | |
1493 case "$ac_cv_build" in | |
1494 *-hp-hpux7* ) opsys=hpux ;; | |
1495 *-hp-hpux8* ) opsys=hpux8 ;; | |
1496 *-hp-hpux9* ) opsys=hpux9 ;; | |
1497 *-hp-hpux10* ) opsys=hpux10 ;; | |
1498 *-hp-hpux11* ) opsys=hpux11 ;; | |
1499 * ) opsys=hpux ;; | |
1500 esac | |
1501 | |
1502 dnl HP has a broken "strcat" | |
1503 case "$opsys" in hpux9 | hpux10 ) XE_ADD_OBJS(strcat.o) ;; esac | |
1504 | |
1505 if test "$opsys" = "hpux10" -o "$opsys" = "hpux11"; then \ | |
1506 ansi_flag="-Ae"; else ansi_flag="-Aa"; fi | |
1507 NON_GNU_CC="cc $ansi_flag" NON_GNU_CPP="cc $ansi_flag -E" | |
1508 | |
1509 case "$ac_cv_build" in *-hp-hpux*shr* ) opsys="${opsys}-shr" ;; esac | |
1510 ;; | |
1511 | |
1512 dnl Orion machines | |
1513 orion-orion-bsd* ) machine=orion opsys=bsd4-2 ;; | |
1514 clipper-orion-bsd* ) machine=orion105 opsys=bsd4-2 ;; | |
1515 | |
1516 dnl IBM machines | |
1517 i[[3-9]]86-ibm-aix1.1* ) machine=ibmps2-aix opsys=usg5-2-2 ;; | |
1518 i[[3-9]]86-ibm-aix1.[[23]]* | i[[3-9]]86-ibm-aix* ) machine=ibmps2-aix opsys=usg5-3 ;; | |
1519 i370-ibm-aix*) machine=ibm370aix opsys=usg5-3 ;; | |
1520 romp-ibm-aos* ) opsys=bsd4-3 ;; | |
1521 romp-ibm-bsd* ) opsys=bsd4-3 ;; | |
1522 romp-ibm-mach* ) opsys=mach-bsd4-3 ;; | |
1523 | |
1524 dnl Integrated Solutions "Optimum V" | |
1525 m68*-isi-bsd4.2* ) machine=isi-ov opsys=bsd4-2 ;; | |
1526 m68*-isi-bsd4.3* ) machine=isi-ov opsys=bsd4-3 ;; | |
1527 | |
1528 dnl Intel 386 machines where we do care about the manufacturer | |
1529 i[[3-9]]86-intsys-sysv* ) machine=is386 opsys=usg5-2-2 ;; | |
1530 | |
1531 dnl Prime EXL | |
1532 i[[3-9]]86-prime-sysv* ) machine=i386 opsys=usg5-3 ;; | |
1533 | |
1534 dnl Sequent Symmetry running Dynix | |
1535 i[[3-9]]86-sequent-bsd* ) machine=symmetry opsys=bsd4-3 ;; | |
1536 | |
1537 dnl Sequent Symmetry running DYNIX/ptx | |
1538 i[[3-9]]86-sequent-ptx* ) machine=sequent-ptx opsys=ptx NON_GNU_CPP="/lib/cpp" ;; | |
1539 | |
1540 dnl Unspecified sysv on an ncr machine defaults to svr4.2. | |
1541 dnl (Plain usg5-4 does not turn on POSIX signals, which we need.) | |
1542 i[[3-9]]86-ncr-sysv* ) machine=ncr386 opsys=usg5-4-2 ;; | |
1543 | |
1544 dnl Intel Paragon OSF/1 | |
1545 i860-intel-osf1* ) machine=paragon opsys=osf1 NON_GNU_CPP=/usr/mach/lib/cpp ;; | |
1546 | |
1547 dnl Intel 860 | |
1548 i860-*-sysv4* ) machine=i860 opsys=usg5-4 NON_GNU_CC="/bin/cc" NON_GNU_CPP="/usr/ccs/lib/cpp" ;; | |
1549 | |
1550 dnl Masscomp machines | |
1551 m68*-masscomp-rtu* ) machine=masscomp opsys=rtu ;; | |
1552 | |
1553 dnl Megatest machines | |
1554 m68*-megatest-bsd* ) machine=mega68 opsys=bsd4-2 ;; | |
1555 | |
1556 dnl Workstations sold by MIPS | |
1557 dnl This is not necessarily all workstations using the MIPS processor - | |
1558 dnl Irises are produced by SGI, and DECstations by DEC. | |
1559 mips-mips-usg* ) machine=mips4 ;; | |
1560 mips-mips-riscos4 ) | |
1561 machine=mips4 | |
1562 NON_GNU_CC="cc -systype bsd43" | |
1563 NON_GNU_CPP="cc -systype bsd43 -E" | |
1564 case "$ac_cv_build" in | |
1565 mips-mips-riscos4* ) opsys=bsd4-3 ;; | |
1566 mips-mips-riscos5* ) opsys=riscos5 ;; | |
1567 esac | |
1568 ;; | |
1569 mips-mips-bsd* ) machine=mips opsys=bsd4-3 ;; | |
1570 mips-mips-* ) machine=mips opsys=usg5-2-2 ;; | |
1571 | |
1572 dnl NeXT | |
1573 m68*-next-* | m68k-*-nextstep* ) machine=m68k opsys=nextstep ;; | |
1574 | |
1575 dnl The complete machine from National Semiconductor | |
1576 ns32k-ns-genix* ) machine=ns32000 opsys=usg5-2 ;; | |
1577 | |
1578 dnl NCR machines | |
1579 m68*-ncr-sysv2* | m68*-ncr-sysvr2* ) machine=tower32 opsys=usg5-2-2 ;; | |
1580 m68*-ncr-sysv3* | m68*-ncr-sysvr3* ) machine=tower32v3 opsys=usg5-3 ;; | |
1581 | |
1582 dnl Nixdorf Targon 31 | |
1583 m68*-nixdorf-sysv* ) machine=targon31 opsys=usg5-2-2 ;; | |
1584 | |
1585 dnl Nu (TI or LMI) | |
1586 m68*-nu-sysv* ) machine=nu opsys=usg5-2 ;; | |
1587 | |
1588 dnl Plexus | |
1589 m68*-plexus-sysv* ) machine=plexus opsys=usg5-2 ;; | |
1590 | |
1591 dnl Pyramid machines | |
1592 pyramid-pyramid-bsd* ) machine=pyramid opsys=bsd4-2 ;; | |
1593 | |
1594 dnl Sequent Balance | |
1595 ns32k-sequent-bsd4.2* ) machine=sequent opsys=bsd4-2 ;; | |
1596 ns32k-sequent-bsd4.3* ) machine=sequent opsys=bsd4-3 ;; | |
1597 | |
1598 dnl Siemens Nixdorf | |
1599 mips-siemens-sysv* | mips-sni-sysv*) | |
1600 machine=mips-siemens opsys=usg5-4 | |
1601 NON_GNU_CC=/usr/ccs/bin/cc | |
1602 NON_GNU_CPP=/usr/ccs/lib/cpp | |
1603 ;; | |
1604 | |
1605 dnl NEC | |
1606 mips-nec-sysv*) | |
1607 machine=mips-nec | |
1608 NON_GNU_CC=/usr/ccs/bin/cc | |
1609 NON_GNU_CPP=/usr/ccs/lib/cpp | |
1610 ;; | |
1611 | |
1612 dnl Silicon Graphics machines | |
1613 dnl Iris 2500 and Iris 2500 Turbo (aka the Iris 3030) | |
1614 m68*-sgi-iris3.5* ) machine=irist opsys=iris3-5 ;; | |
1615 m68*-sgi-iris3.6* | m68*-sgi-iris*) machine=irist opsys=iris3-6 ;; | |
1616 dnl Iris 4D | |
1617 mips-sgi-irix3.* ) opsys=irix3-3 ;; | |
1618 mips-sgi-irix4.* ) opsys=irix4-0 ;; | |
1619 mips-sgi-irix6* ) opsys=irix6-0 ;; | |
1620 mips-sgi-irix5.1* ) opsys=irix5-1 ;; | |
1621 mips-sgi-irix5.2* ) opsys=irix5-2 ;; | |
1622 mips-sgi-irix5.* ) opsys=irix5-3 ;; | |
1623 mips-sgi-irix* ) opsys=irix5-0 ;; | |
1624 | |
1625 dnl SONY machines | |
1626 *-sony-newsos[[34]]* | *-sony-news[[34]]* ) opsys=bsd4-3 ;; | |
1627 *-sony-news* ) opsys=newsos5 ;; | |
1628 | |
1629 dnl Stride | |
1630 m68*-stride-sysv* ) machine=stride opsys=usg5-2 ;; | |
1631 | |
1632 dnl Suns | |
1633 *-*-solaris* | *-*-sunos* | *-sun-mach* | *-sun-bsd* ) | |
1634 dnl Hardware type | |
1635 case "$ac_cv_build" in | |
1636 m68*-sunos1* ) machine=sun1 ;; | |
1637 m68*-sunos2* ) machine=sun2 ;; | |
1638 m68* ) machine=sun3 ;; | |
1639 i*86*-sun-sunos[[34]]* ) machine=sun386 ;; | |
1640 i*86-*-* ) machine=intel386 ;; | |
1641 rs6000* ) machine=rs6000 ;; | |
1642 esac | |
1643 | |
1644 dnl Make $canonical even more so. | |
1645 case "$ac_cv_build" in *-sunos5*) | |
1646 ac_cv_build=`echo $ac_cv_build | sed -e s/sunos5/solaris2/`;; | |
1647 esac | |
1648 | |
1649 dnl On SunOS 4, use /usr/lib/cpp, sans dynodump, /bin/ranlib | |
1650 dnl On SunOS 5, use cc -E, need dynodump, RANLIB not needed | |
1651 dnl But, SunOS 5.6 no longer needs dynodump because it has a similar | |
1652 dnl function integrated. | |
1653 case "$ac_cv_build" in | |
1654 *-sunos4* ) | |
1655 #test -f /usr/lib/cpp && NON_GNU_CPP=/usr/lib/cpp ;; | |
1656 : ;; | |
1657 *-solaris2* ) | |
1658 #test -f /usr/ccs/lib/cpp && NON_GNU_CPP=/usr/ccs/lib/cpp | |
1659 RANLIB=':' ;; | |
1660 esac | |
1661 | |
1662 case "$ac_cv_build" in | |
1663 *-solaris* ) | |
1664 opsys=sol2 | |
1665 os_release_major=`uname -r | sed -e 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).*/\1/'` | |
1666 os_release_minor=`uname -r | sed -e 's/^\([[0-9]]\{1,\}\)\.\([[0-9]]\{1,\}\).*/\2/'` | |
1667 case "$os_release_minor" in [[0-9]]) | |
1668 os_release_minor="0${os_release_minor}";; | |
1669 esac | |
1670 os_release="${os_release_major}${os_release_minor}" | |
1671 AC_DEFINE_UNQUOTED(OS_RELEASE, $os_release) ;; | |
1672 | |
1673 dnl The last Sun386 ran 4.0. | |
1674 i*86-*-sunos4* ) opsys=sunos4-0 ;; | |
1675 *-sunos4.0* ) opsys=sunos4-0 ;; | |
1676 *-sunos4.1.2* ) opsys=sunos4-1-2 ;; | |
1677 *-sunos4.1.3* ) opsys=sunos4-1-3 ;; | |
1678 *-sunos4.1.[[4-9]]* ) opsys=sunos4-1-4 ;; | |
1679 *-sunos4* | *-sunos ) opsys=sunos4-1 ;; | |
1680 *-mach* ) opsys=mach-bsd4-3 ;; | |
1681 * ) opsys=bsd4-2 ;; | |
1682 esac | |
1683 | |
1684 case "$ac_cv_build" in *-sunos4*shr* ) opsys="${opsys}-shr" ;; esac | |
1685 | |
1686 dnl Watch out for a compiler guaranteed not to work. | |
1687 test "$opsys $CC" = "sol2 /usr/ucb/cc" && CC="" | |
1688 ;; | |
1689 | |
1690 dnl Tadpole 68k | |
1691 m68*-tadpole-sysv* ) machine=tad68k opsys=usg5-3 ;; | |
1692 | |
1693 dnl Tahoe machines | |
1694 tahoe-tahoe-bsd4.2* ) machine=tahoe opsys=bsd4-2 ;; | |
1695 tahoe-tahoe-bsd4.3* ) machine=tahoe opsys=bsd4-3 ;; | |
1696 | |
1697 dnl Tandem Integrity S2 | |
1698 mips-tandem-sysv* ) machine=tandem-s2 opsys=usg5-3 ;; | |
1699 | |
1700 dnl Tektronix XD88 | |
1701 m88k-tektronix-sysv3* ) machine=tekxd88 opsys=usg5-3 ;; | |
1702 | |
1703 dnl Tektronix 16000 box (6130?) | |
1704 ns16k-tektronix-bsd* ) machine=ns16000 opsys=bsd4-2 ;; | |
1705 dnl Tektronix 4300 | |
1706 dnl src/m/tek4300.h hints that this is a m68k machine. | |
1707 m68*-tektronix-bsd* ) machine=tek4300 opsys=bsd4-3 ;; | |
1708 | |
1709 dnl Titan P2 or P3 | |
1710 titan-titan-sysv* ) machine=titan opsys=usg5-3 ;; | |
1711 | |
1712 dnl Ustation E30 (SS5E) | |
1713 m68*-unisys-uniplus* ) machine=ustation opsystem=unipl5-2 ;; | |
1714 | |
1715 dnl Vaxen. | |
1716 vax-dec-* ) | |
1717 case "$ac_cv_build" in | |
1718 *-sysv[[01]]* | *-sysvr[[01]]* ) opsys=usg5-0 ;; | |
1719 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;; | |
1720 *-mach* ) opsys=mach-bsd4-3 ;; | |
1721 esac | |
1722 ;; | |
1723 | |
1724 dnl Whitechapel MG1 | |
1725 ns16k-whitechapel-* ) machine=mg1 ;; | |
1726 | |
1727 dnl Wicat | |
1728 m68*-wicat-sysv* ) machine=wicat opsys=usg5-2 ;; | |
1729 | |
1730 dnl Intel 386 machines where we do not care about the manufacturer | |
1731 i[[3-9]]86-*-* ) | |
1732 machine=intel386 | |
1733 case "$ac_cv_build" in | |
1734 *-isc1.* | *-isc2.[[01]]* ) opsys=386-ix ;; | |
1735 *-isc2.2* ) opsys=isc2-2 ;; | |
1736 *-isc4.0* ) opsys=isc4-0 ;; | |
1737 *-isc4.* ) opsys=isc4-1 | |
1738 GCC_TEST_OPTIONS=-posix | |
1739 NON_GCC_TEST_OPTIONS=-Xp | |
1740 ;; | |
1741 *-isc* ) opsys=isc3-0 ;; | |
1742 *-esix5* ) opsys=esix5r4 NON_GNU_CPP=/usr/lib/cpp ;; | |
1743 *-esix* ) opsys=esix ;; | |
1744 *-mach* ) opsys=mach-bsd4-3 ;; | |
1745 *-xenix* ) opsys=xenix ;; | |
1746 *-sco3.2v4* ) opsys=sco4 NON_GNU_CPP=/lib/cpp ;; | |
1747 *-bsd386* | *-bsdi1* ) opsys=bsd386 ;; | |
1748 *-bsdi4* ) opsys=bsdos4 ;; | |
1749 *-bsdi3* ) opsys=bsdos3 ;; | |
1750 *-bsdi2.1* ) opsys=bsdos2-1 ;; | |
1751 *-bsdi2* ) opsys=bsdos2 ;; | |
1752 *-sco3.2v5* ) opsys=sco5 ;; | |
1753 *-sysv5* ) opsys=sco7 ;; | |
1754 *-386bsd* ) opsys=386bsd ;; | |
1755 *-freebsd* ) opsys=freebsd ;; | |
1756 *-nextstep* ) opsys=nextstep ;; | |
1757 *-pc-cygwin* ) opsys=cygwin32 ;; | |
1758 *-pc-mingw* ) opsys=mingw32 ; | |
1759 test -z "$with_tty" && with_tty="no";; | |
1760 dnl Otherwise, we fall through to the generic opsys code at the bottom. | |
1761 esac | |
1762 ;; | |
1763 | |
1764 dnl Linux/68k | |
1765 m68k-*-linux* ) machine=m68k opsys=linux ;; | |
1766 | |
1767 esac | |
1768 | |
1769 dnl Initialize machine from $canonical if not in our database above. | |
1770 test -z "$machine" && machine=`echo $ac_cv_build | sed 's/-.*$//'` | |
1771 | |
1772 dnl Initialize opsys from `uname -s` if not in our database above. | |
1773 test -z "$opsys" && opsys=`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` | |
1774 | |
1775 dnl Use configure-time autodetection if s&m not available | |
1776 if test -r "${srcdir}/src/m/${machine}.h"; then | |
1777 machfile="m/${machine}.h" | |
1778 AC_DEFINE_UNQUOTED(config_machfile, "$machfile") | |
1779 else | |
1780 echo "XEmacs has no builtin knowledge of \`$machine' machines." | |
1781 echo "Using configure-time autodetection only." | |
1782 fi | |
1783 | |
1784 if test -r "${srcdir}/src/s/${opsys}.h"; then | |
1785 opsysfile="s/${opsys}.h" | |
1786 AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile") | |
1787 else | |
1788 echo "XEmacs has no builtin knowledge of \`$opsys' operating systems." | |
1789 echo "Using configure-time autodetection only." | |
1790 fi | |
1791 | |
1792 | |
1793 dnl -------------------------------------------------------------- | |
1794 dnl $opsys detection complete; defaults depending on $opsys follow | |
1795 dnl -------------------------------------------------------------- | |
1796 | |
1797 if test -z "$enable_pdump"; then | |
1798 case "$opsys" in | |
1799 linux* ) enable_pdump=yes ;; dnl glibc 2.3.1 seems to hose unexec | |
1800 darwin ) enable_pdump=yes ;; dnl No "native" working dumper available | |
1801 cygwin* ) enable_pdump=yes ;; dnl unexec is broken | |
1802 * ) enable_pdump=no ;; | |
1803 esac | |
1804 fi | |
1805 | |
3092 | 1806 if test "$enable_newgc" = "yes"; then |
1807 if test "$enable_vdb" = "auto"; then | |
1808 case "$opsys" in | |
3520 | 1809 darwin ) case "$machine" in |
4424
42711a251efd
Look for all x86 machines to determine which write barrier to use on MacOSX.
Marcus Crestani <crestani@informatik.uni-tuebingen.de>
parents:
4419
diff
changeset
|
1810 i[[3-9]]86 ) check_vdb_posix=yes ;; |
3520 | 1811 * ) AC_DEFINE(VDB_MACH) have_vdb_mach=yes ;; |
1812 esac ;; | |
3092 | 1813 cygwin* ) AC_DEFINE(VDB_WIN32) have_vdb_win32=yes ;; |
1814 linux* ) check_vdb_posix=yes ;; | |
1815 freebsd ) check_vdb_posix=yes ;; | |
1816 dnl if not sure, try posix first, maybe we are lucky | |
1817 * ) check_vdb_posix=yes ;; | |
1818 esac | |
1819 else | |
1820 case "$enable_vdb" in | |
1821 mach ) AC_DEFINE(VDB_MACH) have_vdb_mach=yes ;; | |
1822 win32 ) AC_DEFINE(VDB_WIN32) have_vdb_win32=yes ;; | |
1823 posix ) check_vdb_posix=yes ;; | |
1824 fake ) have_vdb_fake=yes ;; | |
1825 no ) have_vdb_fake=yes ;; | |
1826 esac | |
1827 fi | |
1828 fi | |
1829 | |
2651 | 1830 if test -z "$with_dynamic"; then |
1831 case "$opsys" in | |
1832 hpux* | sunos4* ) with_dynamic=no ;; | |
1833 *) with_dynamic=yes ;; | |
1834 esac | |
1835 fi | |
1836 if test "$with_dynamic" = "yes"; then | |
1837 case "$opsys" in | |
1838 hpux* | sunos4* | sco5 ) opsys="${opsys}-shr" ;; | |
1839 decosf* ) ld_call_shared="-call_shared" ;; | |
1840 darwin ) AC_DEFINE(DLSYM_NEEDS_UNDERSCORE) ;; | |
1841 esac | |
1842 else dnl "$with_dynamic" = "no" | |
1843 case "$opsys" in | |
1844 sol2 ) | |
1845 echo "Static linking is not supported on Solaris 2." | |
1846 echo "Rerun configure without specifying --without-dynamic." | |
1847 exit 1 ;; | |
1848 linux ) ld_call_shared="-Bstatic" ;; | |
1849 decosf* ) ld_call_shared="-non_shared" ;; | |
1850 esac | |
1851 fi | |
1852 | |
1853 dnl Tools configuration | |
1854 case "$opsys" in | |
1855 aix* ) NON_GNU_CC=xlc ;; dnl Use xlc by default on AIX | |
1856 darwin ) RANLIB="ranlib -c" ;; dnl Avoid link error in lwlib-config.c | |
1857 esac | |
1858 | |
1859 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${ac_cv_build} | sed 'y/.-/__/'` | |
1860 AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher) | |
1861 | |
1862 dnl -------------------------------------------------- | |
1863 dnl Determine the compiler, set up for feature testing | |
1864 dnl -------------------------------------------------- | |
1865 | |
1866 dnl Sun Development environment support | |
1867 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias | |
1868 XE_CHECK_FEATURE_DEPENDENCY(workshop, tooltalk) | |
1869 if test "$with_workshop" = "yes"; then | |
1870 AC_DEFINE(SUNPRO) | |
1871 fi | |
1872 | |
1873 if test "$enable_clash_detection" != "no"; then | |
1874 AC_DEFINE(CLASH_DETECTION) | |
1875 fi | |
1876 | |
1877 dnl Choose a compiler from (in order) | |
2680 | 1878 dnl --with-compiler, env var CC, with_gcc=no && ${NON_GNU_CC:-cc}, AC_PROG_CC |
2651 | 1879 test -n "$with_compiler" && CC="$with_compiler" |
1880 if test "$with_gcc" = "no"; then dnl Try to find a non-gcc compiler | |
1881 case "$CC" in "" | *gcc* ) CC="${NON_GNU_CC-cc}" ;; esac | |
1882 fi | |
1883 | |
1884 dnl If we don't set CFLAGS here, AC_PROG_CC will set it. | |
1885 dnl But we know better what's good for us, so we do our own | |
1886 dnl computation of real CFLAGS later. | |
1887 dnl --with_cflags overrides environment variable CFLAGS | |
1888 test "${with_cflags-unset}" != unset && CFLAGS="$with_cflags" | |
1889 if test "${CFLAGS-unset}" != unset | |
1890 then cflags_specified=yes; | |
1891 else cflags_specified=no; | |
1892 fi | |
1893 | |
1894 if test "${with_cflags_warning-unset}" != unset | |
1895 then cflags_warning_specified=yes; | |
1896 else cflags_warning_specified=no; | |
1897 fi | |
1898 | |
2667 | 1899 if test "${with_cflags_optimization-unset}" != unset |
2651 | 1900 then cflags_optimization_specified=yes; |
1901 else cflags_optimization_specified=no; | |
1902 fi | |
1903 | |
2667 | 1904 if test "${with_cflags_debugging-unset}" != unset |
2651 | 1905 then cflags_debugging_specified=yes; |
1906 else cflags_debugging_specified=no; | |
1907 fi | |
1908 | |
1909 xe_save_CFLAGS="$CFLAGS" | |
1910 | |
1911 AC_AIX dnl Defines _ALL_SOURCE on AIX. | |
1912 | |
1913 AC_PROG_CC dnl Autoconf has its own magic for compiler autodetection | |
1914 | |
1915 dnl Retry using random guesswork if AC_PROG_CC got it wrong... | |
1916 if test "$with_gcc" = "no" -a "$GCC" = "yes"; then | |
1917 CC=${NON_GNU_CC-cc} | |
1918 AC_PROG_CC | |
1919 elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then | |
1920 CC=gcc | |
1921 AC_PROG_CC | |
1922 fi | |
1923 CFLAGS="$xe_save_CFLAGS" | |
1924 | |
1925 dnl Determine GCC version. | |
1926 if test "$GCC" = "yes"; then | |
1927 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () { | |
3494 | 1928 return __GNUC__; |
1929 }])], [:], [__GCC="$?"]) | |
1930 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () { | |
1931 return __GNUC_MINOR__; | |
1932 }])], [:], [__GCC_MINOR="$?"]) | |
1933 __GCC_VERSION=$__GCC"."$__GCC_MINOR | |
1934 echo "You appear to be using GCC version" $__GCC_VERSION | |
2651 | 1935 fi |
1936 | |
1937 dnl Support for using a different compiler for xemacs itself. | |
1938 dnl Useful for building XEmacs with a C++ compiler. | |
1939 dnl For example, `configure --compiler=gcc --xemacs-compiler=g++ | |
1940 | |
1941 dnl The compiler used to build xemacs, as opposed to the compiler | |
1942 dnl used by configure and lib-src, is determined from the following | |
1943 dnl sources, in order of priority: | |
2680 | 1944 dnl o --with-xemacs-compiler configure flag |
2651 | 1945 dnl o XEMACS_CC environment variable |
1946 dnl o same as the regular compiler, (determined previously) | |
1947 | |
1948 dnl We don't do AC_PROG_CC for XEMACS_CC; if we can't trust these people.... | |
1949 test -n "$with_xemacs_compiler" && XEMACS_CC="$with_xemacs_compiler" | |
1950 : ${XEMACS_CC:="$CC"} | |
1951 | |
1952 dnl Figure out what C preprocessor to use. | |
1953 | |
1954 dnl On Sun systems, people sometimes set up the variable CPP | |
1955 dnl with a value that is a directory, not an executable at all. | |
1956 dnl Detect that case, and ignore that value. | |
1957 test -n "$CPP" -a -d "$CPP" && CPP= | |
1958 | |
1959 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP" | |
1960 | |
1961 AC_PROG_CPP | |
1962 | |
1963 dnl -------------------------------------------------------------------- | |
1964 dnl Compiler feature macros | |
1965 dnl -------------------------------------------------------------------- | |
1966 | |
1967 dnl We want feature macros defined here *and* in config.h.in, so that | |
1968 dnl the compilation environment at configure time and compile time agree. | |
1969 | |
1970 AC_MSG_CHECKING(for GNU libc) | |
3312 | 1971 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <features.h>],[ |
2651 | 1972 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__) |
1973 #error Not a GNU libc system :-( | |
1974 ******* ======= ******** &&&&&&&& | |
1975 #endif | |
3312 | 1976 ])], have_glibc=yes, have_glibc=no) |
2651 | 1977 AC_MSG_RESULT($have_glibc) |
1978 dnl I'm tired of pop being broken with GLIBC -slb | |
1979 dnl Well. then why not fix fucking pop? | |
1980 test "$have_glibc" = "yes" && AC_DEFINE(_GNU_SOURCE) | |
1981 | |
1982 dnl We'd like to use vendor extensions, where available. | |
1983 dnl We'd like to use functions from the latest Unix98 standards. | |
1984 dnl See http://www.opengroup.org/onlinepubs/007908799/xsh/compilation.html | |
1985 case "$opsys" in | |
1986 sol2) | |
1987 AC_DEFINE(__EXTENSIONS__) | |
1988 dnl Solaris 2 before 2.5 had some bugs with feature test macro interaction. | |
1989 if test "$os_release" -ge 505; then | |
1990 AC_DEFINE(_XOPEN_SOURCE,500) | |
1991 AC_DEFINE(_XOPEN_SOURCE_EXTENDED) | |
1992 fi ;; | |
1993 linux) | |
1994 AC_DEFINE(_POSIX_C_SOURCE,199506L) | |
1995 dnl #### should this be 600? | |
1996 AC_DEFINE(_XOPEN_SOURCE,500) | |
1997 AC_DEFINE(_XOPEN_SOURCE_EXTENDED) | |
1998 ;; | |
1999 freebsd4*) | |
2000 AC_DEFINE(_POSIX_C_SOURCE,199506L) | |
2001 dnl #### Do we want these too? Apparently yes for _XOPEN_SOURCE=500. | |
2002 AC_DEFINE(_XOPEN_SOURCE,500) | |
2003 dnl AC_DEFINE(_XOPEN_SOURCE_EXTENDED) | |
2004 ;; | |
2005 esac | |
2006 | |
2007 dnl Identify compilers to enable compiler-specific hacks. | |
2008 dnl Add support for other compilers HERE! | |
2009 dnl GCC is already identified elsewhere. | |
2010 AC_RUN_IFELSE([AC_LANG_SOURCE([int main () { | |
2011 #if defined __SUNPRO_C | |
2012 return 11; | |
2013 #elif defined __DECC | |
2014 return 12; | |
2015 #elif defined __USLC__ && defined __SCO_VERSION__ | |
2016 return 13; | |
2017 #elif defined __INTEL_COMPILER | |
2018 return 14; | |
2019 #else | |
2020 return 0; | |
2021 #endif | |
2022 }])], [], | |
2023 [case "$?" in | |
2024 11) echo "You appear to be using the SunPro C compiler." ; __SUNPRO_C=yes ;; | |
2025 12) echo "You appear to be using the DEC C compiler." ; __DECC=yes ;; | |
2026 13) echo "You appear to be using the SCO C compiler." ; __USLC__=yes ;; | |
2027 14) echo "You appear to be using the Intel C++ compiler."; __ICC=yes | |
2028 dnl Newer versions of icc claim to be GCC | |
2029 GCC=no ;; | |
2030 esac]) | |
2031 | |
2032 dnl -------------------------------------------------------------------- | |
2033 dnl Extract some information from the operating system and machine files | |
2034 dnl -------------------------------------------------------------------- | |
2035 | |
2036 echo "Extracting information from the machine- and system-dependent headers..." | |
2037 | |
2038 dnl It is not important that this name contain the PID; you cannot run | |
2039 dnl two configures in the same directory and have anything work | |
2040 dnl anyway. | |
2041 tempcname="conftest.c" | |
2042 | |
2043 dnl CPP_to_sh(CPP_SYMBOL, SH_VAR, DEFAULT_VALUE) | |
2044 define([CPP_to_sh], | |
2045 [[#]ifndef [$1] | |
2046 [#]define [$1]ifelse([$3],,, [ "$3"]) | |
2047 [#]endif | |
2048 configure___ [$2]=[$1] | |
2049 ])dnl CPP_to_sh | |
2050 | |
2051 dnl CPP_boolean_to_sh(CPP_SYMBOL, SH_VAR) | |
2052 define([CPP_boolean_to_sh], | |
2053 [[#]ifdef [$1] | |
2054 configure___ [$2]=yes | |
2055 [#]else | |
2056 configure___ [$2]=no | |
2057 [#]endif | |
2058 ])dnl CPP_boolean_to_sh | |
2059 | |
2060 cat > $tempcname < confdefs.h | |
2061 cat >> $tempcname <<EOF | |
2062 #define NOT_C_CODE | |
2063 #define C_SWITCH_SITE | |
2064 #define C_SWITCH_X_SITE | |
2065 #define LD_SWITCH_SITE | |
2066 #define LD_SWITCH_X_SITE | |
2067 #define LD_SWITCH_X_SITE_AUX | |
2068 #define OS_RELEASE $os_release | |
2069 | |
2070 #ifdef config_opsysfile | |
2071 #include "$srcdir/src/$opsysfile" | |
2072 #endif | |
2073 | |
2074 #ifdef config_machfile | |
2075 #include "$srcdir/src/$machfile" | |
2076 #endif | |
2077 | |
2078 CPP_to_sh(LIBS_MACHINE, libs_machine) | |
2079 CPP_to_sh(LIBS_SYSTEM, libs_system) | |
2080 CPP_to_sh(LIBS_TERMCAP, libs_termcap) | |
2081 CPP_to_sh(LIB_STANDARD, libs_standard) | |
2082 | |
2083 CPP_to_sh(OBJECTS_MACHINE, objects_machine) | |
2084 CPP_to_sh(OBJECTS_SYSTEM, objects_system) | |
2085 | |
2086 CPP_to_sh(C_SWITCH_MACHINE, c_switch_machine) | |
2087 CPP_to_sh(C_SWITCH_SYSTEM, c_switch_system) | |
2088 | |
2089 CPP_to_sh(LD_SWITCH_MACHINE, ld_switch_machine) | |
2090 CPP_to_sh(LD_SWITCH_SYSTEM, ld_switch_system) | |
2091 | |
2092 CPP_to_sh(UNEXEC, unexec) | |
2093 | |
2094 CPP_to_sh(SYSTEM_TYPE, system_type) | |
2095 | |
2096 CPP_to_sh(LD_SWITCH_SHARED, ld_switch_shared, -c) | |
2097 | |
2098 #define ORDINARY_LD "\$(CC) \$(CFLAGS)" | |
2099 configure___ ordinary_ld=ORDINARY_LD | |
2100 | |
2101 #ifdef ORDINARY_LINK | |
2102 #define LD ORDINARY_LD | |
2103 #else /* no ORDINARY LINK */ | |
2104 #ifdef COFF_ENCAPSULATE | |
2105 #define LD "\$(CC) -nostdlib" | |
2106 #else /* not COFF_ENCAPSULATE */ | |
2107 #ifdef LINKER | |
2108 #define LD LINKER | |
2109 #else /* ! defined (LINKER) */ | |
2110 #define LD "ld" | |
2111 #endif /* ! defined (LINKER) */ | |
2112 #endif /* ! defined (COFF_ENCAPSULATE) */ | |
2113 #endif /* not ORDINARY_LINK */ | |
2114 configure___ ld=LD | |
2115 | |
2116 CPP_to_sh(LIB_GCC, lib_gcc) | |
2117 CPP_to_sh(LD_TEXT_START_ADDR, ld_text_start_addr) | |
2118 | |
2119 #if ! defined (ORDINARY_LINK) && !defined (START_FILES) | |
2120 #ifdef NO_REMAP | |
2121 #ifdef COFF_ENCAPSULATE | |
2122 #define START_FILES "pre-crt0.o /usr/local/lib/gcc-crt0.o" | |
2123 #else /* ! defined (COFF_ENCAPSULATE) */ | |
2124 #define START_FILES "pre-crt0.o /lib/crt0.o" | |
2125 #endif /* ! defined (COFF_ENCAPSULATE) */ | |
2126 #else /* ! defined (NO_REMAP) */ | |
2127 #define START_FILES "ecrt0.o" | |
2128 #endif /* ! defined (NO_REMAP) */ | |
2129 #endif /* no ORDINARY_LINK */ | |
2130 #ifndef START_FILES | |
2131 #define START_FILES | |
2132 #endif | |
2133 configure___ start_files=START_FILES | |
2134 | |
2135 CPP_boolean_to_sh(ORDINARY_LINK, ordinary_link) | |
2136 CPP_boolean_to_sh(SYSTEM_MALLOC, system_malloc) | |
2137 CPP_boolean_to_sh(TERMINFO, have_terminfo) | |
2138 dnl The MAIL_USE_xxx variables come from the s&m headers | |
2139 CPP_boolean_to_sh(MAIL_USE_FLOCK, mail_use_flock) | |
2140 CPP_boolean_to_sh(MAIL_USE_LOCKF, mail_use_lockf) | |
2141 CPP_boolean_to_sh(MAIL_USE_LOCKING, mail_use_locking) | |
2142 CPP_boolean_to_sh(HAVE_WIN32_PROCESSES, win32_processes) | |
2143 EOF | |
2144 | |
2145 dnl The value of CPP is a quoted variable reference, so we need to do this | |
2146 dnl to get its actual value... | |
2147 CPP=`eval "echo $CPP $CPPFLAGS"` | |
2148 define(TAB, [ ])dnl | |
2149 eval `$CPP -Isrc $tempcname \ | |
2150 | sed -n -e "s/[[ TAB]]*=[[ TAB\"]]*/='/" -e "s/[[ TAB\"]]*\$/'/" -e "s/^configure___//p"` | |
2151 | |
2152 rm $tempcname | |
2153 | |
2154 dnl s&m files shouldn't be required to define anything, or even to exist. | |
2155 dnl So we default SYSTEM_TYPE to the obvious documented standard, `uname -s`, | |
2156 dnl appropriately emacsulated. | |
2157 test -z "$system_type" && \ | |
2158 AC_DEFINE_UNQUOTED(SYSTEM_TYPE,"`uname -s | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`") | |
2159 | |
2160 dnl If the s&m files don't define a system-specific dumper, simply use pdump. | |
2161 dnl Sometime in the future, we'll remove all definitions of UNEXEC | |
2162 dnl from all the s&m files. | |
2163 test -z "$unexec" && enable_pdump=yes | |
2164 | |
2165 if test "$enable_pdump" = "yes"; then | |
2166 ordinary_link="yes" | |
2167 ld="${ordinary_ld}" | |
2168 start_files= | |
2169 libs_standard= | |
2170 unexec= | |
2171 lib_gcc= | |
2172 fi | |
2173 | |
3263 | 2174 dnl Enable KKCC by default |
2790 | 2175 test -z "$enable_kkcc" && enable_kkcc=yes |
2176 | |
2720 | 2177 dnl Dump into executable |
2178 if test -z "$enable_dump_in_exec"; then | |
2179 if test "$enable_pdump" = "yes"; then | |
3263 | 2180 if test "$enable_newgc" = "yes"; then |
2720 | 2181 enable_dump_in_exec=no |
2182 else | |
2183 enable_dump_in_exec=yes | |
2184 fi | |
2185 fi | |
2186 fi | |
2187 | |
3092 | 2188 dnl New incremental garbage collector |
2189 if test "$enable_newgc" = "yes"; then | |
2190 enable_kkcc=yes | |
2191 fi | |
2192 | |
2651 | 2193 dnl For debugging... |
2194 test "$verbose" = "yes" && \ | |
2195 PRINT_VAR(libs_machine libs_system libs_termcap libs_standard | |
2196 objects_machine objects_system c_switch_machine c_switch_system | |
2197 ld_switch_machine ld_switch_system unexec ld_switch_shared | |
2198 ld lib_gcc ld_text_start_addr start_files ordinary_link | |
2199 have_terminfo mail_use_flock mail_use_lockf) && echo "" | |
2200 | |
2201 dnl Pick up mingw include path | |
2202 dnl We only cope with headers in mingw, not mingw32: no previous version of | |
2203 dnl XEmacs supported mingw and cygnus have made this incompatible change | |
2204 dnl so we just go with the flow. | |
2205 case "$opsys" in mingw* | cygwin*) | |
3228 | 2206 cygwin_include=`eval gcc -print-search-dirs | sed -ne s'/install: //p'` |
2207 cygwin_include=`eval "cd $cygwin_include/../../../..; pwd"` | |
2208 cygwin_include="-I$cygwin_include/include" ; | |
2651 | 2209 extra_includes="$cygwin_include/mingw $cygwin_include" ; |
2210 case "$opsys" in mingw*) | |
2211 XE_APPEND($extra_includes, c_switch_system) ;; | |
2212 esac | |
2213 ;; | |
2214 esac | |
2215 | |
2216 dnl Non-ordinary link usually requires -lc | |
2217 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc" | |
2218 | |
2219 dnl ----------------------- | |
2220 dnl Compiler-specific hacks | |
2221 dnl ----------------------- | |
2222 | |
2223 dnl DEC C `-std1' means ANSI C mode | |
2224 test "$__DECC" = "yes" && XE_APPEND(-std1, c_switch_site) | |
2225 | |
2226 dnl Some versions of SCO native compiler need -Kalloca | |
2227 if test "$__USLC__" = yes; then | |
2228 AC_MSG_CHECKING(for whether the -Kalloca compiler flag is needed) | |
2229 need_kalloca=no | |
3317 | 2230 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [void *x = alloca(4);])], [:], [ |
2651 | 2231 xe_save_c_switch_system="$c_switch_system" |
2232 c_switch_system="$c_switch_system -Kalloca" | |
3317 | 2233 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [void *x = alloca(4);])], |
3312 | 2234 [ need_kalloca=yes ]) |
2651 | 2235 c_switch_system="$xe_save_c_switch_system"]) |
2236 AC_MSG_RESULT($need_kalloca) | |
2237 test "$need_kalloca" = "yes" && XE_APPEND(-Kalloca,c_switch_system) | |
2238 fi | |
2239 | |
2240 dnl If we're specifying XEMACS_CC, it'd better be in the same family | |
2241 dnl as CC or the following flag calculations are bogus. | |
4510
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2242 dnl No error/abort; detection is too fragile. |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2243 |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2244 xemacs_cc_cc_mismatch=no |
2651 | 2245 if test "$CC" != "$XEMACS_CC"; then |
4510
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2246 case "$XEMACS_CC" in |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2247 *g++* ) |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2248 if test "$GCC" != "yes"; then |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2249 AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong]) |
4543
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2250 xemacs_cc_cc_mismatch=yes |
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2251 fi |
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2252 ;; |
4510
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2253 esac |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2254 if test -n "$GCC"; then |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2255 case $XEMACS_CC in |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2256 *g++* ) |
4543
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2257 # it's as expected, do nothing |
4510
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2258 ;; |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2259 * ) |
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2260 AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong]) |
4543
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2261 xemacs_cc_cc_mismatch=yes |
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2262 ;; |
4510
bd1fbed783dd
Improve g++ detection.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3972
diff
changeset
|
2263 esac |
4543
fe64f1351cbd
Fix my syntax errors.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4537
diff
changeset
|
2264 fi |
2651 | 2265 dnl #### Add other detectable mismatches here. |
2266 fi | |
2267 | |
2268 dnl Calculate optimization flags. These will be off by default in beta | |
2269 dnl versions and on in release versions. | |
2270 | |
2667 | 2271 if test -z "$with_optimization"; then |
2992 | 2272 # If user set --with-cflags-optimization, use it to unilaterally |
2273 # determine whether optimization should be enabled. | |
2274 if test "$cflags_optimization_specified" = "yes" ; then | |
3443 | 2275 if test -z "$with_cflags_optimization" ; then |
2992 | 2276 with_optimization=no |
2277 else | |
2278 with_optimization=yes | |
2279 fi | |
2280 elif test -z "$emacs_is_beta" ; then | |
2667 | 2281 with_optimization=yes |
2282 else | |
2651 | 2283 with_optimization=no |
2284 fi | |
2285 fi | |
2286 | |
2287 | |
2288 dnl #### We should be checking C_OPTIMIZE_SWITCH in m/*, s/*. | |
2289 | |
2290 AC_MSG_CHECKING([for preferred optimization flags]) | |
2291 if test "$with_optimization" = "yes" ; then | |
2292 if test "$cflags_optimization_specified" = "no"; then | |
2293 dnl Following values of cflags_optimization are known to work well. | |
2294 dnl Should we take debugging options into consideration? | |
2295 if test "$GCC" = "yes"; then | |
2296 with_cflags_optimization="-O3" | |
2297 elif test "$__SUNPRO_C" = "yes"; then | |
2298 case "$opsys" in | |
2299 sol2 ) with_cflags_optimization="-xO4" ;; | |
2300 sunos4* ) with_cflags_optimization="-xO2" ;; | |
2301 esac | |
2302 elif test "$__DECC" = "yes"; then | |
2303 with_cflags_optimization="-O3" | |
2304 elif test "$CC" = "xlc"; then | |
2305 dnl see http://www.nersc.gov/vendor_docs/ibm/vac/sc094959.pdf | |
2306 with_cflags_optimization="-O3 -qstrict -qnoansialias -qlibansi -qmaxmem=20000" | |
2307 elif test "$__ICC" = "yes"; then | |
2308 with_cflags_optimization="-O3 -Ob2" | |
2309 dnl ### Add optimal cflags_optimization support for other compilers HERE! | |
2310 else | |
2311 with_cflags_optimization="-O" ;dnl The only POSIX-approved flag | |
2312 fi | |
2313 fi | |
2314 else | |
2315 with_cflags_optimization= | |
2316 fi | |
2317 | |
2318 AC_MSG_RESULT([${with_cflags_optimization}]) | |
2319 | |
2320 dnl #### We should be checking C_DEBUG_SWITCH in m/*, s/*. | |
2321 | |
2322 AC_MSG_CHECKING([for preferred debugging flags]) | |
2323 if test "$cflags_debugging_specified" = "no"; then | |
2324 dnl ### Add optimal debugging support for other compilers HERE! | |
2325 with_cflags_debugging="-g" | |
2326 | |
2327 debugging_ok_with_optimization=no | |
2328 if test "$GCC" = "yes" -o "$CC" = "xlc" -o "$__ICC" = "yes"; then | |
2329 debugging_ok_with_optimization=yes | |
2330 fi | |
2331 | |
2332 if test "$with_optimization" = "yes" -a "$debugging_ok_with_optimization" = "no"; then | |
2333 with_cflags_debugging= | |
2334 fi | |
2335 fi | |
2336 AC_MSG_RESULT([${with_cflags_debugging}]) | |
2337 | |
2338 dnl Calculate warning flags. We separate the flags for warnings from | |
2339 dnl the other flags because we want to force the warnings to be seen | |
2340 dnl by everyone who doesn't specifically override them. | |
2341 | |
2342 AC_MSG_CHECKING([for preferred warning flags for XEMACS_CC]) | |
2343 | |
2344 dnl If this stays nil, it will be set to cflags_warning before use. | |
2345 xe_cflags_warning="" | |
2346 | |
2347 if test "$cflags_warning_specified" = "no"; then | |
2348 dnl Following warning flags are known to work well. | |
2349 if test "$__SUNPRO_C" = "yes"; then | |
2350 case "$opsys" in | |
2351 sol2 ) with_cflags_warning="-v" ;; | |
2352 esac | |
2353 elif test "$CC" = "xlc"; then | |
2354 with_cflags_warning="-qinfo" | |
2355 elif test "$GCC" = "yes"; then | |
2356 with_cflags_warning="-Wall -Wno-switch -Wundef" | |
2357 dnl This is not very useful, as it issues warnings that may appear | |
2358 dnl or disappear rather randomly, cannot easily be fixed, and are | |
2359 dnl not a big deal. If you want it, add it yourself. | |
2360 dnl with_cflags_warning="$with_cflags_warning -Winline" | |
2361 | |
2362 dnl Yuck, bad compares have been worth at least 3 crashes! | |
2363 dnl Warnings about char subscripts are pretty pointless, though, | |
2364 dnl and we use them in various places. | |
2365 with_cflags_warning="$with_cflags_warning -Wsign-compare -Wno-char-subscripts" | |
3494 | 2366 test "$__GCC" -ge 3 && with_cflags_warning="$with_cflags_warning -Wpacked" |
2651 | 2367 dnl glibc is intentionally not `-Wpointer-arith'-clean. |
2368 dnl Ulrich Drepper has rejected patches to fix the glibc header files. | |
2369 test "$have_glibc" != "yes" && \ | |
2370 with_cflags_warning="$with_cflags_warning -Wpointer-arith" | |
2371 dnl Warning flags that may differ for gcc and g++ (xemacs_compiler) | |
2372 dnl With g++, -Wshadow produces five zillion utterly random warnings -- | |
2373 dnl a local var named `buffer' conflicts with `struct buffer' for | |
2374 dnl example. Even with gcc, -Wshadow is questionable because of its | |
2375 dnl complaints about parameters with the same names as global functions. | |
2376 dnl There is no -Wmissing-declarations under g++. | |
2377 dnl But gcc warns about -Weffc++ in C compiles. | |
2378 dnl With g++, there is no effective way to use -Wunused-parameter without | |
2379 dnl some very ugly code changes. | |
2380 if test "$with_xemacs_compiler" = "g++"; then | |
2381 xe_cflags_warning="$with_cflags_warning -Weffc++" | |
3494 | 2382 elif test "$__GCC" -ge 3; then |
2651 | 2383 xe_cflags_warning="$with_cflags_warning -Wunused-parameter" |
3494 | 2384 if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then |
2385 with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement" | |
2386 fi | |
2651 | 2387 fi |
2388 with_cflags_warning="$with_cflags_warning -Wshadow -Wmissing-declarations" | |
2389 with_cflags_warning="$with_cflags_warning -Wmissing-prototypes -Wstrict-prototypes" | |
2390 dnl **** If more gcc/g++ flags are added, from here on must handle | |
2391 dnl **** with_cflags_warning and xe_cflags_warning in parallel | |
2392 elif test "$__ICC" = "yes"; then | |
2393 with_cflags_warning="-Wall -w1 -we147" | |
2394 dnl ### Add optimal with_cflags_warning support for other compilers HERE! | |
2395 fi | |
2396 fi | |
2397 test -z "$xe_cflags_warning" && xe_cflags_warning="$with_cflags_warning" | |
2398 AC_MSG_RESULT([${xe_cflags_warning}]) | |
2399 | |
2400 AC_MSG_CHECKING([for preferred warning flags for CC]) | |
2401 AC_MSG_RESULT([${with_cflags_warning}]) | |
2402 | |
2403 dnl Calculate remaining cflags. | |
2404 dnl Use either command line flag, environment var, or autodetection | |
2405 | |
2406 AC_MSG_CHECKING([for remaining CFLAGS]) | |
2407 | |
2408 if test "$cflags_specified" = "no"; then | |
2409 dnl Following values of CFLAGS are known to work well. | |
2410 if test "$CC" = "xlc"; then | |
2411 CFLAGS="-qro" | |
2412 dnl ### Add optimal CFLAGS support for other compilers HERE! | |
2413 fi | |
2414 fi | |
2415 AC_MSG_RESULT([${CFLAGS}]) | |
2416 | |
2417 dnl Now combine all C flags. Put the warning and optimization flags first | |
2418 dnl so that user-specified flags will override. | |
2419 dnl Do XE_CFLAGS before adding flags to CFLAGS. | |
2420 dnl Flags for XEMACS_CC: | |
2421 | |
2422 XE_CFLAGS="$xe_cflags_warning $with_cflags_debugging $with_cflags_optimization $CFLAGS" | |
2423 dnl Flags for CC: | |
2424 CFLAGS="$with_cflags_warning $with_cflags_debugging $with_cflags_optimization $CFLAGS" | |
2425 | |
2426 AC_MSG_CHECKING([total value of XE_CFLAGS]) | |
2427 AC_MSG_RESULT([${XE_CFLAGS}]) | |
2428 AC_MSG_CHECKING([total value of CFLAGS]) | |
2429 AC_MSG_RESULT([${CFLAGS}]) | |
2430 | |
2431 dnl Search for GCC specific build problems we know about | |
2432 if test "$GCC" = "yes"; then | |
2433 AC_MSG_CHECKING(for buggy gcc versions) | |
2434 GCC_VERSION=`$CC --version` | |
2435 case `uname -s`:`uname -m`:$GCC_VERSION in | |
2436 dnl egcs 2.90.21 (egcs-1.00 release) | |
2437 dnl egcs 2.90.29 (egcs-1.0.3 release) | |
2438 *:sun4*:2.8.1|*:sun4*:egcs-2.90.*) | |
2439 dnl Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures | |
2440 dnl without also using `-fno-schedule-insns'. | |
2441 case "$CFLAGS" in | |
2442 *-O2*|*-O3*) | |
2443 case "$CFLAGS" in | |
2444 *-fno-schedule-insns*) ;; | |
2445 *) | |
2446 AC_MSG_RESULT(yes) | |
2447 AC_MSG_WARN([Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures]) | |
2448 AC_MSG_WARN([without also using -fno-schedule-insns.]) | |
2449 AC_MSG_ERROR([Aborting due to known problem]) | |
2450 ;; | |
2451 esac | |
2452 ;; | |
2453 esac | |
2454 ;; | |
2455 dnl egcs-2.91.57 (egcs-1.1 release) | |
2456 dnl egcs-2.91.66 (egcs-1.1.2 release) | |
2457 Linux:alpha:egcs-2.91.*) | |
2458 AC_MSG_RESULT(yes) | |
2459 AC_MSG_WARN([There have been reports of egcs-1.1 not compiling XEmacs correctly on]) | |
2460 AC_MSG_WARN([Alpha Linux. There have also been reports that egcs-1.0.3a is O.K.]) | |
2461 AC_MSG_ERROR([Aborting due to known problem]) | |
2462 ;; | |
2463 *:i*86*:2.7.2*) | |
2464 case "$CFLAGS" in | |
2465 *-O2*|*-O3*) | |
2466 case "$GCC_VERSION" in | |
2467 2.7.2) | |
2468 case "$CFLAGS" in | |
2469 *-fno-strength-reduce*) ;; | |
2470 *) | |
2471 AC_MSG_RESULT(yes) | |
2472 AC_MSG_WARN([Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using]) | |
2473 AC_MSG_WARN([-fno-strength-reduce.]) | |
2474 AC_MSG_ERROR([Aborting due to known problem]) | |
2475 ;; | |
2476 esac | |
2477 ;; | |
2478 esac | |
2479 case "$CFLAGS" in | |
2480 *-fno-caller-saves*) ;; | |
2481 *) | |
2482 AC_MSG_RESULT(yes) | |
2483 AC_MSG_WARN([Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using]) | |
2484 AC_MSG_WARN([-fno-caller-saves.]) | |
2485 AC_MSG_ERROR([Aborting due to known problem]) | |
2486 ;; | |
2487 esac | |
2488 ;; | |
2489 esac | |
2490 ;; | |
2491 esac | |
2492 AC_MSG_RESULT(no) | |
2493 fi | |
2494 | |
2495 dnl GNU ld now defaults to combreloc, which screws up unexec, but not pdump. | |
2496 dnl Note that it's OK if the GNU style long option causes non-GNU ld to barf | |
2497 dnl a usage message, that's often good enough. Please report it, though. | |
2498 dnl #### Should make this Solaris-friendly. | |
2499 dnl Link with -z nocombreloc for now. | |
2500 if test "$enable_pdump" != "yes"; then | |
3312 | 2501 AC_MSG_CHECKING([for "-z nocombreloc" linker flag]) |
2651 | 2502 case "`ld --help 2>&1`" in |
2503 *-z\ nocombreloc* ) AC_MSG_RESULT(yes) | |
2504 XE_PREPEND(-z nocombreloc, ld_switch_site) ;; | |
2505 *) AC_MSG_RESULT(no) ;; | |
2506 esac | |
2507 fi | |
2508 | |
2509 dnl Inform compiler that certain flags are meant for the linker | |
2510 XE_PROTECT_LINKER_FLAGS(ld_switch_system) | |
2511 XE_PROTECT_LINKER_FLAGS(ld_switch_machine) | |
2512 XE_PROTECT_LINKER_FLAGS(ld_switch_site) | |
2513 XE_PROTECT_LINKER_FLAGS(LDFLAGS) | |
2514 XE_PROTECT_LINKER_FLAGS(ld_call_shared) | |
2515 | |
2516 dnl Add s&m-determined objects (including unexec) to link line | |
2517 test -n "$objects_machine" && XE_ADD_OBJS($objects_machine) | |
2518 test -n "$objects_system" && XE_ADD_OBJS($objects_system) | |
2519 test -n "$unexec" && test ! "$enable_pdump" = "yes" && XE_ADD_OBJS($unexec) | |
2520 test "$enable_pdump" = "yes" && XE_ADD_OBJS(dumper.o) | |
2521 | |
2522 dnl Dynodump (Solaris 2.x, x<6) | |
2523 AC_MSG_CHECKING(for dynodump) | |
2524 if test "$unexec" != "unexsol2.o"; then | |
2525 AC_MSG_RESULT(no) | |
2526 else | |
2527 AC_MSG_RESULT(yes) | |
2528 AC_DEFINE(DYNODUMP) | |
2529 XE_APPEND(dynodump, MAKE_SUBDIR) | |
2530 XE_APPEND(dynodump, SRC_SUBDIR_DEPS) | |
2531 case "$machine" in | |
2532 sparc ) dynodump_arch=sparc ;; | |
2533 *86* ) dynodump_arch=i386 ;; | |
2534 powerpc ) dynodump_arch=ppc ;; | |
2535 esac | |
2536 fi | |
2537 | |
2538 dnl Feed s&m crud to src/Makefile | |
2539 | |
2540 dnl Linux/powerpc needs the following magic for some reason | |
2541 dnl [Not needed with YellowDog 2.3 and causes link problems with YellowDog 3.0, | |
2542 dnl the two most popular PowerPC distributions.] | |
2543 dnl test "$machine$opsys" = "powerpclinux" && start_flags="-T $srcdir/src/ppc.ldscript" | |
2544 | |
2545 AC_LANG(C) | |
2546 if test "$unexec" = "unexaix.o"; then | |
2547 dnl AIX needs various hacks to make static linking work. | |
2548 if test "$with_dynamic" = "no"; then | |
2549 start_flags="-Wl,-bnso,-bnodelcsect" | |
2550 test "$GCC" = "yes" && start_flags="-B/bin/ ${start_flags}" | |
2551 for f in "/lib/syscalls.exp" "/lib/threads.exp"; do | |
2552 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; fi | |
2553 done | |
2554 for f in "/usr/lpp/X11/bin/smt.exp" "/usr/bin/X11/smt.exp"; do | |
2555 if test -r "$f"; then start_flags="${start_flags},-bI:${f}"; break; fi | |
2556 done | |
2557 AC_CHECK_LIB([c], [terminateAndUnload], [XE_APPEND(-lC, libs_system)]) | |
2558 fi | |
2559 elif test -n "$ld_text_start_addr"; then | |
2560 start_flags="-T $ld_text_start_addr -e __start" | |
2561 fi | |
2562 AC_SUBST(start_flags) | |
2563 | |
2564 AC_SUBST(ld_switch_shared) | |
2565 AC_SUBST(start_files) | |
2566 if test "$ordinary_link" = "no" -a "$GCC" = "yes"; then | |
2567 test -z "$linker" && linker='$(CC) -nostdlib' | |
2568 test -z "$lib_gcc" && lib_gcc='`$(CC) -print-libgcc-file-name`' | |
2569 fi | |
2570 test "$GCC" != "yes" && lib_gcc= | |
2571 AC_SUBST(ld) | |
2572 AC_SUBST(lib_gcc) | |
2573 | |
2574 dnl --------------------------------------------------------------- | |
2575 dnl Get version information for: | |
2576 dnl C compiler, libc | |
2577 dnl #### should do CC compiler, too, if different from XEMACS_CC | |
2578 dnl --------------------------------------------------------------- | |
2579 | |
2580 compiler_version="" | |
2581 gcc_compiler_specs="" | |
2582 libc_version="" | |
2583 | |
2584 AC_MSG_CHECKING([for compiler version information]) | |
2585 | |
2586 dnl First try portable compilers, then crack system secrets | |
2587 dnl #### Is this code correct if $XEMACS_CC != $CC? XEMACS_CC hasn't been | |
2588 dnl run through the AC_PROG_CC mill. | |
2589 dnl Would anybody really build libsrc with GCC and XEmacs with non-GCC? | |
2590 if test "$GCC" = "yes"; then | |
2692 | 2591 compiler_version=`$XEMACS_CC --version | sed 1q` |
2592 gcc_compiler_specs=`$XEMACS_CC -v 2>&1 | sed 's/.* \([[^ ]]\)/\1/' | sed 1q` | |
2651 | 2593 else case "$XEMACS_CC" in |
2594 dnl The Intel cc compiler | |
2595 ic*) | |
2692 | 2596 compiler_version=`icc -V 2>&1 | sed 1q` |
2651 | 2597 ;; |
2598 dnl non-gcc machine-specific magic - contributions welcome | |
2599 *) case "$ac_cv_build" in | |
2600 *-*-aix* ) | |
2601 dnl Yes, it's this ugly for AIX... | |
2602 realcc=`which $XEMACS_CC` | |
2603 dnl Might be a symlink created by replaceCset command | |
2604 if test -L $realcc ; then | |
2605 ccdir=`dirname $realcc` | |
2606 ccprog=`/bin/ls -l $realcc | sed 's/.* \([[^ ]]\)/\1/'` | |
2607 dnl This doesn't handle ../../xlc type stuff, but I've not seen one... | |
2608 case $ccprog in | |
2609 */*) realcc=$ccprog;; | |
2610 *) realcc=$ccdir/$ccprog;; | |
2611 esac | |
2612 fi | |
2613 lpp=`lslpp -wqc $realcc | cut -f2 -d:` | |
2614 if test ! -z "$lpp" ; then | |
2615 lppstr=`lslpp -Lqc $lpp` | |
2616 lpplev=`echo "$lppstr" | cut -f3 -d:` | |
2617 lppdesc=`echo "$lppstr" | cut -f8 -d:` | |
2618 fi | |
2619 if test ! -z "$lpplev" ; then | |
2620 compiler_version="$lpp $lpplev - $lppdesc" | |
2621 fi | |
2622 ;; | |
2623 | |
2624 *-*-solaris*) | |
2692 | 2625 compiler_version=`$XEMACS_CC -V 2>&1 | sed 1q` |
2651 | 2626 ;; |
2627 | |
2628 alpha*-dec-osf*) | |
2629 compiler_version=`$XEMACS_CC -V | tr '\n' ' '` | |
2630 ;; | |
2631 | |
2632 mips-sgi-irix*) | |
2633 compiler_version=`$XEMACS_CC -version` | |
2634 ;; | |
2635 esac | |
2636 esac | |
2637 fi | |
2638 | |
2639 dnl Awww, shucks. | |
2640 if test -z "$compiler_version"; then | |
2641 compiler_version="detection failed (please report this)" | |
2642 fi | |
2643 AC_MSG_RESULT([$compiler_version]) | |
2644 | |
2645 AC_MSG_CHECKING(for standard C library version information) | |
2646 | |
2647 case "$ac_cv_build" in | |
2648 *-*-linux*) | |
2649 dnl #### who would ever _not_ be running the distro's libc? | |
2650 dnl Maybe it would be better to get/augment this info with ldd? | |
2651 if test -f /etc/redhat-release ; then | |
2652 libc_version=`rpm -q glibc` | |
2653 elif test -f /etc/debian_version ; then | |
2654 libc_version=`dpkg-query --showformat='${version}' --show libc6` | |
2655 libc_version="GNU libc $libc_version (Debian)" | |
2656 dnl need SuSE et al checks here... | |
2657 fi | |
2658 dnl #### Tested on Debian, does this actually work elsewhere? ;-) | |
2659 if test -z "$libc_version"; then | |
2660 libc_version=`ls /lib/libc-*.so | sed -e 's,/lib/libc-\(.*\)\.so,\1,'` | |
2661 fi | |
2662 ;; | |
2663 | |
2664 *-*-aix*) | |
2665 libc_version="bos.rte.libc `lslpp -Lqc bos.rte.libc | cut -f3 -d:`" | |
2666 ;; | |
2667 | |
2668 *-*-solaris*) | |
2669 libc=`pkginfo -l SUNWcsl | grep VERSION: | awk '{print $2}'` | |
2670 libc_version="SUNWcsl $libc" | |
2671 | |
2672 ;; | |
2673 | |
2674 mips-sgi-irix*) | |
2675 libc_version="IRIX libc `uname -sRm`" | |
2676 ;; | |
2677 | |
2678 alpha*-dec-osf*) | |
2679 dnl Another ugly case | |
2680 (cd /usr/.smdb.; | |
2681 libc_version=` grep -h libc.so *.inv | awk '$9 == "f" {print $12}' | tr '\n' ','` | |
2682 ) | |
2683 ;; | |
2684 esac | |
2685 | |
2686 dnl Awww, shucks. | |
2687 if test -z "libc_version"; then | |
2688 libc_version="detection failed (please report this)" | |
2689 fi | |
2690 AC_MSG_RESULT([$libc_version]) | |
2691 | |
2692 dnl --------------------------------------------------------------- | |
2693 dnl Add site and system specific flags to compile and link commands | |
2694 dnl --------------------------------------------------------------- | |
2695 | |
2696 dnl --with-site-libraries (multiple dirs) | |
2697 COLON_TO_SPACE(with_site_libraries) | |
2698 if test -n "$with_site_libraries"; then | |
2699 for arg in $with_site_libraries; do | |
2700 case "$arg" in | |
2701 -* ) ;; | |
2702 * ) test -d "$arg" || \ | |
2703 XE_DIE("Invalid site library \`$arg': no such directory") | |
2704 arg="-L${arg}" ;; | |
2705 esac | |
2706 XE_APPEND($arg, ld_switch_site) | |
2707 done | |
2708 fi | |
2709 | |
2710 dnl --with-site-includes (multiple dirs) | |
2711 COLON_TO_SPACE(with_site_includes) | |
2712 if test -n "$with_site_includes"; then | |
2713 for arg in $with_site_includes; do | |
2714 case "$arg" in | |
2715 -* ) ;; | |
2716 * ) test -d "$arg" || \ | |
2717 XE_DIE("Invalid site include \`$arg': no such directory") | |
2718 arg="-I${arg}" ;; | |
2719 esac | |
2720 XE_APPEND($arg, c_switch_site) | |
2721 done | |
2722 fi | |
2723 | |
2724 dnl --with-site-prefixes (multiple dirs) | |
2725 dnl --with-site-prefixes=dir1:dir2 is a convenient shorthand for | |
2726 dnl --with-site-libraries=dir1/lib:dir2/lib --with-site-includes=dir1/include:dir2/include | |
2727 dnl Site prefixes take precedence over the standard places, but not over | |
2728 dnl with-site-includes and with-site-libraries. | |
2729 COLON_TO_SPACE(with_site_prefixes) | |
2730 if test -n "$with_site_prefixes"; then | |
2731 for dir in $with_site_prefixes; do | |
2732 lib_dir="${dir}/lib" | |
2733 inc_dir="${dir}/include" | |
2734 if test ! -d "$dir"; then | |
2735 XE_DIE("Invalid site prefix \`$dir': no such directory") | |
2736 elif test ! -d "$lib_dir"; then | |
2737 XE_DIE("Invalid site prefix \`$dir': no such directory \`$lib_dir'") | |
2738 else | |
2739 if test -d "$inc_dir"; then | |
2740 XE_APPEND("-I$inc_dir", c_switch_site) | |
2741 fi | |
2742 XE_APPEND("-L$lib_dir", ld_switch_site) | |
2743 fi | |
2744 done | |
2745 fi | |
2746 | |
2747 dnl GNU software installs by default into /usr/local/{include,lib} | |
2748 dnl if test -d "/usr/local/include" -a -d "/usr/local/lib"; then | |
2749 dnl XE_APPEND("-L/usr/local/lib", ld_switch_site) | |
2750 dnl XE_APPEND("-I/usr/local/include", c_switch_site) | |
2751 dnl fi | |
2752 | |
2753 dnl Extra system-specific library directories - please add to list | |
2754 for dir in "/usr/ccs/lib"; do | |
2755 test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system) | |
2756 done | |
2757 | |
2758 dnl --with-site-runtime-libraries (multiple dirs) | |
2759 COLON_TO_SPACE(with_site_runtime_libraries) | |
2760 if test -n "$with_site_runtime_libraries"; then | |
2761 LD_RUN_PATH="`echo $with_site_runtime_libraries | sed -e 's/ */:/g'`" | |
2762 export LD_RUN_PATH | |
2763 fi | |
2764 | |
2765 dnl Linux systems have dynamic runtime library directories listed in | |
2766 dnl /etc/ld.so.conf. Since those are used at run time, it seems pretty | |
2767 dnl safe to use them at link time, and less controversial than forcing | |
2768 dnl the run-time to use the link-time libraries. This also helps avoid | |
2769 dnl mismatches between the link-time and run-time libraries. | |
2770 | |
2771 dnl #### Unfortunately, there are horrible libc4 and libc5 libraries | |
2772 dnl listed in /etc/ld.so.conf on some systems, and including them on | |
2773 dnl the link path leads to linking in utterly broken libc's. | |
2774 dnl There are many clever ways of approaching this problem, | |
2775 dnl but finding one that actually works... | |
2776 | |
2777 dnl if test -z "$LD_RUN_PATH" -a -r "/etc/ld.so.conf"; then | |
2778 dnl for dir in `cat /etc/ld.so.conf`; do | |
2779 dnl test -d "$dir" && XE_APPEND(-L${dir}, ld_switch_system) | |
2780 dnl done | |
2781 dnl add_runtime_path=no | |
2782 dnl fi | |
2783 | |
2784 dnl ------------------------------------- | |
2785 dnl Compute runtime library path | |
2786 dnl ------------------------------------- | |
2787 | |
2788 if test -n "$add_runtime_path"; then :; | |
2789 elif test "$with_dynamic" = "no"; then add_runtime_path=no | |
2790 elif test -n "$LD_RUN_PATH"; then add_runtime_path=yes | |
2791 else case "$opsys" in | |
2792 sol2 | irix* | *bsd* | decosf* ) add_runtime_path=yes ;; | |
2793 * ) add_runtime_path=no ;; | |
2794 esac | |
2795 fi | |
2796 | |
2797 if test "$add_runtime_path" = "yes"; then | |
2798 dnl Try to autodetect runtime library flag (usually -R), | |
2799 dnl and whether it works (or at least does no harm) | |
3312 | 2800 AC_MSG_CHECKING([for runtime libraries flag]) |
2651 | 2801 case "$opsys" in |
2802 sol2 ) dash_r="-R" ;; | |
2803 decosf* | linux* | irix*) dash_r="-rpath " ;; | |
2804 *) | |
2805 dash_r="" | |
2806 for try_dash_r in "-R" "-R " "-rpath "; do | |
2807 xe_check_libs="${try_dash_r}/no/such/file-or-directory" | |
2808 XE_PROTECT_LINKER_FLAGS(xe_check_libs) | |
3312 | 2809 AC_LINK_IFELSE([], dash_r="$try_dash_r") |
2651 | 2810 xe_check_libs="" |
2811 test -n "$dash_r" && break | |
2812 done ;; | |
2813 esac | |
2814 if test -n "$dash_r"; | |
3312 | 2815 then AC_MSG_RESULT(["${dash_r}"]) |
2651 | 2816 else AC_MSG_RESULT(NONE) |
2817 fi | |
2818 fi | |
2819 | |
2820 xe_add_unique_runpath_dir=' | |
2821 xe_add_p=yes | |
2822 for xe_dir in $runpath_dirs; do dnl Uniquify | |
2823 test "$xe_dir" = "$xe_runpath_dir" && xe_add_p=no | |
2824 done | |
2825 if test "$xe_add_p" = "yes"; then | |
2826 test -n "$runpath" && runpath="${runpath}:" | |
2827 runpath="${runpath}${xe_runpath_dir}" | |
2828 runpath_dirs="$runpath_dirs $xe_runpath_dir" | |
2829 fi' | |
2830 | |
2831 XE_COMPUTE_RUNPATH() | |
2832 | |
2833 dnl ----------------------------------- | |
2834 dnl Do some misc autoconf-special tests | |
2835 dnl ----------------------------------- | |
2836 | |
2837 dnl Do the opsystem or machine files prohibit the use of the GNU malloc? | |
2838 dnl Assume not, until told otherwise. | |
2839 GNU_MALLOC=yes | |
2840 if test "$with_dlmalloc" != "no"; then | |
2841 doug_lea_malloc=yes | |
2842 else | |
2843 doug_lea_malloc=no | |
2844 fi | |
2845 after_morecore_hook_exists=yes | |
2846 AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) | |
2847 AC_MSG_CHECKING(whether __after_morecore_hook exists) | |
3312 | 2848 AC_LINK_IFELSE([AC_LANG_PROGRAM([extern void (* __after_morecore_hook)();], |
2849 [__after_morecore_hook = 0])], | |
2651 | 2850 [AC_MSG_RESULT(yes)], |
2851 [AC_MSG_RESULT(no) | |
2852 after_morecore_hook_exists=no]) | |
2853 if test "$system_malloc" = "yes" ; then | |
2854 GNU_MALLOC=no | |
2855 GNU_MALLOC_reason=" | |
2856 - The GNU allocators don't work with this system configuration." | |
2857 elif test "$with_system_malloc" = "yes" ; then | |
2858 GNU_MALLOC=no | |
2859 GNU_MALLOC_reason=" | |
2860 - User chose not to use GNU allocators." | |
2861 elif test "$with_debug_malloc" = "yes" ; then | |
2862 GNU_MALLOC=no | |
2863 GNU_MALLOC_reason=" | |
2864 - User chose to use Debugging Malloc." | |
2865 fi | |
2866 | |
2867 if test "$doug_lea_malloc" = "yes" -a "$GNU_MALLOC" = "yes" ; then | |
2868 GNU_MALLOC_reason=" | |
2869 - Using Doug Lea's new malloc from the GNU C Library." | |
2870 AC_DEFINE(DOUG_LEA_MALLOC) | |
2871 if test "$after_morecore_hook_exists" = "no" ; then | |
2872 GNU_MALLOC_reason=" | |
2873 - Using Doug Lea's new malloc from the Linux C Library." | |
2874 AC_DEFINE(_NO_MALLOC_WARNING_) | |
2875 fi | |
2876 fi | |
2877 | |
2878 dnl #### mcheck is broken in all versions of Linux libc and glibc. | |
2879 dnl Try this again when 2.1 hits the streets. | |
2880 dnl Avoid using free-hook.c if support exists for malloc debugging in libc | |
2881 dnl have_libmcheck=no | |
2882 dnl if test "$enable_error_checking_malloc" = "yes" -a \ | |
2883 dnl "$have_glibc" = "yes" -a \ | |
2884 dnl "$doug_lea_malloc" = "yes"; then | |
2885 dnl AC_CHECK_HEADERS(mcheck.h) | |
2886 dnl AC_CHECK_LIB(mcheck, mcheck, have_libmcheck=yes, have_libmcheck=no) | |
2887 dnl fi | |
2888 | |
2889 dnl if test "$have_libmcheck" = "yes"; then | |
2890 dnl AC_DEFINE(HAVE_LIBMCHECK) | |
2891 dnl libmcheck=-lmcheck | |
2892 dnl AC_SUBST(libmcheck) | |
2893 dnl fi | |
2894 | |
2895 dnl Some other nice autoconf tests. If you add a test here which | |
2896 dnl should make an entry in src/config.h, do not forget to add an | |
2897 dnl #undef clause to src/config.h.in for autoconf to modify. | |
2898 | |
3862 | 2899 dnl Sun likes to hide these utilities. Steve Baur asked that we make |
2900 dnl the failure occur at configure time, not at use time. | |
2901 AC_CHECK_PROG(AR,ar,ar,not_found) | |
2902 if test "$AR" = "not_found"; then | |
2903 XE_DIE(["ar not found -- is PATH set correctly?"]) | |
2904 fi | |
2905 dnl These tests don't necessarily check that the program exists. | |
2651 | 2906 AC_PROG_RANLIB |
2907 AC_PROG_INSTALL | |
2908 AC_PROG_YACC | |
2909 | |
2910 dnl checks for header files | |
2911 AC_CHECK_HEADERS(dnl | |
2912 a.out.h dnl | |
2913 elf.h dnl | |
2914 cygwin/version.h dnl | |
2915 fcntl.h dnl | |
2916 libgen.h dnl | |
2917 locale.h dnl | |
2918 wchar.h dnl | |
2919 mach/mach.h dnl | |
2920 sys/param.h dnl | |
2921 sys/pstat.h dnl | |
2922 sys/resource.h dnl | |
2923 sys/time.h dnl | |
2924 sys/timeb.h dnl | |
2925 sys/times.h dnl | |
2926 sys/un.h dnl | |
2927 sys/vlimit.h dnl | |
2928 ulimit.h dnl | |
2929 ) | |
2930 AC_HEADER_SYS_WAIT | |
2931 AC_HEADER_STDC | |
2932 AC_HEADER_TIME | |
2933 AC_CHECK_DECLS([sys_siglist],,, | |
2934 [#include <signal.h> | |
2935 /* NetBSD declares sys_siglist in unistd.h. */ | |
2936 #if HAVE_UNISTD_H | |
2937 # include <unistd.h> | |
2938 #endif | |
667 | 2939 ]) |
2651 | 2940 |
2941 | |
2942 dnl ---------------------------------------------------------------- | |
2943 dnl Checking for utime() or utimes(). | |
2944 dnl We prefer utime, since it is more standard. | |
2945 dnl Some systems have utime.h but do not declare the struct anyplace, | |
2946 dnl so we use a more sophisticated test for utime than AC_CHECK_FUNCS. | |
2947 dnl ---------------------------------------------------------------- | |
2948 AC_MSG_CHECKING(for utime) | |
3312 | 2949 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h> |
2651 | 2950 #include <utime.h>], |
3312 | 2951 [struct utimbuf x; x.actime = x.modtime = 0; utime ("/", &x);])], |
2651 | 2952 [AC_MSG_RESULT(yes) |
2953 AC_DEFINE(HAVE_UTIME)], | |
2954 [AC_MSG_RESULT(no) | |
2955 dnl We don't have utime(); how about utimes()? | |
2956 AC_CHECK_FUNCS(utimes)]) | |
2957 | |
2958 | |
2959 dnl checks for typedefs | |
2960 AC_TYPE_SIGNAL | |
2961 AC_TYPE_SIZE_T | |
2962 AC_TYPE_PID_T | |
2963 AC_TYPE_UID_T | |
2964 AC_TYPE_MODE_T | |
2965 AC_TYPE_OFF_T | |
3862 | 2966 dnl #### Translated from deprecated 2.13-ism. |
2967 dnl We probably want to DTRT with #ifdef HAVE_SSIZE_T in src/config.h.in. | |
2968 dnl Specifically, we should typedef st sizeof(ssize_t) == sizeof(size_t). | |
2969 AC_CHECK_TYPE([ssize_t],, | |
2970 [AC_DEFINE_UNQUOTED([ssize_t], [int], | |
2971 [Define to `int' if | |
2972 <sys/types.h> does not define.])]) | |
2651 | 2973 |
2974 dnl not AC_CHECK_TYPE; lisp.h does hairy conditional typedef | |
2975 if test "$ac_cv_header_inttypes_h" != "yes"; then | |
2976 AC_MSG_CHECKING(for intptr_t in sys/types.h) | |
3312 | 2977 AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <sys/types.h> |
2651 | 2978 intptr_t x; |
3312 | 2979 ])],[AC_MSG_RESULT(yes) |
2651 | 2980 AC_DEFINE(HAVE_INTPTR_T_IN_SYS_TYPES_H,1)], |
2981 [AC_MSG_RESULT(no)]) | |
2982 fi | |
2983 | |
2984 dnl check for Unix98 socklen_t | |
2985 AC_MSG_CHECKING(for socklen_t) | |
3312 | 2986 AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <sys/types.h> |
2651 | 2987 #include <sys/socket.h> |
2988 socklen_t x; | |
3312 | 2989 ])],[AC_MSG_RESULT(yes)],[ |
2990 AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <sys/types.h> | |
2651 | 2991 #include <sys/socket.h> |
2992 int accept (int, struct sockaddr *, size_t *); | |
3312 | 2993 ])],[ |
2651 | 2994 AC_MSG_RESULT(size_t) |
2995 AC_DEFINE(socklen_t,size_t)], [ | |
2996 AC_MSG_RESULT(int) | |
2997 AC_DEFINE(socklen_t,int)])]) | |
2998 | |
2999 AC_MSG_CHECKING(for struct timeval) | |
3312 | 3000 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#ifdef TIME_WITH_SYS_TIME |
2651 | 3001 #include <sys/time.h> |
3002 #include <time.h> | |
3003 #else | |
3004 #ifdef HAVE_SYS_TIME_H | |
3005 #include <sys/time.h> | |
3006 #else | |
3007 #include <time.h> | |
3008 #endif | |
3312 | 3009 #endif], [static struct timeval x; x.tv_sec = x.tv_usec;])], |
2651 | 3010 [AC_MSG_RESULT(yes) |
3011 HAVE_TIMEVAL=yes | |
3012 AC_DEFINE(HAVE_TIMEVAL)], | |
3013 [AC_MSG_RESULT(no) | |
3014 HAVE_TIMEVAL=no]) | |
3015 | |
3016 dnl checks for structure members | |
3017 AC_STRUCT_TM | |
3018 AC_STRUCT_TIMEZONE | |
3019 | |
3020 dnl checks for compiler characteristics | |
3021 AC_C_CONST | |
3022 | |
3023 dnl check for Make feature | |
3024 AC_PROG_MAKE_SET | |
3025 | |
3026 dnl check byte order | |
3027 AC_C_BIGENDIAN | |
3028 | |
3029 dnl define SIZEOF_TYPE | |
3030 AC_CHECK_SIZEOF(short) | |
3031 if test "$ac_cv_sizeof_short" = 0; then | |
3032 echo "" | |
3033 echo "*** PANIC *** Configure tests are not working - compiler is broken." | |
3034 echo "*** PANIC *** Please examine config.log for compilation errors." | |
3035 exit 1 | |
3036 fi | |
3037 AC_CHECK_SIZEOF(int) | |
3038 AC_CHECK_SIZEOF(long) | |
3039 AC_CHECK_SIZEOF(long long) | |
3040 AC_CHECK_SIZEOF(void *) | |
3041 AC_CHECK_SIZEOF(double) | |
3042 | |
3043 dnl check for long file names | |
3044 AC_SYS_LONG_FILE_NAMES | |
3045 | |
3046 dnl -lm is required for floating point support, among other things | |
3047 AC_CHECK_FUNC(sin, ,AC_CHECK_LIB(m, sin)) | |
3048 | |
3312 | 3049 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <math.h>], |
3050 [return atanh(1.0) + asinh(1.0) + acosh(1.0); ])], | |
2651 | 3051 AC_DEFINE(HAVE_INVERSE_HYPERBOLIC)) |
3052 | |
3053 dnl See if mkstemp is available | |
3054 AC_CHECK_FUNCS(mkstemp) | |
3055 | |
3056 dnl Determine type of mail locking from configure args and s&m headers | |
3312 | 3057 AC_MSG_CHECKING([type of mail spool file locking]) |
3058 AC_MSG_RESULT() | |
2651 | 3059 AC_CHECK_FUNCS(lockf flock) |
3060 dnl The mail_use_xxx variables are set according to the s&m headers. | |
3061 test -z "$with_mail_locking" -a "$mail_use_flock" = "yes" && with_mail_locking=flock | |
3062 test -z "$with_mail_locking" -a "$mail_use_lockf" = "yes" && with_mail_locking=lockf | |
3063 test -z "$with_mail_locking" -a "$mail_use_locking" = "yes" && with_mail_locking=locking | |
3064 if test -z "$with_mail_locking"; then | |
3065 case "$opsys" in cygwin* | mingw*) | |
3066 with_mail_locking=pop ;; | |
3067 esac | |
3068 fi | |
3069 | |
3070 if test "$with_mail_locking" = "lockf"; then AC_DEFINE(MAIL_LOCK_LOCKF) | |
3071 elif test "$with_mail_locking" = "flock"; then AC_DEFINE(MAIL_LOCK_FLOCK) | |
3072 elif test "$with_mail_locking" = "locking"; then AC_DEFINE(MAIL_LOCK_LOCKING) | |
3073 elif test "$with_mail_locking" = "pop"; then | |
3074 with_pop=yes | |
3075 with_mail_locking= | |
3076 elif test "$with_mail_locking" = "mmdf"; then AC_DEFINE(MAIL_LOCK_MMDF) | |
3077 else with_mail_locking="file"; AC_DEFINE(MAIL_LOCK_DOT) | |
3078 fi | |
3079 test "$with_mail_locking" = "lockf" -a "$ac_cv_func_lockf" != "yes" && \ | |
3080 XE_DIE("lockf mail locking requested but not available.") | |
3081 test "$with_mail_locking" = "flock" -a "$ac_cv_func_flock" != "yes" && \ | |
3082 XE_DIE("flock mail locking requested but not available.") | |
3083 test "$with_mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \ | |
3084 XE_DIE("locking mail locking requested but not available.") | |
3085 | |
3086 case "$opsys" in decosf*) | |
3087 AC_CHECK_LIB(pthreads, cma_open) | |
3088 test "$ac_cv_lib_pthreads_cma_open" = "yes" && \ | |
3089 c_switch_site="$c_switch_site -threads" ;; | |
3090 esac | |
3091 | |
3092 dnl ---------------------------------------------------------------- | |
3093 dnl Miscellaneous flags | |
3094 dnl ---------------------------------------------------------------- | |
3095 | |
3096 AC_MSG_CHECKING(whether the -xildoff compiler flag is required) | |
3097 if ${CC-cc} '-###' -xildon no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then | |
3098 if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; | |
3099 then AC_MSG_RESULT(no); | |
3100 else AC_MSG_RESULT(yes); XE_APPEND(-xildoff, ld_switch_site) | |
3101 fi | |
3102 else AC_MSG_RESULT(no) | |
3103 fi | |
3104 | |
3105 dnl Link with "-z ignore" on Solaris if supported | |
3106 if test "$opsys" = "sol2"; then | |
3107 if test "$os_release" -ge 506; then | |
3312 | 3108 AC_MSG_CHECKING([for "-z ignore" linker flag]) |
2651 | 3109 case "`ld -h 2>&1`" in |
3110 *-z\ ignore\|record* ) AC_MSG_RESULT(yes) | |
3111 XE_PREPEND(-z ignore, ld_switch_site) ;; | |
3112 *) AC_MSG_RESULT(no) ;; | |
3113 esac | |
3114 fi | |
3115 fi | |
3116 | |
3117 dnl ---------------------- | |
3118 dnl Choose a window system | |
3119 dnl ---------------------- | |
3120 | |
3312 | 3121 AC_MSG_CHECKING([for specified window system]) |
3122 AC_MSG_RESULT() | |
2651 | 3123 |
3124 dnl Autodetection of Gdk libraries and includes | |
3125 dnl ------------------------------------------- | |
3126 dnl On some systems (FreeBSD springs to mind), they use | |
3127 dnl versions on the utility routines, so instead of gtk-config | |
3128 dnl you must use gtk12-config, etc, etc. | |
3129 | |
3130 GNOME_CONFIG=no | |
3131 GTK_CONFIG=no | |
3132 | |
3133 if test "$with_gnome" != "no"; then | |
3134 AC_MSG_CHECKING(for GNOME configuration script) | |
3135 for possible in gnome-config | |
3136 do | |
3137 possible_version=`${possible} --version 2> /dev/null` | |
3138 if test "x${possible_version}" != "x"; then | |
3139 GNOME_CONFIG="${possible}" | |
3140 with_gnome=yes | |
3141 with_gtk=yes | |
3142 break | |
3143 fi | |
3144 done | |
3145 AC_MSG_RESULT([${GNOME_CONFIG}]) | |
3146 fi | |
3147 | |
3148 if test "${GNOME_CONFIG}" != "no"; then | |
3149 GNOME_LIBS=`${GNOME_CONFIG} --libs gnomeui` | |
3150 GNOME_CFLAGS=`${GNOME_CONFIG} --cflags gnomeui` | |
3151 AC_DEFINE(HAVE_GNOME) | |
3152 XE_APPEND(${GNOME_LIBS}, libs_gtk) | |
3153 XE_APPEND(${GNOME_CFLAGS}, c_switch_gtk) | |
3154 fi | |
3155 | |
3156 if test "$with_gtk" != "no";then | |
3157 AC_MSG_CHECKING(for GTK configuration script) | |
3158 for possible in gtk12-config gtk14-config gtk-config | |
3159 do | |
3160 possible_version=`${possible} --version 2> /dev/null` | |
3161 if test "x${possible_version}" != "x"; then | |
3162 GTK_CONFIG="${possible}" | |
3163 case "${possible_version}" in | |
3164 1.0.*) AC_MSG_WARN([GTK 1.2 is required, please upgrade your version of GTK.]); with_gtk=no;; | |
3165 1.3.*) AC_MSG_WARN([GTK 1.3 is not supported right now]); with_gtk=no;; | |
3166 1.2.*) | |
3167 with_gtk=yes | |
3168 break | |
3169 ;; | |
3170 *) AC_MSG_WARN([Found unsupported version of GTK: $possible_version]);; | |
3171 esac | |
3172 fi | |
3173 done | |
3174 AC_MSG_RESULT([${GTK_CONFIG}]) | |
3175 fi | |
3176 | |
3177 if test "${GTK_CONFIG}" != "no"; then | |
3178 AC_MSG_CHECKING(gtk version) | |
3179 GTK_VERSION=`${GTK_CONFIG} --version` | |
3180 AC_MSG_RESULT(${GTK_VERSION}) | |
3181 | |
3182 AC_MSG_CHECKING(gtk libs) | |
3183 GTK_LIBS=`${GTK_CONFIG} --libs` | |
3184 XE_APPEND(${GTK_LIBS}, libs_gtk) | |
3185 AC_MSG_RESULT(${GTK_LIBS}) | |
3186 | |
3187 AC_MSG_CHECKING(gtk cflags) | |
3188 GTK_CFLAGS=`${GTK_CONFIG} --cflags` | |
3189 if test "$GCC" = "yes"; then | |
3190 GTK_CFLAGS="${GTK_CFLAGS} -Wno-shadow" | |
3191 fi | |
3192 XE_APPEND(${GTK_CFLAGS}, c_switch_gtk) | |
3193 AC_MSG_RESULT(${GTK_CFLAGS}) | |
3194 | |
3195 AC_CHECK_LIB(gdk_imlib, main, XE_PREPEND(-lgdk_imlib, libs_gtk)) | |
3196 AC_CHECK_LIB(Imlib, Imlib_init, XE_APPEND(-lImlib, libs_gtk)) | |
3197 AC_CHECK_FUNCS(gdk_imlib_init) | |
3198 | |
3199 AC_DEFINE(HAVE_XPM) | |
3200 AC_DEFINE(HAVE_GTK) | |
3201 AC_SUBST(GTK_CONFIG) | |
3202 | |
3203 window_system=gtk | |
3204 with_gtk=yes | |
3205 if test "$with_x11" != "no"; then | |
3206 AC_MSG_WARN([Configuring GTK, forcing with_x11 to no]) | |
3207 with_x11=no | |
3208 fi | |
3209 | |
3210 for feature in scrollbars toolbars menubars dialogs widgets | |
3211 do | |
3212 eval "feature_value=\${enable_${feature}}" | |
3213 case "${feature_value}" in | |
3214 yes|no|gtk|"" ) | |
3215 ;; | |
3216 * ) | |
3217 feature_conflict_with_gtk=yes | |
3218 AC_MSG_WARN([--enable-${feature}=${feature_value} is incompatible with --with-gtk]) ;; | |
3219 esac | |
3220 done | |
3221 if test "${feature_conflict_with_gtk}" = "yes"; then | |
3222 XE_DIE(["One or more GUI toolkit features conflict with GTK"]) | |
3223 fi | |
3224 | |
3225 test "${enable_scrollbars}" != "no" && enable_scrollbars=gtk | |
3226 test "${enable_toolbars}" != "no" && enable_toolbars=gtk | |
3227 test "${enable_menubars}" != "no" && enable_menubars=gtk | |
3228 test "${enable_dialogs}" != "no" && enable_dialogs=gtk | |
3229 test "${enable_widgets}" != "no" && enable_widgets=gtk | |
3230 | |
3231 dnl Check for libglade support (it rocks) | |
3232 OLD_CFLAGS="${CFLAGS}" | |
3233 OLD_CPPFLAGS="${CPPFLAGS}" | |
3234 OLD_LDFLAGS="${LDFLAGS}" | |
3235 CFLAGS="${GTK_CFLAGS} ${CFLAGS}" | |
3236 CPPFLAGS="${GTK_CFLAGS} ${CFLAGS}" | |
3237 LDFLAGS="${LDFLAGS} ${GTK_LIBS}" | |
3238 AC_CHECK_HEADERS(glade/glade.h glade.h) | |
3239 AC_CHECK_LIB(xml, main, XE_PREPEND(-lxml, libs_gtk)) | |
3240 AC_CHECK_LIB(glade, main, XE_PREPEND(-lglade, libs_gtk)) | |
3241 AC_CHECK_LIB(glade-gnome, main, XE_PREPEND(-lglade-gnome, libs_gtk)) | |
3242 AC_EGREP_HEADER([char \*txtdomain;], [glade/glade-xml.h], | |
3243 [AC_MSG_RESULT(yes) | |
3244 AC_DEFINE(LIBGLADE_XML_TXTDOMAIN,1)], | |
3245 [AC_MSG_RESULT(no)]) | |
3246 CFLAGS="${OLD_CFLAGS}" | |
3247 CPPFLAGS="${OLD_CPPFLAGS}" | |
3248 LDFLAGS="${OLD_LDFLAGS}" | |
3249 fi | |
3250 | |
3251 dnl We may eventually prefer gtk/gdk over vanilla X11... | |
3252 | |
3253 if test "$with_x11" != "no"; then | |
3254 dnl User-specified --x-includes or --x-libraries implies --with-x11. | |
3255 test "$x_includes $x_libraries" != "NONE NONE" && \ | |
3256 window_system=x11 with_x11=yes | |
3257 | |
3258 dnl Autodetection of X11 libraries and includes | |
3259 dnl ------------------------------------------- | |
3260 dnl AC_PATH_XTRA thinks it can find our X headers and includes, but | |
3261 dnl it often gets it wrong, so we only use it as a last resort. | |
3262 | |
3263 dnl $OPENWINHOME implies --x-includes and --x-libraries | |
3264 dnl Not (yet) handled by autoconf2 | |
3265 if test "$x_includes $x_libraries" = "NONE NONE" \ | |
3266 -a -n "$OPENWINHOME" \ | |
3267 -a "$OPENWINHOME" != "/usr/openwin" \ | |
3268 -a -d "$OPENWINHOME"; then | |
3269 test -d "$OPENWINHOME/lib" && x_libraries="$OPENWINHOME/lib" | |
3270 test -d "$OPENWINHOME/include" && x_includes="$OPENWINHOME/include" | |
3271 test -d "$OPENWINHOME/share/include" && x_includes="$OPENWINHOME/share/include" | |
3272 fi | |
3273 | |
3274 if test "$x_includes" = "NONE"; then | |
3275 dnl AC_PATH_XTRA often guesses /usr/include, when some other | |
3276 dnl include directory is a MUCH better guess (Linux, HP-UX 10.20). | |
3277 dnl This is a workaround for idiot (esp. HP) system vendors, who | |
3278 dnl provide a /usr/include/X11, but DON'T FULLY POPULATE IT. | |
3279 for dir in "/usr/X11" "/usr/X11R6"; do | |
3280 if test -d "$dir/include/X11"; then x_includes="$dir/include"; break; fi | |
3281 done | |
3282 fi | |
3283 | |
3284 if test "$x_libraries" = "NONE"; then | |
3285 for dir in "/usr/X11/lib" "/usr/X11R6/lib" "/usr/lib/X11R6"; do | |
3286 if test -r "$dir/libX11.a"; then x_libraries="$dir"; break; fi | |
3287 done | |
3288 fi | |
3289 | |
3290 AC_PATH_XTRA # Autoconf claims to find X library and include dirs for us. | |
3291 if test "$no_x" = "yes" | |
3292 then with_x11=no window_system=none HAVE_X_WINDOWS=no | |
3293 else with_x11=yes window_system=x11 HAVE_X_WINDOWS=yes | |
3294 fi | |
3295 fi | |
3296 | |
3297 dnl #### wmperry:: !x11 != NONE | |
3298 dnl case "$with_x11" in | |
3299 dnl yes ) window_system=x11 HAVE_X_WINDOWS=yes ;; | |
3300 dnl no ) window_system=none HAVE_X_WINDOWS=no ;; | |
3301 dnl esac | |
3302 | |
3303 if test "$with_x11" = "yes"; then | |
3304 AC_DEFINE(HAVE_X_WINDOWS) | |
3305 XE_APPEND(lwlib, MAKE_SUBDIR) | |
3306 XE_APPEND(lwlib, SRC_SUBDIR_DEPS) | |
3307 | |
3308 dnl Look for Motif, but only if not found in $x_includes and $x_libraries | |
3309 AC_CHECK_HEADER(Xm/Xm.h, [AC_CHECK_LIB(Xm, XmStringFree, got_motif=yes)]) | |
3310 | |
3311 if test "$got_motif" != "yes"; then | |
3312 dnl Try to find Motif/CDE/Tooltalk dirs | |
3313 dnl These take precedence over other X libs/includes, so PRE-pend | |
3314 for lib_dir in "/usr/dt/lib" "/usr/lib/Motif2.1" \ | |
3315 "/usr/lib/Motif1.2" "/usr/lib/Motif1.1"; do | |
3316 inc_dir=`echo $lib_dir | sed -e 's/lib/include/'` | |
3317 if test -d "$lib_dir" -a -d "$inc_dir"; then | |
3318 case "$x_libraries" in *"$lib_dir"* ) ;; *) | |
3319 x_libraries="$lib_dir $x_libraries" | |
3320 XE_PREPEND(-L${lib_dir}, X_LIBS) ;; | |
3321 esac | |
3322 case "$x_includes" in "$inc_dir"* ) ;; *) | |
3323 x_includes="$inc_dir $x_includes" | |
3324 XE_PREPEND(-I${inc_dir}, X_CFLAGS) ;; | |
3325 esac | |
3326 break; dnl only need ONE Motif implementation! | |
3327 fi | |
3328 done | |
3329 fi | |
3330 | |
3331 dnl Contrib X libs/includes do NOT take precedence, so AP-pend | |
3332 for rel in "X11R6" "X11R5" "X11R4"; do | |
3333 lib_dir="/usr/contrib/$rel/lib" inc_dir="/usr/contrib/$rel/include" | |
3334 if test -d "$lib_dir" -a -d "$inc_dir"; then | |
3335 case "$x_libraries" in *"$lib_dir"* ) ;; *) | |
3336 x_libraries="$x_libraries $lib_dir" | |
3337 XE_APPEND(-L${lib_dir}, X_LIBS) | |
3338 esac | |
3339 case "$x_includes" in "$inc_dir"* ) ;; *) | |
3340 x_includes="$x_includes $inc_dir" | |
3341 XE_APPEND(-I${inc_dir}, X_CFLAGS) | |
3342 esac | |
3343 break; dnl Only need ONE X11 implementation ! | |
3344 fi | |
3345 done | |
3346 | |
3347 dnl Avoid version mismatch for shared library libXm.so on osf4 | |
3348 case "$opsys" in | |
3349 decosf*) if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ;; | |
3350 esac | |
3351 | |
3352 ld_switch_x_site="$X_LIBS" | |
3353 | |
3354 XE_COMPUTE_RUNPATH() | |
3355 | |
3356 if test "$verbose" = "yes"; then | |
3357 echo; echo "X11 compilation variables:" | |
3358 PRINT_VAR(x_libraries x_includes X_CFLAGS X_LIBS X_PRE_LIBS X_EXTRA_LIBS) | |
3359 echo | |
3360 fi | |
3361 | |
3362 dnl Set up bitmaps search path. | |
3363 dnl The original suggestion was to unconditionally to append X11/bitmaps | |
3364 dnl to each element of $x_includes, I'm pretty sure this is the wrong | |
3365 dnl thing to do. We test for bitmaps and X11/bitmaps directories on each | |
3366 dnl element and add them to BITMAPDIR if they exist. | |
3367 bitmapdirs= | |
3368 if test "$x_includes" != NONE; then | |
3369 for i in $x_includes; do | |
3370 if test -d "$i/bitmaps"; then | |
3371 bitmapdirs="$i/bitmaps:$bitmapdirs" | |
3372 fi | |
3373 if test -d "$i/X11/bitmaps"; then | |
3374 bitmapdirs="$i/X11/bitmaps:$bitmapdirs" | |
3375 fi | |
3376 done | |
3377 bitmapdirs=`echo "$bitmapdirs" | sed s/.$//` | |
3378 fi | |
3379 test ! -z "$bitmapdirs" && AC_DEFINE_UNQUOTED(BITMAPDIR, "$bitmapdirs") | |
3380 | |
3381 dnl Autodetect defines extracted from X config by xmkmf, e.g. NARROWPROTO | |
3312 | 3382 AC_MSG_CHECKING([for X defines extracted by xmkmf]) |
3383 AC_MSG_RESULT() | |
2651 | 3384 rm -fr conftestdir |
3385 if mkdir conftestdir; then | |
3386 cd conftestdir | |
3387 cat > Imakefile <<'EOF' | |
3388 xetest: | |
3389 @echo ${PROTO_DEFINES} ${STD_DEFINES} | |
3390 EOF | |
3391 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then | |
3392 # GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
3393 xmkmf_defines=`${MAKE-make} xetest 2>/dev/null | grep -v make` | |
3394 fi | |
3395 cd .. | |
3396 rm -fr conftestdir | |
3397 for word in $xmkmf_defines; do | |
3398 case "$word" in | |
3399 -D__STDC__*) ;; | |
3400 -D* ) | |
3401 sym=`echo '' $word | sed -e 's:^ *-D::' -e 's:=.*::'` | |
3402 case "$word" in | |
3403 -D*=* ) val=`echo '' $word | sed -e 's:^.*=::'` ;; | |
3404 * ) val=1 ;; | |
3405 esac | |
3406 dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above. | |
3407 if grep "^#define $sym " confdefs.h >/dev/null; then :; else | |
3408 if test "$val" = "1" | |
3409 then AC_DEFINE_UNQUOTED($sym) | |
3410 else AC_DEFINE_UNQUOTED($sym,$val) | |
3411 fi | |
3412 fi ;; | |
3413 esac | |
3414 done | |
3415 fi | |
3416 | |
3417 dnl make sure we can find Intrinsic.h | |
3418 AC_CHECK_HEADER(X11/Intrinsic.h, , | |
3419 [AC_MSG_ERROR([Unable to find X11 header files.])]) | |
3420 | |
3421 dnl -lXt and -lX11 are required | |
3422 dnl Some broken systems require the magic "-b i486-linuxaout" flag | |
3423 AC_CHECK_LIB(X11, XOpenDisplay, have_lib_x11=yes) | |
3424 if test "$have_lib_x11" != "yes"; then | |
3425 AC_CHECK_LIB(X11, XGetFontProperty, | |
3426 ld_switch_x_site="-b i486-linuxaout $ld_switch_x_site", | |
3427 [AC_MSG_ERROR([Unable to find X11 libraries.])], | |
3428 -b i486-linuxaout) | |
3429 fi | |
3430 libs_x="-lX11" | |
3431 test "$verbose" = "yes" && echo " Setting libs_x to \"-lX11\"" | |
3432 | |
3433 dnl Autodetect -lXext | |
3434 AC_CHECK_LIB(Xext, XShapeSelectInput, XE_PREPEND(-lXext, libs_x)) | |
3435 | |
3436 dnl Require -lXt | |
3437 AC_CHECK_LIB(Xt, XtOpenDisplay, XE_PREPEND(-lXt, libs_x), | |
3438 AC_MSG_ERROR([Unable to find X11 libraries.])) | |
3439 | |
3440 AC_MSG_CHECKING(the version of X11 being used) | |
3441 AC_RUN_IFELSE([AC_LANG_SOURCE([#include <X11/Intrinsic.h> | |
4537
7ca6d57ce12d
Clarify syntax in configure.ac following Vladimir Ivanovic's change.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4536
diff
changeset
|
3442 int main(int c, char **v) { return c>1 ? XlibSpecificationRelease : 0; }])], |
2651 | 3443 [./conftest foobar; x11_release=$?],[x11_release=4],[x11_release=4]) |
3444 AC_MSG_RESULT(R${x11_release}) | |
3445 AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release}) | |
3446 | |
3447 if test "${x11_release}" = "4"; then | |
3448 case "$enable_widgets" in | |
3449 "" | "no") enable_widgets=no ;; | |
3450 *) XE_DIE("Widget support requires X11R5 or greater") ;; | |
3451 esac | |
3452 fi | |
3453 | |
3454 AC_CHECK_FUNCS(XConvertCase XtRegisterDrawable) | |
3455 | |
3456 AC_CHECK_HEADERS(X11/Xlocale.h X11/Xfuncproto.h) | |
3457 | |
3458 dnl XFree86 has a non-standard prototype for this X11R6 function | |
3459 AC_CHECK_FUNCS(XRegisterIMInstantiateCallback) | |
3460 AC_MSG_CHECKING(for standard XRegisterIMInstantiateCallback prototype) | |
3312 | 3461 AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
2651 | 3462 #define NeedFunctionPrototypes 1 |
3463 #include <X11/Xlib.h> | |
3464 extern Bool XRegisterIMInstantiateCallback( | |
3465 Display*, struct _XrmHashBucketRec*, char*, char*, XIMProc, XPointer*); | |
3312 | 3466 ])], |
2651 | 3467 [AC_MSG_RESULT(yes)], |
3468 [AC_MSG_RESULT(no) | |
3469 AC_DEFINE(XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE)]) | |
3470 | |
3471 dnl autodetect -lXmu | |
3472 test -z "$with_xmu" && { AC_CHECK_LIB(Xmu, XmuReadBitmapDataFromFile, | |
3473 with_xmu=yes, with_xmu=no) } | |
3474 if test "$with_xmu" = "no"; then | |
3475 XE_ADD_OBJS(xmu.o) | |
3476 else | |
3477 XE_PREPEND(-lXmu, libs_x) | |
3478 AC_DEFINE(HAVE_XMU) | |
3479 fi | |
3480 | |
3481 dnl Autodetect -lXbsd | |
3482 dnl #### Someone, please add a better function than main | |
3483 AC_CHECK_LIB(Xbsd, main, XE_PREPEND(-lXbsd, libs_x)) | |
3484 | |
3485 dnl Problem with the MIT distribution of X on AIX | |
3486 if test "$unexec" = "unexaix.o" -a "$x11_release" = "6"; then | |
3487 dnl X11R6 requires thread-safe code on AIX for some reason | |
3488 if test "$GCC" = "yes"; then | |
3489 XE_PREPEND(-mthreads, X_CFLAGS) | |
3490 XE_PREPEND(-mthreads, libs_x) | |
3491 else | |
3492 case "$CC" in | |
3493 "xlc" ) CC="xlc_r" ;; | |
3494 "xlC" ) CC="xlC_r" ;; | |
3495 "cc" ) CC="cc_r" ;; | |
3496 esac | |
3497 fi | |
3498 fi | |
3499 | |
3094 | 3500 dnl include xft/AA support? |
3501 dnl #### need to check for includes here (especially, freetype.h for v.2) | |
3502 | |
3503 if test "$with_xft_emacs" = "yes"; then | |
3312 | 3504 AC_MSG_CHECKING([for Xrender, fontconfig, and Xft]) |
3094 | 3505 xft_includes_found=no |
4152 | 3506 dnl try pkg-config |
3507 xft_config_prog="pkg-config xft" | |
3508 xft_config_ok=`$xft_config_prog --cflags 2>/dev/null` | |
3509 if test "$?" = 0 ; then | |
3510 xft_cflags=`$xft_config_prog --cflags` | |
3511 xft_libs=`$xft_config_prog --libs` | |
3512 c_switch_site="$c_switch_site $xft_cflags" | |
3513 ld_switch_site="$ld_switch_site $xft_libs" | |
3514 xft_includes_found=yes | |
3515 else | |
3516 AC_CHECK_HEADERS([freetype/config/ftheader.h], | |
3517 [xft_includes_found=yes], | |
3518 [ | |
3519 dnl #### How about /sw/include, and /opt/local/include? | |
3520 dnl these directories need to be the parent of the freetype directory | |
3521 for freetype_include_top in "/usr/local/include/freetype2" \ | |
3522 "/usr/X11R6/include/freetype2" \ | |
3523 "/usr/include/freetype2" | |
3524 do | |
3525 if test -d $freetype_include_top; then | |
3526 AC_MSG_CHECKING([in ${freetype_include_top}]) | |
3527 dnl disable autoconf's fucking cache; why these fuckheads think it | |
3528 dnl is better to be broken than to be slow, I don't know! | |
3529 dnl #### there's gotta be a better-looking way to do this!! | |
3530 unset "$as_ac_Header" | |
3531 save_c_switch_site="$c_switch_site" | |
3532 c_switch_site="$c_switch_site -I${freetype_include_top}" | |
3533 AC_CHECK_HEADERS([freetype/config/ftheader.h], | |
3534 [xft_includes_found=yes], | |
3535 [c_switch_site=$save_c_switch_site]) | |
3536 fi | |
3537 done]) | |
3538 fi | |
3158 | 3539 if test "$xft_includes_found" != "yes"; then |
3540 XE_DIE(["Unable to find headers for --with-xft"]) | |
3541 else | |
3542 AC_CHECK_LIB(Xrender, XRenderQueryExtension, XE_PREPEND(-lXrender, libs_x), | |
3543 [XE_DIE(["Unable to find libXrender for --with-xft"])]) | |
3544 AC_CHECK_LIB(fontconfig, FcPatternCreate, XE_PREPEND(-lfontconfig, libs_x), | |
3545 [XE_DIE(["Unable to find libfontconfig for --with-xft"])]) | |
3546 AC_CHECK_LIB(Xft, XftFontOpen, XE_PREPEND(-lXft, libs_x), | |
3547 [XE_DIE(["Unable to find libXft for --with-xft"])]) | |
4328
dfd878799ef0
Autoconfiscate the recent fontconfig spelling change.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4152
diff
changeset
|
3548 |
dfd878799ef0
Autoconfiscate the recent fontconfig spelling change.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4152
diff
changeset
|
3549 AC_CHECK_FUNCS(FcConfigGetRescanInterval) |
dfd878799ef0
Autoconfiscate the recent fontconfig spelling change.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4152
diff
changeset
|
3550 AC_CHECK_FUNCS(FcConfigSetRescanInterval) |
3354 | 3551 dnl #### detect fontconfig properly!!!! |
3552 with_fontconfig=yes | |
3553 AC_DEFINE(HAVE_FONTCONFIG) | |
3158 | 3554 AC_DEFINE(USE_XFT) |
3555 dnl Due to interactions with other libraries, must postpone AC_DEFINE | |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
3556 dnl of USE_XFT_MENUBARS, USE_XFT_TABS, and USE_XFT_GAUGES. |
3158 | 3557 unset xft_includes_found |
3558 fi | |
3094 | 3559 fi |
3560 | |
2651 | 3561 fi dnl $with_x11 = yes |
3562 | |
3563 if test "$with_msw" != "no"; then | |
3312 | 3564 AC_MSG_CHECKING([for MS-Windows]) |
3565 AC_MSG_RESULT() | |
2651 | 3566 AC_CHECK_LIB(gdi32,main,with_msw=yes) |
3567 if test "$with_msw" = "yes"; then | |
3568 AC_DEFINE(HAVE_MS_WINDOWS) | |
3569 | |
3570 dnl The net installer only works with MS-Windows currently | |
3571 if test "$with_netinstall" = "yes"; then | |
3572 XE_APPEND(netinstall, MAKE_SUBDIR) | |
3573 XE_APPEND(netinstall, SRC_SUBDIR_DEPS) | |
3574 XE_APPEND(netinstall, INSTALL_ARCH_DEP_SUBDIR) | |
3575 fi | |
3576 | |
3577 install_pp="$srcdir/lib-src/installexe.sh" | |
3578 XE_APPEND(-limm32 -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lole32 -luuid -lwinspool -lmpr, libs_system) | |
3579 if test "$with_dragndrop" != no; then | |
3580 XE_APPEND(msw, dragndrop_proto) | |
3581 with_dragndrop=yes | |
3582 fi | |
3583 if test "$window_system" != x11; then | |
3584 window_system=msw | |
3585 test "$enable_scrollbars" != "no" && enable_scrollbars=msw | |
3586 test "$enable_menubars" != "no" && enable_menubars=msw | |
3587 test "$enable_toolbars" != "no" && enable_toolbars=msw | |
3588 test "$enable_dialogs" != "no" && enable_dialogs=msw | |
3589 test "$enable_widgets" != "no" && enable_widgets=msw | |
3590 fi | |
3591 dnl check for our special version of select | |
3592 AC_RUN_IFELSE([AC_LANG_SOURCE([#include <fcntl.h> | |
3593 int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }])], | |
3594 [AC_DEFINE(HAVE_MSG_SELECT)]) | |
3595 fi | |
3596 fi | |
3597 | |
3598 AC_SUBST(install_pp) | |
3599 | |
3600 test -z "$with_dragndrop" && with_dragndrop="$with_dragndrop_default" | |
3601 test -z "$window_system" && window_system="none" | |
3602 | |
3603 dnl Test for features that require a window system - ANY window system | |
3604 if test "$window_system" = "none"; then | |
3605 for feature in menubars scrollbars toolbars dialogs dragndrop xface | |
3606 do | |
3607 if eval "test -n \"\$enable_${feature}\" -a \"\$enable_${feature}\" != no" ; then | |
3608 AC_MSG_WARN([--enable-$feature ignored: Not valid without window system support]) | |
3609 fi | |
3610 eval "enable_${feature}=no" | |
3611 done | |
3612 else | |
3613 test -z "$enable_toolbars" && enable_toolbars=yes | |
3614 fi | |
3615 | |
3616 dnl ### Test for features that require mswindows support - currently none | |
3617 dnl ### MS-Windows folks: add code here..... (martin) | |
3618 if test "$with_msw" != "yes"; then | |
3619 for feature in MARTIN_IS_CLUELESS_ABOUT_MSW_FEATURES | |
3620 do | |
3621 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then | |
3622 AC_MSG_WARN([--with-$feature ignored: Not valid without MS-Windows support]) | |
3623 fi | |
3624 eval "with_${feature}=no" | |
3625 done | |
3626 else | |
3627 : | |
3628 fi | |
3629 | |
3630 dnl Test for features that require X11 support | |
3631 if test "$with_x11" != "yes"; then | |
3632 dnl It ought to be reasonable to have no output device at all, and only use | |
3633 dnl XEmacs in --batch mode. | |
3634 dnl if test "$with_tty" = "no" ; then | |
3635 dnl AC_MSG_ERROR([No window system support and no TTY support - Unable to proceed.]) | |
3636 dnl fi | |
3637 for feature in with_tooltalk with_cde with_offix with_wmcommand with_xim with_xmu enable_sound_nas | |
3638 do | |
3639 if eval "test -n \"\$${feature}\" -a \"\$${feature}\" != \"no\"" ; then | |
3640 AC_MSG_WARN([--$feature ignored: Not valid without X support]) | |
3641 fi | |
3642 eval "${feature}=no" | |
3643 done | |
3644 fi | |
3645 | |
3646 dnl Balloon Help requires the Shape extension, not available everywhere, | |
3647 dnl for example not on AIX 4.3. | |
3648 if test "$with_x11" = "yes"; then | |
3649 AC_CHECK_HEADER(X11/extensions/shape.h, [ | |
3650 AC_DEFINE(HAVE_BALLOON_HELP) | |
2741 | 3651 ],[], |
3652 [ | |
3653 #include <X11/Xlib.h> | |
3654 #include <X11/Xutil.h> | |
3655 ]) | |
2651 | 3656 fi |
3657 | |
3658 dnl FSF 19.29 has some bitmapdir stuff here. | |
3659 bitmapdir= | |
3660 | |
3661 case "$window_system" in | |
3662 x11 ) HAVE_X_WINDOWS=yes; echo " Using X11." ;; | |
3663 msw ) HAVE_X_WINDOWS=no ; echo " Using MS-Windows." ;; | |
3664 gtk ) | |
3665 HAVE_X_WINDOWS=no | |
3666 test "$with_gnome" = "yes" && echo " Using GNOME." | |
3667 test "$with_gnome" = "no" && echo " Using GTK." | |
3668 ;; | |
3669 none ) HAVE_X_WINDOWS=no ; echo " Using no window system." ;; | |
3670 esac | |
3671 | |
3672 case "$x_libraries" in *X11R4* ) | |
3673 test "$opsys" = "hpux9" && opsysfile="s/hpux9-x11r4.h" | |
3674 test "$opsys" = "hpux9-shr" && opsysfile="s/hpux9shxr4.h" | |
3675 esac | |
3676 | |
3677 dnl Enable or disable proper handling of WM_COMMAND | |
3312 | 3678 AC_MSG_CHECKING([for WM_COMMAND option]) |
2651 | 3679 dnl if test "$with_wmcommand" = "yes"; then |
3680 if test "$with_wmcommand" != "no"; then | |
3681 AC_DEFINE(HAVE_WMCOMMAND) | |
3312 | 3682 AC_MSG_RESULT(yes) |
3683 else | |
3684 AC_MSG_RESULT(no) | |
2651 | 3685 fi |
3686 | |
3687 dnl Autodetect Xauth | |
3688 dnl -lXau is only used by gnuclient, so use a special variable for Xauth X libs | |
3689 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no | |
3690 test -z "$with_xauth" && { AC_CHECK_HEADER(X11/Xauth.h, ,with_xauth=no) } | |
3691 test -z "$with_xauth" && { AC_CHECK_LIB(Xau, XauGetAuthByAddr,[:],with_xauth=no) } | |
3692 test -z "$with_xauth" && with_xauth=yes | |
3693 if test "$with_xauth" = "yes"; then | |
3694 AC_DEFINE(HAVE_XAUTH) | |
3695 XE_SPACE(libs_xauth, $GTK_LIBS $X_EXTRA_LIBS -lXau $libs_x $X_PRE_LIBS) | |
3696 fi | |
3697 AC_SUBST(libs_xauth) | |
3698 | |
3699 dnl This one is for the static initializeds variables in | |
3700 dnl offix.c, so that the thing is dumped after lastfile.o | |
3701 AC_SUBST(dnd_objs) | |
3702 | |
3703 dnl Autodetect dll support | |
3704 | |
3705 dnl If g++ is used, we have to explicitly link modules with -lstdc++ on Cygwin | |
3706 dnl to avoid undefined symbol errors. This will never hurt, so just do it on | |
3707 dnl all platforms in case others have the same brain damage. | |
3708 if test "$with_xemacs_compiler" = "g++"; then | |
3709 LIBSTDCPP=-lstdc++ | |
3710 else | |
3711 LIBSTDCPP= | |
3712 fi | |
3713 AC_SUBST(LIBSTDCPP) | |
3714 | |
3715 dnl This must come before the detection code for anything that is in a module | |
3716 if test "$enable_modules" != "no"; then | |
3312 | 3717 AC_MSG_CHECKING([for module support]) |
3718 AC_MSG_RESULT() | |
2651 | 3719 |
3720 case "$opsys" in | |
3721 mingw* | cygwin* ) have_dl=yes ;; | |
3722 darwin ) have_dl=yes | |
3723 AC_DEFINE(HAVE_DYLD) | |
3724 ;; | |
3725 * ) | |
3726 dnl Check for the ELFish dlopen() | |
3727 AC_CHECK_HEADER(dlfcn.h, [ | |
3728 AC_MSG_CHECKING([for dlopen in -lc]) | |
3312 | 3729 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dlfcn.h>], |
3730 [dlopen ("", 0);])], [ have_dl=yes ; AC_MSG_RESULT($have_dl)], [ | |
2741 | 3731 AC_MSG_RESULT([no]) |
2651 | 3732 AC_MSG_CHECKING([for dlopen in -ldl]) |
3733 ac_save_LIBS="$LIBS" | |
3734 LIBS="$LIBS -ldl" | |
3312 | 3735 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dlfcn.h>], |
3736 [dlopen ("", 0);])], [ have_dl=yes; AC_MSG_RESULT($have_dl)], [ | |
2741 | 3737 AC_MSG_RESULT([no]) |
2651 | 3738 AC_MSG_CHECKING([for dlopen in -lsvld]) |
3739 LIBS="$ac_save_LIBS -lsvld" | |
3312 | 3740 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dlfcn.h>], |
3741 [dlopen ("", 0);])], [ have_dl=yes; AC_MSG_RESULT($have_dl) ], | |
2741 | 3742 [LIBS="$ac_save_LIBS" ; AC_MSG_RESULT([no])])])])]) |
2651 | 3743 if test "$have_dl" = "yes"; then |
3744 AC_DEFINE(HAVE_DLOPEN) | |
3745 else | |
3746 dnl Check for HP/UX shl_load | |
3747 AC_CHECK_HEADER(dl.h, [ | |
3748 AC_MSG_CHECKING([for shl_load in -lc]) | |
3312 | 3749 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], |
3750 [shl_load ("", 0, 0);])], [have_dl=yes; AC_MSG_RESULT($have_dl)], [ | |
2741 | 3751 AC_MSG_RESULT([no]) |
2651 | 3752 AC_MSG_CHECKING([for shl_load in -ldl]) |
3753 ac_save_LIBS="$LIBS" | |
3754 LIBS="$LIBS -ldld" | |
3312 | 3755 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <dl.h>], |
3756 [shl_load ("", 0, 0);])], [have_dl=yes], | |
2741 | 3757 [LIBS="$ac_save_LIBS"; AC_MSG_RESULT([no])])])]) |
2651 | 3758 if test "$have_dl" = "yes"; then |
3759 AC_DEFINE(HAVE_SHL_LOAD) | |
3760 else | |
3761 dnl Check for libtool's libltdl | |
3762 AC_CHECK_HEADER(ltdl.h, [ | |
3763 AC_MSG_CHECKING([for lt_dlinit in -lltdl]) | |
3764 ac_save_LIBS="$LIBS" | |
3765 LIBS="$LIBS -lltdl" | |
3312 | 3766 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <ltdl.h>], |
3767 [lt_dlinit ();])], [have_dl=yes], [LIBS="$ac_save_LIBS"])]) | |
2741 | 3768 AC_MSG_RESULT($have_dl) |
2651 | 3769 if test "$have_dl" = "yes"; then |
3770 AC_DEFINE(HAVE_LTDL) | |
3771 fi | |
3772 dnl end !HP/UX | |
3773 fi | |
3774 dnl end !dlopen | |
3775 fi | |
3776 ac_save_LIBS= | |
3777 dnl end !darwin | |
3778 esac | |
3779 | |
3780 if test -n "$have_dl"; then | |
3781 dnl XE_SHLIB_STUFF (in aclocal.m4) defines $can_build_shared | |
3782 XE_SHLIB_STUFF | |
3783 fi | |
3784 | |
3785 if test "$can_build_shared" = "yes"; then | |
3786 AC_DEFINE(HAVE_SHLIB) | |
3787 dnl src must be built before modules on MacOSX and Windows platforms, since | |
3788 dnl the binary must be available to properly link the modules | |
3789 dnl For no-module builds, this is added *after* the module directories | |
3790 XE_APPEND(src, MAKE_SUBDIR) | |
3791 XE_APPEND(src, INSTALL_ARCH_DEP_SUBDIR) | |
3792 test -n "$libdl" && XE_PREPEND(-l${libdl}, LIBS) | |
3793 AC_CHECK_FUNCS(dlerror _dlerror) | |
3794 enable_modules=yes | |
3795 MOD_CC="../../lib-src/ellcc" | |
3796 MODCFLAGS="\$(CFLAGS) --mode=compile --mod-output=\$@ -I../../src -I\$(srcdir)/../../src" | |
3797 INSTALLPATH="\$(moduledir)" | |
3798 MOD_INSTALL_PROGRAM=${INSTALL_PROGRAM} | |
3799 OBJECT_TO_BUILD="\$(MODNAME).ell" | |
3800 else | |
3801 if test "$enable_modules" = "yes"; then | |
3802 XE_DIE("Required module support cannot be provided.") | |
3803 else | |
3804 echo " No module support." | |
3805 fi | |
3806 enable_modules=no | |
3807 fi | |
3808 fi | |
3809 if test "$enable_modules" != "yes"; then | |
3810 MOD_CC="$XEMACS_CC" | |
3811 MODCFLAGS="\$(XE_CFLAGS) -I../../src -I\$(srcdir)/../../src" | |
3812 INSTALLPATH="" | |
3813 MOD_INSTALL_PROGRAM="true" | |
3814 OBJECT_TO_BUILD="\$(MODNAME).o" | |
3815 fi | |
3816 MODARCHDIR= | |
3817 MAKE_DOCFILE="../../lib-src/make-docfile" | |
3818 AC_SUBST(with_modules, $enable_modules) | |
3819 AC_SUBST(MOD_CC) | |
3820 AC_SUBST(MODARCHDIR) | |
3821 AC_SUBST(MAKE_DOCFILE) | |
3822 AC_SUBST(MODCFLAGS) | |
3823 AC_SUBST(INSTALLPATH) | |
3824 AC_SUBST(MOD_INSTALL_PROGRAM) | |
3825 AC_SUBST(OBJECT_TO_BUILD) | |
3826 | |
3827 dnl Autodetect tooltalk | |
3828 if test "$with_tooltalk" != "no" ; then | |
3829 dnl autodetect the location of tt_c.h | |
3830 dnl tt_c.h might be in Tt or desktop include directories | |
3831 for dir in "" "Tt/" "desktop/" ; do | |
3832 AC_CHECK_HEADER(${dir}tt_c.h, tt_c_h_file="${dir}tt_c.h"; break) | |
3833 done | |
3834 if test -z "$tt_c_h_file"; then | |
3835 if test "$with_tooltalk" = "yes"; then | |
3836 USAGE_ERROR("Unable to find required tooltalk header files.") | |
3837 fi | |
3838 with_tooltalk=no | |
3839 fi | |
3840 fi | |
3841 if test "$with_tooltalk" != "no" ; then | |
3842 for extra_libs in "" "-lI18N -lce" "-lcxx"; do | |
3843 AC_CHECK_LIB(tt, tt_message_create, | |
3844 tt_libs="-ltt $extra_libs"; break, [:],$extra_libs) | |
3845 done | |
3846 if test -z "$tt_libs"; then | |
3847 if test "$with_tooltalk" = "yes"; then | |
3848 USAGE_ERROR("Unable to find required tooltalk libraries.") | |
3849 fi | |
3850 with_tooltalk=no | |
3851 fi | |
3852 fi | |
3853 test -z "$with_tooltalk" && with_tooltalk=yes | |
3854 if test "$with_tooltalk" = "yes"; then | |
3855 AC_DEFINE(TOOLTALK) | |
3856 AC_DEFINE_UNQUOTED(TT_C_H_FILE, "$tt_c_h_file") | |
3857 XE_PREPEND($tt_libs, libs_x) | |
3858 fi | |
3859 | |
3860 dnl Autodetect CDE | |
3861 test -z "$with_cde" && { AC_CHECK_HEADER(Dt/Dt.h, , with_cde=no) } | |
3862 test -z "$with_cde" && { AC_CHECK_LIB(DtSvc, DtDndDragStart, [:], with_cde=no) } | |
3863 if test "$with_dragndrop" = "no" ; then | |
3864 if test "$with_cde" = "yes" ; then | |
3312 | 3865 AC_MSG_WARN([--with-cde forced to `no'; no generic Drag'n'Drop support]) |
2651 | 3866 fi |
3867 with_cde=no | |
3868 fi | |
3869 test -z "$with_cde" && with_cde=yes | |
3870 if test "$with_cde" = "yes" ; then | |
3871 AC_DEFINE(HAVE_CDE) | |
3872 XE_PREPEND(-lDtSvc, libs_x) | |
3873 XE_APPEND(CDE, dragndrop_proto) | |
3874 with_tooltalk=yes # CDE requires Tooltalk | |
3875 need_motif=yes # CDE requires Motif | |
3876 fi | |
3877 | |
3878 dnl Always compile OffiX unless --without-offix is given, no | |
3879 dnl X11 support is compiled in, no standard Xmu is available, | |
3880 dnl or dragndrop support is disabled | |
3881 dnl Because OffiX support currently loses when more than one display | |
3882 dnl is in use, we now disable it by default -slb 07/10/1998. | |
3883 test "$window_system" != "x11" && with_offix=no | |
3884 if test "$with_xmu" != yes -a "$with_x11" = yes; then | |
3885 if test "$with_offix" = "yes" ; then | |
3312 | 3886 AC_MSG_WARN([--with-offix forced to `no'; no real Xmu support]) |
2651 | 3887 fi |
3888 with_offix=no | |
3889 fi | |
3890 if test "$with_dragndrop" = no; then | |
3891 if test "$with_offix" = "yes" ; then | |
3312 | 3892 AC_MSG_WARN([--with-offix forced to `no'; no generic Drag'n'Drop support]) |
2651 | 3893 fi |
3894 with_offix=no | |
3895 fi | |
3896 if test "$with_cde" = yes; then | |
3897 if test "$with_offix" = "yes" ; then | |
3312 | 3898 AC_MSG_WARN([--with-offix forced to `no'; CDE already found]) |
2651 | 3899 fi |
3900 with_offix=no | |
3901 fi | |
3902 test -z "$with_offix" && with_offix=no | |
3903 if test "$with_offix" = "yes"; then | |
3904 AC_DEFINE(HAVE_OFFIX_DND) | |
3905 XE_APPEND(offix.o, dnd_objs) | |
3906 XE_APPEND(OffiX, dragndrop_proto) | |
3907 fi | |
3908 if test "$with_gtk" = "yes"; then | |
3909 XE_APPEND(GTK, dragndrop_proto) | |
3910 fi | |
3911 | |
3912 dnl Autodetect Drag'n'Drop support | |
3913 dnl always included if CDE, Offix, or MSWindows are defined | |
3914 if test "$with_dragndrop" != "no" ; then | |
3915 AC_MSG_CHECKING(if drag and drop API is needed) | |
3916 if test -n "$dragndrop_proto" ; then | |
3917 with_dragndrop=yes | |
3918 AC_MSG_RESULT([yes (${dragndrop_proto} )]) | |
3919 AC_DEFINE(HAVE_DRAGNDROP) | |
3920 XE_APPEND(dragdrop.o, extra_objs) | |
3921 else | |
3922 with_dragndrop=no | |
3923 AC_MSG_RESULT(no) | |
3924 fi | |
3925 fi | |
3926 | |
3927 dnl Autodetect LDAP | |
3312 | 3928 AC_MSG_CHECKING([for LDAP]) |
3929 AC_MSG_RESULT() | |
2651 | 3930 ldap_libs= |
3931 test -z "$with_ldap" && { AC_CHECK_HEADER(ldap.h, ,with_ldap=no) } | |
3932 test -z "$with_ldap" && { AC_CHECK_HEADER(lber.h, ,with_ldap=no) } | |
3933 if test "$with_ldap" != "no"; then | |
3934 AC_CHECK_LIB(ldap, ldap_search, with_ldap=yes) | |
3935 dnl Check for other libraries we need to link with to get the main routines. | |
3936 test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes], , -llber) } | |
3937 test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes], , -llber -lkrb) } | |
3938 test "$with_ldap" != "yes" && { AC_CHECK_LIB(ldap, ldap_open, [with_ldap=yes with_ldap_lber=yes with_ldap_krb=yes with_ldap_des=yes], , -llber -lkrb -ldes) } | |
3939 dnl Recently, we need -lber even though the main routines are elsewhere, | |
3940 dnl because otherwise be get link errors w.r.t. ber_pvt_opt_on. So just | |
3941 dnl check for that (it's a variable not a fun but that doesn't seem to | |
3942 dnl matter in these checks) and stick in -lber if so. Can't hurt (even to | |
3943 dnl stick it in always shouldn't hurt, I don't think) ... #### Someone who | |
3944 dnl #### understands LDAP needs to fix this properly. | |
3945 test "$with_ldap_lber" != "yes" && { AC_CHECK_LIB(lber, ber_pvt_opt_on, with_ldap_lber=yes) } | |
3946 fi | |
3947 if test "$with_ldap" = "yes"; then | |
3948 AC_DEFINE(HAVE_LDAP) | |
3949 if test "$with_ldap_des" = "yes" ; then | |
3950 XE_PREPEND(-ldes, ldap_libs) | |
3951 fi | |
3952 if test "$with_ldap_krb" = "yes" ; then | |
3953 XE_PREPEND(-lkrb, ldap_libs) | |
3954 fi | |
3955 if test "$with_ldap_lber" = "yes" ; then | |
3956 XE_PREPEND(-llber, ldap_libs) | |
3957 fi | |
3958 XE_PREPEND(-lldap, ldap_libs) | |
3959 save_LIBS="$LIBS" LIBS="$LIBS $ldap_libs" | |
3960 AC_CHECK_FUNCS(ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result) | |
3961 LIBS="$save_LIBS" | |
3962 XE_APPEND(modules/ldap, MAKE_SUBDIR) | |
3963 need_modules_common=yes | |
3964 if test "$enable_modules" = "yes"; then | |
3965 XE_APPEND(modules/ldap, INSTALL_ARCH_DEP_SUBDIR) | |
3966 fi | |
3967 fi | |
3968 AC_SUBST(ldap_libs) | |
3969 | |
3970 dnl Autodetect PostgreSQL | |
3971 dnl On many Linux systems, PostgreSQL is packaged to be installed in /usr; | |
3972 dnl in this case, configure will easily detect it there. | |
3973 dnl | |
3974 dnl If PostgreSQL is installed into a different prefix, | |
3975 dnl (such as the default /usr/local/pgsql when building from source), | |
3976 dnl that prefix must be specified using the --with-site-prefixes flag. | |
3977 postgresql_libs= | |
3978 if test "$with_postgresql" != "no"; then | |
3312 | 3979 AC_MSG_CHECKING([for PostgreSQL]) |
3980 AC_MSG_RESULT() | |
2651 | 3981 |
3982 dnl Look for these standard header file locations, known to be used on Linux | |
3983 for header_dir in "" "pgsql/" "postgresql/"; do | |
3984 AC_CHECK_HEADER(${header_dir}libpq-fe.h, | |
3985 libpq_fe_h_file=${header_dir}libpq-fe.h; break) | |
3986 done | |
3987 | |
3050 | 3988 pq_libs= |
3989 extra_libs= | |
3990 if test -n "$libpq_fe_h_file"; then | |
3991 dnl #### Would it be nicer to do this with a loop? | |
3992 dnl It seems unlikely that checking for SSL/crypto support can hurt, | |
3993 dnl even if it's found. | |
3994 AC_CHECK_LIB(pq, PQconnectdb,[pq_libs="-lpq"],[ | |
3995 unset ac_cv_lib_pq_PQconnectdb; | |
3996 AC_CHECK_LIB(pq, PQconnectdb,[pq_libs="-lpq -lcrypto -lssl"],, | |
3997 [-lcrypto -lssl])]) | |
3998 if test -z "$pq_libs"; then | |
3999 have_libpq="no" | |
4000 else | |
4001 have_libpq="yes" | |
4002 fi | |
4003 fi | |
2651 | 4004 |
4005 if test -n "$libpq_fe_h_file" -a "$have_libpq" = "yes"; then | |
4006 with_postgresql=yes | |
4007 AC_DEFINE(HAVE_POSTGRESQL) | |
4008 AC_CHECK_LIB(pq,PQconnectStart, [ | |
4009 with_postgresqlv7=yes; | |
3050 | 4010 AC_DEFINE(HAVE_POSTGRESQLV7)], [:], $extra_libs) |
2651 | 4011 AC_DEFINE_UNQUOTED(LIBPQ_FE_H_FILE, "$libpq_fe_h_file") |
3050 | 4012 XE_PREPEND([$pq_libs], postgresql_libs) |
2651 | 4013 XE_APPEND(modules/postgresql, MAKE_SUBDIR) |
4014 need_modules_common=yes | |
4015 if test "$enable_modules" = "yes"; then | |
4016 XE_APPEND(modules/postgresql, INSTALL_ARCH_DEP_SUBDIR) | |
4017 fi | |
4018 elif test "$with_postgresql" = "yes"; then | |
4019 XE_DIE("Required PostgreSQL support cannot be provided. Check --with-site-prefixes.") | |
4020 fi | |
4021 fi | |
4022 AC_SUBST(postgresql_libs) | |
4023 | |
4024 dnl ---------------------- | |
4025 dnl Graphics libraries | |
4026 dnl ---------------------- | |
4027 | |
4028 if test "$window_system" != "none"; then | |
3312 | 4029 AC_MSG_CHECKING([for graphics libraries]) |
4030 AC_MSG_RESULT() | |
2651 | 4031 |
4032 dnl add special code to handle xpm-nox on Cygwin (csw) | |
4033 dnl -- should only happen if CYGWIN && WITH_XPM && WITH_MSW && !WITH_X | |
4034 libpath_xpm= | |
4035 incpath_xpm= | |
3727 | 4036 libname_xpm="-lXpm" |
2651 | 4037 case "$opsys" in |
4038 cygwin*) | |
3228 | 4039 cygwin_top=`eval gcc -print-search-dirs | sed -ne s'/install: //p'` |
4040 cygwin_top=`eval "cd $cygwin_top/../../../..; pwd"` | |
2651 | 4041 case "$window_system" in |
4042 dnl use "standard" search pattern | |
4043 x11) ;; | |
4044 dnl hardcode "standard" non-X11 xpm lib/inc dirs | |
4045 msw) libpath_xpm="-L${cygwin_top}/lib/noX" | |
4046 incpath_xpm="-I${cygwin_top}/include/noX" | |
3727 | 4047 libname_xpm="-lXpm-noX" |
2651 | 4048 ;; |
4049 dnl not supported on cygwin (yet?) | |
4050 gtk) ;; | |
4051 dnl probably not reached... | |
4052 none) ;; | |
4053 dnl ditto | |
4054 *) ;; | |
4055 esac | |
4056 ;; | |
4057 dnl use "standard" search pattern for all other OS's | |
4058 *) ;; | |
4059 esac | |
4060 dnl Autodetect Xpm | |
4061 xpm_problem="" | |
4062 if test -z "$with_xpm"; then | |
4063 XE_PREPEND("$incpath_xpm", CFLAGS) | |
2940 | 4064 XE_PREPEND("$incpath_xpm", XE_CFLAGS) |
2651 | 4065 XE_PREPEND("$libpath_xpm", LDFLAGS) |
4066 AC_MSG_CHECKING(for Xpm - no older than 3.4f) | |
3727 | 4067 xe_check_libs="$libname_xpm" |
2651 | 4068 AC_RUN_IFELSE([AC_LANG_SOURCE([#define XPM_NUMBERS |
4069 #include <X11/xpm.h> | |
4070 int main(int c, char **v) { | |
4071 return c == 1 ? 0 : | |
4072 XpmIncludeVersion != XpmLibraryVersion() ? 1 : | |
4073 XpmIncludeVersion < 30406 ? 2 : 0 ;}])], | |
4074 [./conftest dummy_arg; xpm_status=$?; | |
4075 if test "$xpm_status" = "0"; then | |
4076 with_xpm=yes; | |
4077 else | |
4078 with_xpm=no; | |
4079 if test "$xpm_status" = "1"; then | |
4080 xpm_problem="Xpm library version and header file version don't match!" | |
4081 elif test "$xpm_status" = "2"; then | |
4082 xpm_problem="Xpm library version is too old!" | |
4083 else | |
4084 xpm_problem="Internal xpm detection logic error!" | |
4085 fi | |
4086 echo " | |
4087 *** WARNING *** $xpm_problem | |
4088 I'm not touching that with a 10-foot pole! | |
4089 If you really want to use the installed version of Xpm, rerun | |
4090 configure and add '--with-xpm=yes', but don't blame me if XEmacs crashes!" | |
4091 fi], | |
4092 [with_xpm=no]) | |
4093 xe_check_libs= | |
4094 AC_MSG_RESULT($with_xpm) | |
4095 fi | |
4096 if test "$with_xpm" = "yes"; then | |
4097 dnl #### This code assumes that if AC_CHECK_LIB fails, | |
4098 dnl #### then it will succeed if FOR_MSW is defined, | |
4099 dnl #### but doesn't actually verify this assumption. | |
4100 AC_DEFINE(HAVE_XPM) | |
4101 XE_PREPEND("$libpath_xpm", LDFLAGS) | |
3727 | 4102 XE_PREPEND("$libname_xpm", libs_x) |
2651 | 4103 XE_PREPEND("$incpath_xpm", CFLAGS) |
2940 | 4104 XE_PREPEND("$incpath_xpm", XE_CFLAGS) |
3312 | 4105 AC_MSG_CHECKING([for "FOR_MSW" xpm]) |
3727 | 4106 xe_check_libs="$libname_xpm" |
3316 | 4107 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[XpmCreatePixmapFromData();])], |
2651 | 4108 [xpm_for_msw=no], |
4109 [xpm_for_msw=yes]) | |
4110 xe_check_libs= | |
4111 AC_MSG_RESULT($xpm_for_msw) | |
4112 if test "$xpm_for_msw" = "yes"; then | |
4113 AC_DEFINE(FOR_MSW) | |
4114 fi | |
4115 fi | |
4116 | |
4117 dnl Autodetect XFACE | |
4118 test -z "$with_xface" && { AC_CHECK_HEADER(compface.h, ,with_xface=no) } | |
4119 test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) } | |
4120 test -z "$with_xface" && with_xface=yes | |
4121 if test "$with_xface" = "yes"; then | |
4122 AC_DEFINE(HAVE_XFACE) | |
4123 XE_PREPEND(-lcompface, libs_x) | |
4124 fi | |
4125 | |
4126 dnl For a brief period we had the GIF code split out into a separate library, | |
4127 dnl but patent problems, etc. sort of squashed that idea. | |
4128 dnl We default to building with builtin GIF decoding | |
4129 if test "$with_gif" != "no"; then | |
4130 with_gif="yes" | |
4131 AC_DEFINE(HAVE_GIF) | |
4132 fi | |
4133 | |
4134 dnl Too many stupid linkers can't detect cascaded lib dependencies until runtime | |
4135 dnl So we always search for libz compression support. | |
4136 if test "$with_png $with_tiff" != "no no"; then | |
4137 AC_CHECK_LIB(c, inflate, [:], [ | |
4138 AC_CHECK_LIB(z, inflate, [XE_PREPEND(-lz, libs_x)],[ | |
4139 AC_CHECK_LIB(gz, inflate, [XE_PREPEND(-lgz, libs_x)])])]) | |
4140 fi | |
4141 | |
4142 dnl autodetect JPEG | |
4143 test -z "$with_jpeg" && { AC_CHECK_HEADER(jpeglib.h, ,with_jpeg=no) } | |
4144 test -z "$with_jpeg" && { AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,[:],with_jpeg=no) } | |
4145 test -z "$with_jpeg" && with_jpeg=yes | |
4146 if test "$with_jpeg" = "yes"; then | |
4147 AC_DEFINE(HAVE_JPEG) | |
4148 XE_PREPEND(-ljpeg, libs_x) | |
4149 fi | |
4150 | |
4151 dnl autodetect PNG | |
4152 png_problem="" | |
4153 test -z "$with_png" && { AC_CHECK_FUNC(pow, ,with_png=no) } | |
4154 test -z "$with_png" && { AC_CHECK_HEADER(png.h, ,with_png=no) } | |
2667 | 4155 test -z "$with_png" && { AC_CHECK_LIB(png, png_read_image,[:],with_png=no,[-lz]) } |
2651 | 4156 if test -z "$with_png"; then |
4157 AC_MSG_CHECKING(for workable png version information) | |
4158 xe_check_libs="-lpng -lz" | |
4159 AC_RUN_IFELSE([AC_LANG_SOURCE([#include <png.h> | |
4160 int main(int c, char **v) { | |
4161 if (c == 1) return 0; | |
4162 if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1; | |
4163 return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}])], | |
4164 [./conftest dummy_arg; png_status=$?; | |
4165 if test "$png_status" = "0"; then | |
4166 with_png=yes; | |
4167 else | |
4168 with_png=no; | |
4169 if test "$png_status" = "1"; then | |
4170 png_problem="PNG library version and header file don't match!" | |
4171 elif test "$png_status" = "2"; then | |
4172 png_problem="PNG library version too old (pre 1.0.2)!" | |
4173 fi | |
4174 echo " | |
4175 *** WARNING *** $png_problem | |
4176 I'm not touching that with a 10-foot pole! | |
4177 If you really want to use the installed version of libPNG, rerun | |
4178 configure and add '--with-png=yes', but don't blame me if XEmacs crashes!" | |
4179 fi], | |
4180 [with_png=no]) | |
4181 xe_check_libs= | |
4182 AC_MSG_RESULT($with_png) | |
4183 fi | |
4184 if test "$with_png" = "yes"; then | |
4185 AC_DEFINE(HAVE_PNG) | |
4186 XE_PREPEND(-lpng, libs_x) | |
4187 fi | |
4188 | |
4189 dnl autodetect TIFF | |
4190 test -z "$with_tiff" && { AC_CHECK_HEADER(tiffio.h, ,with_tiff=no) } | |
2667 | 4191 test -z "$with_tiff" && { AC_CHECK_LIB(tiff, TIFFClientOpen,[:],with_tiff=no,[-lz]) } |
2651 | 4192 test -z "$with_tiff" && with_tiff=yes |
4193 if test "$with_tiff" = "yes"; then | |
4194 AC_DEFINE(HAVE_TIFF) | |
4195 XE_PREPEND(-ltiff, libs_x) | |
4196 fi | |
4197 fi | |
4198 | |
4199 dnl ---------------------- | |
4200 dnl GTK-Specific Graphics libraries | |
4201 dnl ---------------------- | |
4202 | |
4203 if test "$with_gtk" = "yes"; then | |
4204 dnl Autodetect XFACE | |
4205 test -z "$with_xface" && { AC_CHECK_HEADER(compface.h, ,with_xface=no) } | |
4206 test -z "$with_xface" && { AC_CHECK_LIB(compface, UnGenFace,[:] ,with_xface=no) } | |
4207 test -z "$with_xface" && with_xface=yes | |
4208 if test "$with_xface" = "yes"; then | |
4209 AC_DEFINE(HAVE_XFACE) | |
4210 XE_PREPEND(-lcompface, libs_gtk) | |
4211 fi | |
4212 fi | |
4213 | |
4214 dnl ---------------------- | |
4215 dnl X-Specific Graphics libraries | |
4216 dnl ---------------------- | |
4217 | |
4218 if test "$with_x11" = "yes"; then | |
3312 | 4219 AC_MSG_CHECKING([for X11 graphics libraries]) |
4220 AC_MSG_RESULT() | |
2651 | 4221 fi |
4222 | |
4223 case "$enable_widgets" in | |
3019 | 4224 "" | "yes" | "athena") detect_athena=yes ;; |
2651 | 4225 *) detect_athena=no ;; |
4226 esac | |
4227 | |
3019 | 4228 case "$enable_dialogs" in |
4229 "" | "yes" | "athena") detect_athena=yes ;; | |
4230 esac | |
4231 | |
2651 | 4232 if test "$with_x11" = "yes" -a "$detect_athena" = "yes" ; then |
3312 | 4233 AC_MSG_CHECKING([for the Athena widgets]) |
4234 AC_MSG_RESULT() | |
2651 | 4235 |
4236 dnl What in heck did the user actually want? | |
4237 case "$with_athena" in | |
4238 dnl This is the default, old fashioned flat Athena. | |
4239 "xaw" | "") athena_variant=Xaw athena_3d=no ;; | |
4240 "3d") athena_variant=Xaw3d athena_3d=yes ;; | |
4241 "next") athena_variant=neXtaw athena_3d=yes ;; | |
4242 "95") athena_variant=Xaw95 athena_3d=yes ;; | |
4243 "xpm") athena_variant=XawXpm athena_3d=yes ;; | |
4244 *) XE_DIE("Unknown Athena widget set \`$with_athena'. This should not happen.") ;; | |
4245 esac | |
4246 | |
4247 dnl Search for the Athena library... | |
4248 if test "$athena_3d" = "no"; then | |
4249 AC_CHECK_LIB($athena_variant, XawScrollbarSetThumb, | |
4250 [ | |
4251 dnl Must not be a 3d library... | |
4440
e4225b6d9389
AC_CHECK_LIB needs a function symbol. <87zls98qtk.fsf@uwakimon.sk.tsukuba.ac.jp>
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4424
diff
changeset
|
4252 AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB, |
2651 | 4253 [AC_MSG_WARN([Could not find a non-3d Athena widget library.])], |
4254 athena_lib=$athena_variant) | |
4255 ], | |
4256 AC_MSG_WARN([Could not find an Athena widget library.])) | |
4257 else | |
4258 dnl The real configuration, need 3d library | |
4440
e4225b6d9389
AC_CHECK_LIB needs a function symbol. <87zls98qtk.fsf@uwakimon.sk.tsukuba.ac.jp>
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4424
diff
changeset
|
4259 AC_CHECK_LIB($athena_variant, XawSme3dComputeTopShadowRGB, athena_lib=$athena_variant, |
2651 | 4260 dnl OK, couldn't find it with a proper name, try the standard Athena lib |
4261 dnl If that is 3d, presume the user asked for what they have installed. | |
4440
e4225b6d9389
AC_CHECK_LIB needs a function symbol. <87zls98qtk.fsf@uwakimon.sk.tsukuba.ac.jp>
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4424
diff
changeset
|
4262 AC_CHECK_LIB(Xaw, XawSme3dComputeTopShadowRGB, |
2651 | 4263 [ |
4264 athena_lib=Xaw; | |
4265 AC_MSG_WARN([Assuming that libXaw is actually $athena_variant.]); | |
4266 ], | |
4267 [AC_MSG_WARN([Could not find a 3d Athena widget library that looked like $athena_variant.])])) | |
4268 fi | |
4269 | |
4270 dnl Now we locate the Athena headers that we need. | |
4271 if test "$athena_3d" = "no"; then | |
4272 AC_CHECK_HEADER(X11/Xaw/ThreeD.h, | |
4273 [AC_MSG_WARN([Could not find a non-3d Athena header set.])], | |
4274 [AC_CHECK_HEADER(X11/Xaw/XawInit.h, | |
4275 [athena_h_path=X11/Xaw], | |
2694 | 4276 [AC_MSG_WARN([Could not find a non-3d Athena header set.])], |
4277 [ | |
4278 #include <X11/Intrinsic.h> | |
4279 ])]) | |
2651 | 4280 else |
4281 dnl The three-d Athena headers are so much more slippery. | |
4282 dnl Curse this `Lets replace standard libraries' thing that they did. :/ | |
4283 AC_CHECK_HEADER(X11/$athena_variant/XawInit.h, | |
4284 [AC_CHECK_HEADER(X11/$athena_variant/ThreeD.h, | |
4285 [athena_h_path=X11/$athena_variant])],[], | |
4286 [ | |
4287 #if HAVE_X11_XFUNCPROTO_H | |
4288 #include <X11/Xfuncproto.h> | |
4289 #endif | |
2705 | 4290 #include <X11/Intrinsic.h> |
2651 | 4291 ]) |
4292 | |
4293 dnl Is the variant specific header directory directly under include? | |
4294 if test -z "$athena_h_path"; then | |
4295 AC_CHECK_HEADER($athena_variant/XawInit.h, | |
4296 [AC_CHECK_HEADER($athena_variant/ThreeD.h, | |
4297 athena_h_path=$athena_variant)],[], | |
4298 [ | |
4299 #if HAVE_X11_XFUNCPROTO_H | |
4300 #include <X11/Xfuncproto.h> | |
4301 #endif | |
2694 | 4302 #include <X11/Intrinsic.h> |
2651 | 4303 ]) |
4304 fi | |
4305 | |
4306 dnl If we couldn't find the specific variant, try the generic Athena 3d headers | |
4307 if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then | |
4308 AC_CHECK_HEADER(X11/Xaw3d/XawInit.h, | |
4309 [AC_CHECK_HEADER(X11/Xaw3d/ThreeD.h, | |
4310 [ | |
4311 AC_MSG_WARN([Assuming that X11/Xaw3d headers are suitable for $athena_variant.]) | |
4312 athena_h_path=X11/Xaw3d | |
4313 ])],[], | |
4314 [ | |
4315 #if HAVE_X11_XFUNCPROTO_H | |
4316 #include <X11/Xfuncproto.h> | |
4317 #endif | |
2694 | 4318 #include <X11/Intrinsic.h> |
2651 | 4319 ]) |
4320 fi | |
4321 | |
4322 dnl Also generic 3d headers directly under include dir | |
4323 if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then | |
4324 AC_CHECK_HEADER(Xaw3d/XawInit.h, | |
4325 [AC_CHECK_HEADER(Xaw3d/ThreeD.h, | |
4326 [ | |
4327 AC_MSG_WARN([Assuming that Xaw3d headers are suitable for $athena_variant.]) | |
4328 athena_h_path=Xaw3d | |
4329 ])],[], | |
4330 [ | |
4331 #if HAVE_X11_XFUNCPROTO_H | |
4332 #include <X11/Xfuncproto.h> | |
4333 #endif | |
2694 | 4334 #include <X11/Intrinsic.h> |
2651 | 4335 ]) |
4336 fi | |
4337 | |
4338 dnl If nothing yet found, see if Xaw is a 3d header set... | |
4339 dnl We AC_MSG_WARN if we fail because I am all out of ideas... | |
4340 if test -z "$athena_h_path"; then | |
4341 AC_CHECK_HEADER(X11/Xaw/ThreeD.h, | |
4342 [ | |
4343 AC_MSG_WARN([Assuming that X11/Xaw headers are suitable for $athena_variant.]) | |
4344 athena_h_path=X11/Xaw | |
4345 ], | |
4346 [AC_MSG_WARN([Could not find a suitable 3d Athena header set.])]) | |
4347 fi | |
4348 fi | |
4349 | |
4350 dnl Do we actually have a usable Athena widget set? Please? | |
4351 if test -n "$athena_lib" -a -n "$athena_h_path"; then | |
4352 have_xaw=yes | |
4353 else | |
4354 have_xaw=no | |
4355 fi | |
4356 | |
4357 else | |
4358 have_xaw=no | |
4359 fi dnl "$with_x11" = "yes" -a "detect_athena" = "yes" | |
4360 | |
4361 if test "$with_x11" = "yes"; then | |
4362 dnl autodetect Motif - but only add to libs_x later (if necessary) | |
4363 dnl Use a different function to the earlier test to avoid problems with the | |
4364 dnl internal cache. | |
4365 AC_CHECK_HEADER(Xm/Xm.h, | |
4366 [AC_CHECK_LIB(Xm, XmStringCreate, have_motif=yes, have_motif=no)], | |
4367 have_motif=no) | |
4368 | |
4369 if test "$have_motif" = "yes"; then | |
4370 dnl autodetect lesstif | |
4371 AC_MSG_CHECKING(for Lesstif) | |
4372 AC_EGREP_CPP(yes, | |
4373 [#include <Xm/Xm.h> | |
4374 #ifdef LESSTIF_VERSION | |
4375 yes | |
4376 #endif | |
4377 ], have_lesstif=yes, have_lesstif=no) | |
4378 AC_MSG_RESULT($have_lesstif) | |
4379 fi | |
4380 | |
4381 fi dnl "$with_x11" = "yes" | |
4382 | |
4383 dnl Finish ensuring that we have values for the various toolkit items. | |
4384 dnl Not all toolkits support all widgets | |
3019 | 4385 |
4386 dnl Avoid using Motif :-( | |
4387 case "$opsys" in | |
3738 | 4388 *linux* | *darwin* | *bsd* | *cygwin* ) lucid_prefers_motif="no" ;; |
3019 | 4389 * ) lucid_prefers_motif="yes" ;; |
4390 esac | |
2651 | 4391 |
4392 case "$enable_menubars" in "" | "yes" | "athena" ) | |
4393 enable_menubars="lucid" ;; | |
4394 esac | |
3094 | 4395 dnl this is not in xft reloaded #3 |
4396 if test "$with_xft_menubars" != "no" ; then | |
4397 if test "$with_xft_emacs" = "yes" -a "$with_menubars" != "no" ; then | |
4398 with_xft_menubars="yes" | |
4399 else | |
4400 with_xft_menubars="no" | |
4401 fi | |
4402 fi | |
2651 | 4403 case "$enable_dialogs" in "" | "yes" | "lucid" ) |
3019 | 4404 if test "$lucid_prefers_motif" = "yes"; then |
4405 if test "$have_motif" = "yes"; then enable_dialogs="motif" | |
4406 elif test "$have_xaw" = "yes"; then enable_dialogs="athena" | |
4407 elif test "$with_msw" = "yes"; then enable_dialogs="msw" | |
4408 else enable_dialogs=no | |
4409 fi | |
4410 else | |
4411 if test "$have_xaw" = "yes"; then enable_dialogs="athena" | |
4412 elif test "$have_motif" = "yes"; then enable_dialogs="motif" | |
4413 elif test "$with_msw" = "yes"; then enable_dialogs="msw" | |
4414 else enable_dialogs=no | |
4415 fi | |
2651 | 4416 fi ;; |
4417 esac | |
4418 case "$enable_scrollbars" in "" | "yes" ) | |
4419 enable_scrollbars="lucid" ;; | |
4420 esac | |
4421 case "$enable_widgets" in "" | "yes" | "lucid") | |
3019 | 4422 if test "$lucid_prefers_motif" = "yes"; then |
4423 if test "$have_motif" = "yes"; then enable_widgets="motif" | |
4424 elif test "$have_xaw" = "yes"; then enable_widgets="athena" | |
4425 elif test "$with_msw" = "yes"; then enable_widgets="msw" | |
4426 else enable_widgets=no | |
4427 fi | |
4428 else | |
4429 if test "$have_xaw" = "yes"; then enable_widgets="athena" | |
4430 elif test "$have_motif" = "yes"; then enable_widgets="motif" | |
4431 elif test "$with_msw" = "yes"; then enable_widgets="msw" | |
4432 else enable_widgets=no | |
4433 fi | |
2651 | 4434 fi ;; |
4435 esac | |
3094 | 4436 dnl this is not in xft reloaded #3 |
4437 if test "$with_xft_tabs" != "no" ; then | |
4438 if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then | |
4439 with_xft_tabs="yes" | |
4440 else | |
4441 with_xft_tabs="no" | |
4442 fi | |
4443 fi | |
4444 dnl this is not in xft reloaded #3 | |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
4445 if test "$with_xft_gauges" != "no" ; then |
3094 | 4446 if test "$with_xft_emacs" = "yes" -a "$enable_widgets" != "no" ; then |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
4447 with_xft_gauges="yes" |
3094 | 4448 else |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
4449 with_xft_gauges="no" |
3094 | 4450 fi |
4451 fi | |
2651 | 4452 |
4453 all_widgets="$enable_menubars $enable_scrollbars $enable_dialogs $enable_toolbars $enable_widgets" | |
4454 | |
4455 case "$all_widgets" in | |
4456 *athena* ) | |
4457 if test "$have_xaw" != "yes"; then | |
4458 XE_DIE("Could not find a suitable Athena library to build with.") | |
4459 fi | |
4460 | |
4461 dnl Add the Lucid widget Athena code | |
4462 XE_APPEND(lwlib-Xaw.o, lwlib_objs) | |
4463 | |
4464 dnl Add the Athena widget library we located earlier | |
4465 XE_PREPEND(-l$athena_lib, libs_x) | |
4466 | |
4467 dnl Tell lwlib where to find the Athena header files. | |
4468 dnl Many people have tried to create a `smart' way of doing this, | |
4469 dnl but all have failed. Before changing the following ugly definitions, | |
4470 dnl consult the veterans of many a battle. | |
4471 AC_DEFINE_UNQUOTED(ATHENA_Scrollbar_h_,"$athena_h_path/Scrollbar.h") | |
4472 AC_DEFINE_UNQUOTED(ATHENA_Dialog_h_,"$athena_h_path/Dialog.h") | |
4473 AC_DEFINE_UNQUOTED(ATHENA_Form_h_,"$athena_h_path/Form.h") | |
4474 AC_DEFINE_UNQUOTED(ATHENA_Command_h_,"$athena_h_path/Command.h") | |
4475 AC_DEFINE_UNQUOTED(ATHENA_Label_h_,"$athena_h_path/Label.h") | |
4476 AC_DEFINE_UNQUOTED(ATHENA_LabelP_h_,"$athena_h_path/LabelP.h") | |
4477 AC_DEFINE_UNQUOTED(ATHENA_Toggle_h_,"$athena_h_path/Toggle.h") | |
4478 AC_DEFINE_UNQUOTED(ATHENA_ToggleP_h_,"$athena_h_path/ToggleP.h") | |
4479 AC_DEFINE_UNQUOTED(ATHENA_AsciiText_h_,"$athena_h_path/AsciiText.h") | |
4480 AC_DEFINE_UNQUOTED(ATHENA_XawInit_h_,"$athena_h_path/XawInit.h") | |
4481 | |
4482 AC_DEFINE(LWLIB_USES_ATHENA) | |
4483 AC_DEFINE(NEED_ATHENA) | |
4484 need_athena="yes" | |
4485 | |
4486 if test "$athena_3d" = "yes"; then | |
4487 AC_DEFINE(HAVE_ATHENA_3D) | |
4488 fi | |
4489 ;; | |
4490 esac | |
4491 | |
4492 case "$all_widgets" in *motif* ) | |
4493 AC_DEFINE(LWLIB_USES_MOTIF) | |
4494 AC_DEFINE(NEED_MOTIF) | |
4495 XE_APPEND(lwlib-Xm.o, lwlib_objs) | |
4496 need_motif=yes ;; | |
4497 esac | |
4498 | |
4499 test "$enable_menubars" = "lucid" && XE_APPEND(xlwmenu.o, lwlib_objs) | |
4500 test "$enable_menubars" = "motif" && XE_APPEND(xlwmenu.o, lwlib_objs) | |
4501 test "$enable_scrollbars" = "lucid" && XE_APPEND(xlwscrollbar.o, lwlib_objs) | |
4502 test "$enable_widgets" != "no" && test "$enable_widgets" != "msw" && \ | |
4503 XE_APPEND(xlwtabs.o xlwgcs.o, lwlib_objs) | |
4504 case "$enable_widgets" in athena* ) | |
4505 XE_APPEND(xlwradio.o xlwcheckbox.o xlwgauge.o, lwlib_objs);; | |
4506 esac | |
4507 case "$all_widgets" in *lucid* ) | |
4508 AC_DEFINE(NEED_LUCID) | |
4509 XE_APPEND(lwlib-Xlw.o, lwlib_objs) ;; | |
4510 esac | |
4511 | |
4512 AC_SUBST(lwlib_objs) | |
4513 | |
4514 test "$enable_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA) | |
4515 test "$enable_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA) | |
4516 | |
4517 if test "$athena_3d" = "yes"; then | |
4518 test "$enable_scrollbars" = "athena" && AC_DEFINE(LWLIB_SCROLLBARS_ATHENA3D) | |
4519 test "$enable_dialogs" = "athena" && AC_DEFINE(LWLIB_DIALOGS_ATHENA3D) | |
4520 fi | |
4521 | |
4522 case "$enable_widgets" in athena* ) AC_DEFINE(LWLIB_WIDGETS_ATHENA);; esac | |
4523 test "$enable_widgets" != "no" && test "$enable_widgets" != "msw" && \ | |
4524 AC_DEFINE(LWLIB_TABS_LUCID) | |
4525 | |
4526 test "$enable_menubars" != "no" && AC_DEFINE(HAVE_MENUBARS) | |
4527 test "$enable_scrollbars" != "no" && AC_DEFINE(HAVE_SCROLLBARS) | |
4528 test "$enable_dialogs" != "no" && AC_DEFINE(HAVE_DIALOGS) | |
4529 test "$enable_toolbars" != "no" && AC_DEFINE(HAVE_TOOLBARS) | |
4530 test "$enable_widgets" != "no" && AC_DEFINE(HAVE_WIDGETS) | |
4531 | |
4532 test "$enable_menubars" = "lucid" && AC_DEFINE(LWLIB_MENUBARS_LUCID) | |
4533 test "$enable_scrollbars" = "lucid" && AC_DEFINE(LWLIB_SCROLLBARS_LUCID) | |
4534 | |
4535 test "$enable_menubars" = "motif" && AC_DEFINE(LWLIB_MENUBARS_MOTIF) | |
4536 test "$enable_scrollbars" = "motif" && AC_DEFINE(LWLIB_SCROLLBARS_MOTIF) | |
4537 test "$enable_dialogs" = "motif" && AC_DEFINE(LWLIB_DIALOGS_MOTIF) | |
4538 test "$enable_widgets" = "motif" && AC_DEFINE(LWLIB_WIDGETS_MOTIF) | |
4539 | |
3094 | 4540 test "$with_xft_menubars" = "yes" && AC_DEFINE(USE_XFT_MENUBARS) |
4541 test "$with_xft_tabs" = "yes" && AC_DEFINE(USE_XFT_TABS) | |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
4542 test "$with_xft_gauges" = "yes" && AC_DEFINE(USE_XFT_GAUGES) |
3094 | 4543 |
2651 | 4544 dnl ---------------------- |
4545 dnl Mule-dependent options | |
4546 dnl ---------------------- | |
4547 | |
4548 test -z "$enable_mule" && enable_mule=no | |
4549 | |
4550 dnl if test "$enable_mule" = "yes" && test ! -d "$srcdir/lisp/mule"; then | |
4551 dnl echo "Attempt to Build with Mule without Mule/Lisp" | |
4552 dnl echo "Please install the XEmacs/Mule tarball or" | |
4553 dnl echo "rerun configure with --with-mule=no" | |
4554 dnl exit 1 | |
4555 dnl fi | |
4556 | |
4557 if test "$enable_default_eol_detection" = "yes"; then | |
4558 AC_DEFINE(HAVE_DEFAULT_EOL_DETECTION) | |
4559 fi | |
4560 | |
2973 | 4561 dnl initialize _libs variables for possible modules at top level |
4562 canna_libs= | |
4563 wnn_libs= | |
4564 | |
2651 | 4565 if test "$enable_mule" = "yes" ; then |
3312 | 4566 AC_MSG_CHECKING([for Mule-related features]) |
2651 | 4567 AC_DEFINE(MULE) |
4568 | |
4569 dnl Use -lintl to get internationalized strerror for Mule | |
4570 AC_CHECK_HEADERS(libintl.h) | |
4571 AC_CHECK_LIB(intl, strerror) | |
4572 | |
3312 | 4573 AC_MSG_CHECKING([for Mule input methods]) |
2651 | 4574 dnl Do we have the XmIm* routines? And if so, do we want to use them? |
4575 case "$with_xim" in "" | "yes" ) | |
3312 | 4576 AC_MSG_CHECKING([for XIM]) |
2651 | 4577 AC_CHECK_LIB(X11, XOpenIM, with_xim=xlib, with_xim=no) |
4578 dnl XIM + Lesstif is not (yet?) usable | |
3019 | 4579 dnl Only use Motif if linking Motif anyway, or don't have xlib XIM |
4580 if test "$need_motif $have_lesstif" = "yes no"; then | |
4581 AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif) | |
3248 | 4582 dnl #### This is always false. |
4583 dnl Not clear what we want, although "yes no yes" is insufficient. | |
3019 | 4584 elif test "$have_motif $have_lesstif $with_xim" = "yes no no"; then |
2651 | 4585 AC_CHECK_LIB(Xm, XmImMbLookupString, with_xim=motif) |
4586 fi ;; | |
4587 esac | |
4588 if test "$with_xim" != "no"; then | |
4589 AC_DEFINE(HAVE_XIM) | |
4590 if test "$with_xim" = "xlib"; then | |
4591 AC_DEFINE(XIM_XLIB) | |
4592 XE_ADD_OBJS(input-method-xlib.o) | |
4593 fi | |
4594 if test "$with_xim" = "motif"; then | |
4595 AC_DEFINE(XIM_MOTIF) | |
4596 need_motif=yes | |
4597 XE_ADD_OBJS(input-method-motif.o) | |
4598 fi | |
4599 if test "$with_xim" = "motif"; then | |
4600 with_xfs=no | |
4601 fi | |
4602 fi | |
4603 | |
4604 dnl "with_xfs" = "yes" | |
4605 if test "$with_xfs" = "yes" ; then | |
3312 | 4606 AC_MSG_CHECKING([for XFontSet]) |
2651 | 4607 AC_CHECK_LIB(X11, XmbDrawString, [:], with_xfs=no) |
4608 if test "$with_xfs" = "yes" && test "$enable_menubars" = "lucid"; then | |
4609 AC_DEFINE(USE_XFONTSET) | |
4610 if test "$with_xim" = "no" ; then | |
4611 XE_ADD_OBJS(input-method-xlib.o) | |
4612 fi | |
4613 fi | |
4614 fi dnl with_xfs | |
4615 | |
4616 dnl Autodetect WNN | |
4617 test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support | |
4618 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/jllib.h, ,with_wnn=no) } | |
4619 dnl gcc 2.97 fixincludes breaks inclusion of wnn/commonhd.h | |
4620 test -z "$with_wnn" && { AC_CHECK_HEADER(wnn/commonhd.h, ,with_wnn=no) } | |
4621 dnl Detour to find crypt | |
4622 if test "$with_wnn" != "no"; then | |
4623 AC_CHECK_FUNCS(crypt) | |
4624 test "$ac_cv_func_crypt" != "yes" && { AC_CHECK_LIB(crypt, crypt) } | |
4625 fi | |
4626 dnl Back to our regularly scheduled wnn hunting | |
4627 if test -z "$with_wnn" -o "$with_wnn" = "yes"; then | |
4628 AC_CHECK_LIB(wnn,jl_dic_list_e,libwnn=wnn, | |
4629 AC_CHECK_LIB(wnn4,jl_dic_list_e,libwnn=wnn4, | |
4630 AC_CHECK_LIB(wnn6,jl_dic_list_e,libwnn=wnn6, | |
4631 AC_CHECK_LIB(wnn6_fromsrc,dic_list_e,libwnn=wnn6_fromsrc,with_wnn=no)))) | |
4632 fi | |
4633 test -z "$with_wnn" && with_wnn=yes | |
4634 if test "$with_wnn" = "yes"; then | |
4635 AC_DEFINE(HAVE_WNN) | |
4636 XE_PREPEND(-l$libwnn, libs_x) | |
4637 if test "$with_wnn6" != "no"; then | |
4638 AC_CHECK_LIB($libwnn, jl_fi_dic_list, with_wnn6=yes) | |
4639 test "$with_wnn6" = "yes" && AC_DEFINE(WNN6) | |
4640 fi | |
4641 fi | |
4642 | |
3830 | 4643 dnl Configure canna |
2973 | 4644 dnl canna_libs variable is initialized at toplevel |
3830 | 4645 dnl #### the hard-coding of /usr/local/canna/include is bogus and |
4646 dnl my Mac OS X 10.4 system needs /usr/local/canna/lib, too | |
4647 dnl #### this whole mess should be in modules/canna, no? maybe not | |
4648 have_canna=no | |
2651 | 4649 if test "$with_canna" != "no"; then |
4650 save_c_switch_site="$c_switch_site" | |
3830 | 4651 for canna_include_path in "" " -I/usr/local/canna/include"; do |
4652 for canna_wchar_aware in "" " -DCANNA_NEW_WCHAR_AWARE=1"; do | |
4653 c_switch_site="$save_c_switch_site$canna_include_path$canna_wchar_aware" | |
4654 # defeat autoconf's cache mechanism | |
4655 $as_unset ac_cv_header_canna_jrkanji_h | |
4656 $as_unset ac_cv_header_canna_RK_h | |
4657 # using $ac_header_compiler is a hack, but autoconf doesn't let us | |
4658 # get at this information otherwise :-( | |
4659 AC_CHECK_HEADER(canna/jrkanji.h,[AC_CHECK_HEADER(canna/RK.h,have_canna=$ac_header_compiler)]) | |
4660 test "$have_canna" = "yes" && break | |
4661 AC_MSG_WARN([You may ignore any *Present but not compiled* message | |
4662 from autoconf. We detect that condition and recheck, but there | |
4663 is no way to suppress autoconf's message.]) | |
4664 done | |
4665 test "$have_canna" = "yes" && break | |
4666 done | |
4667 if test "$have_canna" = "yes"; then | |
4668 c_switch_site="$save_c_switch_site$canna_include_path" | |
4669 else | |
2651 | 4670 c_switch_site="$save_c_switch_site" |
4671 fi | |
4672 fi | |
4673 | |
3830 | 4674 test "$have_canna" = "yes" && { AC_CHECK_LIB(RKC, RkBgnBun, [:],have_canna=no) } |
4675 test "$have_canna" = "yes" && { AC_CHECK_LIB(canna,jrKanjiControl,[:],have_canna=no) } | |
4676 if test "$have_canna" = "yes"; then | |
2651 | 4677 AC_DEFINE(HAVE_CANNA) |
3830 | 4678 test -n "$canna_wchar_aware" && AC_DEFINE(CANNA_NEW_WCHAR_AWARE) |
2973 | 4679 XE_APPEND(modules/canna, MAKE_SUBDIR) |
4680 need_modules_common=yes | |
4681 if test "$with_modules" = "yes"; then | |
4682 XE_APPEND(modules/canna, INSTALL_ARCH_DEP_SUBDIR) | |
4683 fi | |
4684 XE_PREPEND(-lcanna -lRKC, canna_libs) | |
3830 | 4685 elif test "$with_canna" != "no"; then |
4686 AC_MSG_WARN([Canna configuration failed. If you expected success, | |
4687 maybe you need --with-site-prefixes=/usr/local/canna?]) | |
2651 | 4688 fi |
2973 | 4689 AC_SUBST(canna_libs) |
2651 | 4690 |
4691 else dnl "$enable_mule" = "no" | |
4692 for feature in xim canna wnn; do | |
4693 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then | |
4694 AC_MSG_WARN([--with-${feature} ignored: Not valid without Mule support]) | |
4695 fi | |
4696 eval "with_${feature}=no" | |
4697 done | |
4698 fi dnl with_mule | |
4699 | |
4700 | |
4701 dnl At this point, we know whether we need the motif lib or not. | |
4702 if test "$need_motif" = "yes" ; then | |
4703 XE_PREPEND(-lXm, libs_x) | |
4704 dnl AIX needs the following library for use with Motif | |
4705 AC_CHECK_LIB(i18n, layout_object_getvalue, [XE_PREPEND(-li18n, libs_x)]) | |
4706 XE_COMPUTE_RUNPATH() | |
4707 fi | |
4708 | |
4709 dnl ---------------------------------------------------------------- | |
4710 dnl Check for POSIX functions. | |
4711 dnl ---------------------------------------------------------------- | |
4712 | |
4713 AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp fsync ftime ftruncate getaddrinfo gethostname getnameinfo getpagesize getrlimit gettimeofday getcwd link logb lrand48 matherr mkdir mktime perror poll random readlink rename res_init rint rmdir select setitimer setpgid setsid sigblock sighold sigprocmask snprintf strerror strlwr strupr symlink tzset ulimit umask usleep vlimit vsnprintf waitpid wcscmp wcslen) | |
4714 | |
4715 dnl getaddrinfo() is borked under hpux11 | |
4716 if test "$ac_cv_func_getaddrinfo" != "no" ; then | |
4717 case "$opsys" in | |
4718 hpux11 ) | |
4719 AC_MSG_WARN([Use of getaddrinfo is disabled for HP-UX 11.XX.]) | |
4720 ac_cv_func_getaddrinfo=no | |
4721 ;; | |
4722 esac | |
4723 fi | |
4724 | |
3092 | 4725 dnl check for vdb-related stuff |
4726 if test "$check_vdb_posix" = "yes" ; then | |
4727 dnl no mprotect, no vdb | |
4728 AC_CHECK_FUNC(mprotect,AC_DEFINE(HAVE_MPROTECT) have_vdb_mprotect=yes,) | |
4729 | |
4730 dnl sigaction needs either struct siginfo or siginfo_t | |
4731 AC_CHECK_FUNC(sigaction, AC_DEFINE(HAVE_SIGACTION) have_vdb_sigaction=yes, | |
4732 have_vdb_sigaction=no) | |
4733 AC_CHECK_MEMBER(struct siginfo.si_addr, | |
4734 AC_DEFINE(HAVE_STRUCT_SIGINFO_SI_ADDR) have_si_addr=yes,, | |
4735 [#include <signal.h>]) | |
4736 AC_CHECK_MEMBER(siginfo_t.si_addr, | |
4737 AC_DEFINE(HAVE_SIGINFO_T_SI_ADDR) have_si_addr=yes,, | |
4738 [#include <signal.h>]) | |
4739 if test "$have_si_addr" != "yes" ; then | |
4740 have_vdb_sigaction=no | |
4741 fi | |
4742 | |
4743 dnl signal needs struct sigcontext | |
4744 AC_CHECK_FUNC(signal, AC_DEFINE(HAVE_SIGNAL) have_vdb_signal=yes,) | |
4745 AC_CHECK_MEMBER(struct sigcontext.cr2, | |
4746 AC_DEFINE(HAVE_STRUCT_SIGCONTEXT_CR2) have_cr2=yes,, | |
4747 [#include <signal.h>]) | |
4748 | |
4749 if test "$have_cr2" != "yes" ; then | |
4750 have_vdb_signal=no | |
4751 fi | |
4752 | |
4753 if test "$have_vdb_mprotect" != "yes" ; then | |
4754 have_vdb_sigaction=no | |
4755 have_vdb_signal=no | |
4756 fi | |
4757 | |
4758 if test "$have_vdb_sigaction" != "yes" -a "$have_vdb_signal" != "yes" ; then | |
4759 have_vdb_posix=no | |
4760 have_vdb_fake=yes | |
3102 | 4761 XE_DIE("No working write-barrier implementation found for this system. |
4762 Please report this and provide information about your system.") | |
3092 | 4763 else |
4764 have_vdb_posix=yes | |
4765 have_vdb_fake=no | |
4766 fi | |
4767 fi | |
4768 | |
2651 | 4769 dnl ---------------------------------------------------------------- |
4770 dnl Check for Unixoid pty/process support. | |
4771 dnl ---------------------------------------------------------------- | |
4772 | |
4773 dnl There is no "standard" pty allocation method. Every system is different. | |
4774 dnl getpt() is the preferred pty allocation method on glibc systems. | |
4775 dnl _getpty() is the preferred pty allocation method on SGI systems. | |
4776 dnl grantpt(), unlockpt(), ptsname() are defined by Unix98. | |
4777 AC_CHECK_FUNCS(getpt _getpty grantpt unlockpt ptsname killpg tcgetpgrp) | |
4778 | |
4779 dnl openpty() is the preferred pty allocation method on BSD and Tru64 systems. | |
4780 dnl openpty() might be declared in: | |
4781 dnl - pty.h (Tru64 or Linux) | |
4782 dnl - libutil.h (FreeBSD) | |
4783 dnl - util.h (NetBSD) | |
4784 AC_CHECK_FUNC(openpty, have_openpty=yes, [ | |
4785 AC_CHECK_LIB(util, openpty, have_openpty=yes need_libutil=yes)]) | |
4786 if test "$have_openpty" = "yes"; then | |
4787 AC_DEFINE(HAVE_OPENPTY) | |
4788 AC_CHECK_HEADERS(libutil.h util.h, break) | |
4789 test "$need_libutil" = "yes" && XE_APPEND(-lutil, libs_system) | |
4790 fi | |
4791 | |
4792 dnl Check for system-specific pty header files | |
4793 dnl Often the TIOCSIG* symbols are hiding there. | |
4794 case "$opsys" in | |
4795 dnl HPUX pty.h #defines TRUE and FALSE, so just use ptyio.h there. | |
4796 hpux*) AC_CHECK_HEADERS(sys/ptyio.h) ;; | |
4797 *) AC_CHECK_HEADERS(pty.h) | |
4798 test "$ac_cv_header_pty_h" = "no" && AC_CHECK_HEADERS(sys/pty.h) | |
4799 ;; | |
4800 esac | |
4801 | |
4802 dnl Check for STREAM support functions. | |
4803 dnl Confusingly, "str" means both "string" and "SysV Streams". | |
4804 AC_CHECK_HEADERS(stropts.h) | |
4805 if test "$ac_cv_header_stropts_h" = "yes"; then | |
4806 AC_CHECK_FUNCS(isastream) | |
4807 AC_CHECK_HEADERS(strtio.h) dnl TIOCSIGNAL | |
4808 fi | |
4809 | |
4810 dnl Check whether the system provides getloadavg(). | |
4811 AC_CHECK_FUNCS(getloadavg) | |
4812 | |
4813 if test "$ac_cv_func_getloadavg" = "yes"; then | |
4814 dnl Solaris 8 declares getloadavg() in <sys/loadavg.h>. | |
4815 dnl glibc 2.2 declares getloadavg() in <stdlib.h>... | |
4816 dnl ...if we #define _GNU_SOURCE, which we do. | |
4817 AC_CHECK_HEADERS(sys/loadavg.h) | |
4818 else | |
4819 dnl We define our own getloadavg() using lower level functions. | |
4820 XE_ADD_OBJS(getloadavg.o) | |
4821 | |
4822 dnl Used by getloadavg() - does not require root priveleges | |
4823 AC_CHECK_LIB(kstat, kstat_open) | |
4824 AC_CHECK_HEADERS(kstat.h) | |
4825 | |
4826 dnl Another way to get the load average | |
4827 AC_CHECK_LIB(kvm, kvm_read) | |
4828 fi | |
4829 | |
4830 dnl If netdb.h does not declare h_errno, we must declare it by hand. | |
4831 AC_MSG_CHECKING(whether netdb declares h_errno) | |
3312 | 4832 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], |
4833 [return h_errno;])], | |
2651 | 4834 [AC_MSG_RESULT(yes) |
4835 AC_DEFINE(HAVE_H_ERRNO)], | |
4836 [AC_MSG_RESULT(no)]) | |
4837 | |
4838 AC_MSG_CHECKING(for sigsetjmp) | |
3312 | 4839 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <setjmp.h>], |
4840 [sigjmp_buf bar; sigsetjmp (bar, 0);])], | |
2651 | 4841 [AC_MSG_RESULT(yes) |
4842 AC_DEFINE(HAVE_SIGSETJMP)], | |
4843 [AC_MSG_RESULT(no)]) | |
4844 | |
4845 AC_MSG_CHECKING(whether localtime caches TZ) | |
4846 AC_CACHE_VAL(emacs_cv_localtime_cache, | |
4847 [if test "$ac_cv_func_tzset" = "yes"; then | |
4848 AC_RUN_IFELSE([AC_LANG_SOURCE([#include <time.h> | |
4849 #if STDC_HEADERS | |
4850 # include <stdlib.h> | |
4851 #endif | |
4852 extern char **environ; | |
4853 unset_TZ () | |
4854 { | |
4855 char **from, **to; | |
4856 for (to = from = environ; (*to = *from); from++) | |
4857 if (! (to[[0]][[0]] == 'T' && to[[0]][[1]] == 'Z' && to[[0]][[2]] == '=')) | |
4858 to++; | |
4859 } | |
4860 char TZ_GMT0[[]] = "TZ=GMT0"; | |
4861 char TZ_PST8[[]] = "TZ=PST8"; | |
4862 main() | |
4863 { | |
4864 time_t now = time ((time_t *) 0); | |
4865 int hour_GMT0, hour_unset; | |
4866 if (putenv (TZ_GMT0) != 0) | |
4867 exit (1); | |
4868 hour_GMT0 = localtime (&now)->tm_hour; | |
4869 unset_TZ (); | |
4870 hour_unset = localtime (&now)->tm_hour; | |
4871 if (putenv (TZ_PST8) != 0) | |
4872 exit (1); | |
4873 if (localtime (&now)->tm_hour == hour_GMT0) | |
4874 exit (1); | |
4875 unset_TZ (); | |
4876 if (localtime (&now)->tm_hour != hour_unset) | |
4877 exit (1); | |
4878 exit (0); | |
4879 }])], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, | |
4880 [# If we have tzset, assume the worst when cross-compiling. | |
4881 emacs_cv_localtime_cache=yes]) | |
4882 else | |
4883 # If we lack tzset, report that localtime does not cache TZ, | |
4884 # since we can't invalidate the cache if we don't have tzset. | |
4885 emacs_cv_localtime_cache=no | |
4886 fi],[:])dnl | |
4887 AC_MSG_RESULT($emacs_cv_localtime_cache) | |
4888 if test $emacs_cv_localtime_cache = yes; then | |
4889 AC_DEFINE(LOCALTIME_CACHE) | |
4890 fi | |
4891 | |
4892 if test "$HAVE_TIMEVAL" = "yes"; then | |
4893 AC_MSG_CHECKING(whether gettimeofday accepts one or two arguments) | |
3312 | 4894 AC_LINK_IFELSE([AC_LANG_PROGRAM([ |
2651 | 4895 #ifdef TIME_WITH_SYS_TIME |
4896 #include <sys/time.h> | |
4897 #include <time.h> | |
4898 #else | |
4899 #ifdef HAVE_SYS_TIME_H | |
4900 #include <sys/time.h> | |
4901 #else | |
4902 #include <time.h> | |
4903 #endif | |
4904 #endif | |
4905 ], | |
4906 [ | |
4907 struct timeval time; | |
4908 gettimeofday (&time, 0); | |
3312 | 4909 ])], |
2651 | 4910 [AC_MSG_RESULT(two)], |
4911 [AC_MSG_RESULT(one) | |
4912 AC_DEFINE(GETTIMEOFDAY_ONE_ARGUMENT)]) | |
4913 fi | |
4914 | |
4915 | |
4916 AC_C_INLINE | |
4917 test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && XE_ADD_OBJS(inline.o) | |
4918 | |
4919 dnl check for the typeof extension | |
4920 AC_MSG_CHECKING(for typeof) | |
3312 | 4921 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i; __typeof__(i) j;])], |
4922 typeofname="__typeof__", | |
4923 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i; typeof(i) j;])], | |
4924 typeofname="typeof", | |
2651 | 4925 typeofname=no)]) |
4926 AC_MSG_RESULT($typeofname) | |
4927 if test "$typeofname" != "no"; then | |
4928 AC_DEFINE_UNQUOTED(TYPEOF, $typeofname) | |
4929 fi | |
4930 | |
4931 dnl HP-UX has a working alloca in libPW. | |
4932 dnl case "${GCC}${opsys}" in hpux* ) | |
4933 dnl AC_CHECK_FUNC(alloca, [:], [AC_CHECK_LIB(PW, alloca)]) | |
4934 dnl esac | |
4935 | |
4936 dnl AC_FUNC_ALLOCA doesn't know about DEC C's #pragma intrinsic(alloca) | |
4937 if test "$__DECC" != "yes"; then | |
4938 AC_FUNC_ALLOCA | |
4939 test -n "$ALLOCA" && XE_ADD_OBJS($ALLOCA) | |
4940 fi | |
4941 | |
4942 AC_MSG_CHECKING(for working alloca in function calls) | |
4943 AC_RUN_IFELSE([AC_LANG_SOURCE([ | |
4944 #if defined (__CYGWIN__) | |
4945 #include <alloca.h> | |
4946 #elif defined (__GNUC__) | |
4947 #define alloca __builtin_alloca | |
4948 #elif defined (__DECC) | |
4949 #include <alloca.h> | |
4950 #pragma intrinsic(alloca) | |
4951 #elif defined (HAVE_ALLOCA_H) | |
4952 #include <alloca.h> | |
4953 #elif defined (_AIX) | |
4954 #pragma alloca | |
4955 #elif ! defined (alloca) | |
4956 #ifdef C_ALLOCA | |
4957 #define alloca xemacs_c_alloca | |
4958 #else | |
4959 void *alloca (); | |
4960 #endif /* C_ALLOCA */ | |
4961 #endif /* !defined (alloca) */ | |
4962 | |
4963 void | |
4964 f1 (double a, void *ptr, int b) | |
4965 { | |
4966 unsigned char *ptr2 = (unsigned char *) ptr; | |
4967 if (ptr2[[0]] != 0xBF || ptr2[[1]] != 0xBF || ptr2[[3000]] != 0xBF) | |
4968 exit (1); | |
4969 if (a != 3.1415 || b != -5490) | |
4970 exit (1); | |
4971 } | |
4972 | |
4973 int | |
4974 f2 (short c, void *ptr, long e) | |
4975 { | |
4976 unsigned char *ptr2 = (unsigned char *) ptr; | |
4977 if (ptr2[[0]] != 0xFB || ptr2[[1]] != 0xFB || ptr2[[1000]] != 0xFB) | |
4978 exit (1); | |
4979 if (c != 665 || e != 776776776) | |
4980 exit (1); | |
4981 f1 (3.1415, memset (alloca (3001), 0xBF, 3001), -5490); | |
4982 return 42; | |
4983 } | |
4984 | |
4985 int | |
4588
6a6689b96f00
Adopt Martin's suggestion of "char **argv" throughout configure.ac.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4543
diff
changeset
|
4986 main (int argc, char **argv) |
2651 | 4987 { |
4988 if (f2 (665, memset (alloca (1001), 0xFB, 1001), 776776776) != 42) | |
4989 return 1; | |
4990 return 0; | |
4991 } | |
4992 ])], working_alloca_in_function_calls=yes, working_alloca_in_function_calls=no) | |
4993 AC_MSG_RESULT($working_alloca_in_function_calls) | |
4994 test "$working_alloca_in_function_calls" != "yes" && \ | |
4995 AC_DEFINE(BROKEN_ALLOCA_IN_FUNCTION_CALLS) | |
4996 | |
4997 AC_MSG_CHECKING([for working scanf]) | |
4998 AC_RUN_IFELSE([AC_LANG_SOURCE([ | |
4999 int | |
5000 main (int argc, char **argv) | |
5001 { | |
5002 int ret, cp1, cp2, endcount; | |
5003 char *p = "0x7d 0x000E "; | |
5004 ret = sscanf (p, "%i %i%n", &cp1, &cp2, &endcount); | |
5005 /* endcount should be 13 but it's 11 in Cygwin newlib after 6/04; | |
5006 this breaks unicode.c */ | |
5007 return endcount != 13; | |
5008 } | |
5009 ])], working_scanf=yes, working_scanf=no) | |
5010 AC_MSG_RESULT($working_scanf) | |
5011 test "$working_scanf" != "yes" && \ | |
5012 AC_DEFINE(CYGWIN_SCANF_BUG) | |
5013 | |
5014 dnl Check whether strcoll exists and works correctly. (This does more | |
5015 dnl than just check for its existence.) If so, it defines HAVE_STRCOLL. | |
5016 AC_FUNC_STRCOLL | |
5017 | |
5018 dnl If `getpgrp' takes no argument (the POSIX.1 version), define | |
5019 dnl `GETPGRP_VOID'. Otherwise, it is the BSD version, which takes a | |
5020 dnl process ID as an argument. | |
5021 AC_CHECK_FUNCS(getpgrp) | |
5022 AC_FUNC_GETPGRP | |
5023 | |
5024 dnl We used to call AC_FUNC_MMAP here | |
5025 dnl Instead we now use following, suggested by Neal Becker | |
5026 AC_MSG_CHECKING(for working mmap) | |
5027 case "$opsys" in ultrix* ) have_mmap=no ;; *) | |
5028 AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdio.h> | |
5029 #include <unistd.h> | |
5030 #include <fcntl.h> | |
5031 #include <sys/mman.h> | |
5032 | |
5033 #ifndef MAP_VARIABLE | |
5034 #define MAP_VARIABLE 0 | |
5035 #endif | |
5036 | |
5037 #ifndef MAP_FAILED | |
5038 #define MAP_FAILED -1 | |
5039 #endif | |
5040 | |
4588
6a6689b96f00
Adopt Martin's suggestion of "char **argv" throughout configure.ac.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
4543
diff
changeset
|
5041 int main (int argc, char **argv) |
2651 | 5042 { |
5043 int fd = -1; | |
5044 caddr_t p; | |
5045 #ifndef MAP_ANONYMOUS | |
5046 fd = open ("/dev/zero", O_RDWR); | |
5047 if (fd < 0) | |
5048 return 1; | |
5049 #define MAP_ANONYMOUS 0 | |
5050 #endif | |
5051 if (mmap(0, 1024, PROT_READ | PROT_WRITE, | |
5052 MAP_PRIVATE | MAP_VARIABLE | MAP_ANONYMOUS, | |
5053 fd, 0) != (void *) MAP_FAILED) | |
5054 return 0; | |
5055 perror ("conftest: mmap failed"); | |
5056 return 1; | |
5057 }])], have_mmap=yes, have_mmap=no) ;; | |
5058 esac | |
5059 AC_MSG_RESULT($have_mmap) | |
5060 test "$have_mmap" = "yes" && AC_DEFINE(HAVE_MMAP) | |
5061 | |
5062 dnl By default we switch off rel-alloc on cygwin as it generally causes us grief | |
5063 case "$opsys" in cygwin*) | |
5064 test "$with_rel_alloc" = "default" && with_rel_alloc=no ;; | |
5065 esac | |
5066 dnl rel_alloc requires either GNU malloc or system malloc with mmap | |
5067 dnl We only turn rel_alloc on by default if mmap is available. | |
5068 test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && with_rel_alloc=no | |
5069 if test "$with_rel_alloc $have_mmap" = "default yes"; then | |
5070 if test "$doug_lea_malloc" = "yes"; then | |
5071 dnl Check if malloc() calls mmap(), making rel_alloc pointless. | |
5072 AC_MSG_CHECKING(for M_MMAP_THRESHOLD) | |
3312 | 5073 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <malloc.h>],[ |
2651 | 5074 #ifndef M_MMAP_THRESHOLD |
5075 #error No M_MMAP_THRESHOLD :-( | |
5076 !@+$%^&*_)(_ - unlikely to compile... | |
5077 #endif | |
3312 | 5078 ])], [with_rel_alloc=no; AC_MSG_RESULT(yes);], |
5079 [with_rel_alloc=yes; AC_MSG_RESULT(no);]) | |
2651 | 5080 else |
5081 with_rel_alloc=yes | |
5082 fi | |
5083 fi | |
5084 test "$with_rel_alloc" = "yes" && AC_DEFINE(REL_ALLOC) | |
5085 | |
5086 dnl Check for terminal I/O variants | |
5087 dnl TERMIOS systems may have termio.h, but not vice-versa, I think. | |
5088 AC_CHECK_HEADER(termios.h, | |
5089 AC_DEFINE(HAVE_TERMIOS) | |
5090 AC_DEFINE(SIGNALS_VIA_CHARACTERS) | |
5091 AC_DEFINE(NO_TERMIO), | |
5092 [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO)])]) | |
5093 | |
5094 | |
5095 dnl Check for Internet sockets. | |
5096 AC_CHECK_FUNC(socket, | |
5097 [AC_CHECK_HEADER(netinet/in.h, | |
5098 [AC_CHECK_HEADER(arpa/inet.h, [ | |
5099 AC_DEFINE(HAVE_SOCKETS) | |
3312 | 5100 AC_MSG_CHECKING([for sun_len member in struct sockaddr_un]) |
5101 AC_LINK_IFELSE([AC_LANG_PROGRAM([ | |
2651 | 5102 #include <sys/types.h> |
5103 #include <sys/socket.h> | |
5104 #include <sys/un.h> | |
5105 ], | |
3312 | 5106 [static struct sockaddr_un x; x.sun_len = 1;])], |
2651 | 5107 [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOCKADDR_SUN_LEN)], |
5108 [AC_MSG_RESULT(no)]) | |
3312 | 5109 AC_MSG_CHECKING([for ip_mreq struct in netinet/in.h]) |
5110 AC_LINK_IFELSE([AC_LANG_PROGRAM([ | |
2651 | 5111 #include <sys/types.h> |
5112 #include <netinet/in.h> | |
5113 ], | |
3312 | 5114 [static struct ip_mreq x;])], |
2651 | 5115 [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MULTICAST)], |
5116 [AC_MSG_RESULT(no)])])])]) | |
5117 | |
5118 dnl Check for SYS V IPC. (Inferior to sockets.) | |
5119 AC_CHECK_FUNC(msgget, | |
5120 [AC_CHECK_HEADER(sys/ipc.h, | |
5121 [AC_CHECK_HEADER(sys/msg.h, | |
5122 [AC_DEFINE(HAVE_SYSVIPC)])])]) | |
5123 | |
5124 dnl Check for directory variants | |
5125 AC_CHECK_HEADER(dirent.h, [AC_DEFINE(SYSV_SYSTEM_DIR)], | |
5126 [AC_CHECK_HEADER(sys/dir.h, , [AC_DEFINE(NONSYSTEM_DIR_LIBRARY)])]) | |
5127 | |
5128 dnl Check for nlist.h | |
5129 AC_CHECK_HEADER(nlist.h, AC_DEFINE(NLIST_STRUCT), ) | |
5130 | |
5131 dnl Check for sound of various sorts. | |
3312 | 5132 AC_MSG_CHECKING([for sound support]) |
5133 AC_MSG_RESULT() | |
2651 | 5134 |
5135 dnl Autodetect native sound | |
5136 test -n "$with_native_sound_lib" && enable_sound_native=yes | |
5137 | |
5138 if test "$enable_sound_native" != "no"; then | |
5139 dnl Maybe sound is already on include path... | |
5140 if test -n "$with_native_sound_lib"; then | |
5141 AC_CHECK_HEADER(multimedia/audio_device.h, | |
5142 [sound_found=yes sound_cflags="" | |
5143 XE_ADD_OBJS(sunplay.o)]) | |
5144 fi | |
5145 | |
5146 dnl Autodetect Sun native sound from SUNWaudmo package | |
5147 if test -z "$sound_found" -a -d "/usr/demo/SOUND"; then | |
5148 if test -d "/usr/demo/SOUND/include/multimedia"; then | |
5149 sun_sound_cflags="-I/usr/demo/SOUND/include" | |
5150 elif test -d "/usr/demo/SOUND/multimedia"; then | |
5151 sun_sound_cflags="-I/usr/demo/SOUND" | |
5152 fi | |
5153 | |
5154 if test -n "$with_native_sound_lib"; then | |
5155 sun_sound_lib="$with_native_sound_lib" | |
5156 elif test -r "/usr/demo/SOUND/lib/libaudio.a"; then | |
5157 sun_sound_lib="/usr/demo/SOUND/lib/libaudio.a" | |
5158 elif test -r "/usr/demo/SOUND/libaudio.a"; then | |
5159 sun_sound_lib="/usr/demo/SOUND/libaudio.a" | |
5160 fi | |
5161 | |
5162 if test -n "$sun_sound_cflags" -a -n "$sun_sound_lib"; then | |
5163 with_native_sound_lib="$sun_sound_lib" | |
5164 sound_cflags="$sun_sound_cflags" | |
5165 sound_found=yes | |
5166 XE_ADD_OBJS(sunplay.o) | |
5167 fi | |
5168 fi | |
5169 | |
5170 dnl Check for SGI and HP native sound libs | |
5171 if test -z "$sound_found"; then | |
5172 case "$ac_cv_build" in | |
5173 *-sgi-* ) | |
5174 if test -z "$with_native_sound_lib"; then | |
5175 AC_CHECK_LIB(audio, ALopenport, with_native_sound_lib="-laudio") | |
5176 fi | |
5177 if test -n "$with_native_sound_lib"; then | |
5178 sound_found=yes sound_cflags="" | |
5179 XE_ADD_OBJS(sgiplay.o) | |
5180 fi ;; | |
5181 hppa*-hp-hpux* ) | |
5182 if test -z "$with_native_sound_lib"; then | |
5183 AC_CHECK_LIB(Alib, AOpenAudio, with_native_sound_lib="-lAlib") | |
5184 fi | |
5185 if test -n "$with_native_sound_lib"; then | |
5186 sound_found=yes | |
5187 XE_ADD_OBJS(hpplay.o) | |
5188 if test "$GCC" = "yes" # Kludge city | |
5189 then sound_cflags="-Dconst= -Dvolatile= -I/usr/audio/examples" | |
5190 else sound_cflags="+e -I/usr/audio/examples" | |
5191 fi | |
5192 fi ;; | |
5193 esac | |
5194 fi | |
5195 | |
3060 | 5196 dnl Win32 uses native sound |
2651 | 5197 if test -z "$sound_found"; then |
3060 | 5198 case "$opsys" in cygwin* | mingw* ) |
2651 | 5199 sound_found=yes |
5200 with_native_sound_lib= | |
5201 XE_ADD_OBJS(ntplay.o) | |
3060 | 5202 ;; |
5203 esac | |
2651 | 5204 fi |
5205 | |
5206 dnl Check for Linux/BSD native sound (also on recent Cygwins) | |
5207 if test -z "$sound_found"; then | |
5208 for dir in "machine" "sys" "linux"; do | |
5209 AC_CHECK_HEADER([${dir}/soundcard.h], [ | |
5210 sound_found=yes | |
2663 | 5211 case "${ac_cv_build}" in |
2651 | 5212 *netbsd* ) |
5213 # #### this is probably not the right way to do this | |
5214 # we should port to native NetBSD stuff | |
2663 | 5215 |
5216 dnl Aidan says: We have other things to be doing. If some | |
5217 dnl energetic NetBSD partisan volunteers, then yeah, cool, | |
5218 dnl but as it is, this works, and is unlikely to stop | |
5219 dnl working any time soon. | |
5220 | |
2651 | 5221 AC_CHECK_LIB(ossaudio, _oss_ioctl, |
2663 | 5222 [with_native_sound_lib=-lossaudio |
2651 | 5223 AC_MSG_WARN([Using NetBSD-deprecated -lossaudio])], |
5224 [sound_found=no]) | |
5225 ;; | |
5226 dnl Aidan sez: OpenBSD as well can use Linux's sound API, and needs | |
5227 dnl the same library. Add here! | |
5228 esac | |
5229 break]) | |
5230 done | |
5231 | |
5232 if test "$sound_found" = "yes"; then | |
5233 need_miscplay=yes | |
5234 XE_ADD_OBJS(linuxplay.o) | |
5235 AC_DEFINE_UNQUOTED(SOUNDCARD_H_FILE, ["${dir}/soundcard.h"]) | |
5236 fi | |
5237 fi | |
5238 | |
5239 if test "$sound_found" = "yes"; then | |
5240 enable_sound_native=yes | |
5241 else | |
5242 if test "$enable_sound_native" = "yes" ; then | |
5243 AC_MSG_WARN([No native libraries found. Disabling native sound support.]) | |
5244 fi | |
5245 enable_sound_native=no | |
5246 fi | |
5247 fi | |
5248 | |
5249 if test "$enable_sound_native" = "yes"; then | |
5250 AC_DEFINE(HAVE_NATIVE_SOUND) | |
5251 test -n "$with_native_sound_lib" && XE_PREPEND($with_native_sound_lib, LIBS) | |
5252 fi | |
5253 | |
3308 | 5254 dnl ALSA sound support |
5255 if test "$enable_sound_alsa" != "no"; then | |
3309 | 5256 AC_CHECK_HEADER([alsa/input.h], [ |
3308 | 5257 AC_CHECK_LIB(asound, snd_pcm_open, have_alsa_sound=yes)]) |
5258 if test "$have_alsa_sound" = "yes"; then | |
5259 enable_sound_alsa=yes | |
5260 AC_DEFINE(HAVE_ALSA_SOUND) | |
5261 XE_ADD_OBJS(alsaplay.o) | |
5262 XE_PREPEND(-lasound, LIBS) | |
5263 else | |
5264 test "$enable_sound_alsa" = "yes" && \ | |
5265 XE_DIE("Required ALSA sound support cannot be provided.") | |
5266 enable_sound_alsa=no | |
5267 fi | |
5268 fi | |
5269 | |
2651 | 5270 dnl NAS Sound support |
5271 if test "$enable_sound_nas" != "no"; then | |
5272 AC_CHECK_HEADER(audio/audiolib.h, [ | |
5273 AC_CHECK_LIB(audio, AuOpenServer, have_nas_sound=yes)]) | |
5274 if test "$have_nas_sound" = "yes"; then | |
5275 enable_sound_nas=yes | |
5276 AC_DEFINE(HAVE_NAS_SOUND) | |
5277 XE_ADD_OBJS(nas.o) | |
5278 XE_PREPEND(-laudio, libs_x) | |
5279 dnl If the nas library does not contain the error jump point, | |
5280 dnl then we force safer behavior. | |
5281 AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[old_nas=yes; AC_DEFINE(NAS_NO_ERROR_JUMP)]) | |
5282 else | |
5283 test "$enable_sound_nas" = "yes" && \ | |
5284 XE_DIE("Required NAS sound support cannot be provided.") | |
5285 enable_sound_nas=no | |
5286 fi | |
5287 fi | |
5288 | |
5289 dnl ESD Sound support | |
5290 if test "$enable_sound_esd" != "no"; then | |
5291 AC_CHECK_PROG(have_esd_config, esd-config, yes, no) | |
5292 if test "$have_esd_config" = "yes"; then | |
5293 save_c_switch_site="$c_switch_site" save_LIBS="$LIBS" | |
5294 XE_APPEND(`esd-config --cflags`, c_switch_site) | |
5295 XE_PREPEND(`esd-config --libs`, LIBS) | |
5296 AC_CHECK_FUNC(esd_play_stream, | |
5297 have_esd_sound=yes, | |
5298 c_switch_site="$save_c_switch_site" LIBS="$save_LIBS") | |
5299 fi | |
5300 | |
5301 if test "$have_esd_sound" = "yes"; then | |
5302 enable_sound_esd=yes | |
5303 need_miscplay=yes | |
5304 XE_ADD_OBJS(esd.o) | |
5305 AC_DEFINE(HAVE_ESD_SOUND) | |
5306 else | |
5307 test "$enable_sound_esd" = "yes" && \ | |
5308 XE_DIE("Required ESD sound support cannot be provided.") | |
5309 enable_sound_esd=no | |
5310 fi | |
5311 fi | |
5312 | |
5313 test "$need_miscplay" = "yes" && XE_ADD_OBJS(miscplay.o) | |
5314 | |
5315 dnl --------------------- | |
5316 dnl TTY-dependent options | |
5317 dnl --------------------- | |
5318 | |
5319 test -z "$with_tty" && with_tty=yes | |
5320 | |
5321 if test "$with_tty" = "yes" ; then | |
3312 | 5322 AC_MSG_CHECKING([for TTY-related features]) |
5323 AC_MSG_RESULT() | |
2651 | 5324 AC_DEFINE(HAVE_TTY) |
5325 | |
5326 dnl Autodetect ncurses. | |
5327 if test -z "$with_ncurses"; then | |
5328 AC_CHECK_LIB(ncurses, tgetent, with_ncurses=yes, with_ncurses=no) | |
5329 fi | |
5330 if test "$with_ncurses" = "yes"; then | |
5331 AC_DEFINE(HAVE_NCURSES) | |
5332 AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h) | |
5333 AC_CHECK_HEADER(ncurses/term.h, term_h_file=ncurses/term.h) | |
5334 XE_ADD_OBJS(terminfo.o) | |
5335 XE_PREPEND(-lncurses, LIBS) | |
5336 | |
5337 if test "$ac_cv_header_ncurses_curses_h" != "yes" ; then | |
5338 dnl Try again, and check for the bogus ncurses/ include bug. | |
5339 dnl (i.e. ncurses/curses.h bogusly includes <unctrl.h> instead of | |
5340 dnl <ncurses/unctrl.h>) | |
5341 save_c_switch_site="$c_switch_site" | |
5342 c_switch_site="$c_switch_site -I/usr/include/ncurses" | |
5343 AC_CHECK_HEADER(ncurses/curses.h, curses_h_file=ncurses/curses.h) | |
5344 if test "$ac_cv_header_ncurses_curses_h" = "yes" | |
5345 then AC_MSG_WARN([Your system has the bogus ncurses include bug.]) | |
5346 else c_switch_site="$save_c_switch_site" | |
5347 fi | |
5348 fi | |
5349 else dnl "$with_ncurses" = "no" | |
5350 dnl Autodetect terminfo/-lcurses/-ltermlib/-ltermcap | |
5351 if test "$have_terminfo" = "yes"; then | |
5352 XE_ADD_OBJS(terminfo.o) | |
5353 if test -n "$libs_termcap"; then | |
5354 XE_PREPEND($libs_termcap, LIBS) | |
5355 else | |
5356 for lib in curses termlib termcap; do | |
5357 AC_CHECK_LIB($lib, tgetent, XE_PREPEND(-l${lib}, LIBS); break) | |
5358 done | |
5359 fi | |
5360 else dnl "$have_terminfo" = "no" && "with_ncurses" = "no" | |
5361 XE_ADD_OBJS(tparam.o) | |
5362 dnl The HP-UX curses library seems to have a badly broken version of select(2) | |
5363 dnl that makes "poll: interrupted system call" messages to appear and | |
5364 dnl Emacs subprocesses to hang (e.g. TeX compilation w/ AUCTeX) */ | |
5365 case "$opsys" in *-hp-hpux* ) libs_termcap="-ltermcap" ;; esac | |
5366 if test -n "$libs_termcap"; then | |
5367 XE_PREPEND($libs_termcap, LIBS) | |
5368 else | |
5369 AC_CHECK_LIB(curses, tgetent, XE_PREPEND(-lcurses, LIBS), | |
5370 AC_CHECK_LIB(termcap, tgetent, XE_PREPEND(-ltermcap, LIBS), | |
5371 XE_ADD_OBJS(termcap.o))) | |
5372 fi | |
5373 fi | |
5374 fi | |
5375 AC_DEFINE_UNQUOTED(CURSES_H_FILE, "${curses_h_file-curses.h}") | |
5376 AC_DEFINE_UNQUOTED(TERM_H_FILE, "${term_h_file-term.h}") | |
5377 | |
5378 dnl General Purpose Mouse (libgpm) support | |
5379 if test "$with_gpm" != "no"; then | |
5380 AC_CHECK_HEADER(gpm.h, [ | |
5381 AC_CHECK_LIB(gpm, Gpm_Open, have_gpm=yes)]) | |
5382 if test "$have_gpm" = "yes"; then | |
5383 with_gpm=yes | |
5384 AC_DEFINE(HAVE_GPM) | |
5385 XE_PREPEND(-lgpm, LIBS) | |
5386 elif test "$with_gpm" = "yes"; then | |
5387 XE_DIE(["GPM requested, but gpm.h or libgpm seems to be missing."]) | |
5388 else | |
5389 with_gpm=no | |
5390 fi | |
5391 fi | |
5392 | |
5393 else dnl "$with_tty" = "no" | |
5394 for feature in ncurses gpm; do | |
5395 if eval "test -n \"\$with_${feature}\" -a \"\$with_${feature}\" != no" ; then | |
5396 AC_MSG_WARN([--with-${feature} ignored: Not valid without TTY support]) | |
5397 fi | |
5398 eval "with_${feature}=no" | |
5399 done | |
5400 fi dnl with_tty | |
5401 | |
5402 dnl Database support | |
5403 dnl We do not necessarily have to have libdb/lib(g)dbm for DB/(G)DBM support. | |
5404 dnl On FreeBSD, both DB and DBM are part of libc. | |
5405 dnl By default, we check for DBM support in libgdbm, then libc, then libdbm. | |
5406 | |
5407 test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \ | |
3312 | 5408 != "no no no" && AC_MSG_CHECKING([for database support]) && \ |
5409 AC_MSG_RESULT() | |
2651 | 5410 |
5411 dnl Check for ndbm.h, required for either kind of DBM support. | |
5412 if test "$enable_database_gdbm $enable_database_dbm" != "no no"; then | |
5413 AC_CHECK_HEADER(ndbm.h, [:], [ | |
5414 test "$enable_database_gdbm" = "yes" -o \ | |
5415 "$enable_database_dbm" = "yes" && \ | |
5416 XE_DIE("Required DBM support cannot be provided.") | |
5417 enable_database_gdbm=no enable_database_dbm=no]) | |
5418 fi | |
5419 | |
5420 dnl Check for DBM support in libgdbm. | |
5421 if test "$enable_database_gdbm" != "no"; then | |
5422 AC_CHECK_LIB(gdbm, dbm_open, [ | |
5423 enable_database_gdbm=yes enable_database_dbm=no libdbm=-lgdbm], [ | |
4401
01970033faa6
Configure fixes from Hans de Graaff, as used in Gentoo.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4350
diff
changeset
|
5424 AC_CHECK_LIB(gdbm_compat, dbm_open, [ |
01970033faa6
Configure fixes from Hans de Graaff, as used in Gentoo.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4350
diff
changeset
|
5425 enable_database_gdbm=yes enable_database_dbm=no libdbm="-lgdbm_compat -lgdbm"], [ |
2651 | 5426 if test "$enable_database_gdbm" = "yes"; then |
5427 XE_DIE("Required GNU DBM support cannot be provided.") | |
5428 fi | |
4401
01970033faa6
Configure fixes from Hans de Graaff, as used in Gentoo.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4350
diff
changeset
|
5429 enable_database_gdbm=no], -lgdbm) |
01970033faa6
Configure fixes from Hans de Graaff, as used in Gentoo.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4350
diff
changeset
|
5430 ]) |
2651 | 5431 fi |
5432 | |
5433 dnl Check for DBM support in libc and libdbm. | |
5434 if test "$enable_database_dbm" != "no"; then | |
5435 AC_CHECK_FUNC(dbm_open, [enable_database_dbm=yes libdbm=], [ | |
5436 AC_CHECK_LIB(dbm, dbm_open, [enable_database_dbm=yes libdbm=-ldbm], [ | |
5437 test "$enable_database_dbm" = "yes" && \ | |
5438 XE_DIE("Required DBM support cannot be provided.") | |
5439 enable_database_dbm=no])]) | |
5440 fi | |
5441 | |
5442 dnl Tell make about the DBM support we detected. | |
5443 test -n "$libdbm" && XE_PREPEND("$libdbm", LIBS) | |
5444 test "$enable_database_gdbm" = "yes" -o \ | |
5445 "$enable_database_dbm" = "yes" && \ | |
5446 AC_DEFINE(HAVE_DBM) | |
5447 | |
3739 | 5448 dnl Check for u_int*_t typedefs. |
5449 AC_CHECK_TYPES([u_int8_t, u_int16_t, u_int32_t]) | |
5450 | |
2651 | 5451 dnl Check for Berkeley DB. |
5452 if test "$enable_database_berkdb" != "no"; then | |
5453 AC_MSG_CHECKING(for Berkeley db.h) | |
5454 for header in "db/db.h" "db.h"; do | |
3312 | 5455 AC_COMPILE_IFELSE([AC_LANG_SOURCE([ |
2651 | 5456 #include <stdlib.h> |
5457 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) | |
5458 #ifdef HAVE_INTTYPES_H | |
5459 #define __BIT_TYPES_DEFINED__ | |
5460 #include <inttypes.h> | |
3739 | 5461 #if !HAVE_U_INT8_T |
2651 | 5462 typedef uint8_t u_int8_t; |
3739 | 5463 #endif |
5464 #if !HAVE_U_INT16_T | |
2651 | 5465 typedef uint16_t u_int16_t; |
3739 | 5466 #endif |
5467 #if !HAVE_U_INT32_T | |
2651 | 5468 typedef uint32_t u_int32_t; |
3739 | 5469 #endif |
2651 | 5470 #ifdef WE_DONT_NEED_QUADS |
3739 | 5471 #if !HAVE_U_INT64_T |
2651 | 5472 typedef uint64_t u_int64_t; |
5473 #endif | |
5474 #endif | |
5475 #endif | |
3739 | 5476 #endif |
2651 | 5477 #include <$header> |
3312 | 5478 ])], db_h_file="$header"; break) |
2651 | 5479 done |
5480 if test -z "$db_h_file" | |
5481 then AC_MSG_RESULT(no); enable_database_berkdb=no | |
5482 else AC_MSG_RESULT($db_h_file) | |
5483 fi | |
5484 | |
5485 if test "$enable_database_berkdb" != "no"; then | |
5486 AC_MSG_CHECKING(for Berkeley DB version) | |
5487 AC_EGREP_CPP(yes, | |
5488 [#include <$db_h_file> | |
5489 #if DB_VERSION_MAJOR > 1 | |
5490 yes | |
5491 #endif | |
5492 ], [AC_EGREP_CPP(yes, | |
5493 [#include <$db_h_file> | |
5494 #if DB_VERSION_MAJOR > 2 | |
5495 yes | |
5496 #endif | |
5497 ], [AC_EGREP_CPP(yes, | |
5498 [#include <$db_h_file> | |
5499 #if DB_VERSION_MAJOR > 3 | |
5500 yes | |
5501 #endif | |
5502 ], [AC_MSG_RESULT(4); dbfunc=db_create; dbver=4],[ | |
5503 AC_MSG_RESULT(3); dbfunc=db_create; dbver=3])],[ | |
5504 AC_MSG_RESULT(2); dbfunc=db_open; dbver=2])],[ | |
5505 AC_MSG_RESULT(1); dbfunc=dbopen; dbver=1]) | |
5506 AC_CHECK_FUNC($dbfunc, enable_database_berkdb=yes need_libdb=no, [ | |
5507 AC_CHECK_LIB(db, $dbfunc, enable_database_berkdb=yes need_libdb=yes)]) | |
5508 fi | |
5509 | |
5510 dnl Berk db 4.1 decorates public functions with version information | |
4401
01970033faa6
Configure fixes from Hans de Graaff, as used in Gentoo.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4350
diff
changeset
|
5511 if test "$enable_database_berkdb" = "yes" -a "$dbver" = "4"; then |
2651 | 5512 rm -f $tempcname |
5513 echo "#include <$db_h_file>" > $tempcname | |
5514 echo "configure___ dbfunc=db_create" >> $tempcname | |
5515 define(TAB, [ ])dnl | |
5516 eval `$CPP -Isrc $tempcname \ | |
5517 | sed -n -e "s/[[ TAB]]*=[[ TAB\"]]*/='/" -e "s/[[ TAB\"]]*\$/'/" -e "s/^configure___//p"` | |
5518 rm -f $tempcname | |
5519 AC_MSG_WARN("db_create is really $dbfunc") | |
5520 AC_CHECK_LIB(db, $dbfunc, enable_database_berkdb=yes need_libdb=yes) | |
5521 fi | |
5522 | |
5523 if test "$enable_database_berkdb" = "yes"; then | |
5524 AC_DEFINE_UNQUOTED(DB_H_FILE, "$db_h_file") | |
5525 AC_DEFINE(HAVE_BERKELEY_DB) | |
5526 test "$need_libdb" = "yes" && XE_PREPEND(-ldb, LIBS) | |
5527 else enable_database_berkdb=no | |
5528 fi | |
5529 fi | |
5530 | |
5531 if test "$enable_database_gdbm $enable_database_dbm $enable_database_berkdb" \ | |
5532 != "no no no"; then | |
5533 AC_DEFINE(HAVE_DATABASE) | |
5534 fi | |
5535 | |
5536 dnl Socks support | |
5537 if test "$with_socks" = "yes"; then | |
5538 AC_CHECK_LIB(socks, SOCKSinit) | |
5539 test -n "$ac_cv_lib_socks_SOCKSinit" && AC_DEFINE(HAVE_SOCKS) | |
5540 fi | |
5541 | |
5542 dnl Usage tracking (undocumented and likely unused option) | |
5543 if test "$usage_tracking" = "yes"; then | |
5544 AC_DEFINE(USAGE_TRACKING) | |
5545 XE_PREPEND(-Bstatic -lut -Bdynamic, LIBS) | |
5546 fi | |
5547 | |
5548 dnl Enhanced number support | |
5549 if test "$enable_bignum" = "gmp"; then | |
5550 AC_CHECK_HEADER(gmp.h, [ | |
5551 AC_CHECK_LIB(gmp, __gmpz_init, have_mpz_init=yes)]) | |
5552 if test "$have_mpz_init" = "yes"; then | |
5553 AC_DEFINE(WITH_NUMBER_TYPES) | |
5554 AC_DEFINE(WITH_GMP) | |
5555 XE_PREPEND(-lgmp, LIBS) | |
5556 else | |
5557 XE_DIE("Required GMP numeric support cannot be provided.") | |
5558 fi | |
5559 elif test "$enable_bignum" = "mp"; then | |
5560 for library in "" "-lcrypto"; do | |
5561 AC_CHECK_HEADER(mp.h, [ | |
5562 AC_CHECK_LIB(mp, mp_mfree, have_mp_mfree=yes; break, [ | |
5563 AC_CHECK_LIB(mp, mfree, have_mfree=yes; break, , $library)], | |
5564 $library)]) | |
5565 done | |
5566 if test "$have_mp_mfree" = "yes"; then | |
5567 AC_DEFINE(MP_PREFIX) | |
5568 XE_APPEND(-lmp, LIBS) | |
5569 if test "$library" != ""; then | |
5570 XE_APPEND($library, LIBS) | |
5571 fi | |
5572 AC_CHECK_FUNC(mp_move, [AC_DEFINE(HAVE_MP_MOVE)]) | |
5573 elif test "$have_mfree" = "yes"; then | |
5574 XE_APPEND(-lmp, LIBS) | |
5575 if test "$library" != ""; then | |
5576 XE_APPEND($library, LIBS) | |
5577 fi | |
5578 AC_CHECK_FUNC(move, [AC_DEFINE(HAVE_MP_MOVE)]) | |
5579 else | |
5580 XE_DIE("Required MP numeric support cannot be provided.") | |
5581 fi | |
5582 AC_DEFINE(WITH_NUMBER_TYPES) | |
5583 AC_DEFINE(WITH_MP) | |
5584 fi | |
5585 | |
5586 dnl Unfortunately, just because we can link doesn't mean we can run. | |
5587 dnl One of the above link tests may have succeeded but caused resulting | |
5588 dnl executables to fail to run. Also any tests using AC_RUN_IFELSE will | |
5589 dnl have reported incorrect results. | |
4537
7ca6d57ce12d
Clarify syntax in configure.ac following Vladimir Ivanovic's change.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4536
diff
changeset
|
5590 AC_RUN_IFELSE([AC_LANG_SOURCE([int main(int c,char **v){return 0;}])],[:],[ |
2651 | 5591 echo "" |
5592 echo "*** PANIC *** The C compiler can no longer build working executables." | |
5593 echo "*** PANIC *** Please examine the tail of config.log for runtime errors." | |
5594 echo "*** PANIC *** The most likely reason for this problem is that configure" | |
5595 echo "*** PANIC *** links with shared libraries, but those libraries cannot be" | |
5596 echo "*** PANIC *** found at run time." | |
5597 echo "*** PANIC ***" | |
5598 echo "*** PANIC *** On a Linux system, edit /etc/ld.so.conf and re-run ldconfig." | |
5599 echo "*** PANIC *** On other systems, try telling configure where to find the" | |
5600 echo "*** PANIC *** shared libraries using the --with-site-runtime-libraries option" | |
5601 echo "*** PANIC ***" | |
5602 echo "*** PANIC *** Another way to shoot yourself in the foot is to specify" | |
5603 echo "*** PANIC *** --with-FEATURE when FEATURE is not actually installed" | |
5604 echo "*** PANIC *** on your system. Don't do that." | |
5605 exit 1]) | |
5606 | |
5607 dnl Process support | |
5608 if test "$win32_processes" != "yes"; then | |
5609 AC_DEFINE(HAVE_UNIX_PROCESSES) | |
5610 fi | |
5611 | |
5612 dnl -------------------------------- | |
5613 dnl Compute SUBST-itutable variables | |
5614 dnl -------------------------------- | |
5615 | |
5616 dnl We ignore (C|LD)_SWITCH_X_(MACHINE|SYSTEM) | |
5617 dnl Use XE_SPACE instead of plain assignment statements to remove extraneous blanks | |
5618 if test "$enable_modules" = "yes"; then | |
5619 ld_libs_module= | |
5620 else | |
2973 | 5621 XE_SPACE(ld_libs_module, $ldap_libs $postgresql_libs $canna_libs) |
2651 | 5622 fi |
5623 | |
5624 XE_SPACE(CFLAGS, $CFLAGS) | |
5625 XE_SPACE(extra_objs, $extra_objs) | |
5626 XE_SPACE(c_switch_general, -DHAVE_CONFIG_H $c_switch_site $c_switch_machine $c_switch_system) | |
5627 XE_SPACE(c_switch_window_system, $c_switch_x_site $c_switch_gtk $X_CFLAGS) | |
5628 XE_SPACE(c_switch_all, $c_switch_general $c_switch_window_system) | |
5629 XE_SPACE(ld_switch_general, $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_run) | |
5630 XE_SPACE(ld_switch_window_system, $ld_switch_x_site) | |
5631 XE_SPACE(ld_switch_all, $ld_switch_general $ld_switch_window_system) | |
5632 XE_SPACE(ld_libs_general, $LIBS $libs_machine $libs_system $libs_standard) | |
5633 XE_SPACE(ld_libs_window_system, $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS) | |
5634 XE_SPACE(ld_libs_all, $ld_libs_window_system $ld_libs_general $ld_libs_module) | |
5635 | |
5636 dnl For no-module builds, make the src dir last | |
5637 if test "$enable_modules" = "no"; then | |
5638 XE_APPEND(src, MAKE_SUBDIR) | |
5639 fi | |
5640 | |
5641 dnl Compute lists of Makefiles and subdirs | |
5642 AC_SUBST(SRC_SUBDIR_DEPS) | |
5643 internal_makefile_list="Makefile.in" | |
5644 SUBDIR_MAKEFILES='' | |
5645 test -d lock || mkdir lock | |
5646 for dir in $MAKE_SUBDIR; do | |
5647 case "$dir" in */* ) dnl Implement mkdir -p | |
5648 ( for d in `echo $dir | sed 's:/: :g'` ; do | |
5649 test -d "$d" || mkdir "$d"; cd "$d" | |
5650 done ) ;; | |
5651 * ) test -d "$dir" || mkdir "$dir" ;; | |
5652 esac | |
5653 XE_SPACE(SUBDIR_MAKEFILES, $SUBDIR_MAKEFILES $dir/Makefile $dir/GNUmakefile) | |
5654 XE_SPACE(internal_makefile_list, $internal_makefile_list $dir/Makefile.in) | |
5655 done | |
5656 AC_SUBST(INSTALL_ARCH_DEP_SUBDIR) | |
5657 AC_SUBST(MAKE_SUBDIR) | |
5658 AC_SUBST(SUBDIR_MAKEFILES) | |
5659 | |
5660 dnl Make s&m symlinks in the src directory, for config.h. | |
5661 for dir in src/s src/m; do | |
5662 if test ! -d "$dir" ; then | |
5663 echo Making symbolic link to "$srcdir/$dir" | |
5664 ${LN_S} "$srcdir/$dir" "$dir" | |
5665 fi | |
5666 done | |
5667 | |
5668 dnl Also make modules/common link if needed for the module Makefiles. | |
5669 if test "$need_modules_common" = "yes"; then | |
5670 for dir in modules/common; do | |
5671 if test ! -d "$dir" ; then | |
5672 echo Making symbolic link to "$srcdir/$dir" | |
5673 ${LN_S} "$srcdir/$dir" "$dir" | |
5674 fi | |
5675 done | |
5676 fi | |
5677 | |
5678 if test "$verbose" = "yes"; then | |
5679 echo "" | |
5680 PRINT_VAR(extra_objs | |
5681 c_switch_general c_switch_window_system c_switch_all | |
5682 ld_switch_general ld_switch_window_system ld_switch_all | |
5683 ld_libs_general ld_libs_window_system ld_libs_all) | |
5684 echo "" | |
5685 fi | |
5686 | |
5687 dnl ---------------------------------------------- | |
5688 dnl Create some auxiliary files for developers. | |
5689 dnl ---------------------------------------------- | |
5690 | |
3418 | 5691 dnl Unlike TAGS, debugger init files depend on config.h. |
5692 dnl Regenerate them locally on every configure. | |
2651 | 5693 dnl Create a .gdbinit useful for debugging XEmacs |
3418 | 5694 if test -f "$srcdir/etc/gdbinit.in"; then |
3092 | 5695 test "$verbose" = "yes" && echo "creating src/.gdbinit.in" |
3418 | 5696 cp $srcdir/etc/gdbinit.in src/.gdbinit.in |
2651 | 5697 fi |
5698 | |
5699 dnl Create a .dbxrc useful for debugging XEmacs | |
3418 | 5700 if test -f "$srcdir/etc/dbxrc.in"; then |
3092 | 5701 test "$verbose" = "yes" && echo "creating src/.dbxrc.in" |
3418 | 5702 echo ". $srcdir/etc/dbxrc.in" > "src/.dbxrc.in" |
2651 | 5703 fi |
5704 | |
5705 dnl Create a useful TAGS file | |
5706 if test -f "$srcdir/TAGS" -a ! -f "TAGS"; then | |
5707 test "$verbose" = "yes" && echo "creating TAGS" | |
5708 echo " | |
5709 $srcdir/TAGS,include" > "TAGS" | |
5710 fi | |
5711 | |
5712 dnl Create top level .sbinit for Sun compilers | |
5713 if test "$__SUNPRO_C" = "yes"; then | |
5714 test "$verbose" = "yes" && echo "creating .sbinit" | |
5715 ( echo "# For use with Sun WorkShop's Source browser." | |
5716 echo "# See sbquery(1) and sbinit(4) for more information" | |
5717 for dir in $MAKE_SUBDIR; do echo "import $dir"; done | |
5718 ) > .sbinit | |
5719 fi | |
5720 | |
5721 dnl There are no more compile tests; remove the core they created. | |
5722 rm -f core | |
5723 | |
5724 dnl ---------------------------------------------- | |
5725 dnl Substitute into Makefile, config.h and paths.h | |
5726 dnl ---------------------------------------------- | |
5727 | |
5728 dnl what sort of things to edit into Makefile, config.h and paths.h | |
5729 dnl configuration here uncanonicalized to avoid exceeding size limits. | |
5730 | |
5731 AC_SUBST(PROGNAME) | |
5732 AC_SUBST(version) | |
3972 | 5733 AC_SUBST(verbose_version) |
2651 | 5734 AC_SUBST(inststaticdir) |
5735 AC_SUBST(instvardir) | |
5736 AC_SUBST(srcdir) | |
5737 AC_SUBST(bindir) | |
4118 | 5738 AC_SUBST(datarootdir) |
2651 | 5739 AC_SUBST(datadir) |
5740 AC_SUBST(statedir) | |
5741 AC_SUBST(libdir) | |
5742 AC_SUBST(mandir) | |
5743 AC_SUBST(extra_includes) | |
5744 | |
5745 AC_SUBST(prefix) | |
5746 AC_SUBST(PREFIX_USER_DEFINED) | |
5747 dnl Yo, Stephen Bourne! I want to marry you! | |
5748 PREFIX=$prefix | |
5749 while true; do | |
5750 case "$PREFIX" in | |
5751 *\$* ) eval "PREFIX=$PREFIX" ;; | |
5752 *) break ;; | |
5753 esac | |
5754 done | |
5755 AC_SUBST(PREFIX) | |
5756 | |
5757 AC_SUBST(exec_prefix) | |
5758 AC_SUBST(EXEC_PREFIX_USER_DEFINED) | |
5759 EXEC_PREFIX=$exec_prefix | |
5760 while true; do | |
5761 case "$EXEC_PREFIX" in | |
5762 *\$* ) eval "EXEC_PREFIX=$EXEC_PREFIX" ;; | |
5763 *) break ;; | |
5764 esac | |
5765 done | |
5766 AC_SUBST(EXEC_PREFIX) | |
5767 | |
5768 AC_SUBST(infodir) | |
5769 AC_SUBST(INFODIR_USER_DEFINED) | |
3729 | 5770 XE_EXPAND_VARIABLE(infodir,INFODIR) |
2651 | 5771 AC_SUBST(INFODIR) |
5772 | |
5773 AC_SUBST(infopath,$with_infopath) | |
5774 AC_SUBST(INFOPATH_USER_DEFINED) | |
3729 | 5775 XE_EXPAND_VARIABLE(with_info_path,INFOPATH) |
4455
49f8ed034500
Fix path-configuration glitches:
Mike Sperber <sperber@deinprogramm.de>
parents:
4450
diff
changeset
|
5776 AC_SUBST(INFOPATH) |
2651 | 5777 |
3179 | 5778 test -n "$with_user_packages" && with_early_packages=$with_user_packages |
5779 AC_SUBST(early_packages,$with_early_packages) | |
5780 AC_SUBST(EARLY_PACKAGE_DIRECTORIES_USER_DEFINED) | |
3729 | 5781 XE_EXPAND_VARIABLE(with_early_packages,EARLY_PACKAGE_DIRECTORIES) |
3179 | 5782 AC_SUBST(EARLY_PACKAGE_DIRECTORIES) |
5783 | |
5784 test -n "$with_system_packages" && with_late_packages=$with_system_packages | |
5785 AC_SUBST(late_packages,$with_late_packages) | |
5786 AC_SUBST(LATE_PACKAGE_DIRECTORIES_USER_DEFINED) | |
3729 | 5787 XE_EXPAND_VARIABLE(with_late_packages,LATE_PACKAGE_DIRECTORIES) |
3179 | 5788 AC_SUBST(LATE_PACKAGE_DIRECTORIES) |
5789 | |
5790 test -n "$with_legacy_packages" && with_last_packages=$with_legacy_packages | |
5791 AC_SUBST(last_packages,$with_last_packages) | |
5792 AC_SUBST(LAST_PACKAGE_DIRECTORIES_USER_DEFINED) | |
3729 | 5793 XE_EXPAND_VARIABLE(with_last_packages,LAST_PACKAGE_DIRECTORIES) |
3179 | 5794 AC_SUBST(LAST_PACKAGE_DIRECTORIES) |
2651 | 5795 |
5796 AC_SUBST(package_path,$with_package_path) | |
5797 AC_SUBST(PACKAGE_PATH_USER_DEFINED) | |
3729 | 5798 XE_EXPAND_VARIABLE(with_package_path,PACKAGE_PATH) |
2651 | 5799 AC_SUBST(PACKAGE_PATH) |
5800 | |
5801 AC_SUBST(lispdir, $with_lispdir) | |
5802 AC_SUBST(LISPDIR_USER_DEFINED) | |
3729 | 5803 XE_EXPAND_VARIABLE(with_lispdir,LISPDIR) |
2651 | 5804 AC_SUBST(LISPDIR) |
5805 | |
5806 AC_SUBST(moduledir,$with_moduledir) | |
5807 AC_SUBST(MODULEDIR_USER_DEFINED) | |
3729 | 5808 XE_EXPAND_VARIABLE(with_moduledir,MODULEDIR) |
2651 | 5809 AC_SUBST(MODULEDIR) |
5810 | |
5811 AC_SUBST(sitelispdir,$with_sitelispdir) | |
5812 AC_SUBST(SITELISPDIR_USER_DEFINED) | |
3729 | 5813 XE_EXPAND_VARIABLE(sitelispdir,SITELISPDIR) |
2651 | 5814 AC_SUBST(SITELISPDIR) |
5815 | |
5816 AC_SUBST(sitemoduledir) | |
5817 AC_SUBST(SITEMODULEDIR_USER_DEFINED) | |
3729 | 5818 XE_EXPAND_VARIABLE(sitemoduledir,SITEMODULEDIR) |
2651 | 5819 AC_SUBST(SITEMODULEDIR) |
5820 | |
5821 AC_SUBST(etcdir,$with_etcdir) | |
5822 AC_SUBST(ETCDIR_USER_DEFINED) | |
3729 | 5823 XE_EXPAND_VARIABLE(with_etcdir,ETCDIR) |
2651 | 5824 AC_SUBST(ETCDIR) |
5825 | |
5826 AC_SUBST(archlibdir,$with_archlibdir) | |
5827 AC_SUBST(ARCHLIBDIR_USER_DEFINED) | |
5828 ARCHLIBDIR=$with_archlibdir | |
3729 | 5829 XE_EXPAND_VARIABLE(with_archlibdir,ARCHLIBDIR) |
2651 | 5830 AC_SUBST(ARCHLIBDIR) |
5831 | |
5832 AC_SUBST(docdir,$with_docdir) | |
5833 AC_SUBST(DOCDIR_USER_DEFINED) | |
3729 | 5834 XE_EXPAND_VARIABLE(with_docdir,DOCDIR) |
2651 | 5835 AC_SUBST(DOCDIR) |
5836 | |
5837 AC_SUBST(docdir) | |
5838 AC_SUBST(bitmapdir) | |
5839 AC_SUBST(extra_objs) | |
5840 | |
5841 dnl The following flags combine all the information from: | |
5842 dnl - command line options (user always gets priority) | |
5843 dnl - user environment variables | |
5844 dnl - determined by configure | |
5845 dnl - the s&m header files (required for ellcc) | |
5846 AC_SUBST(machfile) | |
5847 AC_SUBST(opsysfile) | |
5848 AC_SUBST(c_switch_general) | |
5849 AC_SUBST(c_switch_window_system) | |
5850 AC_SUBST(c_switch_all) | |
5851 AC_SUBST(ld_switch_general) | |
5852 AC_SUBST(ld_switch_window_system) | |
5853 AC_SUBST(ld_switch_all) | |
5854 AC_SUBST(ld_libs_general) | |
5855 AC_SUBST(ld_libs_window_system) | |
5856 AC_SUBST(ld_libs_all) | |
5857 AC_SUBST(CFLAGS) | |
5858 AC_SUBST(CPPFLAGS) | |
5859 AC_SUBST(LDFLAGS) | |
5860 RECURSIVE_MAKE_ARGS="\$(MFLAGS) CC='\$(CC)' CFLAGS='\$(CFLAGS)' LDFLAGS='\$(LDFLAGS)' CPPFLAGS='\$(CPPFLAGS)'" | |
5861 AC_SUBST(RECURSIVE_MAKE_ARGS) | |
5862 | |
5863 AC_SUBST(native_sound_lib,$with_native_sound_lib) | |
5864 AC_SUBST(sound_cflags) | |
5865 AC_SUBST(RANLIB) | |
5866 AC_SUBST(dynodump_arch) | |
5867 | |
5868 AC_SUBST(XEMACS_CC) | |
5869 AC_SUBST(XE_CFLAGS) | |
5870 | |
5871 dnl The default is yes | |
5872 if test "$with_prefix" = "yes"; then | |
5873 AC_DEFINE(PREFIX_USER_DEFINED) | |
5874 fi | |
5875 | |
5876 dnl The default is no | |
5877 if test "$with_site_lisp" = "no"; then | |
5878 AC_DEFINE(INHIBIT_SITE_LISP) | |
5879 fi | |
5880 dnl The default is yes | |
5881 if test "$with_site_modules" = "no"; then | |
5882 AC_DEFINE(INHIBIT_SITE_MODULES) | |
5883 fi | |
5884 | |
5885 XE_SPACE(ac_configure_args, $ac_configure_args) | |
3765 | 5886 dnl Put back the leading space to work around problems with |
5887 dnl 'config.status --recheck' under autoconf 2.60 and 2.61. | |
5888 ac_configure_args=" $ac_configure_args" | |
2651 | 5889 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$ac_cv_build") |
5890 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "$ac_configure_args") | |
5891 | |
5892 dnl Following are deprecated | |
5893 | |
5894 null_string="" | |
5895 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, $null_string) | |
5896 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, $null_string) | |
5897 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, $null_string) | |
5898 AC_DEFINE_UNQUOTED(LD_SWITCH_SITE, $null_string) | |
5899 AC_DEFINE_UNQUOTED(C_SWITCH_SITE, $null_string) | |
5900 | |
5901 dnl Note: as a general rule, *only* define things here that are not | |
5902 dnl autodetected. For things that are autodetected, define them | |
5903 dnl at the point where the autodetection occurs or would occur, | |
5904 dnl so that the user gets immediate feedback on the results of the | |
5905 dnl autodetection. | |
5906 | |
5907 if test "$GNU_MALLOC" = "yes"; then AC_DEFINE(GNU_MALLOC) | |
5908 elif test "$with_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC) | |
5909 elif test "$with_debug_malloc" = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC) | |
5910 AC_DEFINE(USE_SYSTEM_MALLOC) | |
5911 fi | |
5912 test "$GCC" = "yes" && AC_DEFINE(USE_GCC) | |
5913 test "$enable_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) | |
5914 test "$enable_kkcc" = "yes" && AC_DEFINE(USE_KKCC) | |
3092 | 5915 test "$enable_newgc" = "yes" && AC_DEFINE(NEW_GC) |
5916 test "$have_vdb_posix" = "yes" && AC_DEFINE(VDB_POSIX) | |
5917 test "$have_vdb_fake" = "yes" && AC_DEFINE(VDB_FAKE) | |
2651 | 5918 test "$enable_quick_build" = "yes" && AC_DEFINE(QUICK_BUILD) |
5919 test "$with_purify" = "yes" && AC_DEFINE(PURIFY) | |
5920 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) | |
5921 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) | |
5922 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS) | |
5923 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD) | |
5924 test "$enable_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE) | |
5925 test "$enable_pdump" = "yes" && AC_DEFINE(PDUMP) | |
2720 | 5926 test "$enable_dump_in_exec" = "yes" && AC_DEFINE(DUMP_IN_EXEC) |
2651 | 5927 test "$with_ipv6_cname" = "yes" && AC_DEFINE(IPV6_CANONICALIZE) |
5928 | |
5929 | |
5930 | |
5931 dnl ------------------------------------------------------------------------- | |
5932 dnl ------------------------------- | |
5933 dnl Report on what we decided to do | |
5934 dnl ------------------------------- | |
5935 | |
5936 dnl #### We should tag this as the _build_ environment. | |
5937 dnl Before doing that, though, must check if tools care about line 1. | |
5938 | |
5939 ( | |
5940 dnl /etc/osversion is on SONY NEWS-OS | |
5941 if test -f /etc/osversion; then dnl SONY NEWS-OS | |
5942 echo "osversion: `cat /etc/osversion`" | |
5943 else | |
5944 echo "uname -a: `uname -a`" | |
5945 fi | |
5946 echo "" | |
5947 echo "$progname $ac_configure_args" | |
5948 ) > Installation | |
5949 | |
5950 if test ! -z ${emacs_beta_version} ; then | |
5951 if test -z "${emacs_is_beta}" ; then | |
5952 xemacs_betaname=".${emacs_beta_version}" | |
5953 else | |
5954 xemacs_betaname="-b${emacs_beta_version}" | |
5955 fi | |
5956 else | |
5957 xemacs_betaname="" | |
5958 fi | |
5959 | |
5960 dnl Start stdout redirection to '| tee -a Installation' | |
5961 ( | |
5962 echo " | |
5963 | |
2938 | 5964 XEmacs ${emacs_major_version}.${emacs_minor_version}${xemacs_betaname} \"$xemacs_codename\" $xemacs_extra_name configured for \`$ac_cv_build'." |
2651 | 5965 |
5966 echo " | |
5967 Compilation Environment and Installation Defaults:" | |
5968 echo " Source code location: $srcdir" | |
5969 echo " Installation prefix: $prefix" | |
5970 if test -n "$with_site_includes"; then | |
5971 echo " Additional header files: $with_site_includes" | |
5972 fi | |
5973 if test -n "$with_site_libraries"; then | |
5974 echo " Additional libraries: $with_site_libraries" | |
5975 fi | |
5976 if test -n "$with_site_prefixes"; then | |
5977 echo " Additional prefixes: $with_site_prefixes" | |
5978 fi | |
5979 if test -n "$runpath"; then | |
5980 echo " Runtime library search path: $runpath" | |
5981 fi | |
5982 | |
5983 if test -n "$opsysfile" | |
5984 then echo " Operating system description file: \`$opsysfile'" | |
5985 else echo " Not using any operating system description file" | |
5986 fi | |
5987 if test -n "$machfile" | |
5988 then echo " Machine description file: \`$machfile'" | |
5989 else echo " Not using any machine description file" | |
5990 fi | |
5991 | |
5992 echo " Compiler version: $compiler_version" | |
5993 if test -n "$gcc_compiler_specs"; then | |
5994 echo " - GCC specs file: $gcc_compiler_specs" | |
5995 fi | |
5996 echo " - Compiler command: $XEMACS_CC $XE_CFLAGS" | |
5997 if test "$CC" != "$XEMACS_CC"; then | |
5998 echo " Compiler version for lib-src: (detection code unimplemented)" | |
5999 echo " - Compiler command for lib-src: $CC $CFLAGS" | |
6000 if test "$xemacs_cc_cc_mismatch" = "yes"; then | |
6001 echo " WARNING: CC and XEMACS_CC mismatched; check CFLAGS carefully." | |
6002 fi | |
6003 fi | |
6004 echo " libc version: $libc_version" | |
6005 echo " Relocating allocator for buffers: $with_rel_alloc" | |
6006 echo " GNU version of malloc: ${GNU_MALLOC}${GNU_MALLOC_reason}" | |
6007 case "$ld_switch_site" in | |
6008 *nocombreloc*) echo " Linking with \`-z nocombreloc'. | |
6009 - Consider configuring with --enable-pdump." ;; | |
6010 esac | |
6011 | |
6012 echo " | |
6013 Window System:" | |
6014 if test "$with_msw" = "yes"; then | |
6015 echo " Compiling in support for the Microsoft window system." | |
6016 fi | |
6017 if test "$with_x11" = "yes"; then | |
6018 echo " Compiling in support for the X window system:" | |
6019 echo " - X Windows headers location: $x_includes" | |
6020 echo " - X Windows libraries location: $x_libraries" | |
6021 if test "$with_xauth" != yes; then | |
6022 echo " - Xau (X authority) not available." | |
6023 fi | |
6024 if test "$with_xmu" != yes; then | |
6025 echo " - Xmu library not available; substituting equivalent routines." | |
6026 fi | |
6027 if test "$with_wmcommand" != no; then | |
6028 echo " - Handling WM_COMMAND properly." | |
6029 fi | |
3354 | 6030 if test "$with_fontconfig" = "yes"; then |
6031 echo " - Using fontconfig to manage fonts." | |
6032 fi | |
3166 | 6033 if test "$with_xft_emacs" = "yes"; then |
3094 | 6034 echo " - Compiling in support for Xft antialiased fonts (EXPERIMENTAL)." |
6035 fi | |
2651 | 6036 fi |
3019 | 6037 if test "$need_motif" = "yes" ; then |
6038 echo " Compiling in support for Motif." | |
6039 if test "$have_lesstif" = "yes"; then | |
6040 echo " - Using LessTif implementation." | |
6041 fi | |
6042 echo " *WARNING* Many versions of Motif are buggy, requiring workarounds." | |
6043 echo " You are likely to experience slow redisplay." | |
6044 echo " You may need to install vendor patches to Motif." | |
6045 echo " See PROBLEMS for more information." | |
6046 fi | |
2651 | 6047 if test "$need_athena" = "yes"; then |
6048 echo " Compiling in support for the Athena widget set:" | |
6049 echo " - Athena headers location: $athena_h_path" | |
6050 echo " - Athena library to link: $athena_lib" | |
6051 fi | |
6052 case "$enable_menubars" in | |
6053 gtk ) echo " Using GTK menubars." ;; | |
6054 lucid ) echo " Using Lucid menubars." ;; | |
6055 motif ) echo " Using Motif menubars." | |
6056 echo " *WARNING* The Motif menubar implementation is currently buggy." | |
6057 echo " We recommend using the Lucid menubar instead." | |
6058 echo " Re-run configure with --enable-menubars='lucid'." ;; | |
6059 msw ) echo " Using MS-Windows menubars." ;; | |
6060 esac | |
3094 | 6061 if test "$with_xft_menubars" = "yes"; then |
6062 echo " - Using Xft to render antialiased fonts in menubars." | |
6063 echo " WARNING: This feature will be replaced with a face." | |
6064 fi | |
2651 | 6065 case "$enable_scrollbars" in |
6066 gtk ) echo " Using GTK scrollbars." ;; | |
6067 lucid ) echo " Using Lucid scrollbars." ;; | |
6068 motif ) echo " Using Motif scrollbars." ;; | |
6069 athena ) echo " Using Athena scrollbars." ;; | |
6070 msw ) echo " Using MS-Windows scrollbars." ;; | |
6071 esac | |
6072 case "$enable_dialogs" in | |
6073 gtk ) echo " Using GTK dialog boxes." ;; | |
6074 motif ) echo " Using Motif dialog boxes." | |
6075 if test "$unexec" = "unexaix.o"; then if test "`uname -v`" = 4 -a "`uname -r`" -ge 3; then | |
6076 echo " *WARNING* The Motif dialog boxes cause problems on AIX 4.3 and higher." | |
6077 echo " We recommend using the Athena dialog boxes instead." | |
6078 echo " Install libXaw and re-run configure with --enable-dialogs='athena'." | |
6079 echo " Read the PROBLEMS file for more information." | |
6080 fi; fi ;; | |
6081 athena ) echo " Using Athena dialog boxes." ;; | |
6082 msw ) echo " Using MS-Windows dialog boxes." ;; | |
6083 esac | |
6084 case "$enable_widgets" in | |
6085 gtk ) echo " Using GTK native widgets." ;; | |
6086 motif ) echo " Using Motif native widgets." ;; | |
6087 athena ) echo " Using Athena native widgets." ;; | |
6088 msw ) echo " Using MS-Windows native widgets." ;; | |
6089 esac | |
3094 | 6090 if test "$with_xft_tabs" = "yes"; then |
6091 echo " - Using Xft to render antialiased fonts in tab controls." | |
6092 echo " WARNING: This feature will be replaced with a face." | |
6093 fi | |
4497
f863b2ee146f
Rename xft_gauge to xft_gauges.
Mats Lidell <matsl@xemacs.org>
parents:
4496
diff
changeset
|
6094 if test "$with_xft_gauges" = "yes"; then |
3094 | 6095 echo " - Using Xft to render antialiased fonts in progress bars." |
6096 echo " WARNING: This feature will be replaced with a face." | |
6097 echo " WARNING: This feature not yet implemented; setting ignored." | |
6098 fi | |
2651 | 6099 if test "$with_dragndrop" = yes; then |
6100 echo " Compiling in support for Drag'n'Drop (EXPERIMENTAL)." | |
6101 echo " - Drag'n'Drop prototype: $dragndrop_proto." | |
6102 fi | |
6103 | |
6104 echo " | |
6105 TTY:" | |
6106 test "$with_ncurses" = yes && echo " Compiling in support for ncurses." | |
6107 test "$with_gpm" = yes && echo " Compiling in support for GPM (General Purpose Mouse)." | |
6108 | |
6109 echo " | |
6110 Images:" | |
6111 test "$with_gif" = yes && echo " Compiling in support for GIF images (builtin)." | |
6112 if test "$with_xpm" = yes; then | |
6113 echo " Compiling in support for XPM images." | |
6114 elif test "$with_x11" = yes; then | |
6115 echo " WARNING: -----------------------------------------------------------" | |
6116 echo " WARNING: Compiling without XPM image support." | |
6117 if test "$xpm_problem" != ""; then | |
6118 echo " Reason: $xpm_problem" | |
6119 fi | |
6120 echo " WARNING: You should strongly consider installing XPM." | |
6121 echo " WARNING: Otherwise toolbars and other graphics will look suboptimal." | |
6122 echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" | |
6123 echo " WARNING: -----------------------------------------------------------" | |
6124 fi | |
6125 if test "$with_png" = yes; then | |
6126 echo " Compiling in support for PNG images." | |
6127 elif test "$window_system" != "none"; then | |
6128 echo " WARNING: -----------------------------------------------------------" | |
6129 echo " WARNING: Compiling without PNG image support." | |
6130 if test "$png_problem" != ""; then | |
6131 echo " Reason: $png_problem" | |
6132 fi | |
6133 echo " WARNING: You should strongly consider installing the PNG libraries." | |
6134 echo " WARNING: Otherwise certain images and glyphs may not display." | |
6135 echo " WARNING: (a copy may be found in ftp://ftp.xemacs.org/pub/xemacs/aux)" | |
6136 echo " WARNING: -----------------------------------------------------------" | |
6137 fi | |
6138 test "$with_jpeg" = yes && echo " Compiling in support for JPEG images." | |
6139 test "$with_tiff" = yes && echo " Compiling in support for TIFF images." | |
6140 test "$with_xface" = yes && echo " Compiling in support for X-Face message headers." | |
6141 | |
6142 echo " | |
6143 Sound:" | |
6144 test "$enable_sound_native" = yes && echo " Compiling in support for sound (native)." | |
3308 | 6145 test "$enable_sound_alsa" = yes && echo " Compiling in support for ALSA (Advanced Linux Sound Architecture)." |
2651 | 6146 test "$enable_sound_nas" = yes && echo " Compiling in support for NAS (network audio system)." |
6147 test "$old_nas" = yes && echo " - NAS library lacks error trapping; will play synchronously." | |
6148 test "$enable_sound_esd" = yes && echo " Compiling in support for ESD (Enlightened Sound Daemon)." | |
6149 | |
6150 echo " | |
6151 Databases:" | |
6152 test "$enable_database_berkdb" = yes && echo " Compiling in support for Berkeley database." | |
6153 test "$enable_database_dbm" = yes && echo " Compiling in support for DBM." | |
6154 test "$enable_database_gdbm" = yes && echo " Compiling in support for GNU DBM." | |
6155 test "$with_ldap" = yes && echo " Compiling in support for LDAP." | |
6156 if test "$with_postgresql" = yes; then | |
6157 echo " Compiling in support for PostgreSQL." | |
6158 echo " - Using PostgreSQL header file: $libpq_fe_h_file" | |
6159 test "$with_postgresqlv7" = yes && echo " - Using PostgreSQL V7 bindings." | |
6160 fi | |
6161 | |
6162 echo " | |
6163 Internationalization:" | |
6164 test "$enable_mule" = yes && echo " Compiling in support for Mule (multi-lingual Emacs)." | |
6165 test "$with_xim" != no && echo " Compiling in support for XIM (X11R5+ I18N input method)." | |
6166 test "$with_xim" = motif && echo " - Using Motif to provide XIM support." | |
6167 test "$with_xim" = xlib && echo " - Using raw Xlib to provide XIM support." | |
6168 test "$with_xfs" = yes && echo " - Using XFontSet to provide bilingual menubar." | |
3830 | 6169 test "$have_canna" = yes && echo " Compiling in support for Canna on Mule." |
2651 | 6170 if test "$with_wnn" = yes; then |
6171 echo " Compiling in support for the WNN input method on Mule." | |
6172 test "$with_wnn6" = yes && echo " - Using WNN version 6." | |
6173 fi | |
6174 | |
6175 echo " | |
6176 Mail:" | |
6177 test "$with_pop" = yes && echo " Compiling in support for POP mail retrieval." | |
6178 test "$with_kerberos" = yes && echo " Compiling in support for Kerberos POP authentication." | |
6179 test "$with_hesiod" = yes && echo " Compiling in support for Hesiod POP server access." | |
6180 test -n "$with_mail_locking" && echo " Compiling in support for \"$with_mail_locking\" mail spool file locking method." | |
6181 | |
6182 echo " | |
6183 Other Features:" | |
6184 test "$with_ipv6_cname" = no && echo " Inhibiting IPv6 canonicalization at startup." | |
6185 test "$with_tooltalk" = yes && echo " Compiling in support for ToolTalk." | |
6186 test "$with_workshop" = yes && echo " Compiling in support for Sun WorkShop." | |
6187 test "$with_socks" = yes && echo " Compiling in support for SOCKS." | |
6188 test "$with_dnet" = yes && echo " Compiling in support for DNET." | |
6189 test "$enable_modules" = "yes" && echo " Compiling in support for dynamic shared object modules." | |
6190 test "$enable_bignum" = "gmp" && echo " Compiling in support for more number types using the GNU MP library." | |
6191 test "$enable_bignum" = "mp" && echo " Compiling in support for more number types using the BSD MP library." | |
6192 if test "$enable_union_type" = yes ; then | |
6193 echo " Using the union type for Lisp_Objects." | |
6194 echo " WARNING: ---------------------------------------------------------" | |
6195 echo " WARNING: This tends to trigger compiler bugs, especially when" | |
6196 echo " WARNING: combined with MULE and ERROR_CHECKING. Crashes have" | |
6197 echo " WARNING: been seen with various versions of GCC (up to about 2.95)," | |
6198 echo " WARNING: and recently with Visual C++ as well (mid-2003)." | |
6199 echo " WARNING: More recent versions may be safer, or not." | |
6200 echo " WARNING: ---------------------------------------------------------" | |
6201 fi | |
2790 | 6202 if test "$enable_kkcc" = yes ; then |
3263 | 6203 echo " Using the new GC mark algorithms (KKCC)." |
2790 | 6204 echo " WARNING: ---------------------------------------------------------" |
6205 echo " WARNING: The new algorithms are experimental. They are enabled by" | |
6206 echo " WARNING: default for this release. Use \`--disable-kkcc' to" | |
6207 echo " WARNING: turn it off." | |
6208 echo " WARNING: ---------------------------------------------------------" | |
6209 fi | |
3263 | 6210 test "$enable_newgc" = yes && echo " Using the new incremental garbage collector and the new allocator." |
3092 | 6211 if test "$have_vdb_posix" = yes ; then |
6212 if test "$have_vdb_sigaction" = yes ; then | |
6213 echo " Using POSIX sigaction() to install fault handler." | |
6214 else | |
6215 echo " Using POSIX signal() to install vdb fault handler." | |
6216 fi | |
6217 fi | |
6218 if test "$have_vdb_win32" = yes ; then | |
6219 echo " Using special WIN32 vdb fault handler." | |
6220 fi | |
6221 if test "$have_vdb_mach" = yes ; then | |
6222 echo " Using mach exception mechanism as vdb fault handler." | |
6223 fi | |
6224 if test "$have_vdb_fake" = yes && test "$enable_vdb" == fake; then | |
6225 echo " Virtual dirty bit write barrier manually disabled." | |
6226 fi | |
2651 | 6227 test "$enable_pdump" = yes && echo " Using the new portable dumper." |
2720 | 6228 test "$enable_dump_in_exec" = yes && echo " Dumping into executable." |
2651 | 6229 test "$enable_debug" = yes && echo " Compiling in support for extra debugging code." |
6230 test "$usage_tracking" = yes && echo " Compiling in support for active usage tracking (Sun internal)." | |
6231 if test "$enable_error_checking_extents $enable_error_checking_types $enable_error_checking_text $enable_error_checking_gc $enable_error_checking_malloc $enable_error_checking_glyphs $enable_error_checking_byte_code $enable_error_checking_display $enable_error_checking_structures" \ | |
6232 != "no no no no no no no no no"; then | |
6233 echo " Compiling in support for runtime error checking." | |
6234 echo " WARNING: ---------------------------------------------------------" | |
6235 echo " WARNING: XEmacs will run noticeably more slowly as a result." | |
6236 echo " WARNING: Error checking is on by default for XEmacs beta releases." | |
6237 echo " WARNING: ---------------------------------------------------------" | |
6238 fi | |
6239 echo "" | |
6240 ) | tee -a Installation | |
6241 dnl echo "The above configure report is appended to \"Installation\" file." | |
6242 echo "" | |
6243 | |
6244 dnl ----------------------------------- | |
6245 dnl Now generate config.h and Makefiles | |
6246 dnl ----------------------------------- | |
6247 AC_CONFIG_HEADER(src/config.h lwlib/config.h) | |
6248 | |
6249 dnl This has to be called in order for this variable to get into config.status | |
6250 AC_SUBST(internal_makefile_list) | |
6251 # Remove any trailing slashes in these variables. | |
6252 test -n "$prefix" && | |
6253 prefix=`echo '' "$prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'` | |
6254 test -n "$exec_prefix" && | |
6255 exec_prefix=`echo '' "$exec_prefix" | sed -e 's:^ ::' -e 's,\([[^/]]\)/*$,\1,'` | |
6256 | |
6257 dnl Build Makefile.in's from Makefile.in.in's | |
6258 dnl except ./Makefile from $srcdir/Makefile.in | |
6259 dnl src/Makefile.in will have src/depend appended to it; | |
6260 dnl module Makefiles will have the common text in | |
6261 dnl modules/common/Makefile.common appended. | |
6262 | |
3481 | 6263 dnl this actually should be conditional on having perl (ie, effectively |
6264 dnl unconditional on sane systems) | |
6265 if test -r $srcdir/src/depend; then :; | |
6266 else | |
6267 echo "creating $srcdir/src/depend" | |
6268 perl $srcdir/src/make-src-depend > $srcdir/src/depend | |
6269 fi | |
6270 | |
2651 | 6271 for file in $internal_makefile_list; do |
6272 case $file in | |
6273 src/Makefile.in ) file="src/Makefile.in:src/Makefile.in.in:src/depend" ;; | |
6274 modules/* ) file="${file}:${file}.in:modules/common/Makefile.common" ;; | |
6275 esac | |
6276 AC_CONFIG_FILES($file) | |
6277 done | |
6278 AC_CONFIG_FILES(src/paths.h src/xemacs.def.in lib-src/config.values) | |
6279 test "$enable_modules" = "yes" && AC_CONFIG_FILES(lib-src/ellcc.h) | |
6280 | |
6281 | |
6282 dnl Normally []'s are used for quoting but this will cause problems | |
6283 dnl since we use brackets in sed. When not inside of a macro definition, | |
6284 dnl two brackets become one, but inside of a macro definition you need | |
6285 dnl more, or something -- I don't understand, but Martin probably does. | |
6286 dnl We put the brackets back later. | |
6287 dnl [ben] | |
3418 | 6288 dnl To insert comments that will remain in the generated file, we use the |
6289 dnl imake XCOMM convention. Lines beginning with "XCOMM " exactly (no | |
6290 dnl leading whitespace, one trailing ASCII space, case sensitive) will be | |
6291 dnl transformed to shell/make/gdb comments in the generated file. | |
6292 dnl [sjt] | |
2651 | 6293 |
6294 dnl MAKE_JUNK_C(filename): | |
6295 dnl Copy a .in file to junk.c in preparation for passing through the | |
6296 dnl C preprocessor. Delete comment lines, pass lines that will be | |
6297 dnl interpreted by cpp through directly, and put quotes around remaining | |
6298 dnl lines, to avoid problems from overly helpful preprocessors that | |
6299 dnl "helpfully" put extra quotes in various places for later use by the | |
6300 dnl compiler. Later, the quotes will be removed. | |
6301 | |
6302 m4_define([MAKE_JUNK_C], | |
6303 [ rm -f junk.c | |
6304 < $1 \ | |
6305 sed -e '/^# Generated/d' \ | |
6306 -e 's%/\*\*/#.*%%' \ | |
6307 -e 's/^ *# */#/' \ | |
6308 dnl Delete Makefile.in.in comment lines | |
6309 -e '/^##/d' \ | |
6310 dnl Pass through CPP directives unchanged | |
6311 -e '/^#/ { | |
6312 p | |
6313 d | |
6314 }' \ | |
6315 dnl Quote other lines to protect from CPP substitution | |
6316 -e '/./ { | |
6317 s/\([[\"]]\)/\\\1/g | |
6318 s/^/"/ | |
6319 s/$/"/ | |
6320 }' > junk.c; | |
6321 ])dnl MAKE_JUNK_C | |
6322 | |
6323 dnl CPP_MAKEFILE(CPPFLAGS,filename): | |
6324 dnl Pass junk.c through the preprocessor and put the result in FILENAME. | |
6325 | |
6326 m4_define([CPP_MAKEFILE], | |
6327 [echo creating $dir/$2 | |
6328 $CPP -I. -I${srcdir}/src $1 junk.c \ | |
6329 dnl Delete line directives inserted by $CPP | |
6330 | sed -e 's/^\#.*//' \ | |
6331 dnl Delete spurious blanks inserted by $CPP | |
6332 -e 's/^[[ TAB]][[ TAB]]*$//'\ | |
6333 -e 's/^ /TAB/' \ | |
6334 dnl Delete blank lines | |
6335 -e '/^[[ ]]*$/d' \ | |
6336 dnl Restore lines quoted above to original contents. | |
6337 -e '/^\"/ { | |
6338 s/\\\([[\"]]\)/\1/g | |
6339 s/^[[ TAB]]*\"// | |
6340 s/\"[[ TAB]]*$// | |
3418 | 6341 }' \ |
6342 dnl Convert comments -- must come after the unquoting operations | |
6343 -e 's/^XCOMM /\# /' > Makefile.new | |
2651 | 6344 chmod 444 Makefile.new |
6345 mv -f Makefile.new $2 | |
6346 ])dnl CPP_MAKEFILE | |
6347 | |
6348 AC_CONFIG_COMMANDS([default], | |
6349 [for dir in . $MAKE_SUBDIR; do | |
6350 ( | |
6351 cd $dir | |
6352 | |
6353 dnl Create a GNUmakefile and Makefile from Makefile.in. | |
6354 dnl Create xemacs.def from xemacs.def.in in the same fashion, | |
3418 | 6355 dnl if it exists (i.e. in the src/ directory). Ditto for the |
6356 dnl debugger init files (in the src/ directory). | |
2651 | 6357 MAKE_JUNK_C(Makefile.in) |
6358 CPP_MAKEFILE(,Makefile) | |
6359 CPP_MAKEFILE(-DUSE_GNU_MAKE,GNUmakefile) | |
3092 | 6360 if test -r ".gdbinit.in"; then |
6361 MAKE_JUNK_C(.gdbinit.in) | |
6362 CPP_MAKEFILE(,.gdbinit) | |
6363 fi | |
6364 if test -r ".dbxrc.in"; then | |
6365 MAKE_JUNK_C(.dbxrc.in) | |
6366 CPP_MAKEFILE(,.dbxrc) | |
6367 fi | |
2651 | 6368 if test -r "xemacs.def.in"; then |
6369 dnl #### We should be using MAKE_JUNK_C instead of the next two lines. | |
6370 dnl #### But the comments in xemacs.def.in need to be converted from C-style | |
6371 dnl #### to lines beginning with ##. | |
6372 rm -f junk.c | |
6373 cp xemacs.def.in junk.c | |
6374 CPP_MAKEFILE(,xemacs.def) | |
6375 fi | |
6376 rm -f junk.c | |
6377 ) | |
6378 done | |
6379 | |
6380 dnl Append AC_DEFINE information to lib-src/config.values | |
6381 dnl (AC_SUBST information is already there (see config.values.sh). | |
6382 sed < config.status >> lib-src/config.values \ | |
6383 -e '/{ac_dA}.*{ac_dB}.*{ac_dC}.*{ac_dD}$/!d' \ | |
6384 -e 's/\${ac_dA}\(.*\)\${ac_dB}.*\${ac_dC}\(.*\)\${ac_dD}/\1 \2/' \ | |
6385 -e 's/^\([[^ ]]*\) $/\1 ""/' \ | |
6386 -e 's/ 1$/ t/' | |
6387 | |
6388 ], | |
6389 [CPP="$CPP" | |
6390 MAKE_SUBDIR="$MAKE_SUBDIR" | |
6391 ])dnl | |
6392 | |
6393 AC_OUTPUT()dnl | |
6394 |