diff options
Diffstat (limited to 'alpine')
-rw-r--r-- | alpine/Makefile.am | 1 | ||||
-rw-r--r-- | alpine/Makefile.in | 1 | ||||
-rw-r--r-- | alpine/arg.c | 69 |
3 files changed, 70 insertions, 1 deletions
diff --git a/alpine/Makefile.am b/alpine/Makefile.am index 0542aad8..da6f661e 100644 --- a/alpine/Makefile.am +++ b/alpine/Makefile.am @@ -52,3 +52,4 @@ CLEANFILES = date.c date.c: echo "char datestamp[]="\"$(ALPINE_DATESTAMP)\"";" > date.c echo "char hoststamp[]="\"$(ALPINE_HOSTSTAMP)\"";" >> date.c + echo "char configoptions[]="\"`../config.status --config`\"";" >> date.c diff --git a/alpine/Makefile.in b/alpine/Makefile.in index a2b7af87..0e84230d 100644 --- a/alpine/Makefile.in +++ b/alpine/Makefile.in @@ -904,6 +904,7 @@ uninstall-am: uninstall-binPROGRAMS date.c: echo "char datestamp[]="\"$(ALPINE_DATESTAMP)\"";" > date.c echo "char hoststamp[]="\"$(ALPINE_HOSTSTAMP)\"";" >> date.c + echo "char configoptions[]="\"`../config.status --config`\"";" >> date.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/alpine/arg.c b/alpine/arg.c index 57c39fca..8e00a210 100644 --- a/alpine/arg.c +++ b/alpine/arg.c @@ -38,7 +38,9 @@ static char rcsid[] = "$Id: arg.c 900 2008-01-05 01:13:26Z hubert@u.washington.e int process_debug_str(char *); void args_add_attach(PATMT **, char *, int); int pinerc_cmdline_opt(char *); +void display_config_options(char *, char *); +extern char configoptions[]; /* * Name started as to invoke function key mode @@ -192,7 +194,68 @@ N_("\tNote: All of -xoauth options above must be used, if any of them is used"), NULL }; - +void +display_config_options(char *configopts, char *defprefix) +{ + char *copts = configopts ? cpystr(configopts) : NULL; + char **options = NULL; + char *s, *t, *prefix; + int len, nlines, pending; + + for(nlines = 0, s = copts; s != NULL; nlines++){ + s = strchr(s, '\''); + if(s != NULL) s++; + } + options = fs_get((nlines/2 + 4)*sizeof(char *)); /* 4 in worst case scenario */ + memset((void *) options, 0, (nlines/2 + 4)*sizeof(char *)); + for(s = copts, len = 0, nlines = 0; s != NULL; ){ + pending = 0; + prefix = len == 0 ? (nlines == 0 ? defprefix : " ") : " "; + if((s = strchr(s, '\'')) != NULL){ + t = strchr(s+1, '\''); + *t = '\0'; + if(!strncmp(s+1, "CFLAGS=", 7) + || !strncmp(s+1, "CC=", 3) + || !strncmp(s+1, "LIBS=", 5) + || !strncmp(s+1, "CPP=", 4) + || !strncmp(s+1, "CPPFLAGS=", 9) + || !strncmp(s+1, "LT_SYS_LIBRARY_PATH=", 20) + || !strncmp(s+1, "LDFLAGS=", 8)){ + display_args_err(s+1, NULL, 0); + *t++ = '\''; + s = t; + continue; + } + if(len + strlen(prefix) + strlen(s+1) > 74 ){ + if(len == 0){ + options[nlines] = fs_get((strlen(prefix) + strlen(s+1) + 3)*sizeof(char)); + sprintf(options[nlines++], "%s%s \\", prefix, s+1); + } + else{ + strcat(options[nlines++], " \\"); + pending++; + } + len = 0; + } + else{ + if(len == 0){ + options[nlines] = fs_get(76*sizeof(char)); + *options[nlines] = '\0'; + } + strcat(options[nlines], prefix); + strcat(options[nlines], s+1); + len = strlen(options[nlines]); + } + if(t != NULL) + *t = '\''; + if(!pending) + s = t ? t + 1 : NULL; + } + } + display_args_err(NULL, options, 0); + free_list_array(&options); + fs_give((void **) &copts); +} /* * Parse the command line args. @@ -1002,6 +1065,10 @@ Loop: while(--ac > 0) datestamp, hoststamp); tmp_20k_buf[SIZEOF_20KBUF-1] = '\0'; display_args_err(tmp_20k_buf, NULL, 0); + if(*configoptions){ + display_args_err(_("Alpine was built with the following options:"), NULL, 0); + display_config_options(configoptions, "./configure "); + } exit(0); } |