mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Build System
- Modified configure.ac to allow inclusion/exclusion of both ncurses and Lua. - Also allows specification of include and lib directories for ncurses and Lua separately. - This addresses a recent problem with Cygwin 1.7, where the most recent patches relocated ncurses from /usr/include to /usr/include/ncurses, and consequently broke task's default configuration, which was not very clever.
This commit is contained in:
parent
756200676d
commit
69e0893c61
1 changed files with 116 additions and 37 deletions
153
configure.ac
153
configure.ac
|
@ -4,9 +4,18 @@
|
||||||
AC_PREREQ(2.61)
|
AC_PREREQ(2.61)
|
||||||
AC_INIT(task, 1.9.0.beta2, support@taskwarrior.org)
|
AC_INIT(task, 1.9.0.beta2, support@taskwarrior.org)
|
||||||
|
|
||||||
|
|
||||||
|
# Source type.
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_LANG(C++)
|
||||||
|
|
||||||
|
|
||||||
|
# Local copies for modification and later AC_SUBST.
|
||||||
CFLAGS="${CFLAGS=}"
|
CFLAGS="${CFLAGS=}"
|
||||||
CXXFLAGS="${CXXFLAGS=}"
|
CXXFLAGS="${CXXFLAGS=}"
|
||||||
|
|
||||||
|
|
||||||
# this macro is used to get the arguments supplied
|
# this macro is used to get the arguments supplied
|
||||||
# to the configure script (./configure --enable-debug)
|
# to the configure script (./configure --enable-debug)
|
||||||
# Check if we have enable debug support.
|
# Check if we have enable debug support.
|
||||||
|
@ -14,15 +23,18 @@ AC_MSG_CHECKING(whether to enable debugging)
|
||||||
debug_default="no"
|
debug_default="no"
|
||||||
AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging
|
AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging
|
||||||
[default=$debug_default]],, enable_debug=$debug_default)
|
[default=$debug_default]],, enable_debug=$debug_default)
|
||||||
# Yes, shell scripts can be used
|
|
||||||
if test "$enable_debug" = "yes"; then
|
if test "x$enable_debug" = "xyes"; then
|
||||||
CXXFLAGS="$CFLAGS -Wall -pedantic -ggdb3 -DDEBUG"
|
CFLAGS="$CFLAGS -Wall -pedantic -ggdb3 -DDEBUG"
|
||||||
|
CXXFLAGS="$CXXFLAGS -Wall -pedantic -ggdb3 -DDEBUG"
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
else
|
else
|
||||||
CXXFLAGS="$CFLAGS -Wall -pedantic -O3"
|
CFLAGS="$CFLAGS -Wall -pedantic -O3"
|
||||||
|
CXXFLAGS="$CXXFLAGS -Wall -pedantic -O3"
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Check for OS.
|
# Check for OS.
|
||||||
OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'|cut -c 1-5`
|
OS=`uname|sed -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'|cut -c 1-5`
|
||||||
if test "$OS" = "sunos"; then
|
if test "$OS" = "sunos"; then
|
||||||
|
@ -51,55 +63,118 @@ else
|
||||||
AC_DEFINE([UNKNOWN], [], [Compiling on Unknown])
|
AC_DEFINE([UNKNOWN], [], [Compiling on Unknown])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for Lua.
|
|
||||||
AC_ARG_ENABLE([lua], AS_HELP_STRING([--enable-lua], [Disable feature lua]))
|
|
||||||
AC_ARG_WITH(lua-inc, [--with-lua-inc=DIR, Lua include files are in DIR],lua_inc=$withval,lua_inc='')
|
|
||||||
AC_ARG_WITH(lua-lib, [--with-lua-lib=DIR, Lua library files are in DIR],lua_lib=$withval,lua_lib='')
|
|
||||||
|
|
||||||
if test "x$enable_lua" = "xyes" ; then
|
# ncurses enabled by default.
|
||||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
AC_ARG_WITH([ncurses],
|
||||||
ac_save_CFLAGS="$CFLAGS"
|
[AS_HELP_STRING([--without-ncurses], [disable support for ncurses])],
|
||||||
ac_save_LDFLAGS="$LDFLAGS"
|
[with_ncurses=no],
|
||||||
|
[with_ncurses=yes])
|
||||||
|
|
||||||
LUA_CFLAGS=""
|
AC_ARG_WITH([ncurses-inc],
|
||||||
LUA_LFLAGS=""
|
[AS_HELP_STRING ([--with-ncurses-inc=DIR], [ncurses include files are in DIR])],
|
||||||
|
[ncurses_inc=$withval],
|
||||||
|
[ncurses_inc=''])
|
||||||
|
|
||||||
if test -n "$lua_inc"; then
|
AC_ARG_WITH([ncurses-lib],
|
||||||
CFLAGS="$CFLAGS -I$lua_inc"
|
[AS_HELP_STRING ([--with-ncurses-lib=DIR], [ncurses lib files are in DIR])],
|
||||||
CPPFLAGS="$CPPFLAGS -I$lua_inc"
|
[ncurses_lib=$withval],
|
||||||
fi
|
[ncurses_lib=''])
|
||||||
if test -n "$lua_lib"; then
|
|
||||||
LDFLAGS="$LDFLAGS -L$lua_lib"
|
if test "x$with_ncurses" == "xyes" ; then
|
||||||
LUA_LFLAGS="-llua"
|
AC_DEFINE([HAVE_LIBNCURSES], [1], [Defined if you have libncurses])
|
||||||
fi
|
if test -n "$ncurses_inc"; then
|
||||||
|
CFLAGS="$CFLAGS -I$ncurses_inc"
|
||||||
|
CXXFLAGS="$CXXFLAGS -I$ncurses_inc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$ncurses_lib"; then
|
||||||
|
LDFLAGS="$LDFLAGS -L$ncurses_lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_LIB([ncurses],[main])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$enable_lua" = "xyes" ; then
|
|
||||||
AC_SUBST(LUA_CFLAGS)
|
# Readline enabled by default.
|
||||||
AC_SUBST(LUA_LFLAGS)
|
#AC_ARG_WITH([readline],
|
||||||
AC_DEFINE([HAVE_LIBLUA], [1], [Building with Lua support])
|
# [AS_HELP_STRING([--without-readline], [disable support for readline])],
|
||||||
|
# [with_readline=no],
|
||||||
|
# [with_readline=yes])
|
||||||
|
#
|
||||||
|
#AC_ARG_WITH([readline-inc],
|
||||||
|
# [AS_HELP_STRING ([--with-readline-inc=DIR], [readline include files are in DIR])],
|
||||||
|
# [readline_inc=$withval],
|
||||||
|
# [readline_inc=''])
|
||||||
|
#
|
||||||
|
#AC_ARG_WITH([readline-lib],
|
||||||
|
# [AS_HELP_STRING ([--with-readline-lib=DIR], [readline lib files are in DIR])],
|
||||||
|
# [readline_lib=$withval],
|
||||||
|
# [readline_lib=''])
|
||||||
|
#
|
||||||
|
#if test "x$with_readline" == "xyes" ; then
|
||||||
|
# AC_DEFINE([HAVE_LIBREADLINE], [1], [Defined if you have libreadline])
|
||||||
|
# if test -n "$readline_inc"; then
|
||||||
|
# CFLAGS="$CFLAGS -I$readline_inc"
|
||||||
|
# CXXFLAGS="$CXXFLAGS -I$readline_inc"
|
||||||
|
# fi
|
||||||
|
#
|
||||||
|
# if test -n "$readline_lib"; then
|
||||||
|
# LDFLAGS="$LDFLAGS -L$readline_lib"
|
||||||
|
# fi
|
||||||
|
#
|
||||||
|
# AC_CHECK_LIB([readline],[main])
|
||||||
|
#fi
|
||||||
|
|
||||||
|
|
||||||
|
# Lua disabled by default.
|
||||||
|
AC_ARG_WITH([lua],
|
||||||
|
[AS_HELP_STRING([--with-lua], [enable support for lua])],
|
||||||
|
[with_lua=yes],
|
||||||
|
[with_lua=no])
|
||||||
|
|
||||||
|
AC_ARG_WITH([lua-inc],
|
||||||
|
[AS_HELP_STRING ([--with-lua-inc=DIR], [lua include files are in DIR])],
|
||||||
|
[lua_inc=$withval],
|
||||||
|
[lua_inc=''])
|
||||||
|
|
||||||
|
AC_ARG_WITH([lua-lib],
|
||||||
|
[AS_HELP_STRING ([--with-lua-lib=DIR], [lua lib files are in DIR])],
|
||||||
|
[lua_lib=$withval],
|
||||||
|
[lua_lib=''])
|
||||||
|
|
||||||
|
if test "x$with_lua" == "xyes" ; then
|
||||||
|
AC_DEFINE([HAVE_LIBLUA], [1], [Defined if you have liblua])
|
||||||
|
if test -n "$lua_inc"; then
|
||||||
|
CFLAGS="$CFLAGS -I$lua_inc"
|
||||||
|
CXXFLAGS="$CXXFLAGS -I$lua_inc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$lua_lib"; then
|
||||||
|
LDFLAGS="$LDFLAGS -L$lua_lib"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_LIB([lua],[main])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Allow the changes above to take effect.
|
||||||
|
AC_SUBST(CFLAGS)
|
||||||
|
AC_SUBST(CXXFLAGS)
|
||||||
|
AC_SUBST(LDFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
# Now the smaller details.
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||||
AC_CONFIG_HEADER([auto.h])
|
AC_CONFIG_HEADER([auto.h])
|
||||||
|
|
||||||
# Checks for programs.
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_LANG(C++)
|
|
||||||
|
|
||||||
AC_SUBST(CFLAGS)
|
|
||||||
|
|
||||||
# Checks for libraries.
|
|
||||||
AC_CHECK_LIB(ncurses,initscr)
|
|
||||||
AC_CHECK_LIB(lua,lua_open)
|
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_HEADER_STDC
|
AC_HEADER_STDC
|
||||||
AC_CHECK_HEADERS([stdlib.h sys/file.h sys/stat.h sys/time.h unistd.h])
|
AC_CHECK_HEADERS([stdlib.h sys/file.h sys/stat.h sys/time.h unistd.h])
|
||||||
AC_CHECK_HEADERS([sstream string vector map])
|
AC_CHECK_HEADERS([sstream string vector map])
|
||||||
|
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_HEADER_STDBOOL
|
AC_HEADER_STDBOOL
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
|
@ -108,15 +183,19 @@ AC_TYPE_SIZE_T
|
||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
|
|
||||||
|
|
||||||
# Checks for library functions.
|
# Checks for library functions.
|
||||||
AC_FUNC_MKTIME
|
AC_FUNC_MKTIME
|
||||||
AC_FUNC_SELECT_ARGTYPES
|
AC_FUNC_SELECT_ARGTYPES
|
||||||
AC_CHECK_FUNCS([select])
|
AC_CHECK_FUNCS([select])
|
||||||
#AC_CHECK_FUNC(flock, [AC_DEFINE([HAVE_FLOCK], [1], [Found flock])])
|
|
||||||
AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE([HAVE_UUID], [1], [Found uuid_unparse_lower])])
|
AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE([HAVE_UUID], [1], [Found uuid_unparse_lower])])
|
||||||
AC_CHECK_FUNC(random, [AC_DEFINE([HAVE_RANDOM], [1], [Found random])])
|
AC_CHECK_FUNC(random, [AC_DEFINE([HAVE_RANDOM], [1], [Found random])])
|
||||||
AC_CHECK_FUNC(srandom, [AC_DEFINE([HAVE_SRANDOM], [1], [Found srandom])])
|
AC_CHECK_FUNC(srandom, [AC_DEFINE([HAVE_SRANDOM], [1], [Found srandom])])
|
||||||
|
|
||||||
|
|
||||||
|
# Generate the Makefiles.
|
||||||
AC_CONFIG_FILES([Makefile src/Makefile])
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
# End.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue