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.
This commit is contained in:
26
examples/ex4.c.template
Normal file
26
examples/ex4.c.template
Normal file
@ -0,0 +1,26 @@
|
||||
#! @BINDIR@/tcc -run -L/usr/X11R6/lib -lX11
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
/* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user