martin      97/11/11 14:50:15

  Modified:    src/main http_main.c
  Log:
  Show Compile Time Settings -- first committed version.  A new switch "-V"
  (in contrast to the existing switch "-v" with lower-case-v) shows (some
  of) the relevant compiler defines which influence Apache's behavior at
  run time. More diags may be added later, as may the optimization of
  several strings into one.
  Reviewed by:Dean Gaudet, Jim Jagielski, Ken Coar
  
  Revision  Changes    Path
  1.248     +76 -2     apachen/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apachen/src/main/http_main.c,v
  retrieving revision 1.247
  retrieving revision 1.248
  diff -u -u -r1.247 -r1.248
  --- http_main.c       1997/11/08 19:19:15     1.247
  +++ http_main.c       1997/11/11 22:50:13     1.248
  @@ -3194,6 +3194,72 @@
   }
   
   
  +static void show_compile_settings(void)
  +{
  +#ifdef SERVER_SUBVERSION
  +    printf("Server base version: \"%s\"\n", SERVER_BASEVERSION);
  +    printf("Server sub-version:  \"%s\"\n", SERVER_SUBVERSION);
  +#else
  +    printf("Server version \"%s\"\n", SERVER_VERSION);
  +#endif
  +    printf("Server built:  %s\n", SERVER_BUILT);
  +    printf("Server compiled with....\n");
  +#ifdef BIG_SECURITY_HOLE
  +    printf(" -D BIG_SECURITY_HOLE\n");
  +#endif
  +#ifdef HTTPD_ROOT
  +    printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
  +#endif
  +#ifdef HAVE_MMAP
  +    printf(" -D HAVE_MMAP\n");
  +#endif
  +#ifdef HAVE_SHMGET
  +    printf(" -D HAVE_SHMGET\n");
  +#endif
  +#ifdef USE_MMAP_FILES
  +    printf(" -D USE_MMAP_FILES\n");
  +#ifdef MMAP_SEGMENT_SIZE
  +     printf(" -D MMAP_SEGMENT_SIZE=%ld\n",(long)MMAP_SEGMENT_SIZE);
  +#endif
  +#endif /*USE_MMAP_FILES*/
  +#ifdef NO_WRITEV
  +    printf(" -D NO_WRITEV\n");
  +#endif
  +#ifdef NO_LINGCLOSE
  +    printf(" -D NO_LINGCLOSE\n");
  +#endif
  +#ifdef USE_FCNTL_SERIALIZED_ACCEPT
  +    printf(" -D USE_FCNTL_SERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef USE_FLOCK_SERIALIZED_ACCEPT
  +    printf(" -D USE_FLOCK_SERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef USE_USLOCK_SERIALIZED_ACCEPT
  +    printf(" -D USE_USLOCK_SERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef USE_SYSVSEM_SERIALIZED_ACCEPT
  +    printf(" -D USE_SYSVSEM_SERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef USE_PTHREAD_SERIALIZED_ACCEPT
  +    printf(" -D USE_PTHREAD_SERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef SAFE_UNSERIALIZED_ACCEPT
  +    printf(" -D SAFE_UNSERIALIZED_ACCEPT\n");
  +#endif
  +#ifdef NO_OTHER_CHILD
  +    printf(" -D NO_OTHER_CHILD\n");
  +#endif
  +#ifdef NO_RELIABLE_PIPED_LOGS
  +    printf(" -D NO_RELIABLE_PIPED_LOGS\n");
  +#endif
  +#ifdef BUFFERED_LOGS
  +    printf(" -D BUFFERED_LOGS\n");
  +#ifdef PIPE_BUF
  +     printf(" -D PIPE_BUF=%ld\n",(long)PIPE_BUF);
  +#endif
  +#endif
  +    printf("\n");
  +}
   
   /*****************************************************************
    * Executive routines.
  @@ -3456,7 +3522,7 @@
   
       setup_prelinked_modules();
   
  -    while ((c = getopt(argc, argv, "Xd:f:vhlZ:")) != -1) {
  +    while ((c = getopt(argc, argv, "Xd:f:vVhlZ:")) != -1) {
        switch (c) {
        case 'd':
            strncpy(server_root, optarg, sizeof(server_root) - 1);
  @@ -3468,6 +3534,10 @@
            break;
        case 'v':
            printf("Server version %s.\n", SERVER_VERSION);
  +         printf("Server built:  %s\n", SERVER_BUILT);
  +         exit(0);
  +     case 'V':
  +         show_compile_settings();
            exit(0);
        case 'h':
            show_directives();
  @@ -4250,7 +4320,7 @@
   
       setup_prelinked_modules();
   
  -    while ((c = getopt(argc, argv, "Xd:f:vhlc:ius")) != -1) {
  +    while ((c = getopt(argc, argv, "Xd:f:vVhlc:ius")) != -1) {
        switch (c) {
   #ifdef WIN32
        case 'c':
  @@ -4281,6 +4351,10 @@
            break;
        case 'v':
            printf("Server version %s.\n", SERVER_VERSION);
  +         printf("Server built:  %s\n", SERVER_BUILT);
  +         exit(0);
  +     case 'V':
  +         show_compile_settings();
            exit(0);
        case 'h':
            show_directives();
  
  
  

Reply via email to