1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ruby-runner.c.in: make macros

* template/ruby-runner.c.in (PATH_SEP, RUBY_INSTALL_NAME): move
  configured values as macros.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-10-05 06:29:54 +00:00
parent 12c367ca50
commit 24e4a93edc

View file

@ -5,6 +5,8 @@
#define BUILDDIR "@abs_top_builddir@"
#define LIBPATHENV "@LIBPATHENV@"
#define PATH_SEP '@PATH_SEPARATOR@'
#define RUBY_INSTALL_NAME "@RUBY_BASE_NAME@"
int
main(int argc, char **argv)
@ -15,7 +17,7 @@ main(int argc, char **argv)
size_t n = strlen(libpath);
char *e = malloc(sizeof(builddir)+n+1);
memcpy(e, builddir, sizeof(builddir)-1);
e[sizeof(builddir)-1] = '@PATH_SEPARATOR@';
e[sizeof(builddir)-1] = PATH_SEP;
memcpy(e+sizeof(builddir), libpath, n+1);
libpath = e;
}
@ -23,6 +25,6 @@ main(int argc, char **argv)
libpath = builddir;
}
setenv(LIBPATHENV, libpath, 1);
execv(BUILDDIR"/@RUBY_BASE_NAME@", argv);
execv(BUILDDIR"/"RUBY_INSTALL_NAME, argv);
return -1;
}