summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitrij Mijoski <dmjpp@hotmail.com>2017-09-12 14:09:51 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-09-15 17:44:37 +0200
commit1eaec743d1f1fbb5efeddd19aff07114cf4c7fc9 (patch)
treed0ac9a5d85894728ab54834a14033a2cddf5568a
parent85d24152f81bfcd463356330f1cc6257f485535f (diff)
downloadcppunit-1eaec743d1f1fbb5efeddd19aff07114cf4c7fc9.tar.gz
Fix money example on propely linking with library with PKG_CHECK.
Change-Id: If42a50386402b7a601268cf8db80236c147009c1 Reviewed-on: https://gerrit.libreoffice.org/42206 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--doc/Money.dox4
-rw-r--r--examples/money/Makefile.am9
-rw-r--r--examples/money/configure.ac (renamed from examples/money/configure.in)4
3 files changed, 10 insertions, 7 deletions
diff --git a/doc/Money.dox b/doc/Money.dox
index d35e8e8..68d5b6d 100644
--- a/doc/Money.dox
+++ b/doc/Money.dox
@@ -69,7 +69,7 @@ hold the code we're going to build. Create \c configure.in and
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(money,0.1)
-AM_PATH_CPPUNIT(1.9.6)
+PKG_CHECK_MODULES([CPPUNIT], [cppunit >= 1.11.6])
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
@@ -82,7 +82,7 @@ TESTS = MoneyApp
check_PROGRAMS = $(TESTS)
MoneyApp_SOURCES = Money.h MoneyTest.h MoneyTest.cpp MoneyApp.cpp
MoneyApp_CXXFLAGS = $(CPPUNIT_CFLAGS)
-MoneyApp_LDFLAGS = $(CPPUNIT_LIBS) -ldl\endverbatim
+MoneyApp_LDADD = $(CPPUNIT_LIBS)\endverbatim
diff --git a/examples/money/Makefile.am b/examples/money/Makefile.am
index e55e9c3..f6afb40 100644
--- a/examples/money/Makefile.am
+++ b/examples/money/Makefile.am
@@ -8,6 +8,9 @@ check_PROGRAMS = $(TESTS)
MoneyApp_SOURCES = Money.h MoneyTest.h MoneyTest.cpp MoneyApp.cpp StdAfx.h
MoneyApp_CXXFLAGS = $(CPPUNIT_CFLAGS)
-MoneyApp_LDADD = \
- $(top_builddir)/src/cppunit/libcppunit.la \
- $(CPPUNIT_LIBS) $(LIBADD_DL)
+
+# MoneyApp_LDADD = $(CPPUNIT_LIBS)
+# USE THIS in your projects, not the line bellow
+
+MoneyApp_LDADD = $(top_builddir)/src/cppunit/libcppunit.la
+# this line is needed to build and test CPPUNIT itself.
diff --git a/examples/money/configure.in b/examples/money/configure.ac
index 5770e39..a6586e7 100644
--- a/examples/money/configure.in
+++ b/examples/money/configure.ac
@@ -1,9 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
dnl Don't forget to run `aclocal -I /usr/local/share/aclocal` before
-dnl running autoconf! This is required for AM_PATH_CPPUNIT to work.
+dnl running autoconf! This is required for PKG_CHECK_MODULES to work.
AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(cppunit-cookbook,1.6.2)
-AM_PATH_CPPUNIT(1.6.2)
+PKG_CHECK_MODULES([CPPUNIT], [cppunit >= 1.11.6])
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL