File:  [GNUtrition Sources] / gnutrition / configure.ac
Revision 1.4: download - view: text, annotated - select for diffs
Mon May 18 19:36:06 2026 UTC (46 hours, 45 minutes ago) by asm
Branches: MAIN
CVS tags: HEAD
More documentation changes

# SPDX-License-Identifier: GPL-3.0-or-later
#
# $Id: configure.ac,v 1.4 2026/05/18 19:36:06 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])

# Optional: TexInfo tools.
AC_CHECK_PROGS([MAKEINFO], [makeinfo], [no])
AC_CHECK_PROGS([TEXIHTML], [texi2html], [no])
AC_CHECK_PROGS([TEXIPDF], [texi2pdf], [no])
AM_CONDITIONAL([HAVE_TEXINFO], [test "$MAKEINFO" != "no" && test "$TEXIHTML" != "no" && test "$TEXIPDF" != "no"])

# Optional: check if local manual copies should get install
AM_CONDITIONAL([INSTALL_HTML], [test -f "$srcdir/gnutrition.html"])
AM_CONDITIONAL([INSTALL_PDF],  [test -f "$srcdir/gnutrition.pdf"])

AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADERS([config.h])
AC_OUTPUT

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>