RH 8.0 build problems with --enable-rootcommit --disable-client --disable-server

Jim Salter <[email protected]>
Newsgroups gmane.comp.version-control.cvs.bugs
Message-ID <[email protected]>
The following build failure occurs with the following commands on the 
latest code base using RH 8.0:

    ./configure --enable-rootcommit --disable-client --disable-server
    ...
    make
    ...
    main.c: In function `main':
    main.c:605: `gzip_level' undeclared (first use in this function)
    main.c:605: (Each undeclared identifier is reported only once
    main.c:605: for each function it appears in.)
    make[2]: *** [main.o] Error 1

The problem is that the code in cvs.h is:

    #if defined(SERVER_SUPPORT) || defined(CLIENT_SUPPORT)
    # include "client.h"
    #endif

and there's no corresponding #ifdef within the main.c.  The fix is as 
follows:

diff -b -c -r1.182 main.c
*** main.c      31 Mar 2003 19:30:56 -0000      1.182
--- main.c      2 May 2003 00:16:09 -0000
***************
*** 602,611 ****
                use_cvsrc = 0; /* unnecessary, since we've done it above */
                break;
            case 'z':
                gzip_level = strtol (optarg, &end, 10);
!               if (*end != '\0' || gzip_level < 0 || gzip_level > 9)
                  error (1, 0,
                         "gzip compression level must be between 0 and 9");
                /* If no CLIENT_SUPPORT, we just silently ignore the gzip
                 * level, so that users can have it in their .cvsrc and not
                 * cause any trouble.
--- 602,616 ----
                use_cvsrc = 0; /* unnecessary, since we've done it above */
                break;
            case 'z':
+               if (*end != '\0')
+                 error (1, 0,
+                        "gzip compression level must be between 0 and 9");
+ #if defined(SERVER_SUPPORT) || defined(CLIENT_SUPPORT)
                gzip_level = strtol (optarg, &end, 10);
!               if (gzip_level < 0 || gzip_level > 9)
                  error (1, 0,
                         "gzip compression level must be between 0 and 9");
+ #endif
                /* If no CLIENT_SUPPORT, we just silently ignore the gzip
                 * level, so that users can have it in their .cvsrc and not
                 * cause any trouble.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.