Subversion Repositories

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

Rev 62 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
62 magnus 1
Description: Use Automake conditionals to construct lib_LTLIBRARIES
2
 Otherwise automake doesn't pick up the correct dependencies for test-oop
3
Bug-Debian: https://bugs.debian.org/909904
4
 
5
--- a/configure.ac
6
+++ b/configure.ac
65 magnus 7
@@ -31,20 +31,20 @@ AC_CHECK_HEADERS(poll.h sys/select.h sys
62 magnus 8
 
9
 if test xno != x$with_adns; then
10
   AC_CHECK_LIB(adns,adns_init,[
11
-    LIBOOP_LIBS="liboop-adns.la $LIBOOP_LIBS"
12
     ADNS_LIBS="-ladns"
13
     AC_DEFINE(HAVE_ADNS)
14
   ])
15
 fi
65 magnus 16
+AM_CONDITIONAL([WANT_ADNS], [test -n "$ADNS_LIBS"])
62 magnus 17
 
18
 if test xno != x$with_readline; then
19
   AC_CHECK_LIB(readline,rl_callback_handler_install,[
20
   AC_CHECK_HEADER(readline/readline.h,[
21
-    LIBOOP_LIBS="liboop-rl.la $LIBOOP_LIBS"
22
     READLINE_LIBS="-lreadline"
23
     AC_DEFINE(HAVE_READLINE)
24
   ])])
25
 fi
65 magnus 26
+AM_CONDITIONAL([WANT_READLINE], [test -n "$READLINE_LIBS"])
62 magnus 27
 
28
 if test xno != x$with_glib; then
29
   save_libs="$LIBS"
65 magnus 30
@@ -57,7 +57,7 @@ if test xno != x$with_glib; then
62 magnus 31
     CPPFLAGS="$save_cppflags $GLIB_INCLUDES"
32
     AC_CHECK_FUNC(g_main_set_poll_func,[
33
     AC_CHECK_HEADER(glib.h,[
34
-      LIBOOP_LIBS="liboop-glib.la $LIBOOP_LIBS"
65 magnus 35
+      have_glib="true"
62 magnus 36
       AC_DEFINE(HAVE_GLIB)
37
     ])])
38
   fi
65 magnus 39
@@ -65,17 +65,18 @@ if test xno != x$with_glib; then
62 magnus 40
   CPPFLAGS="$save_cppflags"
41
 
42
   PKG_CHECK_MODULES(GLIB2,glib-2.0 >= 2.0,[
43
-    LIBOOP_LIBS="liboop-glib2.la $LIBOOP_LIBS"
65 magnus 44
+    have_glib2="true"
62 magnus 45
     AC_DEFINE(HAVE_GLIB)
46
     ],[:])
47
 fi
65 magnus 48
+AM_CONDITIONAL([WANT_GLIB], [test -n "have_glib"])
49
+AM_CONDITIONAL([WANT_GLIB2], [test -n "have_glib2"])
62 magnus 50
 
51
 if test xno != x$with_tcl; then
65 magnus 52
   for version in "" 8.4 8.3 8.2 8.1 8.0 ; do
62 magnus 53
     CPPFLAGS="$save_cppflags -I/usr/include/tcl$version"
54
     AC_CHECK_LIB(tcl$version,Tcl_Main,[
55
     AC_CHECK_HEADER(tcl.h,[
56
-      LIBOOP_LIBS="liboop-tcl.la $LIBOOP_LIBS"
57
       AC_DEFINE(HAVE_TCL)
58
       TCL_INCLUDES="-I/usr/include/tcl$version"
59
       TCL_LIBS="-ltcl$version"
65 magnus 60
@@ -84,6 +85,7 @@ if test xno != x$with_tcl; then
62 magnus 61
   done
62
   CPPFLAGS="$save_cppflags"
63
 fi
65 magnus 64
+AM_CONDITIONAL([WANT_TCL], [test -n "$TCL_LIBS"])
62 magnus 65
 
66
 if test xyes = x$with_libwww; then
67
   save_libs="$LIBS"
65 magnus 68
@@ -95,13 +97,14 @@ if test xyes = x$with_libwww; then
62 magnus 69
     LIBS="$save_libs $WWW_LIBS"
70
     CPPFLAGS="$save_cppflags $WWW_INCLUDES"
71
     AC_CHECK_FUNC(HTEvent_setRegisterCallback,[
72
-      LIBOOP_LIBS="liboop-www.la $LIBOOP_LIBS"
65 magnus 73
+      have_www="true"
62 magnus 74
       AC_DEFINE(HAVE_WWW)
75
     ])
76
   fi
77
   LIBS="$save_libs"
78
   CPPFLAGS="$save_cppflags"
79
 fi
65 magnus 80
+AM_CONDITIONAL([WANT_WWW], [test -n "$have_www"])
62 magnus 81
 
82
 if test -z "$no_wacky_libs" ; then
83
   AC_CHECK_LIB(resolv,res_query)
65 magnus 84
@@ -123,5 +126,4 @@ AC_SUBST(ADNS_LIBS)
62 magnus 85
 AC_SUBST(WWW_INCLUDES)
86
 AC_SUBST(WWW_LIBS)
87
 AC_SUBST(READLINE_LIBS)
88
-AC_SUBST(LIBOOP_LIBS)
89
 AC_OUTPUT([Makefile liboop.pc liboop-glib2.pc])
90
--- a/Makefile.am
91
+++ b/Makefile.am
92
@@ -7,8 +7,25 @@
93
 # See the file COPYING for details.
94
 
95
 AUTOMAKE_OPTIONS = foreign 1.7
96
-lib_LTLIBRARIES = liboop.la @LIBOOP_LIBS@
97
-EXTRA_LTLIBRARIES = liboop-adns.la liboop-glib2.la liboop-glib.la liboop-tcl.la liboop-www.la liboop-rl.la
98
+lib_LTLIBRARIES = liboop.la
65 magnus 99
+if WANT_ADNS
62 magnus 100
+  lib_LTLIBRARIES += liboop-adns.la
101
+endif
65 magnus 102
+if WANT_GLIB
62 magnus 103
+  lib_LTLIBRARIES += liboop-glib.la
104
+endif
65 magnus 105
+if WANT_GLIB2
62 magnus 106
+  lib_LTLIBRARIES += liboop-glib2.la
107
+endif
65 magnus 108
+if WANT_TCL
62 magnus 109
+  lib_LTLIBRARIES += liboop-tcl.la
110
+endif
65 magnus 111
+if WANT_WWW
62 magnus 112
+  lib_LTLIBRARIES += liboop-www.la
113
+endif
65 magnus 114
+if WANT_READLINE
62 magnus 115
+  lib_LTLIBRARIES += liboop-rl.la
116
+endif
117
 
118
 pkgconfigdir = $(libdir)/pkgconfig
119
 pkgconfig_DATA = liboop.pc liboop-glib2.pc