Commit 6fc32577 authored by anilsaharan's avatar anilsaharan

- Applied various patches for the shared lilbrary build

- Added conditional compilation code
- Modified the Makefile rules for the _test.o generation from the C souorce files in the Framework directory.


git-svn-id: http://svn.code.sf.net/p/cunit/code/trunk@86 f00e6729-6848-4c17-8bfb-678c97c00071
parent a8cf0545
......@@ -19,7 +19,7 @@ echo "Preparing for Installation."
%build
echo "Preparing for Building."
./configure --prefix=%{_prefix} && \
./configure --prefix=%{_prefix} --enable-automated --enable-basic --enable-console --enable-curses && \
make
%install
......
......@@ -7,12 +7,23 @@ CURSES_INCLUDES = CUCurses.h
FRAMEWORK_INCLUDES = CUError.h CUnit.h MyMem.h TestDB.h TestRun.h Util.h
# Default configuration without enabling anything
INCLUDE_FILES = \
${FRAMEWORK_INCLUDES} \
${CONSOLE_INCLUDES} \
${CURSES_INCLUDES} \
${AUTOMATED_INCLUDES} \
${BASIC_INCLUDES}
INCLUDE_FILES = ${FRAMEWORK_INCLUDES}
if ENABLE_BASIC
INCLUDE_FILES += $(BASIC_INCLUDES)
endif
if ENABLE_CONSOLE
INCLUDE_FILES += $(CONSOLE_INCLUDES)
endif
if ENABLE_AUTOMATED
INCLUDE_FILES += $(AUTOMATED_INCLUDES)
endif
if ENABLE_CURSES
INCLUDE_FILES += $(CURSES_INCLUDES)
endif
CUnitInclude_HEADERS = ${INCLUDE_FILES}
noinst_LIBRARIES = libcunitautomated.a
noinst_LTLIBRARIES = libcunitautomated.la
libcunitautomated_a_SOURCES = \
libcunitautomated_la_SOURCES = \
Automated.c
noinst_LIBRARIES = libcunitbasic.a
noinst_LTLIBRARIES = libcunitbasic.la
libcunitbasic_a_SOURCES = \
libcunitbasic_la_SOURCES = \
Basic.c
noinst_LIBRARIES = libcunitconsole.a
noinst_LTLIBRARIES = libcunitconsole.la
libcunitconsole_a_SOURCES = \
libcunitconsole_la_SOURCES = \
Console.c
noinst_LIBRARIES = libcunitcurses.a
noinst_LTLIBRARIES = libcunitcurses.la
libcunitcurses_a_SOURCES = \
libcunitcurses_la_SOURCES = \
Curses.c
noinst_LIBRARIES = libcunitfmk.a libcunittestfmk.a
noinst_LTLIBRARIES = libcunitfmk.la
noinst_LIBRARIES = libcunittestfmk.a
libcunitfmk_a_SOURCES = \
TEST_DEFINES = -DCUNIT_BUILD_TESTS -DCUNIT_DO_NOT_DEFINE_UNLESS_BUILDING_TESTS -DMEMTRACE
TEST_INCLUDES = -I../Test
%_test.o: %.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o $@ -c $<
libcunitfmk_la_SOURCES = \
CUError.c \
MyMem.c \
TestDB.c \
......@@ -16,20 +24,3 @@ TEST_OBJECTS = \
libcunittestfmk_a_SOURCES =
libcunittestfmk_a_LIBADD = $(TEST_OBJECTS)
TEST_DEFINES = -DCUNIT_BUILD_TESTS -DCUNIT_DO_NOT_DEFINE_UNLESS_BUILDING_TESTS -DMEMTRACE
TEST_INCLUDES = -I../Test
CUError_test.o: CUError.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o CUError_test.o -c CUError.c
MyMem_test.o: MyMem.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o MyMem_test.o -c MyMem.c
TestDB_test.o: TestDB.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o TestDB_test.o -c TestDB.c
TestRun_test.o: TestRun.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o TestRun_test.o -c TestRun.c
Util_test.o: Util.c
$(COMPILE) $(TEST_INCLUDES) $(TEST_DEFINES) -o Util_test.o -c Util.c
AUTOMATED_OBJECTS = Automated/Automated.o
BASIC_OBJECTS = Basic/Basic.o
CONSOLE_OBJECTS = Console/Console.o
CURSES_OBJECTS = Curses/Curses.o
FRAMEWORK_OBJECTS = Framework/CUError.o Framework/MyMem.o Framework/TestDB.o Framework/TestRun.o Framework/Util.o
AUTOMATED_OBJECTS = Automated/Automated.lo
BASIC_OBJECTS = Basic/Basic.lo
CONSOLE_OBJECTS = Console/Console.lo
CURSES_OBJECTS = Curses/Curses.lo
FRAMEWORK_OBJECTS = Framework/CUError.lo Framework/MyMem.lo Framework/TestDB.lo Framework/TestRun.lo Framework/Util.lo
OBJECT_FILES = $(FRAMEWORK_OBJECTS) $(BASIC_OBJECTS) $(AUTOMATED_OBJECTS) $(CONSOLE_OBJECTS) $(CURSES_OBJECTS)
OBJECT_FILES = $(FRAMEWORK_OBJECTS)
COMPILE_DIRS = Framework
if ENABLE_BASIC
OBJECT_FILES += $(BASIC_OBJECTS)
COMPILE_DIRS += Basic
endif
if ENABLE_CONSOLE
OBJECT_FILES += $(CONSOLE_OBJECTS)
COMPILE_DIRS += Console
endif
if ENABLE_AUTOMATED
OBJECT_FILES += $(AUTOMATED_OBJECTS)
COMPILE_DIRS += Automated
endif
if ENABLE_CURSES
OBJECT_FILES += $(CURSES_OBJECTS)
COMPILE_DIRS += Curses
endif
COMPILE_DIRS += . Test
TEST_OBJECTS = \
Framework/CUError_test.o \
......@@ -13,13 +36,12 @@ TEST_OBJECTS = \
Framework/TestRun_test.o \
Framework/Util_test.o
COMPILE_DIRS = Framework Automated Basic Console Curses . Test
SUBDIRS = $(COMPILE_DIRS)
lib_LIBRARIES = libcunit.a
libcunit_a_SOURCES =
libcunit_a_LIBADD = $(OBJECT_FILES)
lib_LTLIBRARIES = libcunit.la
libcunit_la_SOURCES =
libcunit_la_LIBADD = $(OBJECT_FILES)
noinst_LIBRARIES = libcunit_test.a
libcunit_test_a_SOURCES =
......
* Wed Aug 03 2005 Anil Kumar <anilsaharan@users.sourceforge.net>
- Applied patch (1239181) for building shared library targets.
- Applied patch (1250604) for enable options in configure.in.
- Modified Makefile.am in various directories for conditional
building based on the configuration options selection. Added
new selections for the Basic and Console also.
* Sun May 08 2005 Jerry St.Clair <jds2@users.sourceforge.net>
- Added 'CU_' prefix to BOOL, TRUE, FALSE in Headers/CUnit.h.
- Added jam system option to build dll's on Windows.
......
EXAMPLE_DIRS = . AutomatedTest BasicTest ConsoleTest CursesTest
EXAMPLE_DIRS = .
if ENABLE_BASIC
EXAMPLE_DIRS += BasicTest
endif
if ENABLE_CONSOLE
EXAMPLE_DIRS += ConsoleTest
endif
if ENABLE_CURSES
EXAMPLE_DIRS += CursesTest
endif
if ENABLE_AUTOMATED
EXAMPLE_DIRS += AutomatedTest
endif
SUBDIRS = ${EXAMPLE_DIRS}
......
......@@ -7,7 +7,9 @@ if [ "$INSTALL_HOME"X == "X" ]; then
INSTALL_HOME=$HOME/CUnitHome
fi
libtoolize --force --copy && \
aclocal && \
autoheader && \
automake --add-missing --include-deps --copy && \
autoconf
......@@ -18,7 +20,7 @@ fi
mkdir -p $INSTALL_HOME
if [ $# -gt 0 ]; then
./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-automated
./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-automated --enable-basic --enable-console
else
./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-memtrace --enable-automated
./configure --srcdir=`pwd` --prefix=$INSTALL_HOME --enable-debug --enable-memtrace --enable-automated --enable-basic --enable-console
fi
/* This is not really set up correctly, but none of
* these macros are used in CUnit, so no matter.
*/
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <assert.h> header file. */
......@@ -10,6 +6,9 @@
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <file.h> header file. */
#undef HAVE_FILE_H
......
dnl Process this file with autoconf to produce a configure script.
AC_INIT(CUnit, 2.0-2)
AM_INIT_AUTOMAKE(CUnit, 2.0-2)
dnl Applied patch to handle AC_ARG_ENABLE targets (Patch 1250604) - Provided by Andrew Kephart <andrew.kephart@alereon.com
PACKAGE=CUnit
VERSION_MAJOR=2
VERSION_MINOR=0
VERSION=@VERSION_MAJOR@.@VERSION_MINOR@
RELEASE=2
AC_INIT(CUnit, 2.0-3)
AM_INIT_AUTOMAKE(CUnit, 2.0-3)
PACKAGE=CUnit
VERSION_MAJOR=2
VERSION_MINOR=0
VERSION=${VERSION_MAJOR}.${VERSION_MINOR}
RELEASE=3
TOPDIR=`pwd`
CFLAGS="-DRELEASE=@RELEASE@ -Wall -W -pedantic -Wshadow -ansi -I${PWD}/CUnit/Headers"
CFLAGS="$CFLAGS -DRELEASE=@RELEASE@ -Wall -W -pedantic -Wshadow -ansi -I${PWD}/CUnit/Headers"
LDFLAGS="-L${PWD}/CUnit/Sources"
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging],
[
echo "++++++++++ Enabling debug mode compilation.";
CFLAGS="$CFLAGS -D_DEBUG -g3 -Wall"
LDFLAGS="$LDFLAGS -g"
],
[
echo "---------- Disabling debug mode compilation."
])
AM_CONDITIONAL(ENABLE_AUTOMATED, false)
[ --enable-debug enable debugging],
[cu_do_debug=$enableval],
[cu_do_debug="no"])
if test x"$cu_do_debug" = xyes ; then
echo "++++++++++ Enabling debug mode compilation."
CFLAGS="$CFLAGS -D_DEBUG -g3 -Wall"
LDFLAGS="$LDFLAGS -g"
else
echo "---------- Disabling debug mode compilation."
fi
AC_ARG_ENABLE(basic,
[ --enable-basic enable basic mode compilation],
[cu_do_basic=$enableval],
[cu_do_basic="no"])
AM_CONDITIONAL(ENABLE_BASIC, test x"$cu_do_basic" = xyes)
if test x"$cu_do_basic" = xyes ; then
echo "++++++++++ Enabling basic mode compilation"
else
echo "---------- Disabling basic mode compilation"
fi
AC_ARG_ENABLE(console,
[ --enable-console enable console mode compilation],
[cu_do_console=$enableval],
[cu_do_console="no"])
AM_CONDITIONAL(ENABLE_CONSOLE, test x"$cu_do_console" = xyes)
if test x"$cu_do_console" = xyes ; then
echo "++++++++++ Enabling console mode compilation"
else
echo "---------- Disabling console mode compilation"
fi
AC_ARG_ENABLE(automated,
[ --enable-automated enable automated mode compilation],
[
echo "++++++++++ Enabling automated(XML) mode compilation";
AM_CONDITIONAL(ENABLE_AUTOMATED, true)
],
[
echo "---------- Disabling automated(XML) mode compilation"
])
AM_CONDITIONAL(ENABLE_CURSES, false)
[ --enable-automated enable automated mode compilation],
[cu_do_automated=$enableval],
[cu_do_automated="no"])
AM_CONDITIONAL(ENABLE_AUTOMATED, test x"$cu_do_automated" = xyes)
if test x"$cu_do_automated" = xyes ; then
echo "++++++++++ Enabling automated(XML) mode compilation"
else
echo "---------- Disabling automated(XML) mode compilation"
fi
AC_ARG_ENABLE(curses,
[ --enable-curses enable curses mode compilation],
[
echo "++++++++++ Enabling curses mode compilation";
AM_CONDITIONAL(ENABLE_CURSES, true)
],
[
echo "---------- Disabling curse mode compilation"
])
[ --enable-curses enable curses mode compilation],
[cu_do_curses=$enableval],
[cu_do_curses="no"])
AM_CONDITIONAL(ENABLE_CURSES, test x"$cu_do_curses" = xyes)
if test x"$cu_do_curses" = xyes ; then
echo "++++++++++ Enabling curses mode compilation"
else
echo "---------- Disabling curses mode compilation"
fi
AC_ARG_ENABLE(memtrace,
[ --enable-memtrace enable memory tracing],
[
echo "++++++++++ Enabling memtrace functionality at compile time.";
[--enable-memtrace enable memory tracing],
[cu_do_memtrace=$enableval],
[cu_do_memtrace="no"])
if test x"$cu_do_memtrace" = xyes ; then
echo "++++++++++ Enabling memtrace functionality at compile time."
CFLAGS="$CFLAGS -DMEMTRACE"
],
[
else
echo "---------- Disabling memtrace functionality at compile time."
])
fi
# Check for programs.
dnl Check for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
# Check for libraries
AC_CHECK_LIB(c, main) dnl Check for -lc
dnl Check for libraries
AC_CHECK_LIB(c, main)
AC_SEARCH_LIBS([initscr],[ncurses curses],[],[echo curses library not found],[])
# Check for standard functions
dnl Check for standard functions
AC_CHECK_FUNC(malloc, [], [echo malloc not found; exit 1])
AC_CHECK_FUNC(free, [], [echo free not found; exit 1])
AC_CHECK_FUNC(calloc, [], [echo calloc not found; exit 1])
......@@ -82,7 +119,7 @@ AC_CHECK_FUNC(setvbuf, [], [echo setvbuf not found; exit 1])
AC_CHECK_FUNC(time, [], [echo time not found; exit 1])
AC_CHECK_FUNC(ctime, [], [echo ctime not found; exit 1])
# Check for header files.
dnl Check for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(assert.h)
AC_CHECK_HEADERS(ctype.h)
......@@ -94,18 +131,18 @@ AC_CHECK_HEADERS(string.h)
AM_CONFIG_HEADER(config.h)
# Check for typedefs, structures, and compiler characteristics.
dnl Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Configure Jamrules for user environment
dnl Configure Jamrules for user environment
AC_CONFIG_FILES([Jamrules:Jamrules.in])
# Set environment variables.
dnl Set environment variables.
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(RELEASE)
# Configure Makefile set.
dnl Configure Makefile set.
AC_CONFIG_FILES( Makefile \
CUnit.spec \
CUnit/Makefile \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment