summaryrefslogtreecommitdiff
blob: cb51a71e6e91ee430aebb41d6b94954f0c3c16f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From b28e69f92f0b0a690e01a7a9b9bc08ffa9e9bc5e Mon Sep 17 00:00:00 2001
From: Sean McGovern <gseanmcg@gmail.com>
Date: Mon, 27 Aug 2012 01:00:44 -0400
Subject: [PATCH] configure: don't build static libgpm by default

---
 configure.ac    |   11 +++++++++++
 src/Makefile.in |    6 ++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7245826..899b92d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -79,6 +79,16 @@ AC_CHECK_HEADERS(sys/sysmacros.h linux/major.h linux/tty.h)
 # Required headers
 AC_CHECK_HEADERS(sys/socket.h,,[AC_MSG_ERROR([Required header file missing])])
 
+AC_ARG_ENABLE([static],
+[  --enable-static         build static libraries @<:@default=no@:>@])
+
+LIBGPM_A=
+
+AS_IF([test "x$enable_static" = "xyes"], [
+        LIBGPM_A=lib/libgpm.a
+])
+
+
 AC_ARG_WITH(curses,
 [  --without-curses        disable curses support even if curses found])
 
@@ -138,6 +148,7 @@ AC_SUBST(ELISP)
 AC_SUBST(SHLIB)
 AC_SUBST(PICFLAGS)
 AC_SUBST(SOLDFLAGS)
+AC_SUBST(LIBGPM_A)
 AC_SUBST(CURSES_OBJS)
 AC_SUBST(SHARED_LIBS)
 AC_SUBST(lispdir)
diff --git a/src/Makefile.in b/src/Makefile.in
index da35a5d..d3b1dcd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -79,7 +79,7 @@ prog/%:	prog/%.o
 #		| $(SED) '\''s/\($*\)\.o\([ :]*\)/\1.o \1.lo\2/g'\'' > $(DEPDIR)/$@'
 
 # Do it all!
-all:	gpm lib/libgpm.so.@abi_lev@ lib/libgpm.a $(PROG)
+all:	gpm lib/libgpm.so.@abi_lev@ @LIBGPM_A@ $(PROG)
 
 gpm:	$(GOBJ)
 	$(CC) @LDFLAGS@ $(LDFLAGS) -o $@ $(GOBJ) @LIBS@ $(LIBS) -lm
@@ -105,7 +105,9 @@ installdirs:
 
 install:	check 
 	$(INSTALL_PROGRAM) gpm $(sbindir)/gpm
-	$(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a
+	if [ -f lib/libgpm.a ] ; then \
+	$(INSTALL_DATA) -m 644 lib/libgpm.a $(libdir)/libgpm.a ; \
+	fi
 	$(INSTALL_DATA) -m 644 $(srcdir)/headers/gpm.h $(includedir)/gpm.h
 	# POSIX requires the range of a for loop be nonempty and Bash
 	# 2.x goes along; unfortunately that means an additional
-- 
1.7.8.6