Mercurial > emacs
comparison configure1.in @ 617:cde1f15848c6
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sun, 19 Apr 1992 08:53:55 +0000 |
parents | 5f36058e31f9 |
children | eca8812e61cd |
comparison
equal
deleted
inserted
replaced
616:3c1ffcac443f | 617:cde1f15848c6 |
---|---|
18 #along with GNU Emacs; see the file COPYING. If not, write to | 18 #along with GNU Emacs; see the file COPYING. If not, write to |
19 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 19 #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | 20 |
21 # Shell script to edit files and make symlinks in preparation for | 21 # Shell script to edit files and make symlinks in preparation for |
22 # compiling Emacs. | 22 # compiling Emacs. |
23 # | 23 # |
24 # Usage: configure machine | 24 # Usage: configure machine |
25 # | 25 # |
26 # If configure succeeds, it leaves its status in config.status. | 26 # If configure succeeds, it leaves its status in config.status. |
27 # If configure fails after disturbing the status quo, | 27 # If configure fails after disturbing the status quo, |
28 # config.status is removed. | 28 # config.status is removed. |
29 # | 29 # |
30 | 30 |
31 progname=$0 | 31 progname=$0 |
32 | 32 |
93 libdir="" | 93 libdir="" |
94 lockdir="" | 94 lockdir="" |
95 window_system="" | 95 window_system="" |
96 have_x_menu="" | 96 have_x_menu="" |
97 | 97 |
98 # This must be the only option on the line, and it can't be abbreviated. | 98 echo "Examining options." |
99 # This keeps it from interfering with the other, documented options. | |
100 if [ "$*" = "+distribute" ]; then | |
101 libroot=/usr/local/lib/emacs | |
102 machine=hp300bsd | |
103 opsystem=bsd4-3 | |
104 shift | |
105 fi | |
106 | |
107 echo "Examining options..." | |
108 for arg in $*; do | 99 for arg in $*; do |
109 case "${arg}" in | 100 case "${arg}" in |
110 -*) | 101 -*) |
111 # Separate the switch name from the value it's being given. | 102 # Separate the switch name from the value it's being given. |
112 case "${arg}" in | 103 case "${arg}" in |
188 (echo "You must specify a machine name as an argument to ${progname}." | 179 (echo "You must specify a machine name as an argument to ${progname}." |
189 echo "${short_usage}") | more | 180 echo "${short_usage}") | more |
190 exit 1 | 181 exit 1 |
191 fi | 182 fi |
192 | 183 |
193 echo "Checking machine..." | 184 echo "Checking the machine." |
194 machfile="m/${machine}.h" | 185 machfile="m/${machine}.h" |
195 if [ ! -r src/${machfile} ]; then | 186 if [ ! -r src/${machfile} ]; then |
196 echo "${progname}: Emacs has no configuration info for the machine called | 187 echo "${progname}: Emacs has no configuration info for the machine called |
197 \`${machine}'. Look at etc/MACHINES for the names of machines | 188 \`${machine}'. Look at etc/MACHINES for the names of machines |
198 that Emacs has been ported to." 1>&2 | 189 that Emacs has been ported to." 1>&2 |
199 exit 1 | 190 exit 1 |
200 fi | 191 fi |
201 | 192 |
202 echo "Checking operating system..." | 193 echo "Checking the operating system." |
203 if [ "${opsystem}" = "" ]; then | 194 if [ "${opsystem}" = "" ]; then |
204 | 195 |
205 echo " No operating system explicitly specified." | 196 echo " No operating system explicitly specified." |
206 echo " Guessing, based on machine..." | 197 echo " Guessing, based on machine." |
207 # Get the default operating system to go with the specified machine. | 198 # Get the default operating system to go with the specified machine. |
208 opsystem=`grep 'USUAL-OPSYS="' src/${machfile} \ | 199 opsystem=`grep 'USUAL-OPSYS="' src/${machfile} \ |
209 | sed 's/^.*USUAL-OPSYS="\([^"]*\)".*$/\1/'` | 200 | sed 's/^.*USUAL-OPSYS="\([^"]*\)".*$/\1/'` |
210 | 201 |
211 if [ "${opsystem}" = "" ]; then | 202 if [ "${opsystem}" = "" ]; then |
249 exit 1 | 240 exit 1 |
250 fi | 241 fi |
251 fi | 242 fi |
252 | 243 |
253 if [ "${libroot}" = "" ]; then | 244 if [ "${libroot}" = "" ]; then |
254 echo "Guessing library directory..." | 245 echo "Guessing library directory." |
255 libroot=`/bin/pwd` | 246 libroot=`/bin/pwd` |
256 fi | 247 fi |
257 | 248 |
258 echo "Checking window system..." | 249 echo "Checking window system." |
259 window_system="`echo ${window_system} | tr A-Z a-z`" | 250 window_system="`echo ${window_system} | tr A-Z a-z`" |
260 case "${window_system}" in | 251 case "${window_system}" in |
261 "none" | "x11" | "x10" ) ;; | 252 "none" | "x11" | "x10" ) ;; |
262 "x" ) window_system=x11 ;; | 253 "x" ) window_system=x11 ;; |
263 "" ) | 254 "" ) |
264 echo " No window system specifed. Looking for X Windows." | 255 echo " No window system specifed. Looking for X Windows." |
265 window_system=none | 256 window_system=none |
266 if [ -r /usr/lib/libX11.a -a -d /usr/include/X11 ]; then | 257 if [ -r /usr/lib/libX11.a -a -d /usr/include/X11 ]; then |
267 window_system=x11 | 258 window_system=x11 |
268 fi | 259 fi |
269 ;; | 260 ;; |
270 * ) | 261 * ) |
271 echo "The \`-window_system' option must be set to \`none' or \`X11'." 1>&2 | 262 echo "The \`-window_system' option must be set to \`none' or \`X11'." 1>&2 |
272 exit 1 | 263 exit 1 |
273 ;; | 264 ;; |
289 esac | 280 esac |
290 | 281 |
291 # What is the return type of a signal handler? We grep | 282 # What is the return type of a signal handler? We grep |
292 # /usr/include/signal.h for the declaration of the signal function. | 283 # /usr/include/signal.h for the declaration of the signal function. |
293 # Yuck. | 284 # Yuck. |
294 echo "Looking for return type of signal handler functions..." | 285 echo "Looking for return type of signal handler functions." |
295 if [ -r /usr/include/signal.h ]; then | 286 if [ -r /usr/include/signal.h ]; then |
296 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*(' | 287 sigpattern='[ ]*([ ]*\*[ ]*signal[ ]*(' |
297 sigtype=void | 288 sigtype=void |
298 if grep -s "int${sigpattern}" /usr/include/signal.h; then | 289 if grep -s "int${sigpattern}" /usr/include/signal.h; then |
299 sigtype=int | 290 sigtype=int |
300 fi | 291 fi |
301 fi | 292 fi |
302 | 293 |
303 | 294 |
304 # Do the opsystem or machine files prohibit the use of the GNU malloc? | |
305 echo "Checking to see if the GNU malloc routines are permissible..." | |
306 if (cd ./src;grep SYSTEM_MALLOC ${opsysfile} ${machfile} > /dev/null); then | |
307 gnu_malloc=no | |
308 gnu_malloc_reason=" | |
309 (The GNU allocators don't work with this machine and/or operating system.)" | |
310 fi | |
311 | |
312 rel_alloc=${gnu_malloc} | |
313 | |
314 if [ "${have_x_menu}" = "" ]; then | 295 if [ "${have_x_menu}" = "" ]; then |
315 have_x_menu=no | 296 have_x_menu=no |
316 fi | 297 fi |
317 | 298 |
318 if [ "${lisppath}" = "" ]; then | 299 if [ "${lisppath}" = "" ]; then |
319 lisppath=${libroot}/local-lisp:${libroot}/lisp | 300 lisppath='$(locallisppath):$(lispdir)' |
320 fi | 301 fi |
321 | 302 |
322 if [ "${datadir}" = "" ]; then | 303 if [ "${datadir}" = "" ]; then |
323 datadir=${libroot}/etc | 304 datadir='$(emacsdir)/etc' |
324 fi | 305 fi |
325 | 306 |
326 if [ "${libdir}" = "" ]; then | 307 if [ "${libdir}" = "" ]; then |
327 libdir=${libroot}/arch-lib | 308 libdir='$(emacsdir)/arch-lib' |
328 fi | 309 fi |
329 | 310 |
330 if [ "${lockdir}" = "" ]; then | 311 if [ "${lockdir}" = "" ]; then |
331 lockdir=${libroot}/lock | 312 lockdir='$(statedir)/lock' |
332 fi | 313 fi |
333 | 314 |
334 echo "Checking for GCC..." | 315 echo "Checking for GCC." |
335 case "${cc}" in | 316 case "${cc}" in |
336 "" ) | 317 "" ) |
337 temppath=`echo $PATH | sed 's/^:/.:/ | 318 temppath=`echo $PATH | sed 's/^:/.:/ |
338 s/::/:.:/g | 319 s/::/:.:/g |
339 s/:$/:./ | 320 s/:$/:./ |
350 case "${O},${g},${cc}" in | 331 case "${O},${g},${cc}" in |
351 ,,gcc ) O=yes; g=yes ;; | 332 ,,gcc ) O=yes; g=yes ;; |
352 ,,* ) O=yes; g=no ;; | 333 ,,* ) O=yes; g=no ;; |
353 esac | 334 esac |
354 | 335 |
355 echo "Guessing which libraries the lib-src programs will want," | 336 echo "Examining the machine- and system-dependent files to find out" |
356 echo " based on the machine- and system-dependent files..." | 337 echo " - which libraries the lib-src programs will want, and" |
338 echo " - whether the GNU malloc routines are usable." | |
339 tempcname="configure.tmp.$$.c" | |
357 echo '#include "src/'${machfile}'" | 340 echo '#include "src/'${machfile}'" |
358 #include "src/'${opsysfile}'" | 341 #include "src/'${opsysfile}'" |
359 #ifndef LIBS_MACHINE | 342 #ifndef LIBS_MACHINE |
360 #define LIBS_MACHINE | 343 #define LIBS_MACHINE |
361 #endif | 344 #endif |
362 #ifndef LIBS_SYSTEM | 345 #ifndef LIBS_SYSTEM |
363 #define LIBS_SYSTEM | 346 #define LIBS_SYSTEM |
364 #endif | 347 #endif |
365 libsrc_libs=LIBS_MACHINE LIBS_SYSTEM | 348 libsrc_libs=LIBS_MACHINE LIBS_SYSTEM |
366 ' > config-tmp-$$.c | 349 #ifdef SYSTEM_MALLOC |
367 eval `${cc} -E config-tmp-$$.c | grep 'libsrc_libs='` | 350 system_malloc=yes |
368 rm config-tmp-$$.c | 351 #else |
352 system_malloc=no | |
353 #endif | |
354 ' > ${tempcname} | |
355 eval `${cc} -E ${tempcname} | grep -v '^#' | grep -v '^[ ]*$'` | |
356 rm ${tempcname} | |
357 | |
358 # Do the opsystem or machine files prohibit the use of the GNU malloc? | |
359 if [ "${system_malloc}" = "yes" ]; then | |
360 gnu_malloc=no | |
361 gnu_malloc_reason=" | |
362 (The GNU allocators don't work with this machine and/or operating system.)" | |
363 fi | |
364 | |
365 if [ ! "${rel_alloc}" ]; then | |
366 rel_alloc=${gnu_malloc} | |
367 fi | |
369 | 368 |
370 rm -f config.status | 369 rm -f config.status |
371 set -e | 370 set -e |
372 | 371 |
373 # Make the proper settings in the config file. | 372 # Make the proper settings in the config file. |
374 echo "Making src/config.h from src/config.h-dist" | 373 echo "Making src/config.h from src/config.h.in" |
375 if [ "${highpri}" != "" ]; then | 374 if [ "${highpri}" != "" ]; then |
376 highpri="(-${highpri})" | 375 highpri="(-${highpri})" |
377 fi | 376 fi |
378 case "${g}" in | 377 case "${g}" in |
379 "yes" ) c_switch_site="${c_switch_site} -g" ;; | 378 "yes" ) c_switch_site="${c_switch_site} -g" ;; |
397 f="-e 's:.*#define ${cflagname}.*:#define ${cflagname} ${val}:'" | 396 f="-e 's:.*#define ${cflagname}.*:#define ${cflagname} ${val}:'" |
398 ;; | 397 ;; |
399 esac | 398 esac |
400 sed_flags="${sed_flags} ${f}" | 399 sed_flags="${sed_flags} ${f}" |
401 done | 400 done |
402 eval '/bin/sed '${sed_flags}' < src/config.h-dist > src/config.h' | 401 rm -f src/config.h |
402 eval '/bin/sed '${sed_flags}' < src/config.h.in > src/config.h' | |
403 # Remind people not to edit this. | |
404 chmod -w src/config.h | |
403 | 405 |
404 # Modify the parameters in the top makefile. | 406 # Modify the parameters in the top makefile. |
405 echo "Editing ./Makefile..." | 407 echo "Producing ./Makefile from ./Makefile.in." |
406 tempMakefile="tempMakefile"$$ | 408 rm -f ./Makefile |
407 /bin/sed < Makefile > ${tempMakefile} \ | 409 (echo "# This file is generated by \`${progname}' from \`./Makefile.in'. |
408 -e 's;^\(LIBROOT=\).*$;\1'"${libroot};" \ | 410 # If you are thinking about editing it, you should seriously consider |
409 -e 's;^\(BINDIR=\).*$;\1'"${bindir};" \ | 411 # editing \`./Makefile.in' itself, or running \`${progname}' instead." |
410 -e 's;^\(LISPPATH=\).*$;\1'"${lisppath};" \ | 412 /bin/sed < Makefile.in \ |
411 -e 's;^\(DATADIR=\).*$;\1'"${datadir};" \ | 413 -e '/^# DIST: /d' \ |
412 -e 's;^\(LOCKDIR=\).*$;\1'"${lockdir};" \ | 414 -e 's;^\(emacsdir=\).*$;\1'"${libroot};" \ |
413 -e 's;^\(LIBDIR=\).*$;\1'"${libdir};" | 415 -e 's;^\(bindir=\).*$;\1'"${bindir};" \ |
414 mv ${tempMakefile} Makefile | 416 -e 's;^\(lisppath=\).*$;\1'"${lisppath};" \ |
417 -e 's;^\(datadir=\).*$;\1'"${datadir};" \ | |
418 -e 's;^\(lockdir=\).*$;\1'"${lockdir};" \ | |
419 -e 's;^\(libdir=\).*$;\1'"${libdir};") > ./Makefile | |
420 # Remind people not to edit this. | |
421 chmod -w ./Makefile | |
415 | 422 |
416 # Modify the parameters in the `build-install' script. | 423 # Modify the parameters in the `build-install' script. |
417 echo "Editing ./build-install..." | 424 echo "Producing ./build-install from ./build-install.in." |
418 tempbi="tempbi"$$ | 425 rm -f ./build-install |
419 /bin/sed < build-install > ${tempbi} \ | 426 (echo "# This file is generated by \`${progname}' from \`./build-install.in'. |
420 -e 's;^\(LIBROOT=\).*$;\1'"${libroot};" \ | 427 # If you are thinking about editing it, you should seriously consider |
421 -e 's;^\(BINDIR=\).*$;\1'"${bindir};" \ | 428 # editing \`./build-install.in' itself, or running \`${progname}' instead." |
422 -e 's;^\(LISPPATH=\).*$;\1'"${lisppath};" \ | 429 /bin/sed < build-install.in \ |
423 -e 's;^\(DATADIR=\).*$;\1'"${datadir};" \ | 430 -e 's;^\(LIBROOT=\).*$;\1'"${libroot};" \ |
424 -e 's;^\(LOCKDIR=\).*$;\1'"${lockdir};" \ | 431 -e 's;^\(BINDIR=\).*$;\1'"${bindir};" \ |
425 -e 's;^\(LIBDIR=\).*$;\1'"${libdir};" | 432 -e 's;^\(LISPPATH=\).*$;\1'"${lisppath};" \ |
426 mv ${tempbi} build-install | 433 -e 's;^\(DATADIR=\).*$;\1'"${datadir};" \ |
427 chmod a+x build-install | 434 -e 's;^\(LOCKDIR=\).*$;\1'"${lockdir};" \ |
435 -e 's;^\(LIBDIR=\).*$;\1'"${libdir};") > ./build-install | |
436 # Remind people not to edit this. | |
437 chmod -w build-install | |
438 chmod +x build-install | |
428 | 439 |
429 # Modify the parameters in the src makefile. | 440 # Modify the parameters in the src makefile. |
430 echo "Editing src/Makefile..." | 441 echo "Producing src/Makefile from src/Makefile.in." |
431 tempMakefile="tempMakefile"$$ | 442 rm -f src/Makefile |
432 /bin/sed < src/Makefile > ${tempMakefile} \ | 443 (echo "# This file is generated by \`${progname}' from \`Makefile.in'. |
433 -e 's;^\(CC[ ]*=\).*$;\1'"${cc};" | 444 # If you are thinking about editing it, you should seriously consider |
434 mv ${tempMakefile} src/Makefile | 445 # editing \`Makefile.in' itself, or running \`${progname}' instead." |
446 /bin/sed < src/Makefile.in \ | |
447 -e 's;^\(CC[ ]*=\).*$;\1'"${cc};") > src/Makefile | |
448 # Remind people not to edit this. | |
449 chmod -w src/Makefile | |
435 | 450 |
436 # Modify the parameters in the lib-src makefile. | 451 # Modify the parameters in the lib-src makefile. |
437 echo "Editing lib-src/Makefile..." | 452 echo "Producing lib-src/Makefile from lib-src/Makefile.in." |
438 tempMakefile="tempMakefile"$$ | 453 rm -f lib-src/Makefile |
439 /bin/sed < lib-src/Makefile > ${tempMakefile} \ | 454 (echo "# This file is generated by \`${progname}' from \`Makefile.in'. |
440 -e 's;^\(CFLAGS=\).*$;\1'"${c_switch_site};" \ | 455 # If you are thinking about editing it, you should seriously consider |
441 -e 's;^\(LOADLIBES=\).*$;\1'"${libsrc_libs};" \ | 456 # editing \`Makefile.in' itself, or running \`${progname}' instead." |
442 -e 's;^\(CC=\).*$;\1'"${cc};" | 457 /bin/sed < lib-src/Makefile.in \ |
443 mv ${tempMakefile} lib-src/Makefile | 458 -e 's;^\(CFLAGS=\).*$;\1'"${c_switch_site};" \ |
459 -e 's;^\(LOADLIBES=\).*$;\1'"${libsrc_libs};" \ | |
460 -e 's;^\(CC=\).*$;\1'"${cc};") > lib-src/Makefile | |
461 # Remind people not to edit this. | |
462 chmod -w lib-src/Makefile | |
463 | |
444 | 464 |
445 # Create a verbal description of what we have done. | 465 # Create a verbal description of what we have done. |
446 message="# Configured for machine \`${machine}' running \`${opsystem}'. | 466 message="# Configured for machine \`${machine}' running \`${opsystem}'. |
447 # The following values have been set in ./Makefile and ./build-install: | 467 # The following values have been set in ./Makefile and ./build-install: |
448 # Executables will be placed in | 468 # Executables will be placed in |
474 # If you are thinking about editing it, you should seriously consider | 494 # If you are thinking about editing it, you should seriously consider |
475 # running \`${progname}' instead. | 495 # running \`${progname}' instead. |
476 " >> config.status | 496 " >> config.status |
477 echo "${message}" >> config.status | 497 echo "${message}" >> config.status |
478 echo "'${progname}' \\ | 498 echo "'${progname}' \\ |
479 -machine='${machine}' \\ | 499 -machine='${machine}' \\ |
480 -opsystem='${opsystem}' \\ | 500 -opsystem='${opsystem}' \\ |
481 -g=${g} \\ | 501 -g=${g} \\ |
482 -O=${O} \\ | 502 -O=${O} \\ |
483 -cc=${cc} \\ | 503 -cc=${cc} \\ |
484 -libdir='${libdir}' \\ | 504 -libdir='${libdir}' \\ |
486 -bindir='${bindir}' \\ | 506 -bindir='${bindir}' \\ |
487 -lisppath='${lisppath}' \\ | 507 -lisppath='${lisppath}' \\ |
488 -lockdir='${lockdir}' \\ | 508 -lockdir='${lockdir}' \\ |
489 -window_system='${window_system}' \\ | 509 -window_system='${window_system}' \\ |
490 -have_x_menu='${have_x_menu}' \\ | 510 -have_x_menu='${have_x_menu}' \\ |
491 -gnu_malloc='${gnu_malloc}' | 511 -gnu_malloc='${gnu_malloc}' \\ |
492 -rel_malloc='${rel_alloc}' \\ | 512 -rel_alloc='${rel_alloc}' \\ |
493 -highpri='${highpri}' \\ | 513 -highpri='${highpri}' \\ |
494 -lisp_float_type='${lisp_float_type}'" >> config.status | 514 -lisp_float_type='${lisp_float_type}'" >> config.status |
515 # Remind people not to edit this. | |
516 chmod -w config.status | |
495 chmod +x config.status | 517 chmod +x config.status |
496 | 518 |
497 # Print the description. | 519 # Print the description. |
498 echo | 520 echo |
499 echo "${message}" | sed -e 's/^# //' | 521 echo "${message}" | sed -e 's/^# //' |