Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 129 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
129 magnus 1
Description: Make sure we don't touch the embedded argp copy when not needed
2
 To avoid inline functions causing build failures under C99 standards
3
Author: Magnus Holmgren <holmgren@debian.org>
4
Bug-Debian: https://bugs.debian.org/777990
5
Forwarded: yes
6
 
7
--- a/configure.ac
8
+++ b/configure.ac
9
@@ -577,15 +577,18 @@ fi
10
 
11
 # We don't use LIBOBJS for this, as the LIBOBJS are added to
12
 # liblsh.a, and we can't add an archive to an archive.
13
+ARGP=""
14
 LIBARGP=""
15
 DOTDOT_LIBARGP=""
16
 if test x$with_system_argp = xno ; then
17
+  ARGP="argp"
18
   # FIXME: Perhaps it's better to use an absolute path?
19
   LIBARGP="argp/libargp.a"
20
   # Needed for linking in src/testsuite.
21
   DOTDOT_LIBARGP="../argp/libargp.a"
22
 fi
23
 
24
+AC_SUBST(ARGP)
25
 AC_SUBST(LIBARGP)
26
 AC_SUBST(DOTDOT_LIBARGP)
27
 
28
@@ -776,7 +779,9 @@ if test x$enable_ipv6 = xyes ; then
29
   AC_DEFINE(WITH_IPV6)
30
 fi
31
 
32
+if test x$with_system_argp = xno ; then
33
 AC_CONFIG_SUBDIRS(src/argp)
34
+fi
35
 AC_CONFIG_SUBDIRS(src/spki)
36
 AC_CONFIG_SUBDIRS(src/sftp)
37
 
38
--- a/src/Makefile.am
39
+++ b/src/Makefile.am
40
@@ -1,6 +1,6 @@
41
 # Process this file with automake to produce Makefile.in
42
 
43
-SUBDIRS = argp rsync scm sftp spki . testsuite
44
+SUBDIRS = @ARGP@ rsync scm sftp spki . testsuite
45
 
46
 include .dist_classes
47
 include .dist_headers
48
--- a/acinclude.m4
49
+++ b/acinclude.m4
50
@@ -190,6 +190,7 @@ AC_DEFUN([LSH_LIB_ARGP],
51
   ac_argp_save_LDFLAGS="$LDFLAGS"
52
   ac_argp_ok=no
53
   # First check if we can link with argp.
54
+  AH_TEMPLATE([HAVE_ARGP_PARSE], [Define if system has argp_parse()])
55
   AC_SEARCH_LIBS(argp_parse, argp,
56
   [ LSH_RPATH_FIX
57
     AC_CACHE_CHECK([for working argp],
58
@@ -294,6 +295,7 @@ int main(int argc, char **argv)
59
 
60
   if test x$lsh_cv_lib_argp_works = xyes ; then
61
     ac_argp_ok=yes
62
+    AC_DEFINE(HAVE_ARGP_PARSE)
63
   else
64
     # Reset link flags
65
     LIBS="$ac_argp_save_LIBS"