diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..189caab0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +/doc +/Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..ae84eec2f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,12 @@ +[package] + +name = "png-sys" +version = "1.6.3" +authors = ["The Servo Project Developers"] + +build = "make -f makefile.cargo" + +[lib] + +name = "png-sys" +path = "lib.rs" diff --git a/lib.rs b/lib.rs new file mode 100644 index 000000000..83f6eb83c --- /dev/null +++ b/lib.rs @@ -0,0 +1 @@ +// Intentionally blank diff --git a/makefile.cargo b/makefile.cargo new file mode 100644 index 000000000..b03d2e3df --- /dev/null +++ b/makefile.cargo @@ -0,0 +1,32 @@ +CC ?= gcc + +CFLAGS += -O3 -fPIC + +LIBPNG_SRC=\ + png.c \ + pngerror.c \ + pngget.c \ + pngmem.c \ + pngpread.c \ + pngread.c \ + pngrio.c \ + pngrtran.c \ + pngrutil.c \ + pngset.c \ + pngtrans.c \ + pngwio.c \ + pngwrite.c \ + pngwtran.c \ + pngwutil.c + +LIBPNG_OBJS=$(patsubst %.c,$(OUT_DIR)/%.o,$(LIBPNG_SRC)) + +.PHONY: all +all: $(OUT_DIR)/libpng.a + cp png.h pnglibconf.h pngconf.h $(OUT_DIR) + +$(OUT_DIR)/%.o: %.c + $(CC) -c $(CFLAGS) -o $@ $< + +$(OUT_DIR)/libpng.a: $(LIBPNG_OBJS) + $(AR) rcs $@ $(LIBPNG_OBJS)