Unverified Commit 5a71535c authored by David Seifert's avatar David Seifert
Browse files

configure.ac: modernise

parent 89eac696
Pipeline #931 passed with stage
in 56 minutes and 2 seconds
......@@ -10,6 +10,17 @@ AC_INIT([graph-tool],
[graph-tool],
[http://graph-tool.skewed.de])
dnl Check whether we want to set defaults for CXXFLAGS
AC_MSG_CHECKING([whether configure should try to set CXXFLAGS to -O3])
AS_IF([test "x${CXXFLAGS+set}" = "xset"], [
enable_flags_setting=no
], [
enable_flags_setting=yes
dnl Set to -O3 here so AC_PROG_CXX does not add -g -O2
CXXFLAGS="-O3"
])
AC_MSG_RESULT([${enable_flags_setting}])
GRAPH_TOOL_VERSION_MAJOR=graph_tool_version_major()
GRAPH_TOOL_VERSION_MINOR=graph_tool_version_minor()
AC_SUBST(GRAPH_TOOL_VERSION_MAJOR)
......@@ -18,22 +29,19 @@ AC_SUBST(GRAPH_TOOL_VERSION_MINOR)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_PROG_CC_C_O
AC_CONFIG_HEADERS([config.h])
AC_SEARCH_LIBS([strerror],[cposix])
AC_SUBST(CXXFLAGS,$CXXFLAGS)
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CXX
AC_LANG([C++])
AC_PROG_CC_STDC
AC_HEADER_STDC
AC_DISABLE_STATIC
AC_PROG_INSTALL
LT_INIT
LT_INIT([disable-static])
# pkg-config generation
PKG_PROG_PKG_CONFIG
......@@ -68,9 +76,6 @@ dnl disable deprecation warning, to silence some harmless BGL-related warnings
dnl set default visibility
[CXXFLAGS="-fvisibility=default -fvisibility-inlines-hidden ${CXXFLAGS}"]
dnl set default optimizations
[CXXFLAGS="-O3 ${CXXFLAGS}"]
dnl OpenMP
AC_DEFINE([OPENMP_MIN_THRESH], 300, [default minimum number of vertices for parallel loops])
......@@ -313,7 +318,7 @@ AC_SUBST(PACKAGE_DOC_DIR)
# Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir,
AC_HELP_STRING([--with-pkgconfigdir],
AS_HELP_STRING([--with-pkgconfigdir],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
......@@ -335,7 +340,7 @@ AC_DEFINE_UNQUOTED([PACKAGE_DOC_DIR], "${PACKAGE_DOC_DIR}", [package doc dir])
AC_DEFINE_UNQUOTED([AUTHOR], "Tiago de Paula Peixoto <tiago@skewed.de>", [program author(s)])
AC_DEFINE_UNQUOTED([COPYRIGHT],
"Copyright (C) 2006-2021 Tiago de Paula Peixoto\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
["Copyright (C) 2006-2021 Tiago de Paula Peixoto\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."],
[copyright info])
# git information
......@@ -347,12 +352,6 @@ AC_DEFINE([GCC_VERSION], [(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATC
# set automake variables
# global CPP flags
AC_SUBST(CPPFLAGS)
# global CXX flags
AC_SUBST(CXXFLAGS)
# extra CPP flags for submodules
[MOD_CPPFLAGS="-I\$(top_srcdir)/src/boost-workaround -I\$(top_srcdir)/src/pcg-cpp/include -DHAVE_CONFIG_H -I\$(top_srcdir)/src/graph -I\$(top_builddir) ${PYTHON_CPPFLAGS} ${BOOST_CPPFLAGS} ${NUMPY_CPPFLAGS} ${EXPAT_CFLAGS}"]
AC_SUBST(MOD_CPPFLAGS)
......@@ -366,10 +365,10 @@ AC_SUBST(MOD_LIBADD)
[MOD_LDFLAGS="-module -avoid-version -export-dynamic -no-undefined -Wl,-E -Wl,--as-needed"]
# MacOS needs different options
if [[ `echo ${target_os} | grep -c -e "^darwin"` == 1 ]]; then
[MOD_LDFLAGS="-module -dynamiclib"]
fi
AS_CASE([${host_os}],
[darwin*], [
MOD_LDFLAGS="-module -dynamiclib"
])
AC_SUBST(MOD_LDFLAGS)
AC_DEFINE([BOOST_BIND_GLOBAL_PLACEHOLDERS], [1], [Supress boost warning])
......
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