Skip to content

Commit 2fd8a15

Browse files
committed
Thrift-1680:Make install requires GNU make
Client: build patch: Jake Farrell Updates boost and libevent configure messages, updates thrift help to display error and smaller message, moves help to --help or -help and takes care of // TODO(dreiss): Delete these when everyone is using the new hotness. Welcome to the new hotness everyone. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1391705 13f79535-47bb-0310-9956-ffa450edef68
1 parent 373a26b commit 2fd8a15

File tree

3 files changed

+26
-91
lines changed

3 files changed

+26
-91
lines changed

aclocal/ax_boost_base.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
AC_DEFUN([AX_BOOST_BASE],
3838
[
3939
AC_ARG_WITH([boost],
40-
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
40+
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost [default=yes]. Optionally specify the root prefix dir where boost is installed]),
4141
[
4242
if test "$withval" = "no"; then
4343
want_boost="no"

aclocal/ax_lib_event.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ AC_DEFUN([AX_LIB_EVENT],
141141
142142
dnl Allow search path to be overridden on the command line.
143143
AC_ARG_WITH([libevent],
144-
AS_HELP_STRING([--with-libevent@<:@=DIR@:>@], [use libevent (default is yes) - it is possible to specify an alternate root directory for libevent]),
144+
AS_HELP_STRING([--with-libevent@<:@=DIR@:>@], [use libevent [default=yes]. Optionally specify the root prefix dir where libevent is installed]),
145145
[
146146
if test "x$withval" = "xno"; then
147147
want_libevent="no"

compiler/cpp/src/main.cc

+24-89
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,18 @@ void version() {
633633
}
634634

635635
/**
636-
* Diplays the usage message and then exits with an error code.
636+
* Display the usage message and then exit with an error code.
637637
*/
638638
void usage() {
639+
fprintf(stderr, "Usage: thrift [options] file\n\n");
640+
fprintf(stderr, "Use thrift -help for a list of options\n");
641+
exit(1);
642+
}
643+
644+
/**
645+
* Diplays the help message and then exits with an error code.
646+
*/
647+
void help() {
639648
fprintf(stderr, "Usage: thrift [options] file\n");
640649
fprintf(stderr, "Options:\n");
641650
fprintf(stderr, " -version Print the compiler version\n");
@@ -971,7 +980,9 @@ int main(int argc, char** argv) {
971980
++arg;
972981
}
973982

974-
if (strcmp(arg, "-version") == 0) {
983+
if (strcmp(arg, "-help") == 0) {
984+
help();
985+
} else if (strcmp(arg, "-version") == 0) {
975986
version();
976987
exit(1);
977988
} else if (strcmp(arg, "-debug") == 0) {
@@ -992,7 +1003,7 @@ int main(int argc, char** argv) {
9921003
} else if (strcmp(arg, "-gen") == 0) {
9931004
arg = argv[++i];
9941005
if (arg == NULL) {
995-
fprintf(stderr, "!!! Missing generator specification\n");
1006+
fprintf(stderr, "Missing generator specification\n");
9961007
usage();
9971008
}
9981009
generator_strings.push_back(arg);
@@ -1055,7 +1066,7 @@ int main(int argc, char** argv) {
10551066
arg = argv[++i];
10561067

10571068
if (arg == NULL) {
1058-
fprintf(stderr, "!!! Missing Include directory\n");
1069+
fprintf(stderr, "Missing Include directory\n");
10591070
usage();
10601071
}
10611072
g_incl_searchpath.push_back(arg);
@@ -1088,7 +1099,7 @@ int main(int argc, char** argv) {
10881099
return -1;
10891100
}
10901101
} else {
1091-
fprintf(stderr, "!!! Unrecognized option: %s\n", arg);
1102+
fprintf(stderr, "Unrecognized option: %s\n", arg);
10921103
usage();
10931104
}
10941105

@@ -1097,103 +1108,27 @@ int main(int argc, char** argv) {
10971108
}
10981109
}
10991110

1111+
// display help
1112+
if ((strcmp(argv[argc-1], "-help") == 0) || (strcmp(argv[argc-1], "--help") == 0)) {
1113+
help();
1114+
}
1115+
11001116
// if you're asking for version, you have a right not to pass a file
1101-
if (strcmp(argv[argc-1], "-version") == 0) {
1117+
if ((strcmp(argv[argc-1], "-version") == 0) || (strcmp(argv[argc-1], "--version") == 0)) {
11021118
version();
11031119
exit(1);
11041120
}
11051121

1106-
// TODO(dreiss): Delete these when everyone is using the new hotness.
1107-
if (gen_cpp) {
1108-
pwarning(1, "-cpp is deprecated. Use --gen cpp");
1109-
string gen_string = "cpp:";
1110-
if (gen_dense) {
1111-
gen_string.append("dense,");
1112-
}
1113-
if (g_cpp_use_include_prefix) {
1114-
gen_string.append("include_prefix,");
1115-
}
1116-
generator_strings.push_back(gen_string);
1117-
}
1118-
if (gen_java) {
1119-
pwarning(1, "-java is deprecated. Use --gen java");
1120-
generator_strings.push_back("java");
1121-
}
1122-
if (gen_javabean) {
1123-
pwarning(1, "-javabean is deprecated. Use --gen java:beans");
1124-
generator_strings.push_back("java:beans");
1125-
}
1126-
if (gen_csharp) {
1127-
pwarning(1, "-csharp is deprecated. Use --gen csharp");
1128-
generator_strings.push_back("csharp");
1129-
}
1130-
if (gen_delphi) {
1131-
pwarning(1, "-delphi is deprecated. Use --gen delphi");
1132-
generator_strings.push_back("delphi");
1133-
}
1134-
if (gen_py) {
1135-
pwarning(1, "-py is deprecated. Use --gen py");
1136-
generator_strings.push_back("py");
1137-
}
1138-
if (gen_rb) {
1139-
pwarning(1, "-rb is deprecated. Use --gen rb");
1140-
generator_strings.push_back("rb");
1141-
}
1142-
if (gen_perl) {
1143-
pwarning(1, "-perl is deprecated. Use --gen perl");
1144-
generator_strings.push_back("perl");
1145-
}
1146-
if (gen_php || gen_phpi) {
1147-
pwarning(1, "-php is deprecated. Use --gen php");
1148-
string gen_string = "php:";
1149-
if (gen_phpi) {
1150-
gen_string.append("inlined,");
1151-
} else if(gen_phps) {
1152-
gen_string.append("server,");
1153-
} else if(gen_phpa) {
1154-
gen_string.append("autoload,");
1155-
} else if(gen_phpo) {
1156-
gen_string.append("oop,");
1157-
} else if(gen_rest) {
1158-
gen_string.append("rest,");
1159-
}
1160-
generator_strings.push_back(gen_string);
1161-
}
1162-
if (gen_cocoa) {
1163-
pwarning(1, "-cocoa is deprecated. Use --gen cocoa");
1164-
generator_strings.push_back("cocoa");
1165-
}
1166-
if (gen_erl) {
1167-
pwarning(1, "-erl is deprecated. Use --gen erl");
1168-
generator_strings.push_back("erl");
1169-
}
1170-
if (gen_st) {
1171-
pwarning(1, "-st is deprecated. Use --gen st");
1172-
generator_strings.push_back("st");
1173-
}
1174-
if (gen_ocaml) {
1175-
pwarning(1, "-ocaml is deprecated. Use --gen ocaml");
1176-
generator_strings.push_back("ocaml");
1177-
}
1178-
if (gen_hs) {
1179-
pwarning(1, "-hs is deprecated. Use --gen hs");
1180-
generator_strings.push_back("hs");
1181-
}
1182-
if (gen_xsd) {
1183-
pwarning(1, "-xsd is deprecated. Use --gen xsd");
1184-
generator_strings.push_back("xsd");
1185-
}
1186-
11871122
// You gotta generate something!
11881123
if (generator_strings.empty()) {
1189-
fprintf(stderr, "!!! No output language(s) specified\n\n");
1124+
fprintf(stderr, "No output language(s) specified\n");
11901125
usage();
11911126
}
11921127

11931128
// Real-pathify it
11941129
char rp[PATH_MAX];
11951130
if (argv[i] == NULL) {
1196-
fprintf(stderr, "!!! Missing file name\n");
1131+
fprintf(stderr, "Missing file name\n");
11971132
usage();
11981133
}
11991134
if (saferealpath(argv[i], rp) == NULL) {

0 commit comments

Comments
 (0)