Add new comment

Finally, I've buildt it. If

Finally, I've buildt it. If somebody else is interested in building the thread-safe library using MinGW, here the Makefile (for v. 0.11.3). It works fine.
Thanks for your help,
Davide
Luminance HDR Developer

--------------------------------------

all: library samples

# OpenMP support
#OPENMP_CFLAGS=-fopenmp
#NO_THREADS=-DLIBRAW_NOTHREADS

# LCMS support
#LCMS_DEF=-DUSE_LCMS -I/usr/local/include
#LCMS_LIB=-L/usr/local/lib -llcms

# Common flags
# WARNING: library order matters
COMMON_LIBS=-lws2_32 -lm ${LCMS_LIB}
CLIBS=-L./lib -lraw_r ${COMMON_LIBS}
CFLAGS=-O3 -I. -w -DLIBRAW_NODLL ${OPENMP_CFLAGS} ${NO_THREADS} -lpthread -D_REENTRANT

DCRAW_LIB_OBJECTS=object/libraw_cxx.o object/libraw_c_api.o object/dcraw_common.o object/dcraw_fileio.o

library: lib/libraw_r.a

samples: bin/raw-identify bin/simple_dcraw bin/dcraw_emu bin/dcraw_half bin/mem_image bin/mem_image bin/unprocessed_raw bin/4channels

install: library
@if [ -d /usr/local/include ] ; then cp -R libraw /usr/local/include/ ; else echo 'no /usr/local/include' ; fi
@if [ -d /usr/local/lib ] ; then cp lib/libraw_r.a /usr/local/lib/ ; else echo 'no /usr/local/lib' ; fi

install-samples: samples
@if [ -d /usr/local/bin ] ; then cp bin/[a-z]* /usr/local/bin/ ; else echo 'no /usr/local/bin' ; fi

# Samples

bin/raw-identify: lib/libraw_r.a samples/raw-identify.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/raw-identify samples/raw-identify.cpp ${CLIBS}

bin/unprocessed_raw: lib/libraw_r.a samples/unprocessed_raw.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/unprocessed_raw samples/unprocessed_raw.cpp ${CLIBS}

bin/4channels: lib/libraw_r.a samples/4channels.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/4channels samples/4channels.cpp ${CLIBS}

bin/simple_dcraw: lib/libraw_r.a samples/simple_dcraw.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/simple_dcraw samples/simple_dcraw.cpp ${CLIBS}

bin/mem_image: lib/libraw_r.a samples/mem_image.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/mem_image samples/mem_image.cpp ${CLIBS}

bin/dcraw_half: lib/libraw_r.a object/dcraw_half.o
gcc ${LCMS_DEF} ${CFLAGS} -o bin/dcraw_half object/dcraw_half.o ${CLIBS} -lstdc++

bin/dcraw_emu: lib/libraw_r.a samples/dcraw_emu.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/dcraw_emu samples/dcraw_emu.cpp ${CLIBS}

#Libraries

# Non-threaded library

object/dcraw_common.o: internal/dcraw_common.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_common.o internal/dcraw_common.cpp

object/dcraw_fileio.o: internal/dcraw_fileio.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_fileio.o internal/dcraw_fileio.cpp

object/libraw_cxx.o: src/libraw_cxx.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/libraw_cxx.o src/libraw_cxx.cpp

object/libraw_c_api.o: src/libraw_c_api.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/libraw_c_api.o src/libraw_c_api.cpp

object/dcraw_half.o: samples/dcraw_half.c
gcc -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_half.o samples/dcraw_half.c

lib/libraw_r.a: ${DCRAW_LIB_OBJECTS}
-rm -f lib\\libraw_r.a
ar crv lib/libraw_r.a ${DCRAW_LIB_OBJECTS}
ranlib lib/libraw_r.a

# Clean

clean:
rm -f bin\\*.dSYM
rm -f lib\\lib*.a bin\\*.exe object\\*.o

----
Davide Anastasia
Developer of Luminance HDR