Skip to content
Browse files

Get it compiling for the PlayBook.

  • Loading branch information...
1 parent 37df185 commit 8f83299806727e2837331c5f7bece8365570302a @hungc hungc committed Dec 9, 2011
Showing with 12 additions and 9 deletions.
  1. +12 −9 Makefile
View
21 Makefile
@@ -11,7 +11,7 @@ getoptdir=$(libdir)/getopt
localedir=$(sharedir)/locale
# Define this to 0 to use the getopt(3) routines in this package.
-LIBCGETOPT=1
+LIBCGETOPT=0
# Define this to 1 if you do not have the gettext routines
WITHOUT_GETTEXT=0
@@ -24,27 +24,29 @@ UNLIKELYNAME=a8vwjfd92
SHELL=/bin/sh
-CC=gcc
-LD=ld
+# CC, LD, LDFLAGS, CPPFLAGS and CFLAGS are defined in the CouchDB build script for PlayBook
+#CC=gcc
+#LD=ld
RM=rm -f
INSTALL=install
MSGFMT=msgfmt
LANGUAGES = cs de es fr it ja nl pt_BR
MOFILES:=$(patsubst %,po/%.mo,$(LANGUAGES))
-CPPFLAGS=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX
+CPPFLAGS+=-DLIBCGETOPT=$(LIBCGETOPT) -DWITH_GETTEXT=$(WITH_GETTEXT) -DLOCALEDIR=\"$(localedir)\" -DNOT_UTIL_LINUX
ifeq ($(LIBCGETOPT),0)
CPPFLAGS+=-I./gnu
endif
-WARNINGS=-Wall \
- -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \
+WARNINGS= -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \
-Wcast-align -Wmissing-declarations \
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
-Wnested-externs -Winline
OPTIMIZE=-O3 -fno-strength-reduce
-CFLAGS=$(WARNINGS) $(OPTIMIZE)
-LDFLAGS=
+
+CFLAGS+=$(WARNINGS) $(OPTIMIZE)
+
+#LDFLAGS=
sources=getopt.c
ifeq ($(LIBCGETOPT),0)
@@ -61,8 +63,9 @@ all: $(binaries) all_po
clean: clean_po
-$(RM) $(objects) $(binaries)
+# Add PlayBook libraries to link against
getopt: $(objects)
- $(CC) $(LDFLAGS) -o $@ $(objects)
+ $(CC) $(LDFLAGS) -o $@ -liconv -lintl $(objects)
install: getopt install_po
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)

0 comments on commit 8f83299

Please sign in to comment.
Something went wrong with that request. Please try again.