blob: 7f1ee6abc15d26edeb7fd9692e0b9563a77eaa52 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
AC_PREREQ(2.65)
m4_define([arrow_glib_version],
m4_esyscmd(grep "^ <version>" "$(dirname $0)/../java/pom.xml" | \
sed -E \
-e 's/(^ <version>)//g' \
-e 's/(<\/version>$)//g' | \
tr -d '\n'))
AC_INIT([arrow-glib],
arrow_glib_version,
[https://issues.apache.org/jira/browse/ARROW],
[apache-arrow-glib])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([arrow-glib/arrow-glib.h])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.13 foreign])
AM_SILENT_RULES([yes])
GARROW_VERSION_MAJOR=$(echo "arrow_glib_version" | \
sed -E -e 's/^([[0-9]]+)\..+$/\1/' | \
tr -d '\n')
GARROW_VERSION_MINOR=$(echo "arrow_glib_version" | \
sed -E -e 's/^[[0-9]]+\.([[0-9]]+)\..+$/\1/' | \
tr -d '\n')
GARROW_VERSION_MICRO=$(echo "arrow_glib_version" | \
sed -E -e 's/^[[0-9]]+\.[[0-9]]+\.([[0-9]]+).*$/\1/' | \
tr -d '\n')
if echo "arrow_glib_version" | grep -- "-" > /dev/null; then
GARROW_VERSION_TAG=$(echo "arrow_glib_version" | \
sed -E -e 's/^[[0-9]]+\.[[0-9]]+\.[[0-9]]+-(.+)$/\1/' | \
tr -d '\n')
else
GARROW_VERSION_TAG=
fi
AC_SUBST(GARROW_VERSION_MAJOR)
AC_SUBST(GARROW_VERSION_MINOR)
AC_SUBST(GARROW_VERSION_MICRO)
AC_SUBST(GARROW_VERSION_TAG)
AC_CANONICAL_HOST
AC_MSG_CHECKING([for macOS])
case "$host_os" in
darwin*)
os_macos=yes
;;
*)
os_macos=no
;;
esac
AC_MSG_RESULT([$os_macos])
AM_CONDITIONAL(OS_MACOS, test "$os_macos" = "yes")
LT_INIT
LT_CURRENT=${GARROW_VERSION_MINOR}
LT_REVISION=${GARROW_VERSION_MICRO}
LT_AGE=0
LT_VERSION_INFO="\$(LT_CURRENT):\$(LT_REVISION):\$(LT_AGE)"
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_VERSION_INFO)
AC_PROG_CC
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_11([ext], [mandatory])
GARROW_CFLAGS="-Wall"
GARROW_CXXFLAGS="-Wall"
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],
[Use debug flags (default=no)])],
[GARROW_DEBUG="$enableval"],
[GARROW_DEBUG="no"])
if test "x$GARROW_DEBUG" != "xno"; then
GARROW_DEBUG="yes"
if test "$CLANG" = "yes"; then
CFLAGS="$CFLAGS -O0 -g"
CXXFLAGS="$CXXFLAGS -O0 -g"
elif test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -O0 -g3"
CXXFLAGS="$CXXFLAGS -O0 -g3"
fi
fi
AC_SUBST(GARROW_CFLAGS)
AC_SUBST(GARROW_CXXFLAGS)
AM_PATH_GLIB_2_0([2.32.4], [], [], [gobject gio])
GOBJECT_INTROSPECTION_REQUIRE([1.32.1])
GTK_DOC_CHECK([1.18-2])
AC_ARG_WITH(arrow-cpp-build-type,
[AS_HELP_STRING([--with-arrow-cpp-build-type=TYPE],
[-DCMAKE_BUILD_TYPE option value for Arrow C++ (default=release)])],
[GARROW_ARROW_CPP_BUILD_TYPE="$withval"],
[GARROW_ARROW_CPP_BUILD_TYPE="release"])
AC_ARG_WITH(arrow-cpp-build-dir,
[AS_HELP_STRING([--with-arrow-cpp-build-dir=PATH],
[Use this option to build with not installed Arrow C++])],
[GARROW_ARROW_CPP_BUILD_DIR="$withval"],
[GARROW_ARROW_CPP_BUILD_DIR=""])
if test "x$GARROW_ARROW_CPP_BUILD_DIR" = "x"; then
USE_ARROW_BUILD_DIR=no
PKG_CHECK_MODULES([ARROW], [arrow arrow-compute])
_PKG_CONFIG(ARROW_LIB_DIR, [variable=libdir], [arrow])
ARROW_LIB_DIR="$pkg_cv_ARROW_LIB_DIR"
PKG_CHECK_MODULES([ARROW_ORC],
[arrow-orc],
[HAVE_ARROW_ORC=yes],
[HAVE_ARROW_ORC=no])
PKG_CHECK_MODULES([ARROW_GPU],
[arrow-gpu],
[HAVE_ARROW_GPU=yes],
[HAVE_ARROW_GPU=no])
PKG_CHECK_MODULES([PARQUET],
[parquet],
[HAVE_PARQUET=yes],
[HAVE_PARQUET=no])
else
USE_ARROW_BUILD_DIR=yes
ARROW_BUILD_DIR="${GARROW_ARROW_CPP_BUILD_DIR}"
AC_SUBST(ARROW_BUILD_DIR)
ARROW_SOURCE_INCLUDE_DIR="\$(abs_top_srcdir)/../cpp/src"
ARROW_BUILD_INCLUDE_DIR="${GARROW_ARROW_CPP_BUILD_DIR}/src"
ARROW_LIB_DIR="${GARROW_ARROW_CPP_BUILD_DIR}/${GARROW_ARROW_CPP_BUILD_TYPE}"
AC_SUBST(ARROW_LIB_DIR)
ARROW_CFLAGS="-I${ARROW_BUILD_INCLUDE_DIR} -I${ARROW_SOURCE_INCLUDE_DIR}"
ARROW_LIBS="-L${ARROW_LIB_DIR} -larrow"
AC_SUBST(ARROW_CFLAGS)
AC_SUBST(ARROW_LIBS)
if test -f "${GARROW_ARROW_CPP_BUILD_DIR}/src/arrow/adapters/orc/arrow-orc.pc"; then
HAVE_ARROW_ORC=yes
else
HAVE_ARROW_ORC=no
fi
ARROW_GPU_CFLAGS=""
if test -f "${GARROW_ARROW_CPP_BUILD_DIR}/src/arrow/gpu/arrow-gpu.pc"; then
HAVE_ARROW_GPU=yes
ARROW_GPU_LIBS="-larrow_gpu"
else
HAVE_ARROW_GPU=no
ARROW_GPU_LIBS=""
fi
AC_SUBST(ARROW_GPU_CFLAGS)
AC_SUBST(ARROW_GPU_LIBS)
PARQUET_CFLAGS=""
if test -f "${GARROW_ARROW_CPP_BUILD_DIR}/src/parquet/parquet.pc"; then
HAVE_PARQUET=yes
PARQUET_LIBS="-lparquet"
else
HAVE_PARQUET=no
PARQUET_LIBS=""
fi
AC_SUBST(PARQUET_CFLAGS)
AC_SUBST(PARQUET_LIBS)
fi
AM_CONDITIONAL([USE_ARROW_BUILD_DIR],
[test "$USE_ARROW_BUILD_DIR" = "yes"])
AM_CONDITIONAL([HAVE_ARROW_ORC], [test "$HAVE_ARROW_ORC" = "yes"])
if test "$HAVE_ARROW_ORC" = "yes"; then
AC_DEFINE(HAVE_ARROW_ORC, [1], [Define to 1 if Apache Arrow supports ORC.])
fi
AM_CONDITIONAL([HAVE_ARROW_GPU], [test "$HAVE_ARROW_GPU" = "yes"])
if test "$HAVE_ARROW_GPU" = "yes"; then
AC_DEFINE(HAVE_ARROW_GPU, [1], [Define to 1 if Apache Arrow supports GPU.])
fi
AM_CONDITIONAL([HAVE_PARQUET], [test "$HAVE_PARQUET" = "yes"])
if test "$HAVE_PARQUET" = "yes"; then
AC_DEFINE(HAVE_PARQUET, [1], [Define to 1 if Apache Parquet exists.])
fi
exampledir="\$(datadir)/arrow-glib/example"
AC_SUBST(exampledir)
AC_CONFIG_FILES([
Makefile
arrow-glib/Makefile
arrow-glib/arrow-glib.pc
arrow-glib/arrow-orc-glib.pc
arrow-glib/version.h
arrow-gpu-glib/Makefile
arrow-gpu-glib/arrow-gpu-glib.pc
parquet-glib/Makefile
parquet-glib/parquet-glib.pc
doc/Makefile
doc/arrow-glib/Makefile
doc/arrow-glib/entities.xml
doc/parquet-glib/Makefile
doc/parquet-glib/entities.xml
example/Makefile
example/lua/Makefile
tool/Makefile
])
AC_OUTPUT