Commit 1a112ef4 authored by Claes Sjofors's avatar Claes Sjofors

Possibility to build co_convert without gtk

parent 22b86d3a
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
using namespace std; using namespace std;
#define PWRE_GTK 1 //#define PWRE_CONF_GTK 1
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
# include <gdk/gdk.h> # include <gdk/gdk.h>
# include <gdk-pixbuf/gdk-pixbuf.h> # include <gdk-pixbuf/gdk-pixbuf.h>
...@@ -66,7 +66,7 @@ static Display *display = 0; ...@@ -66,7 +66,7 @@ static Display *display = 0;
int cnv_get_image( char *fname, cnv_tImImage *image, cnv_tPixmap *pixmap) int cnv_get_image( char *fname, cnv_tImImage *image, cnv_tPixmap *pixmap)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
if ( !gdk_init_done) { if ( !gdk_init_done) {
gdk_init( 0, 0); gdk_init( 0, 0);
gdk_init_done = 1; gdk_init_done = 1;
...@@ -93,7 +93,7 @@ int cnv_get_image( char *fname, cnv_tImImage *image, cnv_tPixmap *pixmap) ...@@ -93,7 +93,7 @@ int cnv_get_image( char *fname, cnv_tImImage *image, cnv_tPixmap *pixmap)
void cnv_free_image( cnv_tImImage image, cnv_tPixmap pixmap) void cnv_free_image( cnv_tImImage image, cnv_tPixmap pixmap)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
gdk_pixbuf_unref( (GdkPixbuf *) image); gdk_pixbuf_unref( (GdkPixbuf *) image);
#elif defined PWRE_IMLIB #elif defined PWRE_IMLIB
...@@ -105,7 +105,7 @@ void cnv_free_image( cnv_tImImage image, cnv_tPixmap pixmap) ...@@ -105,7 +105,7 @@ void cnv_free_image( cnv_tImImage image, cnv_tPixmap pixmap)
void cnv_print_image( cnv_tImImage image, char *filename) void cnv_print_image( cnv_tImImage image, char *filename)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
char *s; char *s;
char type[20]; char type[20];
GError *error = NULL; GError *error = NULL;
...@@ -128,19 +128,23 @@ void cnv_print_image( cnv_tImImage image, char *filename) ...@@ -128,19 +128,23 @@ void cnv_print_image( cnv_tImImage image, char *filename)
int cnv_image_width( cnv_tImImage image) int cnv_image_width( cnv_tImImage image)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
return gdk_pixbuf_get_width( (GdkPixbuf *)image); return gdk_pixbuf_get_width( (GdkPixbuf *)image);
#elif defined PWRE_IMLIB #elif defined PWRE_IMLIB
return ((ImlibImage *)image)->rgb_width; return ((ImlibImage *)image)->rgb_width;
#else
return 0;
#endif #endif
} }
int cnv_image_height( cnv_tImImage image) int cnv_image_height( cnv_tImImage image)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
return gdk_pixbuf_get_height( (GdkPixbuf *)image); return gdk_pixbuf_get_height( (GdkPixbuf *)image);
#elif defined PWRE_IMLIB #elif defined PWRE_IMLIB
return ((ImlibImage *)image)->rgb_height; return ((ImlibImage *)image)->rgb_height;
#else
return 0;
#endif #endif
} }
...@@ -148,7 +152,7 @@ void cnv_image_pixel_iter( cnv_tImImage image, ...@@ -148,7 +152,7 @@ void cnv_image_pixel_iter( cnv_tImImage image,
void (* pixel_cb)(void *, ofstream&, unsigned char *), void (* pixel_cb)(void *, ofstream&, unsigned char *),
void *userdata, ofstream& fp) void *userdata, ofstream& fp)
{ {
#if defined PWRE_GTK #if defined PWRE_CONF_GTK
unsigned char *rgb, *rgb_row; unsigned char *rgb, *rgb_row;
int rgb_height; int rgb_height;
int rgb_width; int rgb_width;
......
...@@ -3,7 +3,10 @@ link_rule_mk := 1 ...@@ -3,7 +3,10 @@ link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \ link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \
$(objects) -L/usr/X11R6/lib -L/opt/gnome/lib -lpwr_co \ $(objects) -L/usr/X11R6/lib -L/opt/gnome/lib -lpwr_co \
`pkg-config --libs gtk+-2.0` \ $(linkgtk) \
-lX11 -lrt -lm -lX11 -lrt -lm
# `pkg-config --libs gtk+-2.0` \
endif endif
...@@ -3,7 +3,7 @@ link_rule_mk := 1 ...@@ -3,7 +3,7 @@ link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \ link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \
$(objects) -L/usr/X11R6/lib -L/opt/gnome/lib -lpwr_co \ $(objects) -L/usr/X11R6/lib -L/opt/gnome/lib -lpwr_co \
`pkg-config --libs gtk+-2.0` \ $(linkgtk) \
-lX11 -lrt -lm -lX11 -lrt -lm
endif endif
...@@ -101,10 +101,18 @@ else ...@@ -101,10 +101,18 @@ else
linkmysql := linkmysql :=
endif endif
ifeq ($(pwre_conf_gtk),1)
cgtk := -DPWRE_CONF_GTK=1
linkgtk := `pkg-config --libs gtk+-2.0`
else
cgtk :=
linkgtk :=
endif
log_done = log_done =
csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_X86=1 -DHW=x86 csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_X86=1 -DHW=x86
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \ cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) `pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk)
rm := rm rm := rm
cp := cp cp := cp
cpflags := cpflags :=
......
...@@ -101,10 +101,18 @@ else ...@@ -101,10 +101,18 @@ else
linkmysql := linkmysql :=
endif endif
ifeq ($(pwre_conf_gtk),1)
cgtk := -DPWRE_CONF_GTK=1
linkgtk := `pkg-config --libs gtk+-2.0`
else
cgtk :=
linkgtk :=
endif
log_done = log_done =
csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_X86_64=1 -DHW=x86_64 csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_X86_64=1 -DHW=x86_64
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \ cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) `pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk)
rm := rm rm := rm
cp := cp cp := cp
cpflags := cpflags :=
......
...@@ -151,6 +151,12 @@ set_env() ...@@ -151,6 +151,12 @@ set_env()
else else
export pwre_conf_mysql=0 export pwre_conf_mysql=0
fi fi
# Gtk
if [ -e /usr/lib/libgtk-x11-2.0.so ]; then
export pwre_conf_gtk=1
else
export pwre_conf_gtk=0
fi
} }
pwre_get_variables() pwre_get_variables()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment