summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 4784b981827f1136d2522a788865cfb738eca73e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# SPDX-License-Identifier: GPL-3.0-only

AC_PREREQ([2.61])
# only for configure -h, see Makefile
AC_INIT([software], [packages])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([config.mak])
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_CPP

AC_DEFUN([REQUIRE_EXECUTABLE], [
	AC_PATH_PROG(m4_toupper([$1]), [$1])
	test -z "$m4_toupper([$1])" && AC_MSG_ERROR([$1 is required])
])
REQUIRE_EXECUTABLE([m4])
REQUIRE_EXECUTABLE([flex])
REQUIRE_EXECUTABLE([bison])

HAVE_LOPSUB=yes
AC_CHECK_HEADER(lopsub.h, [], [HAVE_LOPSUB=no])
AC_CHECK_LIB([lopsub], [lls_merge], [], [HAVE_LOPSUB=no])
if test $HAVE_LOPSUB == no; then AC_MSG_ERROR([
	The lopsub library is required to build this software, but
	the above checks indicate it is not installed on your system.

	On Debian/Ubuntu systems you may install the liblopsub-dev package.
	Alternatively, run the following command to download a copy.
		git clone https://git.tuebingen.mpg.de/lopsub.git
	Install the library, then run this configure script again.

	If you installed lopsub at a non-standard location, make sure to set
	PATH, CPPFLAGS and LDFLAGS accordingly. For example:

		pfx=/prefix/where/lopsub/is/installed
		export PATH=\$pfx/bin:\$PATH
		export CPPFLAGS=-I\$pfx/include
		export LDFLAGS=-L\$pfx/lib
])
fi
REQUIRE_EXECUTABLE([lopsubgen])
AC_OUTPUT