build: MinGW now compiles selphy_print cleanly.

Need to test it out. Especially the dynamic DLL loading.
master
Solomon Peachy 3 years ago
parent d6109815c9
commit 9abe62b115
  1. 2
      .gitignore
  2. 13
      Makefile
  3. 12
      README
  4. 5
      backend_common.h
  5. 2
      backend_mitsu70x.c
  6. 2
      backend_mitsu9550.c
  7. 4
      backend_shinkos6145.c
  8. 14
      lib6145/Makefile
  9. 12
      lib70x/Makefile

2
.gitignore vendored

@ -1,6 +1,8 @@
*~
*.o
*.so
*.exe
*.dll
sonyupd
sonyupdneo

@ -4,7 +4,11 @@
#
# Basic stuff
ifneq (,$(findstring mingw,$(CC)))
EXEC_NAME ?= dyesub_backend.exe
else
EXEC_NAME ?= dyesub_backend
endif
CPUS ?= $(shell nproc)
#NO_GUTENPRINT = 1
REVISION ?= -g$(shell if [ -d .git ] ; then git rev-parse --short HEAD; else echo "NONE" ; fi)
@ -58,13 +62,16 @@ CPPFLAGS += -DURI_PREFIX=\"$(BACKEND_NAME)\" $(OLD_URI)
CFLAGS += -funit-at-a-time
# List of backends
BACKENDS = canonselphy canonselphyneo dnpds40 hiti kodak605 kodak1400 kodak6800 magicard mitsu70x mitsu9550 mitsud90 mitsup95d shinkos1245 shinkos2145 shinkos6145 shinkos6245 sonyupd sonyupdneo
BACKENDS = canonselphy canonselphyneo dnpds40 hiti kodak605 kodak1400 kodak6800 magicard mitsu70x mitsu9550 mitsud90 mitsup95d shinkos1245 shinkos2145 shinkos6145 shinkos6245 sonyupd sonyupdneo
# For the s6145, mitsu70x, and mitsu9550 backends
ifneq (,$(findstring mingw,$(CC)))
CPPFLAGS += -DUSE_LTDL
LDFLAGS += -lltdl
else
CPPFLAGS += -DUSE_DLOPEN
LDFLAGS += -ldl
#CPPFLAGS += -DUSE_LTDL
#LDFLAGS += -lltdl
endif
# Build stuff
DEPS += backend_common.h

@ -153,7 +153,17 @@
Debian/Ubuntu
apt-get install libusbx-dev libusb-1.0-0-dev libcups2-dev gutenprint-dev
All you need to do after that is type 'make'
All you need to do after that is type 'make'
Compilation for Windows:
This is highly experimental.
Currently only MinGW is supported. You will need the 'libltdl' and
'libusbx' MinGW packages.
Once the necessary packages are installed, run 'mingw64-make' and
everything should compile cleanly.
***************************************************************************
CUPS backend usage:

@ -373,5 +373,10 @@ extern struct dyesub_backend BACKEND;
#define DL_CLOSE(__x) do {} while(0)
#define DL_EXIT() do {} while(0)
#endif
#ifdef _WIN32
#define DLL_SUFFIX ".dll"
#else
#define DLL_SUFFIX ".so"
#endif
#endif /* __BACKEND_COMMON_H */

