diff --git a/Makefile b/Makefile index 1c97db9bf..27f2acd9b 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # bill@newbreedsoftware.com # http://www.tuxpaint.org/ -# June 14, 2002 - November 20, 2009 +# June 14, 2002 - February 24, 2010 # The version number, for release: @@ -34,6 +34,9 @@ endif endif endif +WINDRES:=windres +PKG_CONFIG:=pkg-config + # test if a library can be linked linktest = $(shell if $(CC) $(CPPFLAGS) $(CFLAGS) -o dummy.o dummy.c $(LDFLAGS) $(1) $(2) > /dev/null 2>&1; \ then \ @@ -74,8 +77,8 @@ PAPER_LIB:=$(call linktest,-lpaper,) PNG:=$(call linktest,-lpng,) PNG:=$(if $(PNG),$(PNG),$(call linktest,-lpng12,)) -FRIBIDI_LIB:=$(shell pkg-config --libs fribidi) -FRIBIDI_CFLAGS:=$(shell pkg-config --cflags fribidi) +FRIBIDI_LIB:=$(shell $(PKG_CONFIG) --libs fribidi) +FRIBIDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags fribidi) windows_ARCH_LINKS:=-lintl $(PNG) -lwinspool -lshlwapi $(FRIBIDI_LIB) osx_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB) @@ -93,8 +96,7 @@ ARCH_HEADERS:=$($(OS)_ARCH_HEADERS) windows_PREFIX:=/usr/local osx_PREFIX:=/usr/local -# FIXME: "finddir" fails on other platforms -bjk 2009.12.08 -beos_PREFIX:=$(shell finddir B_APPS_DIRECTORY)/TuxPaint +beos_PREFIX=$(shell finddir B_APPS_DIRECTORY)/TuxPaint linux_PREFIX:=/usr/local PREFIX:=$($(OS)_PREFIX) @@ -164,7 +166,7 @@ CURSOR_SHAPES:=LARGE # Libraries, paths, and flags: -SDL_LIBS:=$(shell sdl-config --libs) -lSDL_image -lSDL_ttf +SDL_LIBS:=$(shell $(PKG_CONFIG) sdl --libs) -lSDL_image -lSDL_ttf # Sound support SDL_MIXER_LIB:=$(call linktest,-lSDL_mixer,$(SDL_LIBS)) @@ -176,15 +178,15 @@ NOPANGOFLAG:=$(if $(SDL_PANGO_LIB),,-DNO_SDLPANGO$(warning -lSDL_Pango failed, n SDL_LIBS+=$(SDL_MIXER_LIB) $(SDL_PANGO_LIB) -SDL_CFLAGS:=$(shell sdl-config --cflags) +SDL_CFLAGS:=$(shell $(PKG_CONFIG) sdl --cflags) # New one: -lrsvg-2 -lcairo # Old one: -lcairo -lsvg -lsvg-cairo -SVG_LIB:=$(shell pkg-config --libs librsvg-2.0 cairo || pkg-config --libs libsvg-cairo) +SVG_LIB:=$(shell $(PKG_CONFIG) --libs librsvg-2.0 cairo || $(PKG_CONFIG) --libs libsvg-cairo) # lots of -I things, so really should be SVG_CPPFLAGS -SVG_CFLAGS:=$(shell pkg-config --cflags librsvg-2.0 cairo || pkg-config --cflags libsvg-cairo) +SVG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags librsvg-2.0 cairo || $(PKG_CONFIG) --cflags libsvg-cairo) # SVG support via Cairo NOSVGFLAG:=$(if $(SVG_LIB),,-DNOSVG$(warning No SVG for you!)) @@ -1004,7 +1006,7 @@ obj/postscript_print.o: src/postscript_print.c Makefile \ obj/resource.o: win32/resources.rc win32/resource.h @echo @echo "...Compiling win32 resources..." - @windres -i win32/resources.rc -o obj/resource.o + @$(WINDRES) -i win32/resources.rc -o obj/resource.o src/tp_magic_api.h: src/tp_magic_api.h.in @@ -1033,8 +1035,8 @@ obj: ###### -MAGIC_SDL_CPPFLAGS:=$(shell sdl-config --cflags) -MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell sdl-config --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB) +MAGIC_SDL_CPPFLAGS:=$(shell $(PKG_CONFIG) sdl --cflags) +MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell $(PKG_CONFIG) sdl --libs) -lSDL_image -lSDL_ttf $(SDL_MIXER_LIB) MAGIC_ARCH_LINKS:=-lintl $(PNG) windows_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS) diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt index 0e6c5c0ee..9054319fa 100644 --- a/docs/AUTHORS.txt +++ b/docs/AUTHORS.txt @@ -7,7 +7,7 @@ bill@newbreedsoftware.com http://www.tuxpaint.org/ -June 17, 2002 - February 16, 2010 +June 17, 2002 - February 24, 2010 $Id$ @@ -735,6 +735,9 @@ $Id$ * Windows 32-bit coding and builds John Popplewell + * Tweaks to help Windows cross-compiling under Linux + Volker Grabsch + * Mac OS X coding and builds Martin Fuhrer Darrell Walisser [retired] @@ -744,6 +747,7 @@ $Id$ * BeOS coding and builds Luc 'Begasus' Schrijvers + Scott McCreary Marcin 'Shard' Konicki [retired] * Debian Linux packages diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index d55583362..7a7aecbb6 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2009.February.18 (0.9.22) +2009.February.24 (0.9.22) * New Tools: ---------- * Label - A tool to add text to a drawing, which can be modified or @@ -35,6 +35,14 @@ $Id$ * Wet Paint - Draws a light coat of paint, and smudges at the same time. (Based on Smudge tool. Requested by gallery artist Angela.) + * Build System Improvements: + -------------------------- + * Variety of tweaks to help Tux Paint cross-compile for Windows under Linux + Volker Grabsch + + * Added support for building under Haiku OS + Scott McCreary + * Other Improvements: ------------------- * Template images are now supported. Similar to Starters, they are diff --git a/src/compiler.h b/src/compiler.h index b6878f7cf..8b3c40216 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - February 18, 2006 + June 14, 2002 - February 24, 2010 $Id$ */ @@ -52,7 +52,7 @@ WIN32 and MINGW don't have strcasestr(). */ #define NOMINMAX -#include "Shlwapi.h" +#include "shlwapi.h" #define strcasestr StrStrI #endif /* WIN32 */ diff --git a/src/fonts.c b/src/fonts.c index a0fba9e4a..c65e622ae 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -131,7 +131,7 @@ int no_system_fonts = 1; #endif int all_locale_fonts; volatile long font_thread_done; -static volatile long font_thread_aborted; +volatile long font_thread_aborted; volatile long waiting_for_fonts; static int font_scanner_pid; int font_socket_fd; diff --git a/src/fonts.h b/src/fonts.h index 2434bb42c..54db77140 100644 --- a/src/fonts.h +++ b/src/fonts.h @@ -69,6 +69,7 @@ extern SDL_Thread *font_thread; extern volatile long font_thread_done; +extern volatile long font_thread_aborted; extern volatile long waiting_for_fonts; extern int font_socket_fd; diff --git a/src/parse.gperf b/src/parse.gperf index 223ed8d4b..9cc9bf3bc 100644 --- a/src/parse.gperf +++ b/src/parse.gperf @@ -6,13 +6,13 @@ %{ -#include "../src/parse.h" #include #include #include #include #include #include +#include "../src/parse.h" const char PARSE_YES[] = "yes"; const char PARSE_NO[] = "no"; diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 8377b8567..0d2a25ee8 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - October 13, 2009 + June 14, 2002 - February 24, 2010 */ @@ -268,7 +268,7 @@ typedef struct safer_dirent ino_t d_ino; ino_t d_pino; unsigned short d_reclen; - char d_name[NAME_MAX]; + char d_name[FILENAME_MAX]; } safer_dirent; #define dirent safer_dirent @@ -1501,9 +1501,9 @@ static int cursor_left, cursor_x, cursor_y, cursor_textwidth; /* canvas-relative static int old_cursor_x, old_cursor_y; static int cur_label, cur_select; static int been_saved; -static char file_id[NAME_MAX]; -static char starter_id[NAME_MAX]; -static char template_id[NAME_MAX]; +static char file_id[FILENAME_MAX]; +static char starter_id[FILENAME_MAX]; +static char template_id[FILENAME_MAX]; static int brush_scroll; static int stamp_scroll[MAX_STAMP_GROUPS]; static int font_scroll, magic_scroll, tool_scroll; @@ -8248,7 +8248,7 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, Uint32(*getpixel) (SDL_Surface *, int, int) = getpixels[src->format->BytesPerPixel]; - + /* FIXME: Deal with gamma, per: http://www.4p8.com/eric.brasseur/gamma.html */ /* Determine scale and centering offsets: */ if (!keep_aspect) @@ -10152,7 +10152,7 @@ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst, static void load_starter_id(char *saved_id) { char *rname; - char fname[NAME_MAX]; + char fname[FILENAME_MAX]; FILE *fi; char color_tag; int r, g, b; @@ -19425,8 +19425,10 @@ static void setup_config(char *argv[]) // FIXME: most of this is not required before starting the font scanner +#ifdef PAPER_H if(tmpcfg_cmd.papersize && !strcmp(tmpcfg_cmd.papersize, "help")) show_available_papersizes(0); +#endif #define SETBOOL(x) do{ if(tmpcfg.x) x = (tmpcfg.x==PARSE_YES); }while(0) SETBOOL(all_locale_fonts); @@ -19504,10 +19506,12 @@ static void setup_config(char *argv[]) strcpy(colorfile, tmpcfg.colorfile); // FIXME can overflow if(tmpcfg.print_delay) print_delay = atoi(tmpcfg.print_delay); +#ifdef PAPER_H if(tmpcfg.printcommand) printcommand = tmpcfg.printcommand; if(tmpcfg.altprintcommand) altprintcommand = tmpcfg.altprintcommand; +#endif if(tmpcfg.alt_print_command_default) { // FIXME: probably need extra variables @@ -19518,8 +19522,10 @@ static void setup_config(char *argv[]) else alt_print_command_default = ALTPRINT_MOD; // default ("mod") } +#ifdef PAPER_H if(tmpcfg.papersize) papersize = tmpcfg.papersize; +#endif }