ChangeSet ID: 6503 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@wine.codeweavers.com 2002/12/05 13:12:13 Modified files: tools : Makefile.in .cvsignore Added files: tools : mingwrap.c Log message: Dimitrie O. Paun New MinGW wrapper that makes gcc on Linux behave like MinGW on Windows, using the Wine headers. Patch: http://cvs.winehq.com/patch.py?id=6503 Old revision New revision Changes Path 1.24 1.25 +16 -4 wine/tools/Makefile.in 1.5 1.6 +1 -0 wine/tools/.cvsignore Added 1.1 +0 -0 wine/tools/mingwrap.c Index: wine/tools/Makefile.in diff -u -p wine/tools/Makefile.in:1.24 wine/tools/Makefile.in:1.25 --- wine/tools/Makefile.in:1.24 Sat Nov 21 00:05:05 2009 +++ wine/tools/Makefile.in Sat Nov 21 00:05:05 2009 @@ -3,11 +3,19 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = .. SRCDIR = @srcdir@ VPATH = @srcdir@ - -PROGRAMS = makedep fnt2bdf bin2res MODULE = none -C_SRCS = makedep.c fnt2bdf.c bin2res.c +PROGRAMS = \ + bin2res \ + fnt2bdf \ + makedep \ + mingwrap + +C_SRCS = \ + bin2res.c \ + fnt2bdf.c \ + makedep.c \ + mingwrap.c SUBDIRS = \ widl \ @@ -38,12 +46,16 @@ fnt2bdf: fnt2bdf.o bin2res: bin2res.o $(CC) $(CFLAGS) -o bin2res bin2res.o +mingwrap: mingwrap.o + $(CC) $(CFLAGS) -DINCLUDEDIR="$(includedir)" -o mingwrap mingwrap.o + install:: $(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext) $(INSTALL_SCRIPT) $(SRCDIR)/winemaker $(bindir)/winemaker + $(INSTALL_SCRIPT) $(SRCDIR)/mingwrap $(bindir)/mingwrap $(INSTALL_DATA) $(SRCDIR)/winemaker.man $(mandir)/man$(prog_manext)/winemaker.$(prog_manext) uninstall:: - $(RM) $(bindir)/winemaker $(mandir)/man$(prog_manext)/winemaker.$(prog_manext) + $(RM) $(bindir)/winemaker $(bindir)/mingwrap $(mandir)/man$(prog_manext)/winemaker.$(prog_manext) ### Dependencies: Index: wine/tools/.cvsignore diff -u -p wine/tools/.cvsignore:1.5 wine/tools/.cvsignore:1.6 --- wine/tools/.cvsignore:1.5 Sat Nov 21 00:05:05 2009 +++ wine/tools/.cvsignore Sat Nov 21 00:05:05 2009 @@ -2,3 +2,4 @@ Makefile bin2res fnt2bdf makedep +mingwrap Index: wine/tools/mingwrap.c diff -u -p /dev/null wine/tools/mingwrap.c:1.1 --- /dev/null Sat Nov 21 00:05:05 2009 +++ wine/tools/mingwrap.c Sat Nov 21 00:05:05 2009 @@ -0,0 +1,69 @@ +/* + * MinGW wrapper: makes gcc behave like MinGW. + * + * Copyright 2002 Dimitrie O. Paun + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifndef GCC_BIN +#define GCC_BIN "gcc" +#endif + +#ifndef INCLUDEDIR +#define INCLUDEDIR "/usr/local/include/wine" +#endif + +int main(int argc, char **argv) +{ + char **gcc_argv; + int i, j; + + gcc_argv = malloc(sizeof(char*) * (argc + 20)); + + i = 0; + gcc_argv[i++] = GCC_BIN; + + gcc_argv[i++] = "-fshort-wchar"; + gcc_argv[i++] = "-fPIC"; + gcc_argv[i++] = "-I" INCLUDEDIR; + gcc_argv[i++] = "-I" INCLUDEDIR "/msvcrt"; + gcc_argv[i++] = "-I" INCLUDEDIR "/windows"; + gcc_argv[i++] = "-DWINE_DEFINE_WCHAR_T"; + gcc_argv[i++] = "-D__int8=char"; + gcc_argv[i++] = "-D__int16=short"; + gcc_argv[i++] = "-D__int32=int"; + gcc_argv[i++] = "-D__int64=long long"; + + for ( j = 1 ; j < argc ; j++ ) { + if (strcmp("-mno-cygwin", argv[j]) == 0) { + /* ignore this option */ + } else { + gcc_argv[i++] = argv[j]; + } + } + gcc_argv[i] = NULL; + + return execvp(GCC_BIN, gcc_argv); +}