comparison src/emacs.c @ 1303:f99d3d25df86

[xemacs-hg @ 2003-02-15 10:15:54 by ben] autoload fixes, make-doc speed improvements Makefile.in.in: Run update-elc-2 with -no-autoloads to avoid multiple autoload-loading problem. configure.usage: Document quick-build better. make-docfile.el: Use `message' (defined in this file) in place of `princ'/`print', and put in a terpri, so that we get correct newline behavior. Rewrite if-progn -> when and a few similar stylistic niceties. And the big change: Allow MS Windows to specify the object files directly and frob them into C files here (formerly this was done in xemacs.mak, and very slooooooooooooooooooowly). Due to line-length limitations in CMD, we need to use a "response file" to hold the arguments, so when we see a response file argument (preceded by an @), read in the args (a bit of trickiness to do this), and process recursively. Also frob .obj -> .c as mentioned earlier and handle other junk dependencies that need to be removed (NEEDTODUMP, make-docfile.exe). update-elc-2.el: Use :test `equal' in call to set-difference. update-elc.el: Put back commented out kill-emacs, update header comment. xemacs.mak: Delete old unused code that checks SATISFIED. Move update-elc-2 up to be near update-elc. Run update-elc-2 with -no-autoloads to avoid multiple autoload-loading problem. Don't compute make-docfile args ourselves. Pass the raw objects to make-docfile.el, which does the computation (much faster than we could). Don't delete the DOC file, split the invocation into two calls to make-docfile.exe (one direct, one through make-docfile.el), etc. In general, all we do is call make-docfile. Add proper dependencies for DOC-file rebuilding so it doesn't get done when not necessary. Implement quick-building here: not building the DOC file unless it doesn't exist, as the quick-build docs say. Makefile.in.in: Don't delete the DOC file. Implement quick-building here: not building the DOC file unless it doesn't exist, as the quick-build docs say. config.h.in, emacs.c: Nothing but niggly spacing changes -- one space before a paren starting a function-call arglist, please.
author ben
date Sat, 15 Feb 2003 10:16:14 +0000
parents e22b0213b713
children 70921960b980
comparison
equal deleted inserted replaced
1302:781dc6d5baba 1303:f99d3d25df86
748 /* 748 /*
749 #if defined (GNU_MALLOC) && \ 749 #if defined (GNU_MALLOC) && \
750 defined (ERROR_CHECK_MALLOC) && \ 750 defined (ERROR_CHECK_MALLOC) && \
751 !defined (HAVE_LIBMCHECK) 751 !defined (HAVE_LIBMCHECK)
752 */ 752 */
753 #if defined(LOSING_GCC_DESTRUCTOR_FREE_BUG) 753 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
754 /* Prior to XEmacs 21, this was `#if 0'ed out. */ 754 /* Prior to XEmacs 21, this was `#if 0'ed out. */
755 /* I'm enabling this because it is the only reliable way I've found to */ 755 /* I'm enabling this because it is the only reliable way I've found to */
756 /* prevent a very annoying problem where GCC will attempt to free(3) */ 756 /* prevent a very annoying problem where GCC will attempt to free (3) */
757 /* memory at exit() and cause a coredump. */ 757 /* memory at exit() and cause a coredump. */
758 init_free_hook (); 758 init_free_hook ();
759 #endif 759 #endif
760 760
761 sort_args (argc, argv); 761 sort_args (argc, argv);
775 clearerr (stdin); 775 clearerr (stdin);
776 776
777 #if defined (HAVE_MMAP) && defined (REL_ALLOC) 777 #if defined (HAVE_MMAP) && defined (REL_ALLOC)
778 /* ralloc can only be used if using the GNU memory allocator. */ 778 /* ralloc can only be used if using the GNU memory allocator. */
779 init_ralloc (); 779 init_ralloc ();
780 #elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) 780 #elif defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC)
781 if (initialized) 781 if (initialized)
782 init_ralloc(); 782 init_ralloc ();
783 #endif 783 #endif
784 784
785 #ifdef HAVE_SOCKS 785 #ifdef HAVE_SOCKS
786 if (initialized) 786 if (initialized)
787 SOCKSinit (argv[0]); 787 SOCKSinit (argv[0]);
1270 #ifdef HAVE_WIN32_PROCESSES 1270 #ifdef HAVE_WIN32_PROCESSES
1271 syms_of_process_nt (); 1271 syms_of_process_nt ();
1272 #endif 1272 #endif
1273 #endif 1273 #endif
1274 syms_of_profile (); 1274 syms_of_profile ();
1275 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) 1275 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC)
1276 syms_of_ralloc (); 1276 syms_of_ralloc ();
1277 #endif /* HAVE_MMAP && REL_ALLOC */ 1277 #endif /* HAVE_MMAP && REL_ALLOC */
1278 syms_of_rangetab (); 1278 syms_of_rangetab ();
1279 syms_of_redisplay (); 1279 syms_of_redisplay ();
1280 syms_of_search (); 1280 syms_of_search ();
1645 -- DEFER_GETTEXT() 1645 -- DEFER_GETTEXT()
1646 -- staticpro*() 1646 -- staticpro*()
1647 -- xmalloc*(), xnew*(), and friends 1647 -- xmalloc*(), xnew*(), and friends
1648 -- Dynarr_*() 1648 -- Dynarr_*()
1649 -- Blocktype_*() 1649 -- Blocktype_*()
1650 -- Fprovide(symbol) 1650 -- Fprovide (symbol)
1651 -- intern() 1651 -- intern()
1652 -- Fput() 1652 -- Fput()
1653 -- dump_add_*() 1653 -- dump_add_*()
1654 -- C library functions with no external dependencies, e.g. str*() 1654 -- C library functions with no external dependencies, e.g. str*()
1655 -- defsymbol(), if it's absolutely necessary and you're sure that 1655 -- defsymbol(), if it's absolutely necessary and you're sure that
1719 init_eval_semi_early (); 1719 init_eval_semi_early ();
1720 1720
1721 #ifdef HAVE_X_WINDOWS 1721 #ifdef HAVE_X_WINDOWS
1722 vars_of_event_Xt (); 1722 vars_of_event_Xt ();
1723 #endif 1723 #endif
1724 #if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) 1724 #if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
1725 vars_of_event_tty (); 1725 vars_of_event_tty ();
1726 #endif 1726 #endif
1727 #ifdef HAVE_MS_WINDOWS 1727 #ifdef HAVE_MS_WINDOWS
1728 vars_of_event_mswindows (); 1728 vars_of_event_mswindows ();
1729 #endif 1729 #endif
1792 vars_of_process_nt (); 1792 vars_of_process_nt ();
1793 #endif 1793 #endif
1794 #endif 1794 #endif
1795 1795
1796 vars_of_profile (); 1796 vars_of_profile ();
1797 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC) 1797 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC)
1798 vars_of_ralloc (); 1798 vars_of_ralloc ();
1799 #endif /* HAVE_MMAP && REL_ALLOC */ 1799 #endif /* HAVE_MMAP && REL_ALLOC */
1800 vars_of_redisplay (); 1800 vars_of_redisplay ();
1801 vars_of_regex (); 1801 vars_of_regex ();
1802 #ifdef HAVE_SCROLLBARS 1802 #ifdef HAVE_SCROLLBARS
2118 #ifdef DEBUG_XEMACS 2118 #ifdef DEBUG_XEMACS
2119 reinit_vars_of_debug (); 2119 reinit_vars_of_debug ();
2120 #endif 2120 #endif
2121 reinit_vars_of_device (); 2121 reinit_vars_of_device ();
2122 reinit_vars_of_eval (); 2122 reinit_vars_of_eval ();
2123 #if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS)) 2123 #if defined (HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
2124 reinit_vars_of_event_tty (); 2124 reinit_vars_of_event_tty ();
2125 #endif 2125 #endif
2126 reinit_vars_of_event_stream (); 2126 reinit_vars_of_event_stream ();
2127 reinit_vars_of_events (); 2127 reinit_vars_of_events ();
2128 reinit_vars_of_extents (); 2128 reinit_vars_of_extents ();
2275 2275
2276 /* try to get the actual pathname of the exec file we are running */ 2276 /* try to get the actual pathname of the exec file we are running */
2277 if (!restart) 2277 if (!restart)
2278 { 2278 {
2279 Vinvocation_name = Fcar (Vcommand_line_args); 2279 Vinvocation_name = Fcar (Vcommand_line_args);
2280 if (XSTRING_DATA(Vinvocation_name)[0] == '-') 2280 if (XSTRING_DATA (Vinvocation_name)[0] == '-')
2281 { 2281 {
2282 /* XEmacs as a login shell, oh goody! */ 2282 /* XEmacs as a login shell, oh goody! */
2283 Vinvocation_name = build_intstring (egetenv ("SHELL")); 2283 Vinvocation_name = build_intstring (egetenv ("SHELL"));
2284 } 2284 }
2285 Vinvocation_directory = Vinvocation_name; 2285 Vinvocation_directory = Vinvocation_name;
2305 2305
2306 Vinvocation_name = Ffile_name_nondirectory (Vinvocation_directory); 2306 Vinvocation_name = Ffile_name_nondirectory (Vinvocation_directory);
2307 Vinvocation_directory = Ffile_name_directory (Vinvocation_directory); 2307 Vinvocation_directory = Ffile_name_directory (Vinvocation_directory);
2308 } 2308 }
2309 2309
2310 #if defined(HAVE_SHLIB) && !defined(WIN32_NATIVE) 2310 #if defined (HAVE_SHLIB) && !defined (WIN32_NATIVE)
2311 /* This is Unix only. MS Windows NT has a library call that does 2311 /* This is Unix only. MS Windows NT has a library call that does
2312 The Right Thing on that system. Rumor has it, this must be 2312 The Right Thing on that system. Rumor has it, this must be
2313 called for GNU dld in temacs and xemacs. */ 2313 called for GNU dld in temacs and xemacs. */
2314 { 2314 {
2315 char *buf = (char *)ALLOCA (XSTRING_LENGTH (Vinvocation_directory) 2315 char *buf = (char *)ALLOCA (XSTRING_LENGTH (Vinvocation_directory)
2649 catchlist = NULL; /* Important! Otherwise free_cons() calls in 2649 catchlist = NULL; /* Important! Otherwise free_cons() calls in
2650 condition_case_unwind() may lead to GC death. */ 2650 condition_case_unwind() may lead to GC death. */
2651 unbind_to (0); /* this closes loadup.el */ 2651 unbind_to (0); /* this closes loadup.el */
2652 purify_flag = 0; 2652 purify_flag = 0;
2653 run_temacs_argc = nargs + 1; 2653 run_temacs_argc = nargs + 1;
2654 #if defined (HEAP_IN_DATA) && !defined(PDUMP) 2654 #if defined (HEAP_IN_DATA) && !defined (PDUMP)
2655 report_sheap_usage (0); 2655 report_sheap_usage (0);
2656 #endif 2656 #endif
2657 LONGJMP (run_temacs_catch, 1); 2657 LONGJMP (run_temacs_catch, 1);
2658 RETURN_NOT_REACHED (Qnil); 2658 RETURN_NOT_REACHED (Qnil);
2659 } 2659 }
2773 } 2773 }
2774 #if 0 2774 #if 0
2775 free (malloc_state_ptr); 2775 free (malloc_state_ptr);
2776 #endif 2776 #endif
2777 /* mmap works in glibc-2.1, glibc-2.0 (Non-Mule only) and Linux libc5 */ 2777 /* mmap works in glibc-2.1, glibc-2.0 (Non-Mule only) and Linux libc5 */
2778 #if (defined(__GLIBC__) && __GLIBC_MINOR__ >= 1) || \ 2778 #if (defined (__GLIBC__) && __GLIBC_MINOR__ >= 1) || \
2779 defined(_NO_MALLOC_WARNING_) || \ 2779 defined (_NO_MALLOC_WARNING_) || \
2780 (defined(__GLIBC__) && __GLIBC_MINOR__ < 1 && !defined(MULE)) || \ 2780 (defined (__GLIBC__) && __GLIBC_MINOR__ < 1 && !defined (MULE)) || \
2781 defined(DEBUG_DOUG_LEA_MALLOC) 2781 defined (DEBUG_DOUG_LEA_MALLOC)
2782 mallopt (M_MMAP_MAX, 64); 2782 mallopt (M_MMAP_MAX, 64);
2783 #endif 2783 #endif
2784 #ifdef REL_ALLOC 2784 #ifdef REL_ALLOC
2785 r_alloc_reinit (); 2785 r_alloc_reinit ();
2786 #endif 2786 #endif
2850 } 2850 }
2851 2851
2852 opurify = purify_flag; 2852 opurify = purify_flag;
2853 purify_flag = 0; 2853 purify_flag = 0;
2854 2854
2855 #if defined (HEAP_IN_DATA) && !defined(PDUMP) 2855 #if defined (HEAP_IN_DATA) && !defined (PDUMP)
2856 report_sheap_usage (1); 2856 report_sheap_usage (1);
2857 #endif 2857 #endif
2858 2858
2859 clear_message (); 2859 clear_message ();
2860 2860
3256 3256
3257 /* Dumping apparently isn't supported by versions of GCC >= 2.8. */ 3257 /* Dumping apparently isn't supported by versions of GCC >= 2.8. */
3258 /* The following needs conditionalization on whether either XEmacs or */ 3258 /* The following needs conditionalization on whether either XEmacs or */
3259 /* various system shared libraries have been built and linked with */ 3259 /* various system shared libraries have been built and linked with */
3260 /* GCC >= 2.8. -slb */ 3260 /* GCC >= 2.8. -slb */
3261 #if defined(GNU_MALLOC) 3261 #if defined (GNU_MALLOC)
3262 static void 3262 static void
3263 voodoo_free_hook (void *mem) 3263 voodoo_free_hook (void *mem)
3264 { 3264 {
3265 /* Disable all calls to free() when XEmacs is exiting and it doesn't */ 3265 /* Disable all calls to free() when XEmacs is exiting and it doesn't */
3266 /* matter. */ 3266 /* matter. */
3326 pause_so_user_can_read_messages (1); 3326 pause_so_user_can_read_messages (1);
3327 #endif 3327 #endif
3328 3328
3329 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0); 3329 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0);
3330 3330
3331 #if defined(GNU_MALLOC) 3331 #if defined (GNU_MALLOC)
3332 __free_hook = 3332 __free_hook =
3333 #ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */ 3333 #ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */
3334 (__typeof__ (__free_hook)) 3334 (__typeof__ (__free_hook))
3335 #endif 3335 #endif
3336 voodoo_free_hook; 3336 voodoo_free_hook;
3599 were in the middle of doing something */ 3599 were in the middle of doing something */
3600 /* debugging_breakpoint (); */ 3600 /* debugging_breakpoint (); */
3601 #if !defined (ASSERTIONS_DONT_ABORT) 3601 #if !defined (ASSERTIONS_DONT_ABORT)
3602 #ifdef _MSC_VER 3602 #ifdef _MSC_VER
3603 /* Calling abort() directly just seems to exit, in a way we can't 3603 /* Calling abort() directly just seems to exit, in a way we can't
3604 trap. (#### The docs say it does raise(SIGABRT), which we should be 3604 trap. (#### The docs say it does raise (SIGABRT), which we should be
3605 able to trap. Perhaps we're messing up somewhere? Or perhaps MS is 3605 able to trap. Perhaps we're messing up somewhere? Or perhaps MS is
3606 messed up.) 3606 messed up.)
3607 3607
3608 So, instead we cause an exception and enter into the structured 3608 So, instead we cause an exception and enter into the structured
3609 exception-handling mechanism, which is just like what happens when a 3609 exception-handling mechanism, which is just like what happens when a
4022 DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /* 4022 DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /*
4023 Mail spool locking method suggested by configure. This is one 4023 Mail spool locking method suggested by configure. This is one
4024 of the symbols in MAIL-LOCK-METHODS. 4024 of the symbols in MAIL-LOCK-METHODS.
4025 */ ); 4025 */ );
4026 { 4026 {
4027 #if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK) 4027 #if defined (MAIL_LOCK_FLOCK) && defined (HAVE_FLOCK)
4028 Vconfigure_mail_lock_method = intern ("flock"); 4028 Vconfigure_mail_lock_method = intern ("flock");
4029 #elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF) 4029 #elif defined (MAIL_LOCK_LOCKF) && defined (HAVE_LOCKF)
4030 Vconfigure_mail_lock_method = intern ("lockf"); 4030 Vconfigure_mail_lock_method = intern ("lockf");
4031 #elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF) 4031 #elif defined (MAIL_LOCK_MMDF) && defined (HAVE_MMDF)
4032 Vconfigure_mail_lock_method = intern ("mmdf"); 4032 Vconfigure_mail_lock_method = intern ("mmdf");
4033 #elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING) 4033 #elif defined (MAIL_LOCK_LOCKING) && defined (HAVE_LOCKING)
4034 Vconfigure_mail_lock_method = intern ("locking"); 4034 Vconfigure_mail_lock_method = intern ("locking");
4035 #else 4035 #else
4036 Vconfigure_mail_lock_method = intern ("dot"); 4036 Vconfigure_mail_lock_method = intern ("dot");
4037 #endif 4037 #endif
4038 } 4038 }
4256 #else 4256 #else
4257 Vconfigure_info_path = Qnil; 4257 Vconfigure_info_path = Qnil;
4258 #endif 4258 #endif
4259 } 4259 }
4260 4260
4261 #if defined(__sgi) && !defined(PDUMP) 4261 #if defined (__sgi) && !defined (PDUMP)
4262 /* This is so tremendously ugly I'd puke. But then, it works. 4262 /* This is so tremendously ugly I'd puke. But then, it works.
4263 * The target is to override the static constructor from the 4263 * The target is to override the static constructor from the
4264 * libiflPNG.so library which is masquerading as libz, and 4264 * libiflPNG.so library which is masquerading as libz, and
4265 * cores on us when re-started from the dumped executable. 4265 * cores on us when re-started from the dumped executable.
4266 * This will have to go for 21.1 -- OG. 4266 * This will have to go for 21.1 -- OG.