void-packages/srcpkgs/mongoose/patches/mk-tweaks.patch

44 lines
1.7 KiB
Diff
Raw Normal View History

2013-04-23 08:10:48 +00:00
--- Makefile.orig 2013-04-23 09:56:44.031317155 +0200
+++ Makefile 2013-04-23 10:01:52.126993442 +0200
@@ -17,7 +17,9 @@
# -DUSE_LUA - embed Lua in Mongoose (+100kb)
2012-06-19 08:13:53 +00:00
2013-04-23 08:10:48 +00:00
PROG = mongoose
-CFLAGS = -std=c99 -O2 -W -Wall -pedantic -pthread $(COPT)
+LIB = lib$(PROG).so.0
+CFLAGS += -std=c99 -O2 -W -Wall -pedantic -pthread $(COPT)
+
2012-06-19 08:13:53 +00:00
2013-04-23 08:10:48 +00:00
# To build with Lua, download and unzip Lua 5.2.1 source code into the
# mongoose directory, and then add $(LUA_SOURCES) to CFLAGS
@@ -79,7 +81,9 @@ all:
2012-06-19 08:13:53 +00:00
# "-Wl,--as-needed" turned on by default in cc command.
# Also, this is turned in many other distros in static linkage builds.
linux:
2013-04-23 08:10:48 +00:00
- $(CC) mongoose.c main.c -o $(PROG) -ldl $(CFLAGS)
2012-06-19 08:13:53 +00:00
+ $(CC) mongoose.c -shared -fPIC -fpic -Wl,-soname,$(LIB) \
2013-04-23 08:10:48 +00:00
+ -o $(LIB) -ldl -lpthread $(CFLAGS)
+ $(CC) main.c -o $(PROG) -ldl -lpthread -L. $(LIB) $(CFLAGS)
2012-06-19 08:13:53 +00:00
2013-04-23 08:10:48 +00:00
mac: bsd
2012-06-19 08:13:53 +00:00
bsd:
2013-04-23 08:10:48 +00:00
@@ -94,6 +98,18 @@ bsd_yassl:
solaris:
$(CC) mongoose.c main.c -lnsl -lsocket -o $(PROG) $(CFLAGS)
2012-06-19 08:13:53 +00:00
+install:
+ install -d $(DESTDIR)$(PREFIX)/include
+ install -m644 mongoose.h $(DESTDIR)$(PREFIX)/include
+ install -d $(DESTDIR)$(PREFIX)/bin
+ install -m755 $(PROG) $(DESTDIR)$(PREFIX)/bin
+ install -d $(DESTDIR)$(PREFIX)/lib
+ ln -sf $(LIB) $(LIB).0; cp -a $(LIB).0 $(DESTDIR)$(PREFIX)/lib
+ ln -sf $(LIB) libmongoose.so; cp -a libmongoose.so $(DESTDIR)$(PREFIX)/lib
+ install -m755 $(LIB) $(DESTDIR)$(PREFIX)/lib
+ install -d $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
2013-04-23 08:10:48 +00:00
+ -install -m644 mongoose.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
2012-06-19 08:13:53 +00:00
+
2013-04-23 08:10:48 +00:00
# For codesign to work in non-interactive mode, unlock login keychain:
# security unlock ~/Library/Keychains/login.keychain
# See e.g. http://lists.apple.com/archives/apple-cdsa/2008/Jan/msg00027.html