winegcc: don't tie the script name to the .exe.so name.
Dimitrie O. Paun
dpaun at rogers.com
Wed Mar 3 07:26:33 CST 2004
ChangeLog
Don't tie the script name to the .exe.so name.
Index: tools/winegcc/utils.c
===================================================================
RCS file: /var/cvs/wine/tools/winegcc/utils.c,v
retrieving revision 1.7
diff -u -r1.7 utils.c
--- tools/winegcc/utils.c 2 Mar 2004 06:53:16 -0000 1.7
+++ tools/winegcc/utils.c 3 Mar 2004 12:59:54 -0000
@@ -187,7 +187,7 @@
return base_name;
}
-void create_file(const char* name, const char* fmt, ...)
+void create_file(const char* name, int mode, const char* fmt, ...)
{
va_list ap;
FILE *file;
@@ -198,6 +198,7 @@
error ("Can not create %s.", name);
vfprintf(file, fmt, ap);
va_end(ap);
+ fchmod(fileno(file), mode);
fclose(file);
}
Index: tools/winegcc/utils.h
===================================================================
RCS file: /var/cvs/wine/tools/winegcc/utils.h,v
retrieving revision 1.6
diff -u -r1.6 utils.h
--- tools/winegcc/utils.h 2 Mar 2004 06:53:16 -0000 1.6
+++ tools/winegcc/utils.h 3 Mar 2004 12:57:20 -0000
@@ -59,7 +59,7 @@
} file_type;
char* get_basename(const char* file);
-void create_file(const char* name, const char* fmt, ...);
+void create_file(const char* name, int mode, const char* fmt, ...);
file_type get_file_type(const char* filename);
file_type get_lib_type(strarray* path, const char* library, char** file);
void spawn(const strarray* arr);
Index: tools/winegcc/winegcc.c
===================================================================
RCS file: /var/cvs/wine/tools/winegcc/winegcc.c,v
retrieving revision 1.11
diff -u -r1.11 winegcc.c
--- tools/winegcc/winegcc.c 2 Mar 2004 06:53:16 -0000 1.11
+++ tools/winegcc/winegcc.c 3 Mar 2004 13:01:59 -0000
@@ -133,11 +133,11 @@
"\n"
"# figure out the full app path\n"
"if [ -n \"$appdir\" ]; then\n"
- " apppath=\"$appdir/$appname.exe.so\"\n"
+ " apppath=\"$appdir/$appname\"\n"
" WINEDLLPATH=\"$appdir:$WINEDLLPATH\"\n"
" export WINEDLLPATH\n"
"else\n"
- " apppath=\"$appname.exe.so\"\n"
+ " apppath=\"$appname\"\n"
"fi\n"
"\n"
"# determine the WINELOADER\n"
@@ -363,7 +363,10 @@
else base_name = base_file;
if (opts->files->size == 1 && strendswith(opts->files->base[0], ".exe.so"))
- goto only_app_loader;
+ {
+ create_file(base_file, 0755, app_loader_template, opts->files->base[0]);
+ return;
+ }
/* prepare the linking path */
lib_dirs = strarray_dup(opts->lib_dirs);
@@ -511,12 +514,8 @@
spawn(link_args);
/* create the loader script */
-only_app_loader:
if (generate_app_loader)
- {
- create_file(base_file, app_loader_template, base_name);
- chmod(base_file, 0755);
- }
+ create_file(base_file, 0755, app_loader_template, strmake("%s.exe.so", base_name));
}
--
Dimi.
More information about the wine-patches
mailing list