From: Ken S. <kg...@gm...> - 2011-02-17 01:20:44
|
2011/2/16 Ken Smith <kg...@gm...>: > 2011/2/16 Hans-Bernhard Bröker <HBB...@t-...>: > >> Actually, you would _always_ have to do cscope -R -b -q. The ability to >> concatenate single-letter options that don't use arguments is a GNU feature >> offered by getopt_long(). No _GNU_SOURCE, no -Rbq. > > Ok. I'm compiling on Linux with the GNU compiler which doesn't define > it by default. Is there a flag I should pass to configure to enable > _GNU_SOURCE or should I just edit the makefiles and add it to CFLAGS? Also, with _GNU_SOURCE, the main.c patch changes to the following. The call to getopt_long needs "a" appended to the third argument. ks Index: src/main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.52 diff -u -r1.52 main.c --- src/main.c 30 Sep 2010 14:29:19 -0000 1.52 +++ src/main.c 17 Feb 2011 01:16:50 -0000 @@ -98,6 +98,7 @@ BOOL linemode = NO; /* use line oriented user interface */ BOOL verbosemode = NO; /* print extra information on line mode */ BOOL recurse_dir = NO; /* recurse dirs when searching for src files */ +BOOL use_abs_paths = NO; /* use absolute pathnames in recursive searches */ char *namefile; /* file of file names */ BOOL ogs; /* display OGS book and subsystem names */ char *prependpath; /* prepend path to file names */ @@ -153,7 +154,7 @@ while ((opt = getopt_long(argcc, argv, - "hVbcCdeF:f:I:i:kLl0:1:2:3:4:5:6:7:8:9:P:p:qRs:TUuv", + "hVbcCdeF:f:I:i:kLl0:1:2:3:4:5:6:7:8:9:P:p:qRs:TUuva", lopts, &longind)) != -1) { switch(opt) { @@ -233,6 +234,9 @@ case 'R': recurse_dir = YES; break; + case 'a': + use_abs_paths = YES; + break; case 'f': /* alternate cross-reference file */ reffile = optarg; if (strlen(reffile) > sizeof(path) - 3) { @@ -405,6 +409,9 @@ case 'R': recurse_dir = YES; break; + case 'a': + use_abs_paths = YES; + break; case 'f': /* alternate cross-reference file */ case 'F': /* symbol reference lines file */ case 'i': /* file containing file names */ |