Hello,attached you will find a patch for basically compiling the library and tifficc. It consists of a trivial makefile and some fixes/hacks (take your pick;) to let the code run on Linux.
hope this helps, Kai-Uwe Behrmann --developing for colour management www.behrmann.name + www.oyranos.org
Am 03.11.08, 14:42 +1300 schrieb Guy K. Kloss:
Unfortunately there seems to be either something wrong with the code, or the
Any ideas?
diff -Naur lcms-2.0preview_orig/include/lcms2.h lcms-2.0preview/include/lcms2.h --- lcms-2.0preview_orig/include/lcms2.h 2008-10-21 17:53:36.000000000 +0200 +++ lcms-2.0preview/include/lcms2.h 2008-11-01 16:39:56.000000000 +0100 @@ -178,6 +178,9 @@ #else # define CMSEXPORT # define CMSAPI +# define FAR +# define cdecl +# define stricmp strcasecmp #endif // Some common definitions diff -Naur lcms-2.0preview_orig/makefile lcms-2.0preview/makefile --- lcms-2.0preview_orig/makefile 1970-01-01 01:00:00.000000000 +0100 +++ lcms-2.0preview/makefile 2008-11-01 16:55:51.000000000 +0100 @@ -0,0 +1,120 @@ +TARGET=lcms +VERSION=2.0.0 +VERSION_A=2 +VERSION_A=0 +VERSION_A=0 + +CC =cc +CFLAGS =-Wall -g $(INCL) +LDFLAGS = -g -LLib/ +LDLIBS = -lc -lm -lpthread -ltiff +LINK_FLAGS_DYNAMIC = -shared $(DSO_LIB_VERSION) +DSO_LIB_VERSION = -Wl,-soname -Wl, + +COLLECT = ar cru +RANLIB = ranlib +LNK = ln -s + + +INCL = -Iinclude -I/usr/include +SRC_DIR = src/ +libdir=/usr/local/lib + +SO=.so + +LIBSONAMEFULL = lib$(TARGET)$(SO).$(VERSION)$(LIBEXT) +LIBSONAME = lib$(TARGET)$(SO).$(VERSION_A)$(LIBEXT) +LIBSO = lib$(TARGET)$(SO)$(LIBEXT) +LIBNAME = lib$(TARGET).a + +CFILES = \ + $(SRC_DIR)cmscam02.c \ + $(SRC_DIR)cmscgats.c \ + $(SRC_DIR)cmscnvrt.c \ + $(SRC_DIR)cmserr.c \ + $(SRC_DIR)cmsgamma.c \ + $(SRC_DIR)cmsgmt.c \ + $(SRC_DIR)cmsintrp.c \ + $(SRC_DIR)cmsio0.c \ + $(SRC_DIR)cmsio1.c \ + $(SRC_DIR)cmslut.c \ + $(SRC_DIR)cmsmd5.c \ + $(SRC_DIR)cmsmtrx.c \ + $(SRC_DIR)cmsnamed.c \ + $(SRC_DIR)cmspack.c \ + $(SRC_DIR)cmspcs.c \ + $(SRC_DIR)cmsplugin.c \ + $(SRC_DIR)cmssamp.c \ + $(SRC_DIR)cmssm.c \ + $(SRC_DIR)cmstypes.c \ + $(SRC_DIR)cmsvirt.c \ + $(SRC_DIR)cmswtpnt.c \ + $(SRC_DIR)cmsxform.c + +NO = $(SRC_DIR)cmsps2.c + +OBJECTS = $(CPPFILES:.cpp=.o) $(CXXFILES:.cxx=.o) $(CFILES:.c=.o) + +TIFFICC_SOURCES = \ + utils/tifficc/tifficc.c \ + utils/shared/vprf.c \ + utils/shared/xgetopt.c + +TIFFICC_OBJECTS = $(TIFFICC_SOURCES:.c=.o) + +all: $(LIBSONAMEFULL) tifficc + + +tifficc: $(LIBNAME) $(TIFFICC_OBJECTS) + echo Linking $@ ... + $(CC) $(CFLAGS) -o tifficc \ + $(TIFFICC_OBJECTS) \ + $(LIBNAME) $(LDLIBS) $(LINK_LIB_PATH) + +# build all objects and libraries, link the headers to $(TARGET) +$(LIBSONAMEFULL): $(OBJECTS) $(LIBNAME) + echo Linking $@ ... + $(CC) $(CFLAGS) $(LINK_FLAGS_DYNAMIC)$@ \ + -o $(LIBSONAMEFULL) \ + $(OBJECTS) \ + -L$(libdir) $(LDLIBS) $(m) + $(RM) $(LIBSONAME) + $(LNK) $(LIBSONAMEFULL) $(LIBSONAME) + $(RM) $(LIBSO) + $(LNK) $(LIBSONAMEFULL) $(LIBSO) + +$(LIBNAME): $(OBJECTS) + echo Linking $@ ... + test -f $(LIBNAME) && $(RM) $(LIBNAME) || echo "" + $(COLLECT) $(LINK_FLAGS_STATIC) $(LIBNAME) \ + $(OBJECTS) + $(RANLIB) $(LIBNAME) + + +# Build commands and filename extensions... +.SUFFIXES: .0 .1 .3 .c .cxx .h .fl .man .o .z + + +.c.o: + echo Compiling $< ... + $(CC) -I. $(CFLAGS) -c -o $@ $< + +.cxx.o: + echo Compiling $< ... + $(CXX) -I. $(CXXFLAGS) -c -o $@ $< + +.cpp.o: + echo Compiling $< ... + $(CXX) -I. $(CXXFLAGS) -c -o $@ $< + +.fl.cxx: + echo Expanding $< ... + fluid -c $< + +.po: + echo Generating $@ ... + msgfmt $< + +clean: + $(RM) $(OBJECTS) $(LIBSONAMEFULL) $(LIBSONAME) $(LIBSO) $(LIBNAME) \ + tifficc $(TIFFICC_OBJECTS) diff -Naur lcms-2.0preview_orig/src/cmscgats.c lcms-2.0preview/src/cmscgats.c --- lcms-2.0preview_orig/src/cmscgats.c 2008-09-30 15:14:22.000000000 +0200 +++ lcms-2.0preview/src/cmscgats.c 2008-11-01 15:37:43.000000000 +0100 @@ -107,7 +107,7 @@ #include <limits.h> #ifndef NON_WINDOWS -#include <io.h> +#include <sys/io.h> #define DIR_CHAR '\\' #else #define DIR_CHAR '/' diff -Naur lcms-2.0preview_orig/src/cmscnvrt.c lcms-2.0preview/src/cmscnvrt.c --- lcms-2.0preview_orig/src/cmscnvrt.c 2008-10-27 16:01:44.000000000 +0100 +++ lcms-2.0preview/src/cmscnvrt.c 2008-11-01 15:40:46.000000000 +0100 @@ -425,7 +425,6 @@ // Default handler for ICC-style intents -static cmsLUT* _cmsDefaultICCintents(int nProfiles, int TheIntents[], cmsHPROFILE hProfiles[], diff -Naur lcms-2.0preview_orig/src/cmsio0.c lcms-2.0preview/src/cmsio0.c --- lcms-2.0preview_orig/src/cmsio0.c 2008-10-24 14:48:40.000000000 +0200 +++ lcms-2.0preview/src/cmsio0.c 2008-11-01 15:48:06.000000000 +0100 @@ -24,6 +24,7 @@ //--------------------------------------------------------------------------------- // +#include <time.h> #include "lcms2_internal.h" // Generic I/O, tag dictionary management, profile struct @@ -697,7 +698,7 @@ memcpy(&Icc -> ProfileID, ProfileID, 16); } -cmsBool CMSEXPORT cmsGetHeaderCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile) +CMSAPI cmsBool CMSEXPORT cmsGetHeaderCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile) { _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; memcpy(Dest, &Icc ->Created, sizeof(struct tm)); diff -Naur lcms-2.0preview_orig/src/cmsps2.c lcms-2.0preview/src/cmsps2.c --- lcms-2.0preview_orig/src/cmsps2.c 2008-01-03 18:09:34.000000000 +0100 +++ lcms-2.0preview/src/cmsps2.c 2008-11-01 15:49:02.000000000 +0100 @@ -24,11 +24,11 @@ //--------------------------------------------------------------------------------- // -#include "lcms2_internal.h" - #include <time.h> #include <stdarg.h> +#include "lcms2_internal.h" + // PostScript ColorRenderingDictionary and ColorSpaceArray CMSAPI icUInt32Number CMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile, int Intent, void* Buffer, icUInt32Number dwBufferLen); diff -Naur lcms-2.0preview_orig/src/cmsvirt.c lcms-2.0preview/src/cmsvirt.c --- lcms-2.0preview_orig/src/cmsvirt.c 2008-10-16 17:42:38.000000000 +0200 +++ lcms-2.0preview/src/cmsvirt.c 2008-11-01 16:07:42.000000000 +0100 @@ -71,7 +71,9 @@ Seq->seq[0].deviceMfg = 0; Seq->seq[0].deviceModel = 0; +#ifndef CMS_DONT_USE_INT64 Seq->seq[0].attributes = 0; +#endif Seq->seq[0].technology = 0; cmsMLUaddASCII( Seq->seq[0].Manufacturer, "Little CMS"); diff -Naur lcms-2.0preview_orig/src/lcms2_internal.h lcms-2.0preview/src/lcms2_internal.h --- lcms-2.0preview_orig/src/lcms2_internal.h 2008-10-27 15:48:56.000000000 +0100 +++ lcms-2.0preview/src/lcms2_internal.h 2008-11-01 15:54:48.000000000 +0100 @@ -25,6 +25,7 @@ #ifndef __lcms_internal_H +#include <time.h> // Include plug-in foundation #include "lcms2_plugin.h" @@ -309,7 +310,7 @@ // Interpolation --------------------------------------------------------------------------------------------------------- -cmsInterpParams* _cmsComputeInterpParams(int nSamples, int InputChan, int OutputChan, void* Table, cmsUInt32Number dwFlags); +cmsInterpParams* _cmsComputeInterpParams(int nSamples, int InputChan, int OutputChan, const void* Table, cmsUInt32Number dwFlags); cmsInterpParams* _cmsComputeInterpParamsEx(const cmsUInt32Number nSamples[], int InputChan, int OutputChan, const void* Table, cmsUInt32Number dwFlags); cmsBool _cmsOptimizeTo8bits(cmsInterpParams* p, cmsGAMMATABLE* G[3]); void _cmsFreeInterpParams(cmsInterpParams* p); @@ -569,4 +570,4 @@ #define __lcms_internal_H -#endif \ Kein Zeilenumbruch am Dateiende. +#endif diff -Naur lcms-2.0preview_orig/utils/tifficc/tifficc.c lcms-2.0preview/utils/tifficc/tifficc.c --- lcms-2.0preview_orig/utils/tifficc/tifficc.c 2008-10-21 17:50:52.000000000 +0200 +++ lcms-2.0preview/utils/tifficc/tifficc.c 2008-11-01 16:27:59.000000000 +0100 @@ -44,7 +44,7 @@ #include <sys/stat.h> #ifndef NON_WINDOWS -#include <io.h> +#include <sys/io.h> #endif #include "tiffio.h" @@ -887,7 +887,7 @@ f = fopen(ProfileFile, "rb"); if (f == NULL) return; - size = xfilelength(_fileno(f)); + size = xfilelength(fileno(f)); EmbedBuffer = (cmsUInt8Number*) malloc(size + 1); EmbedLen = fread(EmbedBuffer, 1, size, f); fclose(f);
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ Lcms-user mailing list Lcms-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lcms-user