From ted at midg3t.net Mon Jan 21 12:14:04 2008 From: ted at midg3t.net (Ted Percival) Date: Mon, 21 Jan 2008 11:14:04 +1000 Subject: Automatically executing the right program In-Reply-To: <472D3E18.8030005@midg3t.net> References: <20071024020303.GJ24243@bakeyournoodle.com> <20071024040525.GL24243@bakeyournoodle.com> <472D3E18.8030005@midg3t.net> Message-ID: <4793F1DC.9030601@midg3t.net> Ted Percival wrote: > How about this patch? The ccontrol config file can contain things like > cc = /usr/bin > > If invoked as gcc-4.2 it will execute /usr/bin/gcc-4.2, etc. That patch was a bit buggy (see ), I have updated it so it works properly now: http://tedp.id.au/gitweb/?p=ccontrol-debian.git;a=blob;f=debian/patches/find-cmd-by-dir;hb=HEAD Is there a reason why ccontrol doesn't just peruse PATH until it finds a matching command that is not ccontrol? I think that would be easier to use, then the config file would only be necessary to configure more interesting things like no-parallel, distcc-hosts, etc. -- \0 From David.Leonard at quest.com Mon Jan 21 13:09:37 2008 From: David.Leonard at quest.com (David Leonard) Date: Mon, 21 Jan 2008 12:09:37 +1000 Subject: hp-ux patch Message-ID: <4793FEE1.7030907@quest.com> Everyone loves HP-UX. *** stdrusty.h Mon Dec 31 15:28:38 2007 --- stdrusty.h Mon Dec 31 15:42:00 2007 *************** *** 2,8 **** --- 2,10 ---- #define _STDRUSTY_H #include #include + #if !defined(__hpux__) #include + #endif /* Is A == B ? */ #define streq(a,b) (strcmp((a),(b)) == 0) *** ccontrol.c Mon Dec 31 15:28:37 2007 --- ccontrol.c Mon Dec 31 15:40:11 2007 *************** *** 11,16 **** --- 11,17 ---- #include #include #include + #include #include #include "stdrusty.h" #include "ccontrol.h" *************** *** 402,404 **** --- 403,428 ---- } return ret; } + + #if defined(__hpux__) + int setenv(const char *name, const char *value, int overwrite) + { + char *env_line; + int name_len = strlen(name); + int value_len = strlen(value); + + if (!overwrite && getenv(name)) + return 0; + env_line = malloc(name_len + 1 + value_len + 1); /* "name=value\0" */ + memcpy(env_line, name, name_len); + env_line[name_len] = '='; + memcpy(env_line + name_len + 1, value, value_len); + env_line[name_len + 1 + value_len] = 0; + return putenv(env_line); + } + + int unsetenv(const char *name) + { + return putenv(name); + } + #endif