cpp: ./configure supports --disable-cxx option not to build/install C++ API

This commit is contained in:
frsyuki 2010-07-06 17:45:15 +09:00
parent c57f616141
commit a2bd5ae638
2 changed files with 28 additions and 13 deletions

View File

@ -9,23 +9,31 @@ CFLAGS="-O4 -Wall $CFLAGS"
AC_SUBST(CXXFLAGS)
CXXFLAGS="-O4 -Wall $CXXFLAGS"
AC_PROG_CC
AC_PROG_CXX
AC_MSG_CHECKING([if C++ API is enabled])
AC_ARG_ENABLE(cxx,
AS_HELP_STRING([--disable-cxx],
[don't build C++ API]) )
AC_MSG_RESULT([$enable_cxx])
if test "$enable_cxx" != "no"; then
AC_PROG_CXX
AM_PROG_CC_C_O
fi
AM_CONDITIONAL(ENABLE_CXX, test "$enable_cxx" != "no")
AC_PROG_LIBTOOL
AM_PROG_AS
AM_PROG_CC_C_O
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS(tr1/unordered_map)
AC_CHECK_HEADERS(tr1/unordered_set)
AC_LANG_POP([C++])
AC_MSG_CHECKING([if debug option is enabled])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--disable-debug],
[disable assert macros and omit -g option.]) )
[disable assert macros and omit -g option]) )
AC_MSG_RESULT([$enable_debug])
if test "$enable_debug" != "no"; then
CXXFLAGS="$CXXFLAGS -g"
CFLAGS="$CFLAGS -g"
@ -33,7 +41,6 @@ else
CXXFLAGS="$CXXFLAGS -DNDEBUG"
CFLAGS="$CFLAGS -DNDEBUG"
fi
AC_MSG_RESULT($enable_debug)
AC_CACHE_CHECK([for __sync_* atomic operations], msgpack_cv_atomic_ops, [
@ -54,10 +61,12 @@ add CFLAGS="--march=i686" and CXXFLAGS="-march=i686" options to ./configure as f
])
fi
major=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
AC_SUBST(VERSION_MAJOR, $major)
AC_SUBST(VERSION_MINOR, $minor)
AC_OUTPUT([Makefile src/Makefile test/Makefile])

View File

@ -6,8 +6,12 @@ libmsgpack_la_SOURCES = \
objectc.c \
version.c \
vrefbuffer.c \
zone.c \
zone.c
if ENABLE_CXX
libmsgpack_la_SOURCES += \
object.cpp
endif
# -version-info CURRENT:REVISION:AGE
libmsgpack_la_LDFLAGS = -version-info 3:0:0
@ -39,7 +43,10 @@ nobase_include_HEADERS = \
msgpack/pack.h \
msgpack/unpack.h \
msgpack/object.h \
msgpack/zone.h \
msgpack/zone.h
if ENABLE_CXX
nobase_include_HEADERS += \
msgpack.hpp \
msgpack/sbuffer.hpp \
msgpack/version.h \
@ -66,6 +73,7 @@ nobase_include_HEADERS = \
msgpack/type/define.hpp \
msgpack/type/tr1/unordered_map.hpp \
msgpack/type/tr1/unordered_set.hpp
endif
EXTRA_DIST = \
msgpack/version.h.in \
@ -80,8 +88,6 @@ msgpack/version.h: msgpack/version.h.in Makefile.in
-e s/VERSION_MINOR_UNDEFINED/$(VERSION_MINOR)/ \
$< > $@
#version.c: msgpack/version.h
doxygen_c:
cat ../Doxyfile > Doxyfile_c