diff options
author | Lukas Larsson <[email protected]> | 2012-06-08 17:33:41 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2012-06-08 17:33:41 +0200 |
commit | 1fc1233587a00b318ce15fd520b057dee726a7fc (patch) | |
tree | 1a7c446ee60b922fb11c89c930f32f55719015f1 /lib/ic | |
parent | d7554d5b53ef85861bb5593fba38f65c40faca33 (diff) | |
parent | 3341122a92e71ade3edc7ecaadab9f55da29e20d (diff) | |
download | otp-1fc1233587a00b318ce15fd520b057dee726a7fc.tar.gz otp-1fc1233587a00b318ce15fd520b057dee726a7fc.tar.bz2 otp-1fc1233587a00b318ce15fd520b057dee726a7fc.zip |
Merge branch 'maint'
* maint:
Update to work with space in include path
Update to work with whitespace in exec path
Diffstat (limited to 'lib/ic')
-rw-r--r-- | lib/ic/c_src/Makefile.in | 12 | ||||
-rw-r--r-- | lib/ic/doc/src/Makefile | 14 | ||||
-rw-r--r-- | lib/ic/examples/pre_post_condition/Makefile | 4 | ||||
-rw-r--r-- | lib/ic/java_src/com/ericsson/otp/ic/Makefile | 8 | ||||
-rw-r--r-- | lib/ic/src/Makefile | 34 | ||||
-rw-r--r-- | lib/ic/src/ic.erl | 2 | ||||
-rw-r--r-- | lib/ic/src/ic_pp.erl | 39 | ||||
-rw-r--r-- | lib/ic/test/Makefile | 50 | ||||
-rw-r--r-- | lib/ic/test/java_client_erl_server_SUITE.erl | 2 |
9 files changed, 89 insertions, 76 deletions
diff --git a/lib/ic/c_src/Makefile.in b/lib/ic/c_src/Makefile.in index 5e034c47c6..d8b8c85a8e 100644 --- a/lib/ic/c_src/Makefile.in +++ b/lib/ic/c_src/Makefile.in @@ -140,12 +140,12 @@ $(OBJDIR)/%.o: %.c include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/c_src - $(INSTALL_DIR) $(RELSYSDIR)/include - $(INSTALL_DIR) $(RELSYSDIR)/priv/lib - $(INSTALL_DATA) ic.c ic_tmo.c $(RELSYSDIR)/c_src - $(INSTALL_DATA) $(IDL_FILES) $(H_FILES) $(RELSYSDIR)/include - $(INSTALL_DATA) $(LIBRARY) $(RELSYSDIR)/priv/lib + $(INSTALL_DIR) "$(RELSYSDIR)/c_src" + $(INSTALL_DIR) "$(RELSYSDIR)/include" + $(INSTALL_DIR) "$(RELSYSDIR)/priv/lib" + $(INSTALL_DATA) ic.c ic_tmo.c "$(RELSYSDIR)/c_src" + $(INSTALL_DATA) $(IDL_FILES) $(H_FILES) "$(RELSYSDIR)/include" + $(INSTALL_DATA) $(LIBRARY) "$(RELSYSDIR)/priv/lib" release_docs_spec: diff --git a/lib/ic/doc/src/Makefile b/lib/ic/doc/src/Makefile index 208f16e441..0ee242b234 100644 --- a/lib/ic/doc/src/Makefile +++ b/lib/ic/doc/src/Makefile @@ -220,12 +220,12 @@ debug opt: include $(ERL_TOP)/make/otp_release_targets.mk release_docs_spec: docs - $(INSTALL_DIR) $(RELSYSDIR)/doc/pdf - $(INSTALL_DATA) $(TOP_PDF_FILE) $(RELSYSDIR)/doc/pdf - $(INSTALL_DATA) $(INFO_FILE) $(RELSYSDIR) - $(INSTALL_DIR) $(RELSYSDIR)/doc/html - (/bin/cp -rf $(HTMLDIR) $(RELSYSDIR)/doc) - $(INSTALL_DIR) $(RELEASE_PATH)/man/man3 - $(INSTALL_DATA) $(MAN3_FILES) $(RELEASE_PATH)/man/man3 + $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf" + $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf" + $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)" + $(INSTALL_DIR) "$(RELSYSDIR)/doc/html" + (/bin/cp -rf $(HTMLDIR) "$(RELSYSDIR)/doc") + $(INSTALL_DIR) "$(RELEASE_PATH)/man/man3" + $(INSTALL_DATA) $(MAN3_FILES) "$(RELEASE_PATH)/man/man3" release_spec: diff --git a/lib/ic/examples/pre_post_condition/Makefile b/lib/ic/examples/pre_post_condition/Makefile index 8f85babb1a..8ae37394ed 100644 --- a/lib/ic/examples/pre_post_condition/Makefile +++ b/lib/ic/examples/pre_post_condition/Makefile @@ -124,8 +124,8 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/examples/pre_post_condition - $(INSTALL_DATA) $(ERL_FILES) $(IDL_FILES) $(TXT_FILES) $(RELSYSDIR)/examples/pre_post_condition + $(INSTALL_DIR) "$(RELSYSDIR)/examples/pre_post_condition" + $(INSTALL_DATA) $(ERL_FILES) $(IDL_FILES) $(TXT_FILES) "$(RELSYSDIR)/examples/pre_post_condition" release_docs_spec: diff --git a/lib/ic/java_src/com/ericsson/otp/ic/Makefile b/lib/ic/java_src/com/ericsson/otp/ic/Makefile index f730749ccb..1b14d4430f 100644 --- a/lib/ic/java_src/com/ericsson/otp/ic/Makefile +++ b/lib/ic/java_src/com/ericsson/otp/ic/Makefile @@ -109,10 +109,10 @@ docs: include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/java_src/com/ericsson/otp/ic - $(INSTALL_DATA) $(JAVA_FILES) $(RELSYSDIR)/java_src/com/ericsson/otp/ic - $(INSTALL_DIR) $(RELSYSDIR)/priv - $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) $(RELSYSDIR)/priv + $(INSTALL_DIR) "$(RELSYSDIR)/java_src/com/ericsson/otp/ic" + $(INSTALL_DATA) $(JAVA_FILES) "$(RELSYSDIR)/java_src/com/ericsson/otp/ic" + $(INSTALL_DIR) "$(RELSYSDIR)/priv" + $(INSTALL_DATA) $(JAVA_DEST_ROOT)$(JARFILE) "$(RELSYSDIR)/priv" release_docs_spec: diff --git a/lib/ic/src/Makefile b/lib/ic/src/Makefile index 5dac304e32..c830ebec95 100644 --- a/lib/ic/src/Makefile +++ b/lib/ic/src/Makefile @@ -196,23 +196,23 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_spec: opt - $(INSTALL_DIR) $(RELSYSDIR)/ebin - $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) $(RELSYSDIR)/ebin - $(INSTALL_DIR) $(RELSYSDIR)/src - $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(INTERNAL_HRL_FILES) $(RELSYSDIR)/src - $(INSTALL_DIR) $(RELSYSDIR)/examples - $(INSTALL_DIR) $(RELSYSDIR)/examples/c-client - $(INSTALL_DATA) $(CCL_EX_FILES) $(RELSYSDIR)/examples/c-client - $(INSTALL_DIR) $(RELSYSDIR)/examples/c-server - $(INSTALL_DATA) $(CSRV_EX_FILES) $(RELSYSDIR)/examples/c-server - $(INSTALL_DIR) $(RELSYSDIR)/examples/erl-plain - $(INSTALL_DATA) $(EPL_EX_FILES) $(RELSYSDIR)/examples/erl-plain - $(INSTALL_DIR) $(RELSYSDIR)/examples/erl-genserv - $(INSTALL_DATA) $(ESRV_EX_FILES) $(RELSYSDIR)/examples/erl-genserv - $(INSTALL_DIR) $(RELSYSDIR)/examples/java-client-server - $(INSTALL_DATA) $(JAVA_EX_FILES) $(RELSYSDIR)/examples/java-client-server - $(INSTALL_DIR) $(RELSYSDIR)/examples/all-against-all - $(INSTALL_DATA) $(MIXED_EX_FILES) $(RELSYSDIR)/examples/all-against-all + $(INSTALL_DIR) "$(RELSYSDIR)/ebin" + $(INSTALL_DATA) $(TARGET_FILES) $(APP_TARGET) "$(RELSYSDIR)/ebin" + $(INSTALL_DIR) "$(RELSYSDIR)/src" + $(INSTALL_DATA) $(ERL_FILES) $(YRL_FILE) $(INTERNAL_HRL_FILES) "$(RELSYSDIR)/src" + $(INSTALL_DIR) "$(RELSYSDIR)/examples" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/c-client" + $(INSTALL_DATA) $(CCL_EX_FILES) "$(RELSYSDIR)/examples/c-client" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/c-server" + $(INSTALL_DATA) $(CSRV_EX_FILES) "$(RELSYSDIR)/examples/c-server" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/erl-plain" + $(INSTALL_DATA) $(EPL_EX_FILES) "$(RELSYSDIR)/examples/erl-plain" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/erl-genserv" + $(INSTALL_DATA) $(ESRV_EX_FILES) "$(RELSYSDIR)/examples/erl-genserv" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/java-client-server" + $(INSTALL_DATA) $(JAVA_EX_FILES) "$(RELSYSDIR)/examples/java-client-server" + $(INSTALL_DIR) "$(RELSYSDIR)/examples/all-against-all" + $(INSTALL_DATA) $(MIXED_EX_FILES) "$(RELSYSDIR)/examples/all-against-all" release_docs_spec: diff --git a/lib/ic/src/ic.erl b/lib/ic/src/ic.erl index 50fad921c4..bc7ec8ba91 100644 --- a/lib/ic/src/ic.erl +++ b/lib/ic/src/ic.erl @@ -250,7 +250,7 @@ make_erl_options(Opts) -> Optimize = Opts#options.optimize, PreProc = lists:flatten( - lists:map(fun(D) -> io_lib:format("-I~s ", [ic_util:to_list(D)]) end, + lists:map(fun(D) -> io_lib:format("-I\"~s\" ", [ic_util:to_list(D)]) end, Includes1)++ lists:map( fun ({Name, Value}) -> diff --git a/lib/ic/src/ic_pp.erl b/lib/ic/src/ic_pp.erl index 8b53473caa..50eeeab48c 100644 --- a/lib/ic/src/ic_pp.erl +++ b/lib/ic/src/ic_pp.erl @@ -1894,23 +1894,37 @@ include_dir(Flags) when is_list(Flags)-> include_dir(_Flags) -> []. -include_dir(Flags,IncDir) -> +include_dir(Flags,IncDirs) -> case string:str(Flags,"-I") of 0 -> - lists:reverse(IncDir); + lists:reverse(IncDirs); X -> - Rem2 = string:sub_string(Flags, X+2), - Rem = string:strip(Rem2, left), - Y = string:str(Rem," "), - case string:str(Rem," ") of - 0 -> - lists:reverse([string:sub_string(Rem, Y+1)|IncDir]); - Y -> - include_dir(string:sub_string(Rem, Y+1), - [string:sub_string(Rem,1,Y-1)|IncDir]) - end + {NewDir, RemainingFlags} = + gobble_inc_dir(string:sub_string(Flags, X+2),nq,[]), + include_dir(RemainingFlags, [NewDir|IncDirs]) end. +% nq = not-quoted, q = quoted. +% Possible strange scenarios: +% /usr/test\ ing/ +% "/usr/test ing/" +% /usr/test\"ing/ +% "/usr/test\"ing/" +gobble_inc_dir([],nq,Acc) -> + % Only accept nq here, if we end up here in q mode the user has missed a " + {lists:reverse(Acc),[]}; +gobble_inc_dir([$\\,$"|R],Q,Acc) -> + gobble_inc_dir(R,Q,[$"|Acc]); +gobble_inc_dir([$"|R],nq,Acc) -> + gobble_inc_dir(R,q,Acc); +gobble_inc_dir([$"|R],q,Acc) -> + gobble_inc_dir(R,nq,Acc); +gobble_inc_dir([$\\,$ |R],nq,Acc) -> + gobble_inc_dir(R,nq,[$ |Acc]); +gobble_inc_dir([$ |R],nq,Acc) -> + {lists:reverse(Acc),R}; +gobble_inc_dir([C|R],Q,Acc) -> + gobble_inc_dir(R,Q,[C|Acc]). %%=============================================================== @@ -1954,7 +1968,6 @@ find_inc_file2(FileName, [D|Rem]) -> _ -> D++"/" end, - case catch file:read_file_info(Dir++FileName) of {ok, _} -> {ok, Dir++FileName}; diff --git a/lib/ic/test/Makefile b/lib/ic/test/Makefile index 1d90a1bc17..65003d703b 100644 --- a/lib/ic/test/Makefile +++ b/lib/ic/test/Makefile @@ -239,39 +239,39 @@ release_spec: release_docs_spec: release_tests_spec: tests - $(INSTALL_DIR) $(RELSYSDIR) - $(INSTALL_DIR) $(RELSYSDIR)/ic_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/ic_register_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/ic_pragma_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/ic_pp_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/ic_be_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_proto_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/erl_client_c_server_proto_SUITE_data - $(INSTALL_DIR) $(RELSYSDIR)/java_client_erl_server_SUITE_data + $(INSTALL_DIR) "$(RELSYSDIR)" + $(INSTALL_DIR) "$(RELSYSDIR)/ic_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/ic_register_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/ic_pragma_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/ic_pp_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/ic_be_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_proto_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/erl_client_c_server_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/erl_client_c_server_proto_SUITE_data" + $(INSTALL_DIR) "$(RELSYSDIR)/java_client_erl_server_SUITE_data" $(INSTALL_DATA) $(IDL_FILES) ic.cover $(TEST_SPEC_FILE) $(ERL_FILES) \ - $(RELSYSDIR) - $(INSTALL_DATA) $(COMPILER_TEST_FILES) $(RELSYSDIR)/ic_SUITE_data + "$(RELSYSDIR)" + $(INSTALL_DATA) $(COMPILER_TEST_FILES) "$(RELSYSDIR)/ic_SUITE_data" $(INSTALL_DATA) $(COMPILER_TEST_FILES2) \ - $(RELSYSDIR)/ic_register_SUITE_data + "$(RELSYSDIR)/ic_register_SUITE_data" $(INSTALL_DATA) $(COMPILER_TEST_FILES3) \ - $(RELSYSDIR)/ic_pragma_SUITE_data + "$(RELSYSDIR)/ic_pragma_SUITE_data" $(INSTALL_DATA) $(COMPILER_TEST_FILES4) \ - $(RELSYSDIR)/ic_be_SUITE_data + "$(RELSYSDIR)/ic_be_SUITE_data" $(INSTALL_DATA) $(PREPROCESSOR_TEST_FILES) \ - $(RELSYSDIR)/ic_pp_SUITE_data + "$(RELSYSDIR)/ic_pp_SUITE_data" $(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_TEST_FILES) \ - $(RELSYSDIR)/c_client_erl_server_SUITE_data + "$(RELSYSDIR)/c_client_erl_server_SUITE_data" $(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_PROTO_TEST_FILES) \ - $(RELSYSDIR)/c_client_erl_server_proto_SUITE_data + "$(RELSYSDIR)/c_client_erl_server_proto_SUITE_data" $(INSTALL_DATA) $(C_CLIENT_ERL_SERVER_PROTO_TMO_TEST_FILES) \ - $(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data + "$(RELSYSDIR)/c_client_erl_server_proto_tmo_SUITE_data" $(INSTALL_DATA) $(ERL_CLIENT_C_SERVER_TEST_FILES) \ - $(RELSYSDIR)/erl_client_c_server_SUITE_data + "$(RELSYSDIR)/erl_client_c_server_SUITE_data" $(INSTALL_DATA) $(ERL_CLIENT_C_SERVER_PROTO_TEST_FILES) \ - $(RELSYSDIR)/erl_client_c_server_proto_SUITE_data - $(INSTALL_DATA) $(SUITE_TARGET_FILES) $(RELSYSDIR) + "$(RELSYSDIR)/erl_client_c_server_proto_SUITE_data" + $(INSTALL_DATA) $(SUITE_TARGET_FILES) "$(RELSYSDIR)" $(INSTALL_DATA) $(JAVA_CLIENT_ERL_SERVER_TEST_FILES) \ - $(RELSYSDIR)/java_client_erl_server_SUITE_data + "$(RELSYSDIR)/java_client_erl_server_SUITE_data" diff --git a/lib/ic/test/java_client_erl_server_SUITE.erl b/lib/ic/test/java_client_erl_server_SUITE.erl index 407c3d2d44..d4523dc2ad 100644 --- a/lib/ic/test/java_client_erl_server_SUITE.erl +++ b/lib/ic/test/java_client_erl_server_SUITE.erl @@ -249,7 +249,7 @@ marshal_any_2(Config) when is_list(Config) -> java(Java, Dir, ClassAndArgs) -> - cmd(Java++" -classpath "++classpath(Dir)++" "++ClassAndArgs). + cmd(Java++" -classpath \""++classpath(Dir)++"\" "++ClassAndArgs). java(Java, Dir, Class, Args) -> java(Java, Dir, Class++" "++to_string(Args)). |