@ -57,7 +57,7 @@ struct BandImage {
#define REQUIRED_LIB_APIVERSION 4
/* Image processing library function prototypes */
#define LIB_NAME_RE "libMitsuD70ImageReProcess.so" // Reimplemented library
#define LIB_NAME_RE "libMitsuD70ImageReProcess" DLL_SUFFIX
typedef int (*lib70x_getapiversionFN)(void);
typedef int (*Get3DColorTableFN)(uint8_t *buf, const char *filename);

@ -57,7 +57,7 @@ struct BandImage {
#define REQUIRED_LIB_APIVERSION 4
/* Image processing library function prototypes */
#define LIB_NAME_RE "libMitsuD70ImageReProcess.so" // Reimplemented library
#define LIB_NAME_RE "libMitsuD70ImageReProcess" DLL_SUFFIX
typedef int (*lib70x_getapiversionFN)(void);
typedef int (*Get3DColorTableFN)(uint8_t *buf, const char *filename);

@ -55,8 +55,8 @@
typedef int (*ImageProcessingFN)(unsigned char *, unsigned short *, void *);
typedef int (*ImageAvrCalcFN)(unsigned char *, unsigned short, unsigned short, unsigned char *);
#define LIB_NAME "libS6145ImageProcess.so" // Official library
#define LIB_NAME_RE "libS6145ImageReProcess.so" // Reimplemented library
#define LIB_NAME "libS6145ImageProcess" DLL_SUFFIX // Official library
#define LIB_NAME_RE "libS6145ImageReProcess" DLL_SUFFIX // Reimplemented library
enum {
S_IDLE = 0,

@ -18,24 +18,30 @@ CFLAGS += -Wall -Wextra -g -Os -std=c99 -D_FORTIFY_SOURCE=2 -fPIC --no-strict-ov
#CPPFLAGS +=
CFLAGS += -funit-at-a-time
ifneq (,$(findstring mingw,$(CC)))
SUFFIX=dll
else
SUFFIX=so
endif
# Build stuff
SOURCES = libS6145ImageReProcess.c
# And now the rules!
.PHONY: clean all install cppcheck
all: lib$(LIBS6145_NAME).so
all: lib$(LIBS6145_NAME).$(SUFFIX)
cppcheck:
$(CPPCHECK) -q -v --std=c99 --enable=all -I/usr/include $(CPPFLAGS) $(SOURCES)
install:
$(MKDIR) -p $(LIBDIR)
$(INSTALL) -o root -m 755 lib$(LIBS6145_NAME).so $(LIBDIR)
$(INSTALL) -o root -m 755 lib$(LIBS6145_NAME).$(SUFFIX) $(LIBDIR)
clean:
$(RM) -f lib$(LIBS6145_NAME).so *.o
$(RM) -f lib$(LIBS6145_NAME).$(SUFFIX) *.o
lib$(LIBS6145_NAME).so: $(SOURCES:.c=.o)
lib$(LIBS6145_NAME).$(SUFFIX): $(SOURCES:.c=.o)
$(CC) $(LDFLAGS) -g -shared -o $@ $^
%.o: %.c

@ -25,13 +25,19 @@ CFLAGS += -Wall -Wextra -g -Os -std=c99 -D_FORTIFY_SOURCE=2 -fPIC --no-strict-ov
#CPPFLAGS +=
CFLAGS += -funit-at-a-time
ifneq (,$(findstring mingw,$(CC)))
SUFFIX=dll
else
SUFFIX=so
endif
# Build stuff
SOURCES = libMitsuD70ImageReProcess.c
# And now the rules!
.PHONY: clean all install cppcheck
all: lib$(LIBMITSUD70_NAME).so
all: lib$(LIBMITSUD70_NAME).$(SUFFIX)
cppcheck:
$(CPPCHECK) -q -v --std=c99 --enable=all -I/usr/include $(CPPFLAGS) $(SOURCES)
@ -46,9 +52,9 @@ install:
$(INSTALL) -o root -m 644 data/*dat $(BACKEND_DATA_DIR)
clean:
$(RM) -f lib$(LIBMITSUD70_NAME).so *.o
$(RM) -f lib$(LIBMITSUD70_NAME).$(SUFFIX) *.o
lib$(LIBMITSUD70_NAME).so: $(SOURCES:.c=.o)
lib$(LIBMITSUD70_NAME).$(SUFFIX): $(SOURCES:.c=.o)
$(CC) $(LDFLAGS) -g -shared -o $@ $^
%.o: %.c

Loading…
Cancel
Save