| 1 |
dnl $Id: configure.ac 58126 2021-03-04 22:14:54Z karl $ |
| 2 |
dnl Process this file with autoconf to produce a configure script. |
| 3 |
dnl |
| 4 |
dnl Copyright 2016-2021 Karl Berry <[email protected]> |
| 5 |
dnl Copyright 2015 Peter Breitenlohner <[email protected]> |
| 6 |
dnl |
| 7 |
dnl This file is free software; the copyright holder |
| 8 |
dnl gives unlimited permission to copy and/or distribute it, |
| 9 |
dnl with or without modifications, as long as this notice is preserved. |
| 10 |
dnl |
| 11 |
m4_include([version.ac])[] dnl define gregorio_version |
| 12 |
AC_INIT([Gregorio (TeX Live)], gregorio_version, [[email protected]], [gregorio--tex-live-], [http://gregorio-project.github.io/]) |
| 13 |
AC_PREREQ([2.65]) |
| 14 |
AC_CONFIG_SRCDIR([gregorio-src/src/gregorio-utils.c]) |
| 15 |
AC_CONFIG_AUX_DIR([../../build-aux]) |
| 16 |
AC_CONFIG_MACRO_DIR([../../m4]) |
| 17 |
|
| 18 |
dnl Common code for all programs using libkpathsea. |
| 19 |
KPSE_COMMON([gregorio]) |
| 20 |
|
| 21 |
|
| 22 |
# [from gnulib] canonicalize.m4 serial 26 |
| 23 |
|
| 24 |
dnl Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc. |
| 25 |
|
| 26 |
dnl This file is free software; the Free Software Foundation |
| 27 |
dnl gives unlimited permission to copy and/or distribute it, |
| 28 |
dnl with or without modifications, as long as this notice is preserved. |
| 29 |
|
| 30 |
# Check whether realpath works. Assume that if a platform has both |
| 31 |
# realpath and canonicalize_file_name, but the former is broken, then |
| 32 |
# so is the latter. |
| 33 |
AC_DEFUN([gl_FUNC_REALPATH_WORKS], |
| 34 |
[ |
| 35 |
AC_CHECK_FUNCS_ONCE([realpath]) |
| 36 |
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
| 37 |
AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [ |
| 38 |
touch conftest.a |
| 39 |
mkdir conftest.d |
| 40 |
AC_RUN_IFELSE([ |
| 41 |
AC_LANG_PROGRAM([[ |
| 42 |
]GL_NOCRASH[ |
| 43 |
#include <stdlib.h> |
| 44 |
#include <string.h> |
| 45 |
]], [[ |
| 46 |
int result = 0; |
| 47 |
{ |
| 48 |
char *name = realpath ("conftest.a", NULL); |
| 49 |
if (!(name && *name == '/')) |
| 50 |
result |= 1; |
| 51 |
} |
| 52 |
{ |
| 53 |
char *name = realpath ("conftest.b/../conftest.a", NULL); |
| 54 |
if (name != NULL) |
| 55 |
result |= 2; |
| 56 |
} |
| 57 |
{ |
| 58 |
char *name = realpath ("conftest.a/", NULL); |
| 59 |
if (name != NULL) |
| 60 |
result |= 4; |
| 61 |
} |
| 62 |
{ |
| 63 |
char *name1 = realpath (".", NULL); |
| 64 |
char *name2 = realpath ("conftest.d//./..", NULL); |
| 65 |
if (strcmp (name1, name2) != 0) |
| 66 |
result |= 8; |
| 67 |
} |
| 68 |
return result; |
| 69 |
]]) |
| 70 |
], |
| 71 |
[gl_cv_func_realpath_works=yes], |
| 72 |
[gl_cv_func_realpath_works=no], |
| 73 |
[case "$host_os" in |
| 74 |
# Guess yes on glibc systems. |
| 75 |
*-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; |
| 76 |
# If we don't know, assume the worst. |
| 77 |
*) gl_cv_func_realpath_works="guessing no" ;; |
| 78 |
esac |
| 79 |
]) |
| 80 |
rm -rf conftest.a conftest.d |
| 81 |
]) |
| 82 |
case "$gl_cv_func_realpath_works" in |
| 83 |
*yes) |
| 84 |
AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath() |
| 85 |
can malloc memory, always gives an absolute path, and handles |
| 86 |
trailing slash correctly.]) |
| 87 |
;; |
| 88 |
esac |
| 89 |
]) |
| 90 |
# end function from canonicalize.m4. now call it: |
| 91 |
|
| 92 |
gl_FUNC_REALPATH_WORKS |
| 93 |
|
| 94 |
dnl Checks for header files. |
| 95 |
AC_CHECK_HEADERS([stdint.h]) |
| 96 |
AC_CHECK_HEADERS([stdalign.h]) |
| 97 |
|
| 98 |
AC_CHECK_ALIGNOF(uint32_t) |
| 99 |
|
| 100 |
AC_C_BIGENDIAN |
| 101 |
|
| 102 |
AC_SUBST([GREGORIO_TREE], [gregorio-src]) |
| 103 |
AC_SUBST([PERL5], ['/usr/bin/env perl']) |
| 104 |
|
| 105 |
KPSE_KPATHSEA_FLAGS |
| 106 |
|
| 107 |
AC_CONFIG_HEADERS([config_.h]) |
| 108 |
|
| 109 |
AC_CONFIG_FILES([Makefile]) |
| 110 |
|
| 111 |
AC_OUTPUT |