2020-11-22 16:12:47 -05:00
|
|
|
AC_INIT([rofi], [1.6.1-dev], [https://github.com/davatorium/rofi/],[],[https://reddit.com/r/qtools/])
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2014-03-18 03:59:42 -04:00
|
|
|
AC_CONFIG_SRCDIR([source/rofi.c])
|
2014-03-17 13:00:09 -04:00
|
|
|
AC_CONFIG_HEADER([config.h])
|
2017-05-04 07:32:20 -04:00
|
|
|
AH_BOTTOM([#include "gitconfig.h"])
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2017-03-11 08:55:58 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Lex & Bison language parser.
|
|
|
|
dnl ---------------------------------------------------------------------
|
2021-01-04 16:56:40 -05:00
|
|
|
AC_PROG_LEX
|
2016-12-09 13:49:49 -05:00
|
|
|
AC_PROG_YACC
|
|
|
|
|
2020-09-03 15:08:17 -04:00
|
|
|
|
|
|
|
AC_DEFUN([AX_PROG_BISON], [
|
|
|
|
AC_REQUIRE([AC_PROG_YACC])
|
|
|
|
AC_REQUIRE([AC_PROG_EGREP])
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[
|
|
|
|
AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
|
|
|
|
[ax_cv_prog_bison=yes], [ax_cv_prog_bison=no])
|
|
|
|
])
|
|
|
|
AS_IF([test "$ax_cv_prog_bison" = "yes"], [
|
|
|
|
dnl replace the yacc-compatible compiler with the real bison, as
|
|
|
|
dnl otherwise autoconf limits us to the POSIX yacc.
|
|
|
|
dnl We also change the generated filename to the old one, so that
|
|
|
|
dnl automake's ylwrap can deal with it.
|
|
|
|
YACC="${YACC% -y} -o y.tab.c"
|
|
|
|
] m4_ifnblank([$1], [[$1]]),
|
|
|
|
m4_ifnblank([$2], [[$2]])
|
|
|
|
)
|
|
|
|
])
|
|
|
|
|
|
|
|
AX_PROG_BISON([],[AC_MSG_ERROR("Failed to find bison")])
|
2017-02-23 15:55:37 -05:00
|
|
|
|
2017-04-04 12:59:35 -04:00
|
|
|
m4_include([m4/ax_prog_flex_version.m4])
|
|
|
|
m4_include([m4/ax_compare_version.m4])
|
|
|
|
AC_SUBST([FLEX], [${LEX}])
|
|
|
|
AX_PROG_FLEX_VERSION([2.5.39],,AC_MSG_ERROR("Require flex version 2.5.39 or higher"))
|
|
|
|
#
|
|
|
|
|
2015-11-14 07:47:45 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Setup automake to be silent and in foreign mode.
|
2015-12-06 11:12:41 -05:00
|
|
|
dnl We want xz distribution
|
2015-11-14 07:47:45 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
2015-03-02 16:23:55 -05:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects dist-xz])
|
2014-03-17 19:11:46 -04:00
|
|
|
AM_SILENT_RULES([yes])
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2015-11-14 07:47:45 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Check for compiler
|
|
|
|
dnl ---------------------------------------------------------------------
|
2015-02-18 08:00:19 -05:00
|
|
|
AC_PROG_CC([clang gcc cc])
|
2015-12-06 11:12:41 -05:00
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl C99 standard
|
|
|
|
dnl ---------------------------------------------------------------------
|
2015-02-18 08:00:19 -05:00
|
|
|
AC_PROG_CC_C99
|
2015-12-06 11:12:41 -05:00
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl C to Object rules.
|
|
|
|
dnl ---------------------------------------------------------------------
|
2015-03-01 13:50:54 -05:00
|
|
|
AM_PROG_CC_C_O
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2015-12-06 11:12:41 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl System extensions
|
|
|
|
dnl ---------------------------------------------------------------------
|
2014-08-22 03:26:46 -04:00
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
2016-02-19 16:43:53 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Static libraries programs
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AM_PROG_AR
|
|
|
|
|
2016-02-16 05:12:58 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Base CFLAGS
|
|
|
|
dnl ---------------------------------------------------------------------
|
2016-02-28 12:33:01 -05:00
|
|
|
AM_CFLAGS="-Wall -Wextra -Wparentheses -Winline -pedantic -Wunreachable-code"
|
2016-02-16 05:12:58 -05:00
|
|
|
|
2015-12-31 13:09:25 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Enable source code coverage reporting for GCC
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
|
2017-03-19 13:03:48 -04:00
|
|
|
AC_ARG_ENABLE([gcov],
|
|
|
|
[AS_HELP_STRING ([--enable-gcov],[Enable source code coverage testing using gcov])],
|
2016-02-16 05:12:58 -05:00
|
|
|
[AM_CFLAGS="${AM_CFLAGS} -coverage"])
|
2016-11-25 15:47:28 -05:00
|
|
|
AS_IF([test "x${enable_gcov}" = "xyes" ], [AC_DEFINE([ENABLE_GCOV], [1], [Enable gcov profiling])])
|
2017-07-27 17:35:46 -04:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([asan], [AS_HELP_STRING ([--enable-asan],[Enable asan support])])
|
|
|
|
AS_IF([test "x${enable_asan}" = "xyes" ], [
|
|
|
|
AC_DEFINE([ENABLE_ASAN], [1], [Enable libasan])
|
|
|
|
AM_CFLAGS="${AM_CFLAGS} -fsanitize=address -fno-omit-frame-pointer -g3"]
|
|
|
|
|
|
|
|
])
|
2016-08-29 02:46:21 -04:00
|
|
|
|
|
|
|
|
2016-08-29 15:38:29 -04:00
|
|
|
dnl --------------------------------------------------------------------
|
|
|
|
dnl DRun dialog
|
|
|
|
dnl --------------------------------------------------------------------
|
2017-03-19 13:03:48 -04:00
|
|
|
AC_ARG_ENABLE([drun], AS_HELP_STRING([--disable-drun],[Disable desktop file run dialog]))
|
2016-09-26 05:56:20 -04:00
|
|
|
AS_IF([test "x${enable_drun}" != "xno"], [AC_DEFINE([ENABLE_DRUN], [1], [Enable desktop file run dialog])])
|
2017-03-11 08:55:58 -05:00
|
|
|
|
2015-09-14 03:01:05 -04:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Disable window mode
|
|
|
|
dnl ---------------------------------------------------------------------
|
2017-03-19 13:03:48 -04:00
|
|
|
AC_ARG_ENABLE([windowmode], AS_HELP_STRING([--disable-windowmode],[Disable window mode]))
|
2015-09-20 05:45:28 -04:00
|
|
|
AS_IF([ test "x$enable_windowmode" != "xno"], [AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])])
|
2015-09-14 02:57:10 -04:00
|
|
|
|
2015-11-14 07:47:45 -05:00
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Check for C functions.
|
|
|
|
dnl ---------------------------------------------------------------------
|
2016-04-14 13:20:37 -04:00
|
|
|
AC_CHECK_FUNC([getline],, AC_MSG_ERROR("Could not find getline in c library"))
|
2016-09-17 12:57:44 -04:00
|
|
|
AC_CHECK_FUNC([open],, AC_MSG_ERROR("Could not find open in c library"))
|
2015-11-12 11:20:51 -05:00
|
|
|
AC_CHECK_FUNC([sysconf],, AC_MSG_ERROR("Could not find sysconf"))
|
2016-04-14 13:20:37 -04:00
|
|
|
AC_CHECK_FUNC([strtok_r],, AC_MSG_ERROR("Could not find strtok_r"))
|
|
|
|
AC_CHECK_FUNC([flock],, AC_MSG_ERROR("Could not find flock"))
|
|
|
|
AC_CHECK_FUNC([ftruncate],,AC_MSG_ERROR("Could not find ftruncate"))
|
|
|
|
AC_CHECK_FUNC([fcntl],, AC_MSG_ERROR("Could not find fcntl"))
|
2016-08-23 18:39:56 -04:00
|
|
|
AC_CHECK_FUNC([setlocale],,AC_MSG_ERROR("Could not find setlocale"))
|
2017-03-08 10:56:28 -05:00
|
|
|
AC_CHECK_FUNC([atexit],, AC_MSG_ERROR("Could not find atexit in c library"))
|
|
|
|
AC_CHECK_FUNC([glob],, AC_MSG_ERROR("Could not find glob in c library"))
|
2020-10-12 14:32:25 -04:00
|
|
|
AC_CHECK_FUNC([readdir],, AC_MSG_ERROR("Could not find readdir in c library"))
|
2015-11-14 07:47:45 -05:00
|
|
|
|
2017-02-06 16:08:10 -05:00
|
|
|
AC_CHECK_HEADER([math.h],, AC_MSG_ERROR("Could not find math.h header file"))
|
2017-02-09 02:45:15 -05:00
|
|
|
AC_SEARCH_LIBS([floor],[m],, AC_MSG_ERROR("Could not find floor in math library"))
|
|
|
|
AC_SEARCH_LIBS([ceil], [m],, AC_MSG_ERROR("Could not find ceil in math library"))
|
2017-02-06 16:08:10 -05:00
|
|
|
|
2019-01-07 11:19:33 -05:00
|
|
|
AC_CHECK_HEADER([sysexits.h],, AC_MSG_ERROR("Could not find the sysexists.h header file"))
|
2020-10-17 15:59:12 -04:00
|
|
|
AC_CHECK_HEADER([setjmp.h],, AC_MSG_ERROR("Could not find the setjmp.h header file"))
|
2019-01-07 11:19:33 -05:00
|
|
|
|
2015-11-14 07:47:45 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Check dependencies
|
|
|
|
dnl ---------------------------------------------------------------------
|
2014-03-17 13:00:09 -04:00
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
2015-12-06 11:12:41 -05:00
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------
|
2017-03-06 04:36:12 -05:00
|
|
|
dnl PKG_CONFIG based dependencies
|
2015-12-06 11:12:41 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
2019-04-19 04:15:06 -04:00
|
|
|
glib_min_major="2"
|
|
|
|
glib_min_minor="40"
|
|
|
|
glib_min_version="${glib_min_major}.${glib_min_minor}"
|
2017-04-12 12:08:57 -04:00
|
|
|
NK_INIT([bindings xdg-theme])
|
2019-04-19 04:15:06 -04:00
|
|
|
PKG_CHECK_MODULES([glib], [glib-2.0 >= ${glib_min_version} gio-unix-2.0 gmodule-2.0])
|
|
|
|
AC_DEFINE_UNQUOTED([GLIB_VERSION_MIN_REQUIRED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The lower GLib version supported])
|
|
|
|
AC_DEFINE_UNQUOTED([GLIB_VERSION_MAX_ALLOWED], [(G_ENCODE_VERSION(${glib_min_major},${glib_min_minor}))], [The highest GLib version supported])
|
2017-05-27 20:18:09 -04:00
|
|
|
GW_CHECK_XCB([xcb-aux xcb-xkb xkbcommon xkbcommon-x11 xcb-ewmh xcb-icccm xcb-xrm xcb-randr xcb-xinerama])
|
2015-09-26 14:34:34 -04:00
|
|
|
PKG_CHECK_MODULES([pango], [pango pangocairo])
|
2016-02-21 13:42:32 -05:00
|
|
|
PKG_CHECK_MODULES([cairo], [cairo cairo-xcb])
|
2017-03-06 04:36:12 -05:00
|
|
|
PKG_CHECK_MODULES([libsn], [libstartup-notification-1.0 ])
|
2020-10-20 14:38:13 -04:00
|
|
|
PKG_CHECK_MODULES([gdkpixbuf], [gdk-pixbuf-2.0])
|
2017-04-30 14:03:31 -04:00
|
|
|
|
2017-05-18 01:59:37 -04:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl check - Unit testing.
|
|
|
|
dnl ---------------------------------------------------------------------
|
2017-04-30 14:03:31 -04:00
|
|
|
AC_ARG_ENABLE([check], AS_HELP_STRING([--disable-check], [Build with checks using check library (default: enabled)]))
|
|
|
|
|
|
|
|
AS_IF([test "x${enable_check}" != "xno"], [ PKG_CHECK_MODULES([check],[check >= 0.11.0], [HAVE_CHECK=1]) ])
|
|
|
|
AM_CONDITIONAL([USE_CHECK], [test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1])
|
|
|
|
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2017-10-31 14:31:58 -04:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Gets the resource compile tool path.
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
AM_PATH_GLIB_2_0
|
|
|
|
|
2015-12-06 11:12:41 -05:00
|
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
dnl Add extra compiler flags
|
|
|
|
dnl ---------------------------------------------------------------------
|
2016-02-16 05:12:58 -05:00
|
|
|
AC_SUBST([AM_CFLAGS])
|
2014-03-17 13:00:09 -04:00
|
|
|
|
2017-02-16 16:32:15 -05:00
|
|
|
AC_CONFIG_FILES([Makefile doc/rofi.doxy pkgconfig/rofi.pc])
|
2014-03-17 13:00:09 -04:00
|
|
|
AC_OUTPUT
|
2015-03-24 11:02:03 -04:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "-------------------------------------"
|
2016-09-26 05:56:20 -04:00
|
|
|
if test x$enable_drun != xno; then
|
|
|
|
echo "Desktop File drun dialog Enabled"
|
2016-08-29 15:38:29 -04:00
|
|
|
else
|
2016-09-26 05:56:20 -04:00
|
|
|
echo "Desktop File drun dialog Disabled"
|
2016-08-29 15:38:29 -04:00
|
|
|
fi
|
|
|
|
if test x$enable_windowmode != xno; then
|
|
|
|
echo "Window Switcher dialog Enabled"
|
|
|
|
else
|
|
|
|
echo "Window Switcher dialog Disabled"
|
|
|
|
fi
|
2017-03-28 14:12:22 -04:00
|
|
|
if test x$enable_asan = xyes; then
|
|
|
|
echo "Asan address sanitize Enabled"
|
|
|
|
else
|
|
|
|
echo "Asan address sanitize Disabled"
|
|
|
|
fi
|
|
|
|
if test x$enable_gcov = xyes; then
|
|
|
|
echo "Code Coverage Enabled"
|
|
|
|
else
|
|
|
|
echo "Code Coverage Disabled"
|
|
|
|
fi
|
2017-04-30 14:03:31 -04:00
|
|
|
if test "x${enable_check}" != "xno" && test "$HAVE_CHECK" -eq 1; then
|
|
|
|
echo "Check based tests Enabled"
|
|
|
|
else
|
|
|
|
echo "Check based tests Disabled"
|
|
|
|
fi
|
2015-03-24 11:02:03 -04:00
|
|
|
echo "-------------------------------------"
|
|
|
|
echo "Now type 'make' to build"
|
|
|
|
echo ""
|