diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6af56d44 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +# Make libzint and zint together + +zint: + $(MAKE) -C backend/ + $(MAKE) -C frontend/ + +install: + $(MAKE) install -C backend/ + $(MAKE) install -C frontend/ + +uninstall: + $(MAKE) uninstall -C frontend/ + $(MAKE) uninstall -C backend/ + +clean: + $(MAKE) clean -C backend/ + $(MAKE) clean -C frontend/ + diff --git a/backend/Makefile b/backend/Makefile new file mode 100644 index 00000000..7a2d30bd --- /dev/null +++ b/backend/Makefile @@ -0,0 +1,54 @@ +# Linux makefile for libzint +# +# make compiles +# make install copies to /usr/local/lib +# make uninstall removes library +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + + +CC := gcc +INCLUDE := -I/usr/local/include +CFLAGS := -g + +prefix := /usr/local +includedir := $(prefix)/include +libdir := $(prefix)/lib +DESTDIR := + +COMMON:= common.c png.c library.c ps.c large.c reedsol.c gs1.c svg.c +COMMON_OBJ:= common.o png.o library.o ps.o large.o reedsol.o gs1.o svg.o +ONEDIM:= code.c code128.c 2of5.c upcean.c telepen.c medical.c plessey.c rss.c +ONEDIM_OBJ:= code.o code128.o 2of5.o upcean.o telepen.o medical.o plessey.o rss.o +POSTAL:= postal.c auspost.c imail.c +POSTAL_OBJ:= postal.o auspost.o imail.o +TWODIM:= code16k.c dmatrix.c dm200.c pdf417.c qr.c maxicode.c composite.c aztec.c code49.c code1.c gridmtx.c +TWODIM_OBJ:= code16k.o dmatrix.o dm200.o pdf417.o qr.o maxicode.o composite.o aztec.o code49.o code1.o gridmtx.o +LIBS:= `libpng12-config --I_opts --L_opts --ldflags` -lz -lm + +libzint: code.c code128.c 2of5.c upcean.c medical.c telepen.c plessey.c postal.c auspost.c imail.c code16k.c dmatrix.c dm200.c reedsol.c pdf417.c maxicode.c rss.c common.c png.c library.c ps.c qr.c large.c composite.c aztec.c gs1.c svg.c code49.c code1.c gridmtx.c + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(ONEDIM) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(POSTAL) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(TWODIM) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(COMMON) + $(CC) $(CFLAGS) $(ZINT_VERSION) -shared -Wl,-soname,libzint.so -o libzint.so.2.3.0 $(INCLUDE) $(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) $(LIBS) + ln -s libzint.so.* libzint.so + +.PHONY: install uninstall clean dist + +install: + test "$(UID)" = "0" && ldconfig -n $(PWD) || true + install -d $(DESTDIR)$(libdir) + mv libzint.* $(DESTDIR)$(libdir) + install -D -p --mode=0644 zint.h $(DESTDIR)$(includedir)/zint.h + +uninstall: + rm $(DESTDIR)$(libdir)/libzint.* + rm $(DESTDIR)$(includedir)/zint.h + +clean: + rm -f libzint.* *.o *.a *~ + + diff --git a/backend/Makefile.bsd b/backend/Makefile.bsd new file mode 100644 index 00000000..2c501dfc --- /dev/null +++ b/backend/Makefile.bsd @@ -0,0 +1,54 @@ +# Linux makefile for libzint +# +# make compiles +# make install copies to /usr/lib +# make uninstall removes library +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + + +CC := gcc +INCLUDE := -I/usr/include +CFLAGS := -g + +prefix := /usr +includedir := $(prefix)/include +libdir := $(prefix)/lib +DESTDIR := + +COMMON:= common.c png.c library.c ps.c large.c reedsol.c gs1.c svg.c +COMMON_OBJ:= common.o png.o library.o ps.o large.o reedsol.o gs1.o svg.o +ONEDIM:= code.c code128.c 2of5.c upcean.c telepen.c medical.c plessey.c rss.c +ONEDIM_OBJ:= code.o code128.o 2of5.o upcean.o telepen.o medical.o plessey.o rss.o +POSTAL:= postal.c auspost.c imail.c +POSTAL_OBJ:= postal.o auspost.o imail.o +TWODIM:= code16k.c dmatrix.c dm200.c pdf417.c qr.c maxicode.c composite.c aztec.c code49.c code1.c gridmtx.c +TWODIM_OBJ:= code16k.o dmatrix.o dm200.o pdf417.o qr.o maxicode.o composite.o aztec.o code49.o code1.o gridmtx.o +LIBS:= `libpng12-config --I_opts --L_opts --ldflags` -lz -lm + +libzint: code.c code128.c 2of5.c upcean.c medical.c telepen.c plessey.c postal.c auspost.c imail.c code16k.c dmatrix.c dm200.c reedsol.c pdf417.c maxicode.c rss.c common.c png.c library.c ps.c qr.c large.c composite.c aztec.c gs1.c svg.c code49.c code1.c gridmtx.c + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(ONEDIM) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(POSTAL) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(TWODIM) + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(COMMON) + $(CC) $(CFLAGS) $(ZINT_VERSION) -shared -Wl,-soname,libzint.so -o libzint.so.2.3.1 $(INCLUDE) $(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) $(LIBS) + ln -s libzint.so.* libzint.so + +.PHONY: install uninstall clean dist + +install: + test "$(UID)" = "0" && ldconfig -n $(PWD) || true + install -d $(DESTDIR)$(libdir) + mv libzint.* $(DESTDIR)$(libdir) + install -D -p --mode=0644 zint.h $(DESTDIR)$(includedir)/zint.h + +uninstall: + rm $(DESTDIR)$(libdir)/libzint.* + rm $(DESTDIR)$(includedir)/zint.h + +clean: + rm -f libzint.* *.o *.a *~ + + diff --git a/backend/Makefile.mingw b/backend/Makefile.mingw new file mode 100644 index 00000000..be33a20b --- /dev/null +++ b/backend/Makefile.mingw @@ -0,0 +1,79 @@ +# Linux makefile for libzint +# +# make compiles with QR Code support +# make install copies to /usr/lib +# make uninstall removes library +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + + +CC:= gcc +AR:= ar rc +RANLIB:= ranlib +INCLUDE:= -I/mingw/include +CFLAGS:= -D_WIN32 -O2 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -Wall + +prefix := /mingw +includedir := $(prefix)/include +libdir := $(prefix)/lib +bindir := $(prefix)/bin +DESTDIR := +APP:=zint +DLL:=$(APP).dll +STATLIB:=lib$(APP).a + +COMMON_OBJ:= common.o png.o library.o ps.o large.o reedsol.o gs1.o svg.o +ONEDIM_OBJ:= code.o code128.o 2of5.o upcean.o telepen.o medical.o plessey.o rss.o +POSTAL_OBJ:= postal.o auspost.o imail.o +TWODIM_OBJ:= code16k.o dmatrix.o dm200.o pdf417.o qr.o maxicode.o composite.o aztec.o code49.o code1.o gridmtx.o + +LIB_OBJ:= $(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) +DLL_OBJ:= $(LIB_OBJ:.o=.lo) dllversion.lo + + +ifeq ($(NO_PNG),true) +DEFINES+= -DNO_PNG +else +DEFINES_DLL+= -DPNG_DLL -DZLIB_DLL +LIBS+= -lpng -lz +endif + +LIBS+= -lm + +all: $(DLL) $(STATLIB) + +%.lo:%.c + @echo Compiling $< ... + $(CC) $(CFLAGS) $(DEFINES) $(DEFINES_DLL) -DDLL_EXPORT -DPIC $(ZINT_VERSION) -c -o $@ $< + +%.o:%.c + @echo Compiling $< ... + $(CC) $(CFLAGS) $(DEFINES) $(ZINT_VERSION) -c -o $@ $< + +$(DLL):$(DLL_OBJ) + @echo Linking $@... + o2dll.sh -o $@ $(DLL_OBJ) $(LIBS) + +$(STATLIB): $(LIB_OBJ) + @echo Linking $@... + $(AR) $@ $(LIB_OBJ) + -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 + +.PHONY: install uninstall clean dist + +install: + cp -fp libzint.* $(DESTDIR)$(libdir) + cp -fp zint.h $(DESTDIR)$(includedir)/zint.h + cp -fp zint.dll $(DESTDIR)$(bindir) + +uninstall: + rm $(DESTDIR)$(libdir)/libzint.* + rm $(DESTDIR)$(includedir)/zint.h + rm $(DESTDIR)$(bindir)/zint.dll + +clean: + rm -f *.lib *.dll *.o *.a *~ *.res *.exe *.def *.lo *.bak + + diff --git a/frontend/Makefile b/frontend/Makefile new file mode 100644 index 00000000..4a8882df --- /dev/null +++ b/frontend/Makefile @@ -0,0 +1,31 @@ +# Linux makefile for zint - requires libzint +# +# make compiles zint +# make install copies binary to /usr/local/bin +# make uninstall removes the binary +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + +CC := gcc +INCLUDE := -I/usr/local/include +CFLAGS := -g + +prefix := /usr/local +bindir := $(prefix)/bin +DESTDIR := + +zint: main.c + $(CC) -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend -L../backend main.c -o zint -lzint + +.PHONY: install uninstall clean dist + +clean: + rm -f zint *.o *.a *~ *.png *.eps *.svg *.log + +install: + install -D -p zint $(DESTDIR)$(bindir)/zint + +uninstall: + rm $(DESTDIR)$(bindir)/zint diff --git a/frontend/Makefile.bsd b/frontend/Makefile.bsd new file mode 100644 index 00000000..cf0131ae --- /dev/null +++ b/frontend/Makefile.bsd @@ -0,0 +1,31 @@ +# Linux makefile for zint - requires libzint +# +# make compiles zint +# make install copies binary to /usr/bin +# make uninstall removes the binary +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + +CC := gcc +INCLUDE := -I/usr/include +CFLAGS := -g + +prefix := /usr +bindir := $(prefix)/bin +DESTDIR := + +zint: main.c + $(CC) -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend -L../backend main.c -o zint -lzint + +.PHONY: install uninstall clean dist + +clean: + rm -f zint *.o *.a *~ *.png *.eps *.svg *.log + +install: + install -D -p zint $(DESTDIR)$(bindir)/zint + +uninstall: + rm $(DESTDIR)$(bindir)/zint diff --git a/frontend/Makefile.mingw b/frontend/Makefile.mingw new file mode 100644 index 00000000..02824960 --- /dev/null +++ b/frontend/Makefile.mingw @@ -0,0 +1,37 @@ +# Linux makefile for zint - requires libzint +# +# make compiles zint +# make install copies binary to /usr/bin +# make uninstall removes the binary +# make clean cleans up a previous compilation and any object or editor files +# + +ZINT_VERSION:=-DZINT_VERSION=\"2.3.1\" + +CC := gcc +CFLAGS := -D_WIN32 -O2 -fms-extensions -mms-bitfields -fno-exceptions -fomit-frame-pointer -Wall -I../backend +prefix := /mingw +bindir := $(prefix)/bin +DESTDIR := + +all: zint zint_static + +%.res:%.rc + windres -O coff --input-format=rc -i $< -o $@ + +zint: main.c zint.res + $(CC) $(CFLAGS) -DZINT_DLL -DPNG_DLL -DZLIB_DLL $(ZINT_VERSION) $? zint.res -o $@ -L../backend -lzint + +zint_static: main.c zint.res + $(CC) -static $(CFLAGS) $(ZINT_VERSION) $? zint.res -o $@ -L../backend -lzint -lpng -lz + +.PHONY: install uninstall clean dist + +clean: + rm -f zint *.o *.a *~ *.png *.eps *.svg *.log *.exe *.bak *.res + +install: + install -D -p zint $(DESTDIR)$(bindir)/zint + +uninstall: + rm $(DESTDIR)$(bindir)/zint diff --git a/readme b/readme index 812f57b7..68ba06a2 100644 --- a/readme +++ b/readme @@ -1,4 +1,4 @@ -Zint and libzint 2.3.0 +Zint and libzint 2.3.1 ---------------------- Zint is a suite of programs to allow easy encoding of data in any of the wide range of public domain barcode standards and to allow integration of this capability into your own programs. This version @@ -15,11 +15,15 @@ Korea Post Barcode, HIBC Code 128, HIBC Code 39, HIBC Data Matrix, HIBC PDF417, HIBC QR Code, HIBC Codablock-F, HIBC Aztec Code, Japanese Postal Code, Code 49, Channel Code, Code One, Grid Matrix, FIM and Flattermarken. -Full documentation is available at project website: http://www.zint.org.uk - + ****************************************************************************** + * PLEASE NOTE: This is just a simple guide to getting Zint working. * + * More complete documentation is available from the project website: * + * >>> http://www.zint.org.uk <<< * + ****************************************************************************** PROJECT STATUS -------------- +Version 2.3.0: This release features a complete rebuild of QR Code and Micro QR Code functionality which now: * Automatically detects and adjusts to Japanese characters @@ -28,30 +32,23 @@ This release features a complete rebuild of QR Code and Micro QR Code functional Also new in this release is Grid Matrix support which similarly supports Chinese character encoding. +Version 2.3.1: +Correction of some minor bugs in Code 128 and Data Matrix, addition of --notext option to CLI and +better operation of --scale option which now scales human readable text and MaxiCode. COMPILING THE CODE ------------------ -This package includes files for compiling in a number of ways depending on what functionality you -want and what platform you are targeting. Zint has been tested on both 32 and 64-bit systems. -It does not use any unusual memory manipulation and so should easily port to a wide range of hardware. +The CMake Method: (Linux, BSD and Cygwin) +The easiest way to configure compilation is to take advantage of the CMake utilities. You will +need to install CMake first. If no Qt libraries are installed then CMake will not attempt to +build the Zint Barcode Studio GUI. Similarly if libpng is not detected then CMake will not attempt +to compile PNG image support. -GNU/Linux and OpenBSD: -To compile the Zint library for you will need libpng and libz pre-installed. Then: - - make - make install - -For some distributions it may be necessary to run - - ldconfig - -as root before libzint can be used. - -To install the GUI interface you will need Qt4 and cmake. Follow these steps: +Once CMake is installed follow these steps: cd build cmake .. - make -j2 + make make install The command line program can be accessed by typing @@ -63,18 +60,25 @@ data will be ignored. The GUI can be accessed by typing zint-qt +The MakeFile Method: +(Linux, BSD and MinGW) +MakeFiles are provided for some systems although this method is depreciated. To compile using +this method simply run: + + make + make install + +If compiling on BSD, RHEL or CentOS substitute MakeFile.bsd for the default MakeFiles. +If compiling on MinGW substitute MakeFile.mingw for the default MakeFiles. + MS Windows: -On the Windows platform you have the choice of compiling with MinGW or with the native compiler, -Microsoft Visual C++. To compile with MinGW follow the instructions for Linux above substituting -the MinGW makefiles for the default Linux ones. For compiling with MS Visual Studio open the -libzint.vcproj project file in the win32 folder and compile in the usual way. +Compiling on Cygwin and MinGW are covered above. Compiling with MS Visual Studio is more involved! +Full instructions are currently not available but will be placed on the project website as soon +as possible. Mac OSX: -HELP NEEDED! It _is_ possible to compile and run Zint on the OSX platform. Unfortunately the -developers of the Zint package do not have access to OSX. If you have any success with comiling -Zint on OSX then please send us a description of how you did it so that we can put that -information here! - +Efforts are currently under way to allow compiling on OSX using the CMake method. If you have +any success with compiling Zint on OSX then please get in touch. THINGS TO DO ------------ @@ -97,7 +101,6 @@ Packaging --------- Binary packages are needed for distribution in the following formats * RPMs for various Linux distros (.spec file now available thanks to Radist) - * Install binaries for MS Windows (MSVC and MinGW make files now included) * Install binaries for Mac OSX Translations