Small changes to get cross compiling using mingw32 suite working.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@631 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2006-07-25 17:45:34 +00:00
parent ac34496500
commit d8c06b041d
9 changed files with 132 additions and 30 deletions

View File

@ -7,6 +7,8 @@ EXTRA_DIST = \
geany.desktop.in \ geany.desktop.in \
geany.spec \ geany.spec \
geany.glade \ geany.glade \
geany_windres.rc \
geany_windres.h \
geany.gladep \ geany.gladep \
data/global.tags \ data/global.tags \
data/php.tags \ data/php.tags \
@ -40,7 +42,6 @@ install-data-local:
fi \ fi \
done done
dist-hook: dist-hook:
if test -d pixmaps; then \ if test -d pixmaps; then \
mkdir $(distdir)/pixmaps; \ mkdir $(distdir)/pixmaps; \
@ -51,6 +52,19 @@ dist-hook:
done \ done \
fi 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 BZIP2_ENV =--best
dist-bzip2: distdir dist-bzip2: distdir

View File

@ -3,6 +3,9 @@ dnl $Id$
AC_INIT(configure.in) AC_INIT(configure.in)
AM_INIT_AUTOMAKE(geany, 0.8) AM_INIT_AUTOMAKE(geany, 0.8)
MAJOR_VERSION="0"
MINOR_VERSION="8"
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
@ -39,7 +42,7 @@ AC_C_VOLATILE
# Checks for library functions. # Checks for library functions.
AC_FUNC_CLOSEDIR_VOID AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE AC_FUNC_ERROR_AT_LINE
AC_REPLACE_FNMATCH #AC_REPLACE_FNMATCH
AC_FUNC_LSTAT AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC AC_FUNC_MALLOC
@ -48,7 +51,7 @@ AC_FUNC_REALLOC
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_FUNC_STAT AC_FUNC_STAT
AC_FUNC_VPRINTF 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 # autoscan end
@ -58,8 +61,10 @@ SVN=`which svn`
if test -d ".svn" -a -x "${SVN}" if test -d ".svn" -a -x "${SVN}"
then then
REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4` REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
VERSION_STRING="$VERSION ($REVISION)"
else else
REVISION="-1" REVISION="-1"
VERSION_STRING="$VERSION"
fi fi
AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number]) AC_DEFINE_UNQUOTED([REVISION], "$REVISION", [subversion revision number])
@ -86,10 +91,6 @@ fi
AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],[enable if you want virtual termninal support [[default=yes]]]), AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],[enable if you want virtual termninal support [[default=yes]]]),
[want_vte="$enableval"], [want_vte="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 # if test "$want_vte" = "yes"; then
# PKG_CHECK_MODULES(VTE, [vte], # PKG_CHECK_MODULES(VTE, [vte],
# [AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])], # [AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])],
@ -99,9 +100,19 @@ fi
# [AC_MSG_ERROR([VTE support enabled, but VTE not found])], []) # [AC_MSG_ERROR([VTE support enabled, but VTE not found])], [])
# fi # fi
# Check for random number paths # Check for random number paths (skip when cross compiling)
AC_CHECK_FILE([/dev/urandom], AC_DEFINE([HAVE_DEVURANDOM], [1], [Define that you found /dev/urandom])) if test "x$build" = "x$target"; then
AC_CHECK_FILE([/dev/random], AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random])) 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` GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
@ -133,11 +144,19 @@ if test "x${datadir}" = 'x${prefix}/share'; then
fi fi
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` GEANY_PIXMAPS_DIR=`eval echo ${datadir}/pixmaps`
AC_SUBST(GEANY_PIXMAPS_DIR) AC_SUBST(GEANY_PIXMAPS_DIR)
GEANY_DATA_DIR=`eval echo ${datadir}/geany` GEANY_DATA_DIR=`eval echo ${datadir}/geany`
AC_SUBST(GEANY_DATA_DIR) AC_SUBST(GEANY_DATA_DIR)
AC_SUBST([MINOR_VERSION])
AC_SUBST([MAJOR_VERSION])
AC_SUBST([VERSION_STRING])
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
tagmanager/Makefile tagmanager/Makefile
@ -150,10 +169,16 @@ doc/Makefile
doc/geany.1 doc/geany.1
geany.spec geany.spec
geany.desktop geany.desktop
geany_windres.rc
]) ])
echo "----------------------------------------" echo "----------------------------------------"
echo "Install Geany in : ${prefix}" 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 "Using GTK version : ${GTK_VERSION}"
echo "Use virtual terminal support : ${want_vte}" echo "Use virtual terminal support : ${want_vte}"
echo "Use named pipe support : ${want_pipe}" echo "Use named pipe support : ${want_pipe}"

32
geany_windres.rc.in Normal file
View File

@ -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
}
}

View File

@ -55,8 +55,11 @@ $(LEXER_SRCS)
libscintilla_a_SOURCES = $(SRCS) libscintilla_a_SOURCES = $(SRCS)
INCLUDES=-I$(top_srcdir) -Iinclude \ if MINGW
@PACKAGE_CFLAGS@ 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 libscintilla_a_LIBADD = scintilla-marshal.o

View File

@ -1,18 +1,12 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
# $Id$ # $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 bin_PROGRAMS = geany
geany_SOURCES = \ SRCS = \
main.c geany.h \ main.c geany.h \
search.c search.h \ search.c search.h \
notebook.c notebook.h \ notebook.c notebook.h \
@ -32,12 +26,42 @@ geany_SOURCES = \
sciwrappers.c sciwrappers.h \ sciwrappers.c sciwrappers.h \
document.c document.h \ document.c document.h \
utils.c utils.h \ utils.c utils.h \
vte.c vte.h \
support.c support.h \ support.c support.h \
interface.c interface.h \ interface.c interface.h \
callbacks.c callbacks.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) 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)

View File

@ -1232,7 +1232,7 @@ on_to_upper_case1_activate (GtkMenuItem *menuitem,
gchar *text; gchar *text;
if (idx < 0) return; 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_get_selected_text(doc_list[idx].sci, text);
sci_replace_sel(doc_list[idx].sci, g_ascii_strup(text, -1)); sci_replace_sel(doc_list[idx].sci, g_ascii_strup(text, -1));
g_free(text); g_free(text);

View File

@ -20,6 +20,7 @@
* INCLUDE FILES * INCLUDE FILES
*/ */
#include "general.h" /* must always come first */ #include "general.h" /* must always come first */
#include <glib.h>
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
# include <stdlib.h> /* to declare malloc (), realloc () */ # include <stdlib.h> /* to declare malloc (), realloc () */
@ -341,7 +342,7 @@ extern char* eStrdup (const char* str)
extern void *eMalloc (const size_t size) extern void *eMalloc (const size_t size)
{ {
void *buffer = malloc (size); void *buffer = g_malloc (size);
if (buffer == NULL) if (buffer == NULL)
error (FATAL, "out of memory"); error (FATAL, "out of memory");
@ -366,7 +367,7 @@ extern void *eRealloc (void *const ptr, const size_t size)
buffer = eMalloc (size); buffer = eMalloc (size);
else else
{ {
buffer = realloc (ptr, size); buffer = g_realloc (ptr, size);
if (buffer == NULL) if (buffer == NULL)
error (FATAL, "out of memory"); error (FATAL, "out of memory");
} }

View File

@ -13,6 +13,7 @@
* INCLUDE FILES * INCLUDE FILES
*/ */
#include "general.h" /* must always come first */ #include "general.h" /* must always come first */
#include <glib.h>
#include <string.h> #include <string.h>
@ -637,7 +638,7 @@ extern char *getArglistFromPos(fpos_t startPosition, const char *tokenName)
pos1 = ftell(File.fp); pos1 = ftell(File.fp);
if (pos2 > pos1) if (pos2 > pos1)
{ {
result = (char *) malloc(sizeof(char ) * (pos2 - pos1 + 2)); result = (char *) g_malloc(sizeof(char ) * (pos2 - pos1 + 2));
if (result != NULL) if (result != NULL)
{ {
fread(result, sizeof(char), pos2 - pos1 + 1, File.fp); fread(result, sizeof(char), pos2 - pos1 + 1, File.fp);

View File

@ -7,6 +7,8 @@
* *
*/ */
#include "general.h" /* must always come first */
#include <stdio.h> #include <stdio.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
@ -25,7 +27,7 @@ gchar *tm_get_real_path(const gchar *file_name)
gchar path[PATH_MAX+1]; gchar path[PATH_MAX+1];
memset(path, '\0', PATH_MAX+1); memset(path, '\0', PATH_MAX+1);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
return lrealpath(file_name, path); return lrealpath(file_name);
#else #else
realpath(file_name, path); realpath(file_name, path);
#endif #endif