
# Copyright (C) 2020-2026 Tommi Höynälänmaa

# This file is part of Theme-D-Intr.

# You can redistribute and/or modify this file under the terms of the
# GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any
# later version.

# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see https://www.gnu.org/licenses/.


AC_INIT([Theme-D-Intr], [1.0.1], [tommi.hoynalanmaa at iki.fi], [theme-d-intr], [https://www.iki.fi/tohoyn/theme-d-intr/])

AM_INIT_AUTOMAKE

AC_CONFIG_MACRO_DIR([m4])

AC_PROG_LN_S

AC_ARG_WITH([guile],
  [AS_HELP_STRING([--with-guile],
    [Guile version to be used])],
  [guile_spec=$withval],
  [guile_spec=no])

CHECK_GUILE_VERSION
GUILE_PACKAGE=guile-$MY_GUILE_VERSION

AC_ARG_WITH([guile-program],
  [AS_HELP_STRING([--with-guile-program],
    [Guile program to be used])],
    [THEME_D_GUILE=$withval],
    [THEME_D_GUILE=/usr/bin/guile-$MY_GUILE_VERSION])

AC_SUBST(THEME_D_GUILE)

SRC_DIR=$(pwd)

LIB_DIR=$(get-theme-d-config-var lib-dir)

SCRIPT_DIR=$datadir/theme-d-intr/scripts

THEME_D_TARGET_LIB_DIR=$libdir/theme-d

AC_SUBST(MY_GUILE_VERSION)

AC_SUBST(SRC_DIR)

AC_SUBST(LIB_DIR)

AC_SUBST(MODULE_DIR, $(${PKG_CONFIG} --variable=sitedir $GUILE_PACKAGE))

AC_SUBST(EXAMPLES_DIR, $docdir/examples)

AC_SUBST(SCRIPT_DIR)

AC_SUBST(THEME_D_TARGET_LIB_DIR)

API_VERSION=2
AC_SUBST(API_VERSION)

EXTRA_GUILD_OPTIONS="-O1"

AC_SUBST(EXTRA_GUILD_OPTIONS)

AC_CONFIG_FILES([Makefile
		 doc/Makefile
		 theme-d-code/Makefile
         theme-d-code/theme-d-intr/Makefile
         theme-d-code/theme-d-intr/base/Makefile
         theme-d-code/theme-d-intr/dbus/Makefile
		 guile-code/Makefile
		 guile-code/guile-theme-d-intr/Makefile
		 guile-code/guile-theme-d-intr-support/Makefile
		 scripts/Makefile
		 examples/Makefile
		 examples/intr-dbus-examples/Makefile
		 examples/intr-dbus-examples/introspect2/Makefile
		 examples/intr-dbus-examples/server-and-client-1/Makefile
		 examples/intr-gtk3-examples/Makefile
		 examples/intr-gtk3-examples/calc/Makefile
		 examples/intr-gtk3-examples/hello/Makefile
		 examples/intr-gtk3-examples/hello2/Makefile
		 examples/intr-gtk3-examples/hello3/Makefile
		 examples/intr-gtk3-examples/theme-d-intr-demo/Makefile
		 examples/intr-gtk4-examples/Makefile
		 examples/intr-gtk4-examples/appwindow/Makefile
		 examples/intr-gtk4-examples/calc/Makefile
		 examples/intr-gtk4-examples/calc2/Makefile
		 examples/intr-gtk4-examples/custom-layout-example/Makefile
		 examples/intr-gtk4-examples/flag-demo/Makefile
		 examples/intr-gtk4-examples/hello/Makefile
		 examples/intr-gtk4-examples/hello2/Makefile
		 examples/intr-gtk4-examples/hello3/Makefile
		 examples/intr-gtk4-examples/theme-d-intr-demo/Makefile
])
AC_OUTPUT
