/* * Silly little bodge for getting GNU make to pass long commands * to broken programs like the Microsoft and Watcom linkers. This * tool is built with gcc, and invoked using GNU make. It echoes * the arguments into a temporary file, and then passes that as a * script to the utility in question. Ugly, but it does the job. * An @ symbol marks that all commands from here on should go in * the argument file, and a \ character indicates to convert slashes * from / to \ format. */ #include #include #include char **__crt0_glob_function(char *_arg) { /* don't let djgpp glob our command line arguments */ return NULL; } int main(int argc, char *argv[]) { char buf[256] = ""; FILE *f = NULL; int flip_slashes = 0; int ret, i, j; char *p; if (argc < 2) { printf("Usage: runner program args\n"); return 1; } for (i=1; i= 126) { fprintf(stderr, "Runner oops: command line is longer than 126 characters!\n"); remove("_tmpfile.arg"); return 1; } } ret = system(buf); remove("_tmpfile.arg"); return ret; }