Permalink
Browse files

Add FreeBSD support

  • Loading branch information...
1 parent e78441a commit ab29816a4271073e2b1892d213e5f97ba73a18f4 @UnderCooled committed Oct 18, 2011
Showing with 34 additions and 0 deletions.
  1. +32 −0 Makefile.freebsd
  2. +2 −0 pam.c
View
@@ -0,0 +1,32 @@
+# Makefile for pngquant
+
+CC=gcc
+
+BIN=pngquant
+PREFIX?=/usr/local
+BINPREFIX= $(PREFIX)/bin
+
+SYSTEMLIBPNG=/usr/local/include/libpng
+
+CFLAGS=-std=gnu99 -O3 -Wall -I. -I$(SYSTEMLIBPNG) -funroll-loops -fomit-frame-pointer
+
+LDFLAGS=-L/usr/local/lib/ -L/usr/lib/ -lz -lpng -lm
+
+OBJS=pngquant.o rwpng.o pam.o mediancut.o
+
+all: $(BIN)
+
+$(BIN): $(OBJS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
+
+install: $(BIN)
+ cp $(BIN) $(BINPREFIX)/$(BIN)
+
+uninstall:
+ rm -f $(BINPREFIX)/$(BIN)
+
+clean:
+ rm -f pngquant $(OBJS)
+
+.PHONY: all install uninstall clean
+
View
2 pam.c
@@ -19,11 +19,13 @@
#include "pam.h"
+#ifndef __FreeBSD__
#ifdef __LP64__
typedef unsigned long long u_register_t;
#else
typedef unsigned long u_register_t;
#endif
+#endif
#define PAM_EQUAL(p,q) ((p).a == (q).a && (p).r == (q).r && (p).g == (q).g && (p).b == (q).b)

0 comments on commit ab29816

Please sign in to comment.