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:
parent
12c367ca50
commit
24e4a93edc
1 changed files with 4 additions and 2 deletions
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#define BUILDDIR "@abs_top_builddir@"
|
#define BUILDDIR "@abs_top_builddir@"
|
||||||
#define LIBPATHENV "@LIBPATHENV@"
|
#define LIBPATHENV "@LIBPATHENV@"
|
||||||
|
#define PATH_SEP '@PATH_SEPARATOR@'
|
||||||
|
#define RUBY_INSTALL_NAME "@RUBY_BASE_NAME@"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
@ -15,7 +17,7 @@ main(int argc, char **argv)
|
||||||
size_t n = strlen(libpath);
|
size_t n = strlen(libpath);
|
||||||
char *e = malloc(sizeof(builddir)+n+1);
|
char *e = malloc(sizeof(builddir)+n+1);
|
||||||
memcpy(e, builddir, sizeof(builddir)-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);
|
memcpy(e+sizeof(builddir), libpath, n+1);
|
||||||
libpath = e;
|
libpath = e;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +25,6 @@ main(int argc, char **argv)
|
||||||
libpath = builddir;
|
libpath = builddir;
|
||||||
}
|
}
|
||||||
setenv(LIBPATHENV, libpath, 1);
|
setenv(LIBPATHENV, libpath, 1);
|
||||||
execv(BUILDDIR"/@RUBY_BASE_NAME@", argv);
|
execv(BUILDDIR"/"RUBY_INSTALL_NAME, argv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue