]> granicus.if.org Git - curl/commitdiff
unit tests: more build adjustments
authorYang Tse <yangsita@gmail.com>
Wed, 1 Jun 2011 19:39:18 +0000 (21:39 +0200)
committerYang Tse <yangsita@gmail.com>
Wed, 1 Jun 2011 19:40:09 +0000 (21:40 +0200)
configure.ac
lib/Makefile.am
tests/Makefile.am
tests/unit/Makefile.am
tests/unit/Makefile.inc

index 819008eeca092b362a5480c95645a2696cf9b864..c8c0d42c04a6ad74cdbec3dcbfea15def5d3e2e8 100644 (file)
@@ -305,6 +305,8 @@ AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
 CURL_CHECK_CURLDEBUG
 AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
 
+AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_curldebug = xyes)
+
 dnl **********************************************************************
 dnl Compilation based checks should not be done before this point.
 dnl **********************************************************************
index d3dc9af918a218131e11adf5cfcf3ac41887aeda..f2e54db95af874d8e55337be050d5b760f7965bb 100644 (file)
@@ -106,7 +106,7 @@ endif
 # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
 
 if NO_UNDEFINED
-# The -no-undefined flag is CRUCIAL for this to build fine on Cygwin.
+# The -no-undefined flag is crucial to build fine on some platforms
 UNDEF = -no-undefined
 endif
 
@@ -116,18 +116,18 @@ if MIMPURE
 MIMPURE = -mimpure-text
 endif
 
-LINKFLAGS=$(UNDEF) $(MIMPURE) $(LIBCURL_LIBS)
+libcurl_la_LDFLAGS = $(UNDEF) $(VERSIONINFO) $(MIMPURE) $(LIBCURL_LIBS)
 
-libcurl_la_LDFLAGS = $(LINKFLAGS) $(VERSIONINFO)
-
-# as unit testing will compile and link everything an extra time, we only
-# do it if debug is enabled
-if CURLDEBUG
+# unit testing static library built only along with unit tests
+if BUILD_UNITTESTS
 noinst_LTLIBRARIES = libcurlu.la
-libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
-libcurlu_la_LDFLAGS = -static $(LINKFLAGS)
+else
+noinst_LTLIBRARIES =
 endif
 
+libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DUNITTESTS
+libcurlu_la_LDFLAGS = -static $(LIBCURL_LIBS)
+
 # Makefile.inc provides the CSOURCES and HHEADERS defines
 include Makefile.inc
 
index 0453493500d9ed0aa84293159b10648d3cf5eb4a..85dd7999a6e8ba922f8df4522be957ce029a014a 100644 (file)
@@ -30,7 +30,14 @@ EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
  serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
  certs/srp-verifier-conf certs/srp-verifier-db
 
-SUBDIRS = data server libtest unit
+if BUILD_UNITTESTS
+BUILD_UNIT = unit
+else
+BUILD_UNIT =
+endif
+
+SUBDIRS = data server libtest $(BUILD_UNIT)
+DIST_SUBDIRS = $(SUBDIRS) unit
 
 PERLFLAGS = -I$(srcdir)
 
index c77a516d59a890cd8ca826264d7d3e014cd71b15..d290a1dc767ac1097edc8a72cfc30582f79b147e 100644 (file)
@@ -48,30 +48,21 @@ INCLUDES = -I$(top_builddir)/include/curl \
            -I$(top_builddir)/include      \
            -I$(top_srcdir)/include        \
            -I$(top_builddir)/lib          \
-           -I$(top_srcdir)/lib                   \
+           -I$(top_srcdir)/lib            \
            -I$(top_srcdir)/tests/libtest
 endif
 
-if CURLDEBUG
-
 EXTRA_DIST = Makefile.inc
 
 LDADD = $(top_builddir)/lib/libcurlu.la @CURL_LIBS@
 DEPENDENCIES = $(top_builddir)/lib/libcurlu.la
 AM_CPPFLAGS = -DUNITTESTS
 
-# Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES,
-# noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS)
+# Makefile.inc provides neat definitions
 include Makefile.inc
 
-if NO_UNDEFINED
-# The -no-undefined flag is crucial to build fine on some platforms
-UNDEF = -no-undefined
-endif
-
-
+if BUILD_UNITTESTS
+noinst_PROGRAMS = $(UNITPROGS)
 else
-# do nothing if debug was not enabled
-all:
-
+noinst_PROGRAMS =
 endif
index ff85e7b3740ad2745cf6515d68f885c59fad953b..da24f4c2e89c02f0792887e7c67d07abfbbc8265 100644 (file)
@@ -5,7 +5,7 @@ UNITFILES = curlcheck.h \
  $(top_srcdir)/tests/libtest/first.c
 
 # These are all unit test programs
-noinst_PROGRAMS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307
+UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307
 
 unit1300_SOURCES = unit1300.c $(UNITFILES)
 unit1301_SOURCES = unit1301.c $(UNITFILES)