Hi! As a regular user of argyll this itches enough for me to dig into the Jam build system and to try to modify it so it uses shared libraries.
After downloading the current source package (version 1.7.0+repack) and hacking at the Jam files I have arrived at a point where it builds, with some caveats. See the attached patch. I had to add libraries to the dependencies of various binaries. For some reason it builds statically nevertheless. The path where the shared libraries are looked for has to be set at build time and is now hard coded to /usr/local/lib/argyll. In the older Debian package argyll this was /usr/lib/x86_86-linux-gnu/argyll on my machine. That would have to be set correctly somehow. I have manually copied all shared libraries to their destination: cp */*.so */*/*.so /usr/local/lib/argyll/ The shared libraries are looked for by their name, like "libxicc.so". In the earlier Debian package this was "libxicc.so.0" and so forth. I haven't managed to have that, too. I have also manually copied all binaries to /usr/local/bin/argyll with something like this: find -type f -a -perm +1 -a ! -name "*.so" -a ! -name "*.sh" -print0 | xargs -0I{} cp {} /usr/local/bin/argyll/ This includes some binaries that are only required for building. I have manually executed strip on all .so files and all binaries. The result is about 6 MB libraries, 3 MB binaries. Better! This is a proof that it works, and won't work out of the box on other architectures. I hope that it serves as a starting point anyway. Cheers, Wolfgang Oertl
diff -ru argyll-1.7.0+repack/gamut/Jamfile argyll-1.7.0+repack-shlib/gamut/Jamfile --- argyll-1.7.0+repack/gamut/Jamfile 2015-05-01 10:15:47.000000000 +0200 +++ argyll-1.7.0+repack-shlib/gamut/Jamfile 2015-05-12 18:55:00.381556496 +0200 @@ -30,7 +30,7 @@ # Gamut mapping library Library libgammap : gammap.c nearsmth.c ; -LINKLIBS = libgammap libgamut ../rspl/librspl ../icc/libicc ../cgats/libcgats +LINKLIBS = libgammap libgamut ../xicc/libxicc ../spectro/libinsttypes ../spectro/libdisptechs ../rspl/librspl ../icc/libicc ../cgats/libcgats ../plot/libplot ../numlib/libnum ../numlib/libui ../plot/libvrml ; # Utilities @@ -55,7 +55,7 @@ # Develop hue sensitive parameter interpolation */ #Main tttt : tttt.c ; -LINKLIBS = libgammap libgamut ../icc/libicc ../cgats/libcgats ../xicc/libxicc +LINKLIBS = libgammap libgamut ../icc/libicc ../cgats/libcgats ../xicc/libxicc ../spectro/libinsttypes ../spectro/libdisptechs ../rspl/librspl ../plot/libplot ../plot/libvrml ../numlib/libnum ../numlib/libui ; # Mapping test routine diff -ru argyll-1.7.0+repack/imdi/Jamfile argyll-1.7.0+repack-shlib/imdi/Jamfile --- argyll-1.7.0+repack/imdi/Jamfile 2015-05-01 10:15:56.000000000 +0200 +++ argyll-1.7.0+repack-shlib/imdi/Jamfile 2015-05-12 22:08:51.363783343 +0200 @@ -54,7 +54,7 @@ ../plot/libvrml ../numlib/libui ; # TIFF file color correction utlity -Main cctiff : cctiff.c : : : ../xicc $(TIFFINC) $(JPEGINC) : : ../xicc/libxicc ../rspl/librspl ../cgats/libcgats ../plot/libplot ../plot/libvrml ../numlib/libui $(TIFFLIB) $(JPEGLIB) ; +Main cctiff : cctiff.c : : : ../xicc $(TIFFINC) $(JPEGINC) : : ../xicc/libxicc ../rspl/librspl ../cgats/libcgats ../plot/libplot ../plot/libvrml ../numlib/libui ../spectro/libinsttypes ../gamut/libgamut ../spectro/libdisptechs $(TIFFLIB) $(JPEGLIB) ; # Old TIFF file color correction utlity #Main cctiffo : cctiffo.c : : : $(TIFFINC) : : $(TIFFLIB) ; @@ -63,7 +63,8 @@ #Main greytiff : greytiff.c ; Main greytiff : greytiff.c : : : ../spectro ../xicc ../gamut ../rspl ../cgats $(TIFFINC) : : ../xicc/libxicc ../gamut/libgamut ../rspl/librspl ../cgats/libcgats - ../plot/libplot ../plot/libvrml ../numlib/libui $(TIFFLIB) $(JPEGLIB) ; + ../plot/libplot ../plot/libvrml ../numlib/libui ../spectro/libinsttypes + ../spectro/libdisptechs $(TIFFLIB) $(JPEGLIB) ; # ssort generation code #Main ssort : ssort.c ; diff -ru argyll-1.7.0+repack/Jambase argyll-1.7.0+repack-shlib/Jambase --- argyll-1.7.0+repack/Jambase 2015-05-12 22:17:25.000000000 +0200 +++ argyll-1.7.0+repack-shlib/Jambase 2015-05-12 22:05:46.233146008 +0200 @@ -951,7 +951,7 @@ CHGRP ?= chgrp ; CHOWN ?= chown ; LEX ?= lex ; - LINKFLAGS ?= $(LDFLAGS) ; + LINKFLAGS ?= $(LDFLAGS) -Wl,-rpath=/usr/local/lib/argyll ; LINKOPTFLAG ?= -O ; # Affects creating .so's LINKSTRIPFLAG ?= -s ; LINKDEBUGFLAG ?= ; @@ -3016,75 +3016,79 @@ # Library library : sources : flags : defines : hdrpaths : objects ; rule Library { - LibraryFromObjects $(<) : $(>) $(6) ; - Objects $(>) : $(3) : $(4) : $(5) ; +# WO Echo "Make a shared library $(<)" ; + ShLibraryFromObjects $(<) : $(>) $(6) : $(7) : $(8) ; + Objects $(>) : $(CCSHOBJFLAG) $(3) : $(4) : $(5) ; +# WO LibraryFromObjects $(<) : $(>) $(6) ; +# WO Objects $(>) : $(3) : $(4) : $(5) ; } # LibraryFromObjects - create a static library from object files. # LibraryFromObjects library : objects ; rule LibraryFromObjects { - local _i ; + ShLibraryFromObjects $(1) : $(2) ; +# local _i ; #Echo "LibraryFromObjects got " $(<) "and" $(>) "'" ; - # Normalize target names and set Grist LOCATE and SOURCE - local _l = [ NormDstTargets $(<[1]:S=$(SUFLIB)) ] ; - local _s = [ NormSrcTargets $(>:S=$(SUFOBJ)) ] ; +# # Normalize target names and set Grist LOCATE and SOURCE +# local _l = [ NormDstTargets $(<[1]:S=$(SUFLIB)) ] ; +# local _s = [ NormSrcTargets $(>:S=$(SUFOBJ)) ] ; #Echo "LibraryFromObjects nomed = " $(_l) "and" $(_s) ; - Depends lib : $(_l) ; - - MakeLocate $(_l) ; - - if $(NOARSCAN) - { - # If we can't scan the library to timestamp its contents, - # we have to just make the library depend directly on the - # on-disk object files. - - Depends $(_l) : $(_s) ; - } - else - { - # If we can scan the library, we make the library depend - # on its members and each member depend on the on-disk - # object file. - - for _i in $(_s) - { - local _m ; - _m = $(_l:M=$(_i:BS)) ; - CopyTarget $(_m) : $(_l) ; # Transfer LOCATE, SEARCH, NOMLOC - Depends $(_l) : $(_m) ; - Depends $(_m) : $(_i) ; - } - } - - Clean clean : $(_l) ; - - if $(CRELIB) { - CreLib $(_l) : $(_s[1]) ; - } - - Archive $(_l) : $(_s) ; - - if $(RANLIB) { - Ranlib $(_l) ; - } - - # If we can't scan the library, we have to leave the .o's around. - if ! ( $(NOARSCAN) || $(NOARUPDATE) ) { - local _ds ; - for _i in $(_s) { - # Don't delete any objects that we've marked with KEEPOBJS - if ! [ geton $(_i) : KEEPOBJS ] { - _ds += $(_i) ; - } - } - if $(_ds) { - RmTemps_ $(_l) : $(_ds) ; - } - } +## Depends lib : $(_l) ; +# +# MakeLocate $(_l) ; +# +# if $(NOARSCAN) +# { +# # If we can't scan the library to timestamp its contents, +# # we have to just make the library depend directly on the +# # on-disk object files. +# +# Depends $(_l) : $(_s) ; +# } +# else +# { +# # If we can scan the library, we make the library depend +# # on its members and each member depend on the on-disk +# # object file. +# +# for _i in $(_s) +# { +# local _m ; +# _m = $(_l:M=$(_i:BS)) ; +# CopyTarget $(_m) : $(_l) ; # Transfer LOCATE, SEARCH, NOMLOC +# Depends $(_l) : $(_m) ; +# Depends $(_m) : $(_i) ; +# } +# } +# +# Clean clean : $(_l) ; +# +# if $(CRELIB) { +# CreLib $(_l) : $(_s[1]) ; +# } +# +# Archive $(_l) : $(_s) ; +# +# if $(RANLIB) { +# Ranlib $(_l) ; +# } +# +# # If we can't scan the library, we have to leave the .o's around. +# if ! ( $(NOARSCAN) || $(NOARUPDATE) ) { +# local _ds ; +# for _i in $(_s) { +# # Don't delete any objects that we've marked with KEEPOBJS +# if ! [ geton $(_i) : KEEPOBJS ] { +# _ds += $(_i) ; +# } +# } +# if $(_ds) { +# RmTemps_ $(_l) : $(_ds) ; +# } +# } } # LibraryFromLibraries - create a static library from object files and static libraries. @@ -3191,7 +3195,8 @@ SHLINKSEARCHEXEPATH = @executable_path/ ; } else { # SHLINKSEARCHEXEPATH = \\$PATH/ ; - SHLINKSEARCHEXEPATH = \\$ORIGIN/ ; +# SHLINKSEARCHEXEPATH = \\$ORIGIN/ ; + SHLINKSEARCHEXEPATH = "" ; } } ShLink_ $(_sl) $(_l) : $(_s) ; @@ -3252,7 +3257,7 @@ #Echo "ShLibraryShLibraries got '" $(<) "' and '" $(>) "'" ; # Normalize target names and set Grist LOCATE and SOURCE local _t = [ NormDstTargets $(<:S=$(SUFSHLIB)) ] ; - local _l = [ NormSrcTargets $(>:S=$(SUFSHIMPLIB)) ] ; + local _l = [ NormSrcTargets $(>:S=$(SUFIMPLIB)) ] ; Depends $(_t) : $(_l) ; @@ -3277,7 +3282,9 @@ # Main image : sources : flags : defines : hdrpaths : objects : libs : shlibs ; rule Main { - MainFromObjects $(<) : $(>) $(6) : $(7) : $(8) ; +# Echo "Main: for $(1) we have libs: $(7), shlibs: $(8)" ; +# WO MainFromObjects $(<) : $(>) $(6) : $(7) : $(8) ; + MainFromObjects $(1) : $(2) $(6) : : $(7) $(8) ; Objects $(>) : $(3) : $(4) : $(5) ; } @@ -3296,7 +3303,8 @@ _o += $(_t) ; } #Echo "MainVariant image '" $(<) "' and objs '" $(_o) "'" ; - MainFromObjects $(<) : $(_o) $(6) : $(7) : $(8) ; +# WO MainFromObjects $(<) : $(_o) $(6) : $(7) : $(8) ; + MainFromObjects $(<) : $(_o) $(6) : : $(7) $(8) ; } # Make an executable from objects @@ -3326,9 +3334,11 @@ MakeLocate $(_t) ; if $(3) { +# Echo "Extra LinkLibraries for " $(1) ": " $(3) ; LinkLibraries $(<) : $(3) ; } if $(4) { +# Echo "Extra LinkShLibraries for " $(<) ": " $(4) ; LinkShLibraries $(<) : $(4) ; } @@ -3351,8 +3361,10 @@ #Echo "MainFromObjects LINKLIBS = '" $(LINKLIBS) "' and P_LINKLIBS ='" $(P_LINKLIBS) "'" ; if $(LINKLIBS) || $(P_LINKLIBS) { - local _l = [ NormSrcTargets $(LINKLIBS:S=$(SUFLIB)) ] $(P_LINKLIBS:S=$(SUFLIB)) ; +# WO local _l = [ NormSrcTargets $(LINKLIBS:S=$(SUFLIB)) ] $(P_LINKLIBS:S=$(SUFLIB)) ; + local _l = [ NormSrcTargets $(LINKLIBS:S=$(SUFIMPLIB)) ] $(P_LINKLIBS:S=$(SUFIMPLIB)) ; Depends $(_t) : $(_l) ; +# WO Echo "Extra LINKLIBS for " $(_t) ": " $(_l) ; # WO LINKLIBS on $(_t) += $(_l) ; } @@ -3404,7 +3416,8 @@ #Echo "LinkLibraries got '" $(<) "' and '" $(>) "'" ; # Normalize target names and set Grist LOCATE and SOURCE local _t = [ NormDstTargets $(<:S=$(SUFEXE)) ] ; - local _l = [ NormSrcTargets $(>:S=$(SUFLIB)) ] ; +# WO local _l = [ NormSrcTargets $(>:S=$(SUFLIB)) ] ; + local _l = [ NormSrcTargets $(>:S=$(SUFIMPLIB)) ] ; Depends $(_t) : $(_l) ; @@ -3418,10 +3431,9 @@ #Echo "LinkShLibraries got '" $(<) "' and '" $(>) "'" ; # Normalize target names and set Grist LOCATE and SOURCE local _t = [ NormDstTargets $(<:S=$(SUFEXE)) ] ; - local _l = [ NormSrcTargets $(>:S=$(SUFSHIMPLIB)) ] ; + local _l = [ NormSrcTargets $(>:S=$(SUFIMPLIB)) ] ; Depends $(_t) : $(_l) ; - LINKSHLIBS on $(_t) += $(_l) ; } @@ -4187,6 +4199,7 @@ # $(LINK) $(LINKOUTFLAG)$(<) $(UNDEFS) $(>) $(LINKFLAGS) $(LINKOBJS) $(LINKLIBS) $(LINKSHLIBS) $(STDLIBS) actions Link_ bind LINKOBJS LINKLIBS LINKSHLIBS { +# echo "Link_: Target $(1), Linklibs $(LINKLIBS), LinkShLibs $(LINKSHLIBS)" ; $(LINK) $(LINKOUTFLAG)$(<) $(UNDEFS) $(>) $(LINKOBJS) $(LINKLIBS) $(LINKSHLIBS) $(LINKFLAGS) $(STDLIBS) } diff -ru argyll-1.7.0+repack/link/Jamfile argyll-1.7.0+repack-shlib/link/Jamfile --- argyll-1.7.0+repack/link/Jamfile 2015-05-01 10:16:01.000000000 +0200 +++ argyll-1.7.0+repack-shlib/link/Jamfile 2015-05-12 22:10:37.613296980 +0200 @@ -27,7 +27,7 @@ HDRS += ../cgats ../xicc ../spectro ../gamut ; LINKLIBS = ../xicc/libxicc ../xicc/libxcolorants ../gamut/libgamut.c ../gamut/libgammap ../rspl/librspl ../cgats/libcgats - ../plot/libvrml $(LINKLIBS) ; + ../plot/libvrml ../spectro/libinsttypes ../spectro/libdisptechs $(LINKLIBS) ; # ICC linker Main collink : collink.c ; diff -ru argyll-1.7.0+repack/namedc/Jamfile argyll-1.7.0+repack-shlib/namedc/Jamfile --- argyll-1.7.0+repack/namedc/Jamfile 2015-05-01 10:16:45.000000000 +0200 +++ argyll-1.7.0+repack-shlib/namedc/Jamfile 2015-05-12 21:36:27.035557615 +0200 @@ -10,8 +10,10 @@ # mXML library Library libnamedc : namedc.c ; -LINKLIBS = ./libnamedc ../xicc/libxicc ../spectro/libconv ../icc/libicc ../cgats/libcgats - ../plot/libplot ../numlib/libui ../numlib/libnum ../xml/libmxml ; +LINKLIBS = ./libnamedc ../xicc/libxicc ../spectro/libconv ../spectro/libinsttypes + ../icc/libicc ../cgats/libcgats ../plot/libplot ../plot/libvrml + ../numlib/libui ../numlib/libnum ../xml/libmxml ../gamut/libgamut + ../spectro/libdisptechs ../rspl/librspl ; # Individual stand alone test of namedc MainVariant namedc : namedc.c : : STANDALONE_TEST ; diff -ru argyll-1.7.0+repack/rspl/Jamfile argyll-1.7.0+repack-shlib/rspl/Jamfile --- argyll-1.7.0+repack/rspl/Jamfile 2015-05-01 10:15:46.000000000 +0200 +++ argyll-1.7.0+repack-shlib/rspl/Jamfile 2015-05-12 18:46:20.009974560 +0200 @@ -34,7 +34,7 @@ if $(BUILD_TESTS) { HDRS = ../h ../numlib ../plot ../icc ../rspl ../xicc ../gamut ../cgats ../spectro $(TIFFINC) ; - LINKLIBS = ../xicc/libxicc ../gamut/libgamut ../spectro/libinsttypes librspl + LINKLIBS = ../xicc/libxicc ../gamut/libgamut ../spectro/libinsttypes librspl ../spectro/libdisptechs ../cgats/libcgats ../icc/libicc ../plot/libplot ../plot/libvrml ../numlib/libnum ../numlib/libui $(TIFFLIB) $(JPEGLIB) ; diff -ru argyll-1.7.0+repack/scanin/Jamfile argyll-1.7.0+repack-shlib/scanin/Jamfile --- argyll-1.7.0+repack/scanin/Jamfile 2015-05-01 10:15:58.000000000 +0200 +++ argyll-1.7.0+repack-shlib/scanin/Jamfile 2015-05-12 22:09:51.160635192 +0200 @@ -28,7 +28,7 @@ Main scanin : scanin.c ; # ObjectHdrs scanin : ../h ../cgats ../numlib ../icc ../rspl ../gamut ../xicc $(TIFFINC) ; ObjectHdrs scanin : ../h ../numlib ../icc ../cgats ../rspl ../xicc ../gamut ../spectro $(TIFFINC) ; -LinkLibraries scanin : libscanrd ../xicc/libxicc ../spectro/libinsttypes +LinkLibraries scanin : libscanrd ../xicc/libxicc ../spectro/libinsttypes ../spectro/libdisptechs ../gamut/libgamut ../rspl/librspl ../cgats/libcgats ../icc/libicc ../plot/libplot ../plot/libvrml ../numlib/libnum ../numlib/libui diff -ru argyll-1.7.0+repack/tweak/Jamfile argyll-1.7.0+repack-shlib/tweak/Jamfile --- argyll-1.7.0+repack/tweak/Jamfile 2015-05-01 10:16:01.000000000 +0200 +++ argyll-1.7.0+repack-shlib/tweak/Jamfile 2015-05-12 22:11:12.029787245 +0200 @@ -17,7 +17,7 @@ ../rspl ../numlib ../plot ; LINKLIBS = ../icc/libicc ../xicc/libxicc ../spectro/libinsttypes ../gamut/libgamut - ../gamut/libgammap ../rspl/librspl + ../gamut/libgammap ../rspl/librspl ../spectro/libdisptechs ../cgats/libcgats ../numlib/libnum ../plot/libplot ../plot/libvrml ../numlib/libui $(LibWin) ; diff -ru argyll-1.7.0+repack/xicc/Jamfile argyll-1.7.0+repack-shlib/xicc/Jamfile --- argyll-1.7.0+repack/xicc/Jamfile 2015-05-01 10:15:48.000000000 +0200 +++ argyll-1.7.0+repack-shlib/xicc/Jamfile 2015-05-12 18:55:41.958162118 +0200 @@ -36,7 +36,7 @@ LINKLIBS = libxicc ../spectro/libinsttypes ../gamut/libgamut ../rspl/librspl ../cgats/libcgats ../icc/libicc ../plot/libplot ../plot/libvrml - ../numlib/libnum ../numlib/libui + ../numlib/libnum ../numlib/libui ../spectro/libdisptechs $(TIFFLIB) $(JPEGLIB) ; # Not created yet
smime.p7s
Description: S/MIME cryptographic signature