2023-05-06 19:18:26 -04:00
|
|
|
AC_PREREQ([2.63])
|
2014-06-03 16:34:38 -04:00
|
|
|
|
|
|
|
AC_INIT([protobuf-c],
|
2023-11-25 18:05:10 -05:00
|
|
|
[1.5.0],
|
2014-06-03 16:34:38 -04:00
|
|
|
[https://github.com/protobuf-c/protobuf-c/issues],
|
|
|
|
[protobuf-c],
|
|
|
|
[https://github.com/protobuf-c/protobuf-c])
|
|
|
|
PACKAGE_DESCRIPTION="Protocol Buffers implementation in C"
|
|
|
|
AC_SUBST(PACKAGE_DESCRIPTION)
|
|
|
|
|
2013-11-16 18:00:53 -05:00
|
|
|
AC_CONFIG_SRCDIR([protobuf-c/protobuf-c.c])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
|
|
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules subdir-objects])
|
2023-05-06 19:18:26 -04:00
|
|
|
AC_PROG_CC
|
2013-11-16 18:00:53 -05:00
|
|
|
AC_PROG_CXX
|
2014-01-25 15:56:40 +00:00
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MKDIR_P
|
2013-11-16 18:00:53 -05:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AM_SILENT_RULES([yes])
|
|
|
|
LT_INIT
|
|
|
|
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2013-12-14 14:11:08 -05:00
|
|
|
AC_CONFIG_FILES([Makefile protobuf-c/libprotobuf-c.pc])
|
2013-11-16 18:00:53 -05:00
|
|
|
|
2017-02-25 18:18:12 -05:00
|
|
|
my_CFLAGS="\
|
|
|
|
-Wall \
|
|
|
|
-Wchar-subscripts \
|
|
|
|
-Wdeclaration-after-statement \
|
|
|
|
-Wformat-security \
|
|
|
|
-Wmissing-declarations \
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wnested-externs \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wshadow \
|
|
|
|
-Wsign-compare \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wtype-limits \
|
|
|
|
"
|
|
|
|
AX_CHECK_COMPILE_FLAG(["-Werror=incompatible-pointer-types"],
|
|
|
|
[my_CFLAGS="$my_CFLAGS -Werror=incompatible-pointer-types"])
|
|
|
|
AX_CHECK_COMPILE_FLAG(["-Werror=int-conversion"],
|
|
|
|
[my_CFLAGS="$my_CFLAGS -Werror=int-conversion"])
|
|
|
|
AX_CHECK_COMPILE_FLAG(["-Wnull-dereference"],
|
|
|
|
[my_CFLAGS="$my_CFLAGS -Wnull-dereference"])
|
|
|
|
AC_SUBST([my_CFLAGS])
|
|
|
|
|
2014-06-03 17:26:59 -04:00
|
|
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
|
|
|
AM_CONDITIONAL([HAVE_DOXYGEN],
|
|
|
|
[test -n "$DOXYGEN"])
|
|
|
|
AM_COND_IF([HAVE_DOXYGEN],
|
|
|
|
[AC_CONFIG_FILES([Doxyfile])
|
|
|
|
DOXYGEN_INPUT="${srcdir}/protobuf-c"
|
|
|
|
AC_SUBST(DOXYGEN_INPUT)
|
|
|
|
])
|
|
|
|
|
2013-11-16 18:00:53 -05:00
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
if test -n "$PKG_CONFIG"; then
|
|
|
|
# Horrible hack for systems where the pkg-config install directory is simply wrong!
|
|
|
|
if $PKG_CONFIG --variable=pc_path pkg-config 2>/dev/null | grep -q /libdata/; then
|
|
|
|
PKG_INSTALLDIR(['${prefix}/libdata/pkgconfig'])
|
|
|
|
else
|
|
|
|
PKG_INSTALLDIR
|
|
|
|
fi
|
|
|
|
fi
|
2014-02-17 09:24:51 +00:00
|
|
|
|
2014-01-13 17:25:29 -05:00
|
|
|
AC_ARG_ENABLE([protoc],
|
|
|
|
AS_HELP_STRING([--disable-protoc], [Disable building protoc_c (also disables tests)]))
|
|
|
|
if test "x$enable_protoc" != "xno"; then
|
|
|
|
AC_LANG_PUSH([C++])
|
2023-07-03 01:10:28 -04:00
|
|
|
AX_CXX_COMPILE_STDCXX(17, noext, mandatory)
|
2023-07-08 23:11:03 -04:00
|
|
|
PKG_CHECK_MODULES([protobuf], [protobuf >= 3.0.0])
|
2014-03-28 13:01:44 -04:00
|
|
|
|
|
|
|
save_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$save_CPPFLAGS $protobuf_CFLAGS"
|
2014-03-24 19:04:15 -04:00
|
|
|
AC_CHECK_HEADERS([google/protobuf/compiler/command_line_interface.h],
|
|
|
|
[],
|
|
|
|
[AC_MSG_ERROR([required protobuf header file not found])])
|
2014-03-28 13:01:44 -04:00
|
|
|
CPPFLAGS="$save_CPPFLAGS"
|
|
|
|
|
2014-03-28 13:23:37 -04:00
|
|
|
AC_ARG_VAR([PROTOC], [protobuf compiler command])
|
|
|
|
AC_PATH_PROG([PROTOC], [protoc], [],
|
|
|
|
[`$PKG_CONFIG --variable=exec_prefix protobuf`/bin:$PATH])
|
2014-01-13 17:25:29 -05:00
|
|
|
if test -z "$PROTOC"; then
|
2014-01-11 15:04:30 -05:00
|
|
|
AC_MSG_ERROR([Please install the protobuf compiler from https://code.google.com/p/protobuf/.])
|
2014-01-13 17:25:29 -05:00
|
|
|
fi
|
2016-07-24 17:21:20 +02:00
|
|
|
|
2014-01-13 17:25:29 -05:00
|
|
|
PROTOBUF_VERSION="$($PROTOC --version)"
|
2016-07-24 17:21:20 +02:00
|
|
|
|
2014-01-13 17:25:29 -05:00
|
|
|
else
|
|
|
|
PROTOBUF_VERSION="not required, not building compiler"
|
2014-01-11 15:04:30 -05:00
|
|
|
fi
|
2016-07-24 17:21:20 +02:00
|
|
|
|
2014-01-13 17:25:29 -05:00
|
|
|
AM_CONDITIONAL([BUILD_COMPILER], [test "x$enable_protoc" != "xno"])
|
2015-02-15 18:34:24 +08:00
|
|
|
AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" != "xno"])
|
2013-11-16 18:00:53 -05:00
|
|
|
|
2014-03-27 15:22:55 -04:00
|
|
|
gl_LD_VERSION_SCRIPT
|
|
|
|
|
2013-12-03 10:26:51 -08:00
|
|
|
gl_VALGRIND_TESTS
|
|
|
|
|
2014-06-02 17:50:57 -04:00
|
|
|
MY_CODE_COVERAGE
|
|
|
|
|
2013-11-21 17:12:00 -05:00
|
|
|
AC_C_BIGENDIAN
|
2013-11-16 18:00:53 -05:00
|
|
|
|
|
|
|
AC_OUTPUT
|
|
|
|
AC_MSG_RESULT([
|
|
|
|
$PACKAGE $VERSION
|
|
|
|
|
2013-11-18 13:59:17 -05:00
|
|
|
CC: ${CC}
|
|
|
|
CFLAGS: ${CFLAGS}
|
|
|
|
CXX: ${CXX}
|
|
|
|
CXXFLAGS: ${CXXFLAGS}
|
|
|
|
LDFLAGS: ${LDFLAGS}
|
|
|
|
LIBS: ${LIBS}
|
2013-11-16 18:00:53 -05:00
|
|
|
|
|
|
|
prefix: ${prefix}
|
|
|
|
sysconfdir: ${sysconfdir}
|
|
|
|
libdir: ${libdir}
|
|
|
|
includedir: ${includedir}
|
|
|
|
pkgconfigdir: ${pkgconfigdir}
|
|
|
|
|
|
|
|
bigendian: ${ac_cv_c_bigendian}
|
2014-01-13 17:25:29 -05:00
|
|
|
protobuf version: ${PROTOBUF_VERSION}
|
2013-11-16 18:00:53 -05:00
|
|
|
])
|