To check it out I have created a little SConscript file to build lcms2 as a 
shared library (see the SConscript at end of mail). I don't know what other 
libraries are needed, but I just assumed for now the usual candidates that 
were also needed for versino 1.1.7 ['m', 'jpeg', 'tiff', 'z'].

Unfortunately there seems to be either something wrong with the code, or the 
code is pretty platform dependent and only works on M$ VisualWhatever 2008 (as 
I am implying from the included project files for that platform).

Any ideas?

Guy

---- Console output of build attempt ----

$ scons   
scons: Reading SConscript files ...                            
scons: done reading SConscript files.                          
scons: Building targets ...                                    
gcc -o Debug/cmscam02.os -c -Wall -fmessage-length=0 -fPIC -DEFENCE -O0 -g3 -
fPIC -I/usr/include -Iinclude -Isrc/include src/cmscam02.c                      
   
In file included from include/lcms2_plugin.h:34,                                
                 from src/lcms2_internal.h:29,
                 from src/cmscam02.c:27:
include/lcms2.h:112:22: warning: integer constant is so large that it is 
unsigned
include/lcms2.h:114:24: warning: integer constant is so large that it is 
unsigned
In file included from include/lcms2_plugin.h:34,
                 from src/lcms2_internal.h:29,
                 from src/cmscam02.c:27:
include/lcms2.h:1094: warning: type defaults to 'int' in declaration of 
'wchar_t'
include/lcms2.h:1094: error: expected ';', ',' or ')' before '*' token
include/lcms2.h:1097: error: expected declaration specifiers or '...' before 
'wchar_t'
include/lcms2.h:1203: warning: 'struct tm' declared inside parameter list
include/lcms2.h:1203: warning: its scope is only this definition or 
declaration, which is probably not what you want
In file included from src/cmscam02.c:27:
src/lcms2_internal.h:396: warning: useless storage class specifier in empty 
declaration
src/lcms2_internal.h:466: warning: 'struct _cmstransform_struct' declared 
inside parameter list
scons: *** [Debug/cmscam02.os] Error 1
scons: building terminated because of errors.


---- SConscript (could/should work on Linux?) ----

import os
import os.path

# Get build mode and check if the user has been naughty:
# only 'debug' or 'release' allowed
build_mode = ARGUMENTS.get('mode', 'debug')   #holds current mode
build_mode = build_mode.lower()

if not (build_mode in ['debug', 'release']):
    print "Error: expected 'debug' or 'release', found: " + build_mode
    Exit(1)

## Project settings:

SHARED_OBJECT_NAME = 'lcms2'
SOURCE_PATH_PREFIX = 'src'
CODE_EXTENSIONS = ['.c']
DESTINATION_PATHS = {'debug': 'Debug',
                     'release': 'Release'}
destination_path = DESTINATION_PATHS[build_mode]

## Library and code settings:

LIBS = ['m', 'jpeg', 'tiff', 'z']
LIB_PATHS = ['/usr/lib']
INCLUDE_PATHS = ['/usr/include',
                 'include']

## Compiler settings:

CC_FLAGS = ['-Wall', '-fmessage-length=0', '-fPIC']
MODE_FLAGS = {'debug': ['-DEFENCE', '-O0', '-g3'],
              'release':  ['-O3']}
LINKFLAGS = ['-Wl,-no-undefined']

#### Do the building:
def get_source_files():
    source_files = os.listdir(os.path.join(os.getcwd(), SOURCE_PATH_PREFIX))
    source_files = [x for x in source_files \
                    if os.path.splitext(x)[1] in CODE_EXTENSIONS]
    source_files = [os.path.join(destination_path, x) for x in source_files]
    return source_files

env = Environment()
env.Repository(SOURCE_PATH_PREFIX)

env.BuildDir(destination_path,
             SOURCE_PATH_PREFIX,
             duplicate=False)

module = env.SharedLibrary(target=SHARED_OBJECT_NAME,
                           source=get_source_files(),
                           LIBS=LIBS,
                           LIBPATH=LIB_PATHS,
                           CPPPATH=INCLUDE_PATHS,
                           CCFLAGS=CC_FLAGS + MODE_FLAGS[build_mode],
                           SHLIBPREFIX='lib',
                           SHLIBSUFFIX='.so',
                           LINKFLAGS=LINKFLAGS)


-- 
Guy K. Kloss
Institute of Information and Mathematical Sciences
Te Kura Putaiao o Mohiohio me Pangarau
Room 2.63, Quad Block A Building
Massey University, Auckland, Albany
Private Bag 102 904, North Shore Mail Centre
voice: +64 9 414-0800 ext. 9585   fax: +64 9 441-8181
eMail: [EMAIL PROTECTED]  http://iims.massey.ac.nz


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

Reply via email to