[csw-devel] SF.net SVN: gar:[9207] csw/mgar/pkg/liblqr/trunk

hson at users.sourceforge.net hson at users.sourceforge.net
Tue Mar 16 16:21:15 CET 2010


Revision: 9207
          http://gar.svn.sourceforge.net/gar/?rev=9207&view=rev
Author:   hson
Date:     2010-03-16 15:21:15 +0000 (Tue, 16 Mar 2010)

Log Message:
-----------
liblqr: Fixes for strange link error

Modified Paths:
--------------
    csw/mgar/pkg/liblqr/trunk/Makefile
    csw/mgar/pkg/liblqr/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/liblqr/trunk/files/examples.diff
    csw/mgar/pkg/liblqr/trunk/files/inline.diff
    csw/mgar/pkg/liblqr/trunk/files/lqr_carver.c.diff

Modified: csw/mgar/pkg/liblqr/trunk/Makefile
===================================================================
--- csw/mgar/pkg/liblqr/trunk/Makefile	2010-03-16 14:45:14 UTC (rev 9206)
+++ csw/mgar/pkg/liblqr/trunk/Makefile	2010-03-16 15:21:15 UTC (rev 9207)
@@ -29,6 +29,10 @@
 
 UFILES_REGEX = $(GARNAME)-((\d+(?:\.\d+)*)-(\d+)?).tar.bz2
 
+PATCHFILES += inline.diff
+PATCHFILES += examples.diff
+PATCHFILES += lqr_carver.c.diff
+
 CONFIGURE_ARGS  = $(DIRPATHS)
 
 STRIP_LIBTOOL=1

Modified: csw/mgar/pkg/liblqr/trunk/checksums
===================================================================
--- csw/mgar/pkg/liblqr/trunk/checksums	2010-03-16 14:45:14 UTC (rev 9206)
+++ csw/mgar/pkg/liblqr/trunk/checksums	2010-03-16 15:21:15 UTC (rev 9207)
@@ -1 +1,4 @@
+a72475efd2dff3ea3c1cca64a3f71353  examples.diff
+f63660355a974deaa91963b41601685a  inline.diff
 0e24ed3c9fcdcb111062640764d7b87a  liblqr-1-0.4.1.tar.bz2
+f8e1412341efdd975d7a5ee4c034e4f4  lqr_carver.c.diff

Added: csw/mgar/pkg/liblqr/trunk/files/examples.diff
===================================================================
--- csw/mgar/pkg/liblqr/trunk/files/examples.diff	                        (rev 0)
+++ csw/mgar/pkg/liblqr/trunk/files/examples.diff	2010-03-16 15:21:15 UTC (rev 9207)
@@ -0,0 +1,143 @@
+diff -Nru ../build-global/liblqr-1-0.4.1/examples/Makefile liblqr-1-0.4.1/examples/Makefile
+--- ../build-global/liblqr-1-0.4.1/examples/Makefile	2009-05-09 18:41:30.000000000 +0200
++++ liblqr-1-0.4.1/examples/Makefile	2010-03-16 03:08:38.227713387 +0100
+@@ -21,7 +21,6 @@
+ tt1out = liquidrescale
+ tt2out = liquidrescale-basic
+ 
+-
+ # collect flags for the compiler for lqr library
+ LQR_CFLAGS = `pkg-config --cflags lqr-1`
+ 
+@@ -51,9 +50,9 @@
+        $(GTHREAD_LIBS)
+ 
+ # define the flags to use in the various compilation steps
+-BASE_FLAGS = -Winline -O2 -Wall
++BASE_FLAGS = 
+ OBJ_BUILD_FLAGS = $(BASE_FLAGS) $(INCLUDES) $(LIBDIRS) 
+-LINKING_FLAGS = $(OBJ_BUILD_FLAGS) $(LIBS) 
++LINKING_FLAGS = $(OBJ_BUILD_FLAGS) $(LIBS) -lgnugetopt
+ 
+ # compilation rules
+ 
+@@ -63,17 +62,17 @@
+ 
+ # linking
+ $(tt1out) : $(tt1obj)
+-	g++ $(LINKING_FLAGS) -o $(tt1out) $(tt1obj)
++	CC $(LINKING_FLAGS) -o $(tt1out) $(tt1obj)
+ 
+ $(tt2out) : $(tt2obj)
+-	g++ $(LINKING_FLAGS) -o $(tt2out) $(tt2obj)
++	CC $(LINKING_FLAGS) -o $(tt2out) $(tt2obj)
+ 
+ # object building
+ $(tt1).o : $(tt1).cpp $(tt1).h
+-	g++ -c $(OBJ_BUILD_FLAGS) $(tt1).cpp
++	CC -c -D__STDC__=1 $(OBJ_BUILD_FLAGS) $(tt1).cpp 
+ 
+ $(tt2).o : $(tt2).cpp
+-	g++ -c $(OBJ_BUILD_FLAGS) $(tt2).cpp
++	CC -c -D__STDC__=1 $(OBJ_BUILD_FLAGS) $(tt2).cpp
+ 
+ #cleanup
+ clean:
+diff -Nru ../build-global/liblqr-1-0.4.1/examples/Makefile.orig liblqr-1-0.4.1/examples/Makefile.orig
+--- ../build-global/liblqr-1-0.4.1/examples/Makefile.orig	1970-01-01 01:00:00.000000000 +0100
++++ liblqr-1-0.4.1/examples/Makefile.orig	2010-03-16 03:09:48.023084903 +0100
+@@ -0,0 +1,80 @@
++#
++# Makefile example for liquidrescale (lqr) library
++# 
++# This is thought for exemplification purposes.
++# It will only work if you have already installed
++# the lqr library, the pngwriter and all their 
++# required dependencies (glib, z, png, freetype).
++#
++# It does not perform any kind of check on the system,
++# and won't report any sensible error message.
++#
++
++
++# set the sources file name
++tt1 = liquidrescale
++tt2 = liquidrescale-basic
++# objects to build
++tt1obj = $(tt1).o
++tt2obj = $(tt2).o
++# executable names
++tt1out = liquidrescale
++tt2out = liquidrescale-basic
++
++# collect flags for the compiler for lqr library
++LQR_CFLAGS = `pkg-config --cflags lqr-1`
++
++LQR_LIBS = `pkg-config --libs lqr-1`
++
++LQR_LIBDIR = `pkg-config --variable=libdir lqr-1`
++
++# collect flags for pngwriter library
++PNGWRITER_CFLAGS = `freetype-config --cflags` 
++
++PNGWRITER_LIBS = -lpng -lpngwriter -lz -lfreetype 
++
++# collect flags for the compiler for glib thread support
++GTHREAD_LIBS = `pkg-config --libs gthread-2.0`
++
++# join the flags collected above
++INCLUDES = \
++	$(LQR_CFLAGS) \
++	$(PNGWRITER_CFLAGS)
++
++LIBDIRS = \
++	  -L$(LQR_LIBDIR)
++
++LIBS = \
++       $(LQR_LIBS) \
++       $(PNGWRITER_LIBS) \
++       $(GTHREAD_LIBS)
++
++# define the flags to use in the various compilation steps
++BASE_FLAGS = 
++OBJ_BUILD_FLAGS = $(BASE_FLAGS) $(INCLUDES) $(LIBDIRS) 
++LINKING_FLAGS = $(OBJ_BUILD_FLAGS) $(LIBS) -lgnugetopt
++
++# compilation rules
++
++.PHONY : all clean
++
++all: $(tt1out) $(tt2out)
++
++# linking
++$(tt1out) : $(tt1obj)
++	CC $(LINKING_FLAGS) -o $(tt1out) $(tt1obj)
++
++$(tt2out) : $(tt2obj)
++	CC $(LINKING_FLAGS) -o $(tt2out) $(tt2obj)
++
++# object building
++$(tt1).o : $(tt1).cpp $(tt1).h
++	CC -c -D__STDC__=1 $(OBJ_BUILD_FLAGS) $(tt1).cpp 
++
++$(tt2).o : $(tt2).cpp
++	CC -c -D__STDC__=1 $(OBJ_BUILD_FLAGS) $(tt2).cpp
++
++#cleanup
++clean:
++	rm -f *~ ctags $(tt1obj) $(tt2obj) $(tt1out) $(tt2out)
++
+diff -Nru ../build-global/liblqr-1-0.4.1/examples/liquidrescale.cpp liblqr-1-0.4.1/examples/liquidrescale.cpp
+--- ../build-global/liblqr-1-0.4.1/examples/liquidrescale.cpp	2009-05-11 02:11:50.000000000 +0200
++++ liblqr-1-0.4.1/examples/liquidrescale.cpp	2010-03-16 03:08:38.252945938 +0100
+@@ -15,9 +15,9 @@
+  * along with this program; if not, see <http://www.gnu.org/licenses/> 
+  */
+ 
++#include <getopt.h>
+ #include <pngwriter.h>
+ #include <lqr.h>
+-#include <getopt.h>
+ #include "liquidrescale.h"
+ 
+ using namespace std;

Added: csw/mgar/pkg/liblqr/trunk/files/inline.diff
===================================================================
--- csw/mgar/pkg/liblqr/trunk/files/inline.diff	                        (rev 0)
+++ csw/mgar/pkg/liblqr/trunk/files/inline.diff	2010-03-16 15:21:15 UTC (rev 9207)
@@ -0,0 +1,89 @@
+diff -Nru ../build-isa-sparcv9/liblqr-1-0.4.1/lqr/lqr_energy.c liblqr-1-0.4.1/lqr/lqr_energy.c
+--- ../build-isa-sparcv9/liblqr-1-0.4.1/lqr/lqr_energy.c	2009-05-11 02:08:03.000000000 +0200
++++ liblqr-1-0.4.1/lqr/lqr_energy.c	2010-03-16 03:02:27.106285715 +0100
+@@ -44,7 +44,7 @@
+ 
+ /* read normalised pixel value from
+  * rgb buffer at the given index */
+-inline gdouble
++extern inline gdouble
+ lqr_pixel_get_norm(void *rgb, gint rgb_ind, LqrColDepth col_depth)
+ {
+     switch (col_depth) {
+@@ -66,7 +66,7 @@
+ 
+ /* write pixel from normalised value
+  * in rgb buffer at the given index */
+-inline void
++extern inline void
+ lqr_pixel_set_norm(gdouble val, void *rgb, gint rgb_ind, LqrColDepth col_depth)
+ {
+     switch (col_depth) {
+@@ -90,7 +90,7 @@
+     }
+ }
+ 
+-inline gdouble
++extern inline gdouble
+ lqr_pixel_get_rgbcol(void *rgb, gint rgb_ind, LqrColDepth col_depth, LqrImageType image_type, gint channel)
+ {
+     gdouble black_fact = 0;
+@@ -115,7 +115,7 @@
+     }
+ }
+ 
+-inline gdouble
++extern inline gdouble
+ lqr_carver_read_brightness_grey(LqrCarver *r, gint x, gint y)
+ {
+     gint now = r->raw[y][x];
+@@ -123,7 +123,7 @@
+     return lqr_pixel_get_norm(r->rgb, rgb_ind, r->col_depth);
+ }
+ 
+-inline gdouble
++extern inline gdouble
+ lqr_carver_read_brightness_std(LqrCarver *r, gint x, gint y)
+ {
+     gdouble red, green, blue;
+@@ -205,7 +205,7 @@
+     return bright * alpha_fact;
+ }
+ 
+-inline gdouble
++extern inline gdouble
+ lqr_carver_read_luma_std(LqrCarver *r, gint x, gint y)
+ {
+     gdouble red, green, blue;
+diff -Nru ../build-isa-sparcv9/liblqr-1-0.4.1/lqr/lqr_energy_priv.h liblqr-1-0.4.1/lqr/lqr_energy_priv.h
+--- ../build-isa-sparcv9/liblqr-1-0.4.1/lqr/lqr_energy_priv.h	2009-05-11 02:08:03.000000000 +0200
++++ liblqr-1-0.4.1/lqr/lqr_energy_priv.h	2010-03-16 03:02:38.451733418 +0100
+@@ -38,18 +38,18 @@
+ #define LQR_SATURATE_(x) (1 / (1 + (1 / (x))))
+ #define LQR_SATURATE(x) ((x) >= 0 ? LQR_SATURATE_(x) : -LQR_SATURATE_(-x))
+ 
+-inline gdouble lqr_pixel_get_norm(void *src, gint src_ind, LqrColDepth col_depth);
+-inline void lqr_pixel_set_norm(gdouble val, void *rgb, gint rgb_ind, LqrColDepth col_depth);
+-inline gdouble lqr_pixel_get_rgbcol(void *rgb, gint rgb_ind, LqrColDepth col_depth, LqrImageType image_type,
++extern inline gdouble lqr_pixel_get_norm(void *src, gint src_ind, LqrColDepth col_depth);
++extern inline void lqr_pixel_set_norm(gdouble val, void *rgb, gint rgb_ind, LqrColDepth col_depth);
++extern inline gdouble lqr_pixel_get_rgbcol(void *rgb, gint rgb_ind, LqrColDepth col_depth, LqrImageType image_type,
+                                     gint channel);
+-inline gdouble lqr_carver_read_brightness_grey(LqrCarver *r, gint x, gint y);
+-inline gdouble lqr_carver_read_brightness_std(LqrCarver *r, gint x, gint y);
++extern inline gdouble lqr_carver_read_brightness_grey(LqrCarver *r, gint x, gint y);
++extern inline gdouble lqr_carver_read_brightness_std(LqrCarver *r, gint x, gint y);
+ gdouble lqr_carver_read_brightness_custom(LqrCarver *r, gint x, gint y);
+-inline gdouble lqr_carver_read_brightness(LqrCarver *r, gint x, gint y);
+-inline gdouble lqr_carver_read_luma_std(LqrCarver *r, gint x, gint y);
+-inline gdouble lqr_carver_read_luma(LqrCarver *r, gint x, gint y);
+-inline gdouble lqr_carver_read_rgba(LqrCarver *r, gint x, gint y, gint channel);
+-inline gdouble lqr_carver_read_custom(LqrCarver *r, gint x, gint y, gint channel);
++extern inline gdouble lqr_carver_read_brightness(LqrCarver *r, gint x, gint y);
++extern inline gdouble lqr_carver_read_luma_std(LqrCarver *r, gint x, gint y);
++extern inline gdouble lqr_carver_read_luma(LqrCarver *r, gint x, gint y);
++extern inline gdouble lqr_carver_read_rgba(LqrCarver *r, gint x, gint y, gint channel);
++extern inline gdouble lqr_carver_read_custom(LqrCarver *r, gint x, gint y, gint channel);
+ 
+ gdouble lqr_carver_read_cached_std(LqrCarver *r, gint x, gint y);
+ gdouble lqr_carver_read_cached_rgba(LqrCarver *r, gint x, gint y, gint channel);

Added: csw/mgar/pkg/liblqr/trunk/files/lqr_carver.c.diff
===================================================================
--- csw/mgar/pkg/liblqr/trunk/files/lqr_carver.c.diff	                        (rev 0)
+++ csw/mgar/pkg/liblqr/trunk/files/lqr_carver.c.diff	2010-03-16 15:21:15 UTC (rev 9207)
@@ -0,0 +1,27 @@
+diff -Nru ../build-global/liblqr-1-0.4.1/lqr/lqr_carver.c liblqr-1-0.4.1/lqr/lqr_carver.c
+--- ../build-global/liblqr-1-0.4.1/lqr/lqr_carver.c	2009-05-11 02:08:03.000000000 +0200
++++ liblqr-1-0.4.1/lqr/lqr_carver.c	2010-03-16 06:27:45.765156213 +0100
+@@ -252,7 +252,11 @@
+     r->rigidity_map = g_try_new0(gfloat, 2 * r->delta_x + 1);
+     r->rigidity_map += r->delta_x;
+     for (x = -r->delta_x; x <= r->delta_x; x++) {
++#if defined(__sun) && defined(__SUNPRO_C) && (defined(__SunOS_5_9) || defined(__SunOS_5_8))
++        r->rigidity_map[x] = r->rigidity * pow(fabs(x), 1.5) / r->h;
++#else
+         r->rigidity_map[x] = r->rigidity * powf(fabsf(x), 1.5) / r->h;
++#endif
+     }
+ 
+     r->active = TRUE;
+@@ -1221,7 +1225,11 @@
+             /* reduce the range if there's no (relevant) difference
+              * with the previous map */
+             if (r->least[data] == least) {
++#if defined(__sun) && defined(__SUNPRO_C) && (defined(__SunOS_5_9) || defined(__SunOS_5_8))
++                if (fabs(r->m[data] - new_m) < UPDATE_TOLERANCE) {
++#else
+                 if (fabsf(r->m[data] - new_m) < UPDATE_TOLERANCE) {
++#endif
+                     if (stop == 0) {
+                         x_stop = x;
+                     }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list