# SPDX-License-Identifier: GPL-3.0-or-later
#
# $Id: configure.ac,v 1.1 2026/05/08 03:23:57 asm Exp $
#
# configure.ac for GNUtrition
#
# Copyright (C) 2026 Free Software Foundation, Inc.
#
# Author: Jason Self <jself@gnu.org>
# Anton McClure <asm@gnu.org>
AC_INIT([gnutrition], m4_esyscmd_s([./version.sh]), [bug-gnutrition@gnu.org], [gnutrition], [http://www.gnu.org/software/gnutrition/])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
# Checks for programs.
AC_PROG_CC
# Use C99.
CFLAGS="${CFLAGS:-} -D_POSIX_C_SOURCE=200809L -std=c99"
# Checks for header files.
AC_CHECK_HEADERS([stdio.h stdlib.h string.h ctype.h errno.h getopt.h libgen.h locale.h])
# Checks for library functions.
AC_CHECK_FUNCS([strdup strerror getopt_long setlocale])
# Check for math library.
AC_CHECK_LIB([m], [fmod])
# Check for SQLite3.
PKG_CHECK_MODULES([SQLITE3], [sqlite3])
# Check for ncurses.
PKG_CHECK_MODULES([NCURSES], [ncurses])
# Optional: GTK 3 for the GUI binary.
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [have_gtk=yes], [have_gtk=no])
# Optional: GIO 2 for D-Bus support in the GUI binary.
PKG_CHECK_MODULES([GIO], [gio-2.0], [have_gio=yes], [have_gio=no])
AM_CONDITIONAL([BUILD_GTK], [test "x$have_gtk" = xyes -a "x$have_gio" = xyes])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>