Revision: 631 Author: eht16 Date: 2006-07-25 10:45:34 -0700 (Tue, 25 Jul 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=631&view=rev
Log Message: ----------- Small changes to get cross compiling using mingw32 suite working.
Modified Paths: -------------- trunk/Makefile.am trunk/configure.in trunk/scintilla/Makefile.am trunk/src/Makefile.am trunk/src/callbacks.c trunk/tagmanager/ctags.c trunk/tagmanager/get.c trunk/tagmanager/tm_work_object.c
Added Paths: ----------- trunk/geany_windres.rc.in Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/Makefile.am 2006-07-25 17:45:34 UTC (rev 631) @@ -7,6 +7,8 @@ geany.desktop.in \ geany.spec \ geany.glade \ + geany_windres.rc \ + geany_windres.h \ geany.gladep \ data/global.tags \ data/php.tags \ @@ -40,7 +42,6 @@ fi \ done
- dist-hook: if test -d pixmaps; then \ mkdir $(distdir)/pixmaps; \ @@ -51,6 +52,19 @@ done \ fi
+if MINGW +install-win32: + GEANY_INSTALL_DIR=geany; \ + mkdir $(GEANY_INSTALL_DIR); \ + cp ChangeLog $(GEANY_INSTALL_DIR)/ChangeLog.txt; \ + cp TODO $(GEANY_INSTALL_DIR)/ToDo.txt; \ + cp COPYING $(GEANY_INSTALL_DIR)/ChangeLog.txt; \ + cp AUTHORS $(GEANY_INSTALL_DIR)/Authors.txt; \ + cp README $(GEANY_INSTALL_DIR)/ReadMe.txt; \ + cp THANKS $(GEANY_INSTALL_DIR)/Thanks.txt; \ + @# to be finished +endif + BZIP2_ENV =--best
dist-bzip2: distdir
Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/configure.in 2006-07-25 17:45:34 UTC (rev 631) @@ -3,7 +3,10 @@
AC_INIT(configure.in) AM_INIT_AUTOMAKE(geany, 0.8) +MAJOR_VERSION="0" +MINOR_VERSION="8"
+ AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX @@ -39,7 +42,7 @@ # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_ERROR_AT_LINE -AC_REPLACE_FNMATCH +#AC_REPLACE_FNMATCH AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MALLOC @@ -48,7 +51,7 @@ AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_VPRINTF -AC_CHECK_FUNCS([gethostname ftruncate fgetpos getcwd gettimeofday isascii mblen memset putenv realpath regcomp setenv strcasecmp strchr strdup strerror strrchr strspn strstr strtol]) +AC_CHECK_FUNCS([gethostname ftruncate fgetpos getcwd gettimeofday isascii mblen memset mkstemp putenv realpath regcomp setenv strcasecmp strchr strdup strerror strrchr strspn strstr strtol])
# autoscan end
@@ -58,8 +61,10 @@ if test -d ".svn" -a -x "${SVN}" then REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4` + VERSION_STRING="$VERSION ($REVISION)" else REVISION="-1" + VERSION_STRING="$VERSION" fi AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])
@@ -86,10 +91,6 @@ AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],[enable if you want virtual termninal support [[default=yes]]]), [want_vte="$enableval"], [want_vte="yes"])
-if test "x$want_vte" = "xyes"; then - AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support]) -fi - # if test "$want_vte" = "yes"; then # PKG_CHECK_MODULES(VTE, [vte], # [AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])], @@ -99,10 +100,20 @@ # [AC_MSG_ERROR([VTE support enabled, but VTE not found])], []) # fi
-# Check for random number paths -AC_CHECK_FILE([/dev/urandom], AC_DEFINE([HAVE_DEVURANDOM], [1], [Define that you found /dev/urandom])) -AC_CHECK_FILE([/dev/random], AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random])) +# Check for random number paths (skip when cross compiling) +if test "x$build" = "x$target"; then + AC_CHECK_FILE([/dev/urandom], AC_DEFINE([HAVE_DEVURANDOM], [1], [Define that you found /dev/urandom])) + AC_CHECK_FILE([/dev/random], AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random])) +fi
+if test "x$target" = "xi386-mingw32msvc"; then + AC_DEFINE_UNQUOTED([WIN32], 1, [we are cross compiling for WIN32]) + want_vte="no" + AC_EXEEXT +fi +AM_CONDITIONAL(MINGW, test "x$target" = "xi386-mingw32msvc") + + GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
# just for a laugh (it has absolutely no effect) @@ -133,11 +144,19 @@ fi fi
+if test "x$want_vte" = "xyes"; then + AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support]) +fi + GEANY_PIXMAPS_DIR=`eval echo ${datadir}/pixmaps` AC_SUBST(GEANY_PIXMAPS_DIR) GEANY_DATA_DIR=`eval echo ${datadir}/geany` AC_SUBST(GEANY_DATA_DIR)
+AC_SUBST([MINOR_VERSION]) +AC_SUBST([MAJOR_VERSION]) +AC_SUBST([VERSION_STRING]) + AC_OUTPUT([ Makefile tagmanager/Makefile @@ -150,10 +169,16 @@ doc/geany.1 geany.spec geany.desktop +geany_windres.rc ])
echo "----------------------------------------" echo "Install Geany in : ${prefix}" +if test "x${build}" != "x" -a "x${target}" != "x" +then + echo "Building Geany on : ${build}" + echo "Building Geany for : ${target}" +fi echo "Using GTK version : ${GTK_VERSION}" echo "Use virtual terminal support : ${want_vte}" echo "Use named pipe support : ${want_pipe}"
Added: trunk/geany_windres.rc.in =================================================================== --- trunk/geany_windres.rc.in (rev 0) +++ trunk/geany_windres.rc.in 2006-07-25 17:45:34 UTC (rev 631) @@ -0,0 +1,32 @@ + +#include <windows.h> // include for version info constants + + +A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "../pixmaps/geany.ico" + +1 VERSIONINFO +FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,0,0 +PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,0,0 +FILETYPE VFT_APP +{ + BLOCK "StringFileInfo" + { + BLOCK "040704E4" + { + VALUE "CompanyName", "" + VALUE "FileVersion", "@VERSION_STRING@" + VALUE "FileDescription", "Small and lighweight IDE (built using mingw gcc)" + VALUE "InternalName", "geany" + VALUE "LegalCopyright", "Copyright 2005-2006 by Enrico Troeger" + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "geany" + VALUE "ProductName", "geany" + VALUE "ProductVersion", "@VERSION_STRING@" + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0407, 1252 + } +} +
Modified: trunk/scintilla/Makefile.am =================================================================== --- trunk/scintilla/Makefile.am 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/scintilla/Makefile.am 2006-07-25 17:45:34 UTC (rev 631) @@ -55,8 +55,11 @@
libscintilla_a_SOURCES = $(SRCS)
-INCLUDES=-I$(top_srcdir) -Iinclude \ -@PACKAGE_CFLAGS@ +if MINGW +INCLUDES=-I$(top_srcdir) -Iinclude -I/usr/local/cross-tools/include @PACKAGE_CFLAGS@ +else +INCLUDES=-I$(top_srcdir) -Iinclude @PACKAGE_CFLAGS@ +endif
libscintilla_a_LIBADD = scintilla-marshal.o
Modified: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/src/Makefile.am 2006-07-25 17:45:34 UTC (rev 631) @@ -1,18 +1,12 @@ ## Process this file with automake to produce Makefile.in # $Id$
-INCLUDES = \ - -DPACKAGE_DATA_DIR=""$(datadir)"" \ - -DPACKAGE_LOCALE_DIR=""$(prefix)/$(DATADIRNAME)/locale"" \ - -I../scintilla/include \ - -I../tagmanager/include \ - @PACKAGE_CFLAGS@
-EXTRA_DIST = images.c gb.c win32.c win32.h +EXTRA_DIST = images.c gb.c
bin_PROGRAMS = geany
-geany_SOURCES = \ +SRCS = \ main.c geany.h \ search.c search.h \ notebook.c notebook.h \ @@ -32,12 +26,42 @@ sciwrappers.c sciwrappers.h \ document.c document.h \ utils.c utils.h \ - vte.c vte.h \ support.c support.h \ interface.c interface.h \ callbacks.c callbacks.h
-#AM_CFLAGS = -Wall -pipe -#AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe -AM_CFLAGS = -DGEANY_DEBUG -g -Wall -pipe + + +if MINGW +# build Geany for Windows +WINDRES = /usr/local/cross-tools/bin/i386-mingw32msvc-windres + +geany_SOURCES = $(SRCS) win32.c win32.h +geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a -lstdc++ @PACKAGE_LIBS@ \ + $(INTLLIBS) -lgdi32 -limm32 -lshell32 -lole32 -luuid -liberty -lcomdlg32 -lcomctl32 \ + geany_windres.res +AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe -mms-bitfields +#AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe -mms-bitfields -g -O0 +geany_LDFLAGS = -mwindows + +INCLUDES = \ + -DPACKAGE_DATA_DIR="data" -DPACKAGE_LOCALE_DIR="data" -I../scintilla/include \ + -I../tagmanager/include @PACKAGE_CFLAGS@ + +geany_windres.res: + $(WINDRES) -i ../geany_windres.rc --input-format=rc -o geany_windres.res -O coff; + +else +# build Geany for all other platforms +AM_CFLAGS = -DGEANY_DEBUG -Wall -pipe +geany_SOURCES = $(SRCS) vte.c vte.h geany_LDADD = @PACKAGE_LIBS@ -lstdc++ ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a $(INTLLIBS) + +INCLUDES = \ + -DPACKAGE_DATA_DIR=""$(datadir)"" -DPACKAGE_LOCALE_DIR=""$(prefix)/$(DATADIRNAME)/locale"" \ + -I../scintilla/include -I../tagmanager/include @PACKAGE_CFLAGS@ + +endif + +#geany_SOURCES = $(SRCS) +#geany_LDADD = @PACKAGE_LIBS@ -lstdc++ ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a $(INTLLIBS)
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/src/callbacks.c 2006-07-25 17:45:34 UTC (rev 631) @@ -1232,7 +1232,7 @@ gchar *text; if (idx < 0) return;
- text = malloc(sci_get_selected_text_length(doc_list[idx].sci) + 1); + text = g_malloc(sci_get_selected_text_length(doc_list[idx].sci) + 1); sci_get_selected_text(doc_list[idx].sci, text); sci_replace_sel(doc_list[idx].sci, g_ascii_strup(text, -1)); g_free(text);
Modified: trunk/tagmanager/ctags.c =================================================================== --- trunk/tagmanager/ctags.c 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/tagmanager/ctags.c 2006-07-25 17:45:34 UTC (rev 631) @@ -20,6 +20,7 @@ * INCLUDE FILES */ #include "general.h" /* must always come first */ +#include <glib.h>
#ifdef HAVE_STDLIB_H # include <stdlib.h> /* to declare malloc (), realloc () */ @@ -341,7 +342,7 @@
extern void *eMalloc (const size_t size) { - void *buffer = malloc (size); + void *buffer = g_malloc (size);
if (buffer == NULL) error (FATAL, "out of memory"); @@ -366,7 +367,7 @@ buffer = eMalloc (size); else { - buffer = realloc (ptr, size); + buffer = g_realloc (ptr, size); if (buffer == NULL) error (FATAL, "out of memory"); }
Modified: trunk/tagmanager/get.c =================================================================== --- trunk/tagmanager/get.c 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/tagmanager/get.c 2006-07-25 17:45:34 UTC (rev 631) @@ -13,6 +13,7 @@ * INCLUDE FILES */ #include "general.h" /* must always come first */ +#include <glib.h>
#include <string.h>
@@ -637,7 +638,7 @@ pos1 = ftell(File.fp); if (pos2 > pos1) { - result = (char *) malloc(sizeof(char ) * (pos2 - pos1 + 2)); + result = (char *) g_malloc(sizeof(char ) * (pos2 - pos1 + 2)); if (result != NULL) { fread(result, sizeof(char), pos2 - pos1 + 1, File.fp); @@ -664,7 +665,7 @@ { int i = 0, pos = 0; ParseState state = st_none_t, prev_state = st_none_t; - + while (buf[i] != '\0') { switch(buf[i])
Modified: trunk/tagmanager/tm_work_object.c =================================================================== --- trunk/tagmanager/tm_work_object.c 2006-07-25 13:14:51 UTC (rev 630) +++ trunk/tagmanager/tm_work_object.c 2006-07-25 17:45:34 UTC (rev 631) @@ -7,6 +7,8 @@ * */
+#include "general.h" /* must always come first */ + #include <stdio.h> #include <limits.h> #include <stdlib.h> @@ -25,7 +27,7 @@ gchar path[PATH_MAX+1]; memset(path, '\0', PATH_MAX+1); #ifdef G_OS_WIN32 - return lrealpath(file_name, path); + return lrealpath(file_name); #else realpath(file_name, path); #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.