1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

support configure --disable-manual

This commit is contained in:
Daniel Stenberg 2004-02-12 14:46:12 +00:00
parent f3663a9d0f
commit 1d937d62c0
3 changed files with 26 additions and 15 deletions

View File

@ -53,6 +53,9 @@ README=$(top_srcdir)/docs/MANUAL
MKHELP=$(top_srcdir)/src/mkhelp.pl MKHELP=$(top_srcdir)/src/mkhelp.pl
HUGE=hugehelp.c HUGE=hugehelp.c
if USE_MANUAL
# Here are the stuff to create a built-in manual
if HAVE_LIBZ if HAVE_LIBZ
# This generates the hugehelp.c file in both uncompressed and compressed formats # This generates the hugehelp.c file in both uncompressed and compressed formats
$(HUGE): $(README) $(MANPAGE) mkhelp.pl $(HUGE): $(README) $(MANPAGE) mkhelp.pl
@ -64,8 +67,14 @@ $(HUGE): $(README) $(MANPAGE) mkhelp.pl
echo '#else' >> $(HUGE) echo '#else' >> $(HUGE)
$(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c $(README) >> $(HUGE) $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c $(README) >> $(HUGE)
echo '#endif /* HAVE_LIBZ */' >> $(HUGE) echo '#endif /* HAVE_LIBZ */' >> $(HUGE)
else else # HAVE_LIBZ
# This generates the hugehelp.c file uncompressed only # This generates the hugehelp.c file uncompressed only
$(HUGE): $(README) $(MANPAGE) mkhelp.pl $(HUGE): $(README) $(MANPAGE) mkhelp.pl
$(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) > $(HUGE) $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) > $(HUGE)
endif endif
else # USE_MANUAL
# built-in manual has been disabled, make a blank file
$(HUGE):
echo "/* explicitly disabled */" >$(HUGE)
endif

View File

@ -91,3 +91,6 @@
/* type to use in place of socklen_t if not defined */ /* type to use in place of socklen_t if not defined */
#undef socklen_t #undef socklen_t
/* Define to 1 if you want the built-in manual */
#undef USE_MANUAL

View File

@ -42,7 +42,9 @@
#include "writeout.h" #include "writeout.h"
#include "getpass.h" #include "getpass.h"
#include "homedir.h" #include "homedir.h"
#ifdef USE_MANUAL
#include "hugehelp.h" #include "hugehelp.h"
#endif
#ifdef USE_ENVIRONMENT #ifdef USE_ENVIRONMENT
#include "writeenv.h" #include "writeenv.h"
#endif #endif
@ -409,7 +411,6 @@ struct Configurable {
char *userpwd; char *userpwd;
char *proxyuserpwd; char *proxyuserpwd;
char *proxy; char *proxy;
bool configread;
bool proxytunnel; bool proxytunnel;
long conf; long conf;
@ -489,8 +490,8 @@ struct Configurable {
/* global variable to hold info about libcurl */ /* global variable to hold info about libcurl */
static curl_version_info_data *curlinfo; static curl_version_info_data *curlinfo;
static int parseconfig(const char *filename, static void parseconfig(const char *filename,
struct Configurable *config); struct Configurable *config);
static char *my_get_line(FILE *fp); static char *my_get_line(FILE *fp);
static int create_dir_hierarchy(char *outfile); static int create_dir_hierarchy(char *outfile);
@ -1069,7 +1070,6 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
char subletter=0; /* subletters can only occur on long options */ char subletter=0; /* subletters can only occur on long options */
const char *parse=NULL; const char *parse=NULL;
int res;
unsigned int j; unsigned int j;
time_t now; time_t now;
int hit=-1; int hit=-1;
@ -1689,10 +1689,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
config->insecure_ok ^= TRUE; config->insecure_ok ^= TRUE;
break; break;
case 'K': /* parse config file */ case 'K': /* parse config file */
res = parseconfig(nextarg, config); parseconfig(nextarg, config);
config->configread = TRUE;
if(res)
return res;
break; break;
case 'l': case 'l':
config->conf ^= CONF_FTPLISTONLY; /* only list the names of the FTP dir */ config->conf ^= CONF_FTPLISTONLY; /* only list the names of the FTP dir */
@ -1713,8 +1710,13 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
return PARAM_BAD_NUMERIC; return PARAM_BAD_NUMERIC;
break; break;
case 'M': /* M for manual, huge help */ case 'M': /* M for manual, huge help */
#ifdef USE_MANUAL
hugehelp(); hugehelp();
return PARAM_HELP_REQUESTED; return PARAM_HELP_REQUESTED;
#else
helpf("built-in manual was disabled and build-time!\n");
return PARAM_OPTION_UNKNOWN;
#endif
case 'n': case 'n':
switch(subletter) { switch(subletter) {
case 'o': /* CA info PEM file */ case 'o': /* CA info PEM file */
@ -1989,8 +1991,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
} }
static int parseconfig(const char *filename, static void parseconfig(const char *filename,
struct Configurable *config) struct Configurable *config)
{ {
int res; int res;
FILE *file; FILE *file;
@ -2163,7 +2165,6 @@ static int parseconfig(const char *filename,
if(file != stdin) if(file != stdin)
fclose(file); fclose(file);
} }
return 0;
} }
static void go_sleep(long ms) static void go_sleep(long ms)
@ -2637,9 +2638,7 @@ operate(struct Configurable *config, int argc, char *argv[])
; ;
} }
else { else {
res = parseconfig(NULL, config); parseconfig(NULL, config);
if(res)
return res;
} }
if ((argc < 2) && !config->url_list) { if ((argc < 2) && !config->url_list) {