1 dnl This is an autoconf script.
2 dnl To rebuild the `configure' script from this, execute the command
4 dnl in the directory containing this script.
7 AC_CONFIG_HEADER(src/config.h)
9 bindir='${exec_prefix}/bin'
10 datadir='${prefix}/lib'
11 statedir='${prefix}/lib'
12 libdir='${exec_prefix}/lib'
13 mandir='${prefix}/man/man1'
14 infodir='${prefix}/info'
15 lispdir='${datadir}/emacs/${version}/lisp'
16 locallisppath='${datadir}/emacs/site-lisp'
17 lisppath='${locallisppath}:${lispdir}'
18 etcdir='${datadir}/emacs/${version}/etc'
19 lockdir='${statedir}/emacs/lock'
20 archlibdir='${libdir}/emacs/${version}/${configuration}'
21 docdir='${datadir}/emacs/${version}/etc'
24 [ --with-x10 Support the X Window System version 10])
26 [ --with-x Support the X Window System version 11])
28 [ --with-x11 Support the X Window System version 11])
29 AC_ARG_WITH(x-toolkit,
30 [ --with-x-toolkit=KIT Use an X toolkit (KIT = lucid or athena)],
31 [ case "${withval}" in
32 y | ye | yes ) val=athena ;;
34 l | lu | luc | luci | lucid ) val=lucid ;;
35 a | at | ath | athe | athena ) val=athena ;;
36 # These don't currently work.
37 # m | mo | mot | moti | motif ) val=motif ;;
38 # o | op | ope | open | open- | open-l | open-lo \
39 # | open-loo | open-look ) val=open-look ;;
41 [#] AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
42 [#]which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.])
43 AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
44 which is \`yes', \`no', \`lucid', or \`athena'.
45 Currently, \`yes', \`athena' and \`lucid' are synonyms.])
51 [ --with-gcc Use GCC to compile Emacs])
52 AC_ARG_ENABLE(in-place,
53 [ --enable-in-place Use libraries and data files directly out of the
55 AC_ARG_ENABLE(single-tree,
56 [ --enable-single-tree Create a directory tree at DIR which looks like:
57 .../DIR/bin/CONFIGNAME (emacs, etags, etc.)
58 .../DIR/bin/CONFIGNAME/etc (movemail, etc.)
59 .../DIR/common/lisp (emacs' lisp files)
60 .../DIR/common/site-lisp (local lisp files)
61 .../DIR/common/lib (DOC, TUTORIAL, etc.)
62 .../DIR/common/lock (lockfiles)])
64 #### Make srcdir absolute, if it isn't already. It's important to
65 #### avoid running the path through pwd unnecessary, since pwd can
66 #### give you automounter prefixes, which can go away.
70 ## We may be able to use the $PWD environment variable to make this
71 ## absolute. But sometimes PWD is inaccurate.
72 if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
76 srcdir="`(cd ${srcdir}; pwd)`"
79 * ) srcdir="`(cd ${srcdir}; pwd)`" ;;
82 #### Check if the source directory already has a configured system in it.
83 if test `pwd` != `(cd ${srcdir} && pwd)` \
84 && test -f "${srcdir}/src/config.h" ; then
85 AC_MSG_WARN([The directory tree \`${srcdir}' is being used
86 as a build directory right now; it has been configured in its own
87 right. To configure in another directory as well, you MUST
88 use GNU make. If you do not have GNU make, then you must
89 now do \`make distclean' in ${srcdir},
90 and then run $0 again.])
92 extrasub='/^VPATH[ ]*=/c\
101 #### Given the configuration name, set machfile and opsysfile to the
102 #### names of the m/*.h and s/*.h files we should use.
104 ### Canonicalize the configuration name.
111 ### If you add support for a new configuration, add code to this
112 ### switch statement to recognize your configuration name and select
113 ### the appropriate operating system and machine description files.
115 ### You would hope that you could choose an m/*.h file pretty much
116 ### based on the machine portion of the configuration name, and an s-
117 ### file based on the operating system portion. However, it turns out
118 ### that each m/*.h file is pretty manufacturer-specific - for
119 ### example, apollo.h, hp9000s300.h, mega68k, news.h, and tad68k are
120 ### all 68000 machines; mips.h, pmax.h, and news-risc are all MIPS
121 ### machines. So we basically have to have a special case for each
122 ### configuration name.
124 ### As far as handling version numbers on operating systems is
125 ### concerned, make sure things will fail in a fixable way. If
126 ### /etc/MACHINES doesn't say anything about version numbers, be
127 ### prepared to handle anything reasonably. If version numbers
128 ### matter, be sure /etc/MACHINES says something about it.
130 ### Eric Raymond says we should accept strings like "sysvr4" to mean
131 ### "System V Release 4"; he writes, "The old convention encouraged
132 ### confusion between `system' and `release' levels'."
134 machine='' opsys='' unported=no
135 case "${canonical}" in
140 case "${canonical}" in
141 i[345]86-*-netbsd*) machine=intel386 ;;
143 # This is somewhat bogus.
144 machine=hp9000s300 ;;
145 mips-*-netbsd*) machine=pmax ;;
146 ns32k-*-netbsd*) machine=ns32000 ;;
147 sparc-*-netbsd*) machine=sparc ;;
152 ## Strictly speaking, we need the version of the alliant operating
153 ## system to choose the right machine file, but currently the
154 ## configuration name doesn't tell us enough to choose the right
155 ## one; we need to give alliants their own operating system name to
156 ## do this right. When someone cares, they can help us.
158 machine=alliant4 opsys=bsd4-2
161 machine=alliant-2800 opsys=bsd4-3
166 machine=altos opsys=usg5-2
171 machine=amdahl opsys=usg5-2-2
174 ## Appallings - I mean, Apollos - running Domain
176 machine=apollo opsys=bsd4-2
179 ## AT&T 3b2, 3b5, 3b15, 3b20
181 machine=att3b opsys=usg5-2-2
184 ## AT&T 3b1 - The Mighty Unix PC!
186 machine=7300 opsys=usg5-2-2
191 machine=ibmrs6000 opsys=aix3-2
196 machine=dpx2 opsys=usg5-3
201 machine=sps7 opsys=usg5-2
204 ## CCI 5/32, 6/32 -- see "Tahoe".
207 ## I don't know what configuration name to use for this; config.sub
208 ## doesn't seem to know anything about it. Hey, Celerity users, get
210 celerity-celerity-bsd* )
211 machine=celerity opsys=bsd4-2
215 ## What operating systems does this chip run that Emacs has been
219 ## We'll use the catch-all code at the bottom to guess the
224 *-convex-bsd* | *-convex-convexos* )
225 machine=convex opsys=bsd4-3
226 ## Prevents suprious white space in makefiles - d.m.cooke@larc.nasa.gov
227 NON_GNU_CPP="cc -E -P"
231 i[345]86-cubix-sysv* )
232 machine=intel386 opsys=usg5-3
236 cydra*-cydrome-sysv* )
237 machine=cydra5 opsys=usg5-3
240 ## Data General AViiON Machines
241 m88k-dg-dgux5.4R3* | m88k-dg-dgux5.4.3* )
242 machine=aviion opsys=dgux5-4r3
244 m88k-dg-dgux5.4R2* | m88k-dg-dgux5.4.2* )
245 machine=aviion opsys=dgux5-4r2
248 machine=aviion opsys=dgux
252 mips-dec-ultrix[0-3].* | mips-dec-ultrix4.0* | mips-dec-bsd4.2* )
253 machine=pmax opsys=bsd4-2
255 mips-dec-ultrix* | mips-dec-bsd* )
256 machine=pmax opsys=bsd4-3
259 machine=pmax opsys=osf1
262 ## Motorola Delta machines
263 m68k-motorola-sysv* | m68000-motorola-sysv* )
264 machine=delta opsys=usg5-3
265 if test -z "`type gnucc | grep 'not found'`"
268 if test -z "`type gcc | grep 'not found'`"
274 m88k-motorola-sysv4* )
275 machine=delta88k opsys=usg5-4
277 m88k-motorola-sysv* | m88k-motorola-m88kbcs* )
278 machine=delta88k opsys=usg5-3
283 machine=dual opsys=usg5-2
286 machine=dual opsys=unipl5-2
291 machine=elxsi opsys=usg5-2
296 machine=ns16000 opsys=umax
299 ## The GEC 93 - apparently, this port isn't really finished yet.
301 ## Gould Power Node and NP1
303 machine=gould opsys=bsd4-2
306 machine=gould opsys=bsd4-3
309 machine=gould-np1 opsys=bsd4-3
312 ## Harris Night Hawk machines running CX/UX (a 5000 looks just like a 4000
313 ## as far as Emacs is concerned).
315 # Build needs to be different on 7.0 and later releases
317 [56].[0-9] ) machine=nh4000 opsys=cxux ;;
318 [7].[0-9] ) machine=nh4000 opsys=cxux7 ;;
321 ## Harris ecx or gcx running CX/UX (Series 1200, Series 3000)
323 machine=nh3000 opsys=cxux
327 xps*-honeywell-sysv* )
328 machine=xps100 opsys=usg5-2
331 ## HP 9000 series 200 or 300
333 machine=hp9000s300 opsys=bsd4-3
335 ## HP/UX 7, 8 and 9 are supported on these machines.
338 ## Someone's system reports A.B8.05 for this.
339 ## I wonder what other possibilities there are.
340 *.B8.* ) machine=hp9000s300 opsys=hpux8 ;;
341 *.08.* ) machine=hp9000s300 opsys=hpux8 ;;
342 *.09.* ) machine=hp9000s300 opsys=hpux9 ;;
343 *) machine=hp9000s300 opsys=hpux ;;
347 ## HP 9000 series 700 and 800, running HP/UX
349 machine=hp800 opsys=hpux
352 machine=hp800 opsys=hpux8
355 machine=hp800 opsys=hpux9shr
358 machine=hp800 opsys=hpux9
361 ## HP 9000 series 700 and 800, running HP/UX
363 ## Cross-compilation? Nah!
365 ## Someone's system reports A.B8.05 for this.
366 ## I wonder what other possibilities there are.
367 *.B8.* ) machine=hp800 opsys=hpux8 ;;
368 *.08.* ) machine=hp800 opsys=hpux8 ;;
369 *.09.* ) machine=hp800 opsys=hpux9 ;;
370 *) machine=hp800 opsys=hpux ;;
376 machine=orion opsys=bsd4-2
379 machine=orion105 opsys=bsd4-2
383 i[345]86-ibm-aix1.1* )
384 machine=ibmps2-aix opsys=usg5-2-2
386 i[345]86-ibm-aix1.[23]* | i[345]86-ibm-aix* )
387 machine=ibmps2-aix opsys=usg5-3
390 machine=ibm370aix opsys=usg5-3
393 machine=ibmrs6000 opsys=aix3-1
396 machine=ibmrs6000 opsys=aix3-2-5
398 rs6000-ibm-aix3.2* | rs6000-ibm-aix* )
399 machine=ibmrs6000 opsys=aix3-2
402 machine=ibmrt opsys=bsd4-3
405 machine=ibmrt opsys=bsd4-2
408 machine=ibmrt opsys=bsd4-3
411 machine=ibmrt opsys=bsd4-2
414 machine=ibmrt opsys=bsd4-3
417 machine=ibmrt opsys=bsd4-3
420 machine=ibmrt-aix opsys=usg5-2-2
423 ## Integrated Solutions `Optimum V'
425 machine=isi-ov opsys=bsd4-2
428 machine=isi-ov opsys=bsd4-3
431 ## Intel 386 machines where we do care about the manufacturer
432 i[345]86-intsys-sysv* )
433 machine=is386 opsys=usg5-2-2
437 i[345]86-prime-sysv* )
438 machine=i386 opsys=usg5-3
442 i[345]86-sequent-bsd* )
443 machine=symmetry opsys=bsd4-3
446 ## Unspecified sysv on an ncr machine defaults to svr4.2.
447 ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
449 machine=intel386 opsys=usg5-4-2
454 machine=i860 opsys=usg5-4
455 NON_GNU_CC="/bin/cc" # Ie, not the one in /usr/ucb/cc.
456 NON_GNU_CPP="/usr/ccs/lib/cpp" # cc -E tokenizes macro expansion.
461 machine=masscomp opsys=rtu
466 machine=mega68 opsys=bsd4-2
469 ## Workstations sold by MIPS
470 ## This is not necessarily all workstations using the MIPS processor -
471 ## Irises are produced by SGI, and DECstations by DEC.
473 ## etc/MACHINES lists mips.h and mips4.h as possible machine files,
474 ## and usg5-2-2 and bsd4-3 as possible OS files. The only guidance
475 ## it gives for choosing between the alternatives seems to be "Use
476 ## -machine=mips4 for RISCOS version 4; use -opsystem=bsd4-3 with
477 ## the BSD world." I'll assume that these are instructions for
478 ## handling two odd situations, and that every other situation
479 ## should use mips.h and usg5-2-2, they being listed first.
482 ## Fall through to the general code at the bottom to decide on the OS.
485 machine=mips4 opsys=bsd4-3
486 NON_GNU_CC="cc -systype bsd43"
487 NON_GNU_CPP="cc -systype bsd43 -E"
490 machine=mips opsys=bsd4-3
493 machine=mips opsys=usg5-2-2
497 m68*-next-* | i[345]86-next-* )
498 machine=next opsys=mach2
501 ## The complete machine from National Semiconductor
503 machine=ns32000 opsys=usg5-2
507 m68*-ncr-sysv2* | m68*-ncr-sysvr2* )
508 machine=tower32 opsys=usg5-2-2
510 m68*-ncr-sysv3* | m68*-ncr-sysvr3* )
511 machine=tower32v3 opsys=usg5-3
516 machine=targon31 opsys=usg5-2-2
521 machine=nu opsys=usg5-2
526 machine=plexus opsys=usg5-2
530 ## I don't really have any idea what sort of processor the Pyramid has,
531 ## so I'm assuming it is its own architecture.
532 pyramid-pyramid-bsd* )
533 machine=pyramid opsys=bsd4-2
537 ns32k-sequent-bsd4.2* )
538 machine=sequent opsys=bsd4-2
540 ns32k-sequent-bsd4.3* )
541 machine=sequent opsys=bsd4-3
546 machine=mips-siemens opsys=usg5-4
547 NON_GNU_CC=/usr/ccs/bin/cc
548 NON_GNU_CPP=/usr/ccs/lib/cpp
551 ## Silicon Graphics machines
552 ## Iris 2500 and Iris 2500 Turbo (aka the Iris 3030)
554 machine=irist opsys=iris3-5
556 m68*-sgi-iris3.6* | m68*-sgi-iris*)
557 machine=irist opsys=iris3-6
561 machine=iris4d opsys=irix3-3
564 machine=iris4d opsys=irix5-0
566 mips-sgi-irix4* | mips-sgi-irix* )
567 machine=iris4d opsys=irix4-0
572 machine=news opsys=bsd4-2
575 machine=news opsys=bsd4-3
578 machine=news opsys=bsd4-3
580 mips-sony-bsd* | mips-sony-newsos4* )
581 machine=news-risc opsys=bsd4-3
584 machine=news-risc opsys=newsos5
589 machine=stride opsys=usg5-2
593 *-sun-sunos* | *-sun-bsd* | *-sun-solaris* | i[345]86-*-solaris2* | i[345]86-*-sunos5* )
594 case "${canonical}" in
595 m68*-sunos1* ) machine=sun1 ;;
596 m68*-sunos2* ) machine=sun2 ;;
597 m68* ) machine=sun3 ;;
598 i[345]86-sun-sunos[34]* ) machine=sun386 ;;
599 i[345]86-*-* ) machine=intel386 ;;
600 sparc* ) machine=sparc ;;
603 case "${canonical}" in
604 ## The Sun386 didn't get past 4.0.
605 i[345]86-*-sunos4 ) opsys=sunos4-0 ;;
606 *-sunos4.0* ) opsys=sunos4-0 ;;
607 *-sunos4.1.3* ) opsys=sunos4-1-3
608 NON_GCC_TEST_OPTIONS=-Bstatic
609 GCC_TEST_OPTIONS=-static
611 *-sunos4shr* ) opsys=sunos4shr ;;
612 *-sunos4* | *-sunos ) opsys=sunos4-1
613 NON_GCC_TEST_OPTIONS=-Bstatic
614 GCC_TEST_OPTIONS=-static
616 *-sunos5.3* | *-solaris2.3* )
618 NON_GNU_CPP=/usr/ccs/lib/cpp
620 *-sunos5.4* | *-solaris2.4* )
622 NON_GNU_CPP=/usr/ccs/lib/cpp
624 *-sunos5* | *-solaris* )
626 NON_GNU_CPP=/usr/ccs/lib/cpp
634 machine=tad68k opsys=usg5-3
638 tahoe-tahoe-bsd4.2* )
639 machine=tahoe opsys=bsd4-2
641 tahoe-tahoe-bsd4.3* )
642 machine=tahoe opsys=bsd4-3
645 ## Tandem Integrity S2
647 machine=tandem-s2 opsys=usg5-3
651 m88k-tektronix-sysv3* )
652 machine=tekxd88 opsys=usg5-3
655 ## Tektronix 16000 box (6130?)
656 ns16k-tektronix-bsd* )
657 machine=ns16000 opsys=bsd4-2
660 ## src/m/tek4300.h hints that this is a m68k machine.
661 m68*-tektronix-bsd* )
662 machine=tek4300 opsys=bsd4-3
666 ## We seem to have lost the machine-description file titan.h!
668 machine=titan opsys=usg5-3
671 ## Ustation E30 (SS5E)
672 m68*-unisys-uniplus* )
673 machine=ustation opsystem=unipl5-2
679 case "${canonical}" in
680 *-bsd4.1* ) opsys=bsd4-1 ;;
681 *-bsd4.2* | *-ultrix[0-3].* | *-ultrix4.0* ) opsys=bsd4-2 ;;
682 *-bsd4.3* | *-ultrix* ) opsys=bsd4-3 ;;
683 *-bsd386* | *-bsdi* ) opsys=bsd386 ;;
684 *-sysv[01]* | *-sysvr[01]* ) opsys=usg5-0 ;;
685 *-sysv2* | *-sysvr2* ) opsys=usg5-2 ;;
686 *-vms* ) opsys=vms ;;
692 ns16k-whitechapel-* )
694 ## We don't know what sort of OS runs on these; we'll let the
695 ## operating system guessing code below try.
700 machine=wicat opsys=usg5-2
703 ## Intel 386 machines where we don't care about the manufacturer
706 case "${canonical}" in
707 *-isc1.* | *-isc2.[01]* ) opsys=386-ix ;;
708 *-isc2.2* ) opsys=isc2-2 ;;
709 *-isc4.0* ) opsys=isc4-0 ;;
710 *-isc* ) opsys=isc3-0 ;;
711 *-esix5* ) opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
712 *-esix* ) opsys=esix ;;
713 *-xenix* ) opsys=xenix ;;
714 *-linux* ) opsys=linux ;;
715 *-sco3.2v4* ) opsys=sco4 ; NON_GNU_CPP=/lib/cpp ;;
716 *-bsd386* | *-bsdi* ) opsys=bsd386 ;;
717 *-386bsd* ) opsys=386bsd ;;
718 *-freebsd* ) opsys=freebsd ;;
719 *-nextstep* ) opsys=mach2 ;;
720 ## Otherwise, we'll fall through to the generic opsys code at the bottom.
729 ### If the code above didn't choose an operating system, just choose
730 ### an operating system based on the configuration name. You really
731 ### only want to use this when you have no idea what the right
732 ### operating system is; if you know what operating systems a machine
733 ### runs, it's cleaner to make it explicit in the case statement
735 if test x"${opsys}" = x; then
736 case "${canonical}" in
737 *-gnu* ) opsys=gnu ;;
738 *-bsd4.[01] ) opsys=bsd4-1 ;;
739 *-bsd4.2 ) opsys=bsd4-2 ;;
740 *-bsd4.3 ) opsys=bsd4-3 ;;
741 *-sysv0 | *-sysvr0 ) opsys=usg5-0 ;;
742 *-sysv2 | *-sysvr2 ) opsys=usg5-2 ;;
743 *-sysv2.2 | *-sysvr2.2 ) opsys=usg5-2-2 ;;
744 *-sysv3 | *-sysvr3 ) opsys=usg5-3 ;;
745 *-sysv4 | *-sysvr4 ) opsys=usg5-4 ;;
746 *-sysv4.1 | *-sysvr4.1 )
747 NON_GNU_CPP=/usr/lib/cpp
749 *-sysv4.2 | *-sysvr4.2 ) opsys=usg5-4-2 ;;
758 if test $unported = yes; then
759 AC_MSG_ERROR([Emacs hasn't been ported to \`${canonical}' systems.
760 Check \`etc/MACHINES' for recognized configuration names.])
763 machfile="m/${machine}.h"
764 opsysfile="s/${opsys}.h"
767 #### Choose a compiler.
768 test -n "$CC" && cc_specified=yes
771 "yes" ) CC="gcc" GCC=yes ;;
772 "no" ) test -z "$CC" && CC=cc ;;
776 # On Suns, sometimes $CPP names a directory.
777 if test -n "$CPP" && test -d "$CPP"; then
781 #### Some systems specify a CPP to use unless we are using GCC.
782 #### Now that we know whether we are using GCC, we can decide whether
783 #### to use that one.
784 if test "x$NON_GNU_CPP" != x && test x$GCC != xyes && test "x$CPP" = x
789 #### Some systems specify a CC to use unless we are using GCC.
790 #### Now that we know whether we are using GCC, we can decide whether
791 #### to use that one.
792 if test "x$NON_GNU_CC" != x && test x$GCC != xyes &&
793 test x$cc_specified != xyes
798 if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x
800 CC="$CC $GCC_TEST_OPTIONS"
803 if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x
805 CC="$CC $NON_GCC_TEST_OPTIONS"
808 #### Some other nice autoconf tests. If you add a test here which
809 #### should make an entry in src/config.h, don't forget to add an
810 #### #undef clause to src/config.h.in for autoconf to modify.
812 dnl checks for programs
818 dnl checks for header files
819 AC_HAVE_HEADERS(sys/timeb.h sys/time.h unistd.h)
821 AC_TIME_WITH_SYS_TIME
822 AC_SYS_SIGLIST_DECLARED
824 dnl checks for typedefs
827 dnl checks for structure members
831 dnl checks for compiler characteristics
834 dnl check for Make feature
837 dnl checks for operating system services
840 dnl other checks for UNIX variants
842 #### Choose a window system.
843 AC_MSG_CHECKING(for specified window system)
847 yes ) window_system=${window_system}x11 ;;
848 no ) window_system=${window_system}none ;;
851 case "${window_system}" in
854 case "${with_x11}" in
855 yes ) window_system=x11 ;;
856 no ) window_system=none ;;
858 case "${with_x10}" in
859 yes ) window_system=x10 ;;
860 no ) window_system=none ;;
864 case "${window_system}" in
865 "none" | "x11" | "x10" ) ;;
867 # --x-includes or --x-libraries implies --with-x11.
868 if test "${x_includes}" != NONE || test "${x_libraries}" != NONE; then
871 # If the user didn't specify a window system and we found X11, use it.
872 if test -r /usr/lib/libX11.a \
873 -o -d /usr/include/X11 \
874 -o -d /usr/X386/include \
875 -o -d ${x_includes}/X11 ; then
881 AC_MSG_ERROR(Don't specify a window system more than once.)
885 AC_MSG_RESULT(${window_system})
887 case "${window_system}" in
889 ### If the user hasn't specified where we should find X, try
890 ### letting Autoconf figure that out.
891 if test "${x_includes}" = NONE && test "${x_libraries}" = NONE; then
894 if test "${x_includes}" != NONE || test "${x_libraries}" != NONE; then
900 test -z "${window_system}" && window_system=none
902 test "${x_libraries}" != NONE && LD_SWITCH_X_SITE="-L${x_libraries}"
903 test "${x_libraries}" != NONE && LD_SWITCH_X_SITE_AUX="-R${x_libraries}"
904 test "${x_includes}" != NONE && C_SWITCH_X_SITE="-I${x_includes}"
906 # Avoid forcing the search of /usr/include before fixed include files.
907 if test "$C_SWITCH_X_SITE" = "-I/usr/include"; then
911 case "${window_system}" in
915 case "${with_x_toolkit}" in
916 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
917 motif ) USE_X_TOOLKIT=MOTIF ;;
918 open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
919 * ) USE_X_TOOLKIT=none ;;
933 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
935 ### If we're using X11, we should use the X menu package.
938 yes ) HAVE_X_MENU=yes ;;
941 #### Extract some information from the operating system and machine files.
943 AC_CHECKING([the machine- and system-dependent files to find out
944 - which libraries the lib-src programs will want, and
945 - whether the GNU malloc routines are usable])
947 ### First figure out CFLAGS (which we use for running the compiler here)
948 ### and REAL_CFLAGS (which we use for real compilation).
949 ### The two are the same except on a few systems, where they are made
950 ### different to work around various lossages. For example,
951 ### GCC 2.5 on Linux needs them to be different because it treats -g
952 ### as implying static linking.
954 ### If the CFLAGS env var is specified, we use that value
955 ### instead of the default.
957 ### It's not important that this name contain the PID; you can't run
958 ### two configures in the same directory and have anything work
960 tempcname="conftest.c"
963 #include "'${srcdir}'/src/'${opsysfile}'"
964 #include "'${srcdir}'/src/'${machfile}'"
971 #ifndef C_SWITCH_SYSTEM
972 #define C_SWITCH_SYSTEM
974 #ifndef C_SWITCH_MACHINE
975 #define C_SWITCH_MACHINE
977 configure___ libsrc_libs=LIBS_MACHINE LIBS_SYSTEM
978 configure___ c_switch_system=C_SWITCH_SYSTEM
979 configure___ c_switch_machine=C_SWITCH_MACHINE
982 #define LIB_X11_LIB -lX11
985 #ifndef LIBX11_MACHINE
986 #define LIBX11_MACHINE
989 #ifndef LIBX11_SYSTEM
990 #define LIBX11_SYSTEM
992 configure___ LIBX=LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
995 configure___ unexec=UNEXEC
997 configure___ unexec=unexec.o
1000 #ifdef SYSTEM_MALLOC
1001 configure___ system_malloc=yes
1003 configure___ system_malloc=no
1006 #ifndef C_DEBUG_SWITCH
1007 #define C_DEBUG_SWITCH -g
1010 #ifndef C_OPTIMIZE_SWITCH
1011 #define C_OPTIMIZE_SWITCH -O
1014 #ifdef THIS_IS_CONFIGURE
1016 /* Get the CFLAGS for tests in configure. */
1018 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
1020 configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
1023 #else /* not THIS_IS_CONFIGURE */
1025 /* Get the CFLAGS for real compilation. */
1027 configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
1029 configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
1032 #endif /* not THIS_IS_CONFIGURE */
1035 # The value of CPP is a quoted variable reference, so we need to do this
1036 # to get its actual value...
1037 CPP=`eval "echo $CPP"`
1039 eval `${CPP} -Isrc ${tempcname} \
1040 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1041 if test "x$CFLAGS" = x; then
1042 eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
1043 | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'`
1045 REAL_CFLAGS="$CFLAGS"
1047 changequote([, ])dnl
1050 ### Compute the unexec source name from the object name.
1051 UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
1053 # Do the opsystem or machine files prohibit the use of the GNU malloc?
1054 # Assume not, until told otherwise.
1056 if test "${system_malloc}" = "yes"; then
1059 (The GNU allocators don't work with this system configuration.)"
1062 if test x"${REL_ALLOC}" = x; then
1063 REL_ALLOC=${GNU_MALLOC}
1069 #### Add the libraries to LIBS and check for some functions.
1071 CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
1074 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
1075 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
1076 AC_CHECK_LIB(dnet, dnet_ntoa)
1077 dnl This causes -lresolv to get used in subsequent tests,
1078 dnl which causes failures on some systems such as HPUX 9.
1079 dnl AC_CHECK_LIB(resolv, gethostbyname)
1081 dnl FIXME replace main with a function we actually want from this library.
1082 AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
1084 AC_MSG_CHECKING(for XFree86)
1085 if test -d /usr/X386/include; then
1088 test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include"
1093 # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
1094 # for the tests that follow.
1096 if test "${HAVE_X11}" = "yes"; then
1097 DEFS="$C_SWITCH_X_SITE $DEFS"
1098 LIBS="$LD_SWITCH_X_SITE $LIBX $LIBS"
1099 CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
1100 AC_HAVE_FUNCS(XrmSetDatabase XScreenResourceString \
1101 XScreenNumberOfScreen XSetWMProtocols)
1104 if test "${USE_X_TOOLKIT}" != "none"; then
1105 AC_MSG_CHECKING(X11 toolkit version)
1106 AC_COMPILE_CHECK(, [#include <X11/Intrinsic.h>],
1107 [#if XtSpecificationRelease < 6
1110 ], [AC_MSG_RESULT(6)
1111 AC_DEFINE(HAVE_X11XTR6)],
1112 [AC_MSG_RESULT(not 6)])
1115 # If netdb.h doesn't declare h_errno, we must declare it by hand.
1116 AC_MSG_CHECKING(whether netdb declarares h_errno)
1117 AC_COMPILE_CHECK(, [#include <netdb.h>],
1123 ], [AC_MSG_RESULT(yes)
1124 AC_DEFINE(HAVE_H_ERRNO)],
1125 [AC_MSG_RESULT(no)])
1129 # logb and frexp are found in -lm on most systems.
1130 AC_CHECK_LIB(m, logb)
1131 AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
1132 random rand48 bcopy bcmp logb frexp fmod drem ftime res_init setsid strerror \
1136 AC_FUNC_CHECK(socket, , ok_so_far=no)
1137 if test $ok_so_far = yes; then
1138 AC_HEADER_CHECK(netinet/in.h, , ok_so_far=no)
1140 if test $ok_so_far = yes; then
1141 AC_HEADER_CHECK(arpa/inet.h, , ok_so_far=no)
1143 if test $ok_so_far = yes; then
1144 AC_DEFINE(HAVE_INET_SOCKETS)
1147 # Set up the CFLAGS for real compilation, so we can substitute it.
1148 CFLAGS="$REAL_CFLAGS"
1151 #### Find out which version of Emacs this is.
1152 version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
1153 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
1154 changequote([, ])dnl
1155 if test x"${version}" = x; then
1156 AC_MSG_ERROR(can't find current emacs version in \`${srcdir}/lisp/version.el'.)
1159 if test -f /usr/lpp/X11/bin/smt.exp; then
1160 AC_DEFINE(HAVE_AIX_SMT_EXP)
1163 ### Specify what sort of things we'll be editing into Makefile and config.h.
1164 ### Use configuration here uncanonicalized to avoid exceeding size limits.
1166 AC_SUBST(configuration)
1169 AC_SUBST(exec_prefix)
1177 AC_SUBST(locallisppath)
1181 AC_SUBST(archlibdir)
1183 AC_SUBST(c_switch_system)
1184 AC_SUBST(c_switch_machine)
1185 AC_SUBST(LD_SWITCH_X_SITE)
1186 AC_SUBST(LD_SWITCH_X_SITE_AUX)
1187 AC_SUBST(C_SWITCH_X_SITE)
1189 AC_SUBST(X_TOOLKIT_TYPE)
1193 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${configuration}")
1194 AC_DEFINE_UNQUOTED(config_machfile, "${machfile}")
1195 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}")
1196 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
1197 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE_AUX, ${LD_SWITCH_X_SITE_AUX})
1198 AC_DEFINE_UNQUOTED(C_SWITCH_X_SITE, ${C_SWITCH_X_SITE})
1199 AC_DEFINE_UNQUOTED(UNEXEC_SRC, ${UNEXEC_SRC})
1201 if test "${HAVE_X_WINDOWS}" = "yes" ; then
1202 AC_DEFINE(HAVE_X_WINDOWS)
1204 if test "${USE_X_TOOLKIT}" != "none" ; then
1205 AC_DEFINE(USE_X_TOOLKIT)
1207 if test "${HAVE_X11}" = "yes" ; then
1210 if test "${HAVE_XFREE386}" = "yes" ; then
1211 AC_DEFINE(HAVE_XFREE386)
1213 if test "${HAVE_X_MENU}" = "yes" ; then
1214 AC_DEFINE(HAVE_X_MENU)
1216 if test "${GNU_MALLOC}" = "yes" ; then
1217 AC_DEFINE(GNU_MALLOC)
1219 if test "${REL_ALLOC}" = "yes" ; then
1220 AC_DEFINE(REL_ALLOC)
1222 if test "${LISP_FLOAT_TYPE}" = "yes" ; then
1223 AC_DEFINE(LISP_FLOAT_TYPE)
1226 # ====================== Developer's configuration =======================
1228 # The following assignments make sense if you're running Emacs on a single
1229 # machine, one version at a time, and you want changes to the lisp and etc
1230 # directories in the source tree to show up immediately in your working
1231 # environment. It saves a great deal of disk space by not duplicating the
1232 # lisp and etc directories.
1234 if test "$enable_in_place" = "yes"; then
1235 lispdir='${srcdir}/lisp'
1236 locallisppath='${srcdir}/site-lisp'
1237 etcdir='${srcdir}/etc'
1238 lockdir='${srcdir}/lock'
1239 # We used to make archlibdir and docdir absolute,
1240 # but that caused trouble with automounters.
1241 archlibdir='${srcdir}/lib-src'
1242 docdir='${srcdir}/etc'
1243 infodir='${srcdir}/info'
1244 elif test "$enable_single_tree" = "yes"; then
1245 bindir='${exec_prefix}/bin/${configuration}'
1246 datadir='${prefix}/common'
1247 statedir='${prefix}/common'
1249 lispdir='${prefix}/common/lisp'
1250 locallisppath='${prefix}/common/site-lisp'
1251 lockdir='${prefix}/common/lock'
1252 archlibdir='${libdir}/etc'
1253 etcdir='${prefix}/common/data'
1254 docdir='${prefix}/common/data'
1257 #### Report on what we decided to do.
1260 Configured for \`${canonical}'.
1262 Where should the build process find the source code? ${srcdir}
1263 What operating system and machine description files should Emacs use?
1264 \`${opsysfile}' and \`${machfile}'
1265 What compiler should emacs be built with? ${CC} ${CFLAGS}
1266 Should Emacs use the GNU version of malloc? ${GNU_MALLOC}${GNU_MALLOC_reason}
1267 Should Emacs use the relocating allocator for buffers? ${REL_ALLOC}
1268 What window system should Emacs use? ${window_system}
1269 What toolkit should Emacs use? ${USE_X_TOOLKIT}${x_includes+
1270 Where do we find X Windows header files? }${x_includes}${x_libraries+
1271 Where do we find X Windows libraries? }${x_libraries}
1275 # Remove any trailing slashes in these variables.
1277 test "${prefix}" != NONE &&
1278 prefix=`echo "${prefix}" | sed 's,\([^/]\)/*$,\1,'`
1279 test "${exec_prefix}" != NONE &&
1280 exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
1281 changequote([, ])dnl
1283 save_no_create="$no_create"
1286 AC_OUTPUT(Makefile lib-src/Makefile.in oldXMenu/Makefile lwlib/Makefile src/Makefile.in)
1288 cat >> ${CONFIG_STATUS} <<EOF
1289 CPP="$CPP" CPPFLAGS="$CPPFLAGS"
1292 cat >> ${CONFIG_STATUS} <<\EOF
1294 ### Make the necessary directories, if they don't exist.
1295 for dir in ./src ./lib-src ./cpp ./oldXMenu ./lwlib ./etc ; do
1296 if test ! -d ${dir}; then
1301 # Build src/Makefile from ${srcdir}/src/Makefile.in. This must be done
1302 # after src/config.h is built, since we rely on that file.
1304 changequote(,)dnl The horror, the horror.
1305 # Now get this: Some word that is part of the ${srcdir} directory name
1306 # or the ${configuration} value might, just might, happen to be an
1307 # identifier like `sun4' or `i386' or something, and be predefined by
1308 # the C preprocessor to some helpful value like 1, or maybe the empty
1309 # string. Needless to say consequent macro substitutions are less
1310 # than conducive to the makefile finding the correct directory.
1311 undefs="`echo $top_srcdir $configuration $canonical |
1312 sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \
1313 -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g' \
1317 echo creating lib-src/Makefile
1319 rm -f junk.c junk1.c junk2.c
1320 sed -e '/start of cpp stuff/q' \
1321 < Makefile.in > junk1.c
1322 sed -e '1,/start of cpp stuff/d'\
1323 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
1324 < Makefile.in > junk.c
1325 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
1326 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
1327 cat junk1.c junk2.c > Makefile.new
1328 rm -f junk.c junk1.c junk2.c
1329 chmod 444 Makefile.new
1330 mv -f Makefile.new Makefile
1333 echo creating src/Makefile
1335 rm -f junk.c junk1.c junk2.c
1336 sed -e '/start of cpp stuff/q' \
1337 < Makefile.in > junk1.c
1338 sed -e '1,/start of cpp stuff/d'\
1339 -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
1340 < Makefile.in > junk.c
1341 $CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
1342 sed -e 's/^ / /' -e '/^#/d' -e '/^[
\f]*$/d' > junk2.c
1343 cat junk1.c junk2.c > Makefile.new
1344 rm -f junk.c junk1.c junk2.c
1345 chmod 444 Makefile.new
1346 mv -f Makefile.new Makefile
1350 test "$save_no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS}