From cb2138f8b098feb1b51a407343a4b99e25d5b506 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sat, 18 Jun 2011 00:24:47 +0200 Subject: Make examples' shebang use target tcc bindir path Use @BINDIR@ in shebang of examples to put the right path on the target system. That is, use #!/usr/local/bin/tcc if tcc is installed in /usr/local/bin and #!/usr/bin/tcc if tcc is installed in /usr/bin/tcc. --- examples/ex1.c | 8 -------- examples/ex1.c.template | 8 ++++++++ examples/ex4.c | 26 -------------------------- examples/ex4.c.template | 26 ++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 34 deletions(-) delete mode 100755 examples/ex1.c create mode 100644 examples/ex1.c.template delete mode 100755 examples/ex4.c create mode 100644 examples/ex4.c.template (limited to 'examples') diff --git a/examples/ex1.c b/examples/ex1.c deleted file mode 100755 index 28139f9..0000000 --- a/examples/ex1.c +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/local/bin/tcc -run -#include - -int main() -{ - printf("Hello World\n"); - return 0; -} diff --git a/examples/ex1.c.template b/examples/ex1.c.template new file mode 100644 index 0000000..8744f58 --- /dev/null +++ b/examples/ex1.c.template @@ -0,0 +1,8 @@ +#! @BINDIR@/tcc -run +#include + +int main() +{ + printf("Hello World\n"); + return 0; +} diff --git a/examples/ex4.c b/examples/ex4.c deleted file mode 100755 index b33b033..0000000 --- a/examples/ex4.c +++ /dev/null @@ -1,26 +0,0 @@ -#!./tcc -run -L/usr/X11R6/lib -lX11 -#include -#include -#include - -/* Yes, TCC can use X11 too ! */ - -int main(int argc, char **argv) -{ - Display *display; - Screen *screen; - - display = XOpenDisplay(""); - if (!display) { - fprintf(stderr, "Could not open X11 display\n"); - exit(1); - } - printf("X11 display opened.\n"); - screen = XScreenOfDisplay(display, 0); - printf("width = %d\nheight = %d\ndepth = %d\n", - screen->width, - screen->height, - screen->root_depth); - XCloseDisplay(display); - return 0; -} diff --git a/examples/ex4.c.template b/examples/ex4.c.template new file mode 100644 index 0000000..81aa00d --- /dev/null +++ b/examples/ex4.c.template @@ -0,0 +1,26 @@ +#! @BINDIR@/tcc -run -L/usr/X11R6/lib -lX11 +#include +#include +#include + +/* Yes, TCC can use X11 too ! */ + +int main(int argc, char **argv) +{ + Display *display; + Screen *screen; + + display = XOpenDisplay(""); + if (!display) { + fprintf(stderr, "Could not open X11 display\n"); + exit(1); + } + printf("X11 display opened.\n"); + screen = XScreenOfDisplay(display, 0); + printf("width = %d\nheight = %d\ndepth = %d\n", + screen->width, + screen->height, + screen->root_depth); + XCloseDisplay(display); + return 0; +} -- cgit v1.3.1