summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2023-03-12 13:24:22 -0700
committerAdrian Thurston <thurston@colm.net>2023-03-12 13:24:22 -0700
commit463f4914057b0193c6ca025e9233c17035bc0448 (patch)
tree9ec7269f3cf6a968252456ada9601dfb5a222991
parentd4577c924451b331c73c8ed0af04f6efd35ac0b4 (diff)
downloadragel-463f4914057b0193c6ca025e9233c17035bc0448.tar.gz
fallback to AC_CHECK_LIB for libcolm and libfsm
If the .la files for libcolm and libfsm are not present then fallback to using AC_CHECK_LIB for these libraries. Many packaging systems strip out .la files so we need to still be able to link if they are not there.
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e1a0fc67..07a2b075 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,6 +59,26 @@ AC_CHECK_FILES(
[],
[AC_ERROR([colm is required to build ragel])]
)
+
+dnl If the .la files are present use those, otherwise locate the libs with AC_CHECK_LIB.
+AC_CHECK_FILES(
+ [$LIBCOLM_LA $LIBFSM_LA],
+ [],
+ [
+ AC_CHECK_LIB(
+ [colm],
+ [colm_run_program],
+ [LIBCOLM_LA=-lcolm],
+ [AC_ERROR([libcolm is required to build ragel])]
+ )
+ AC_CHECK_LIB(
+ [fsm],
+ [libfsm_present],
+ [LIBFSM_LA=-lfsm],
+ [AC_ERROR([libfsm is required to build ragel])]
+ )
+ ]
+)
AC_SUBST(COLM)
AC_SUBST(COLM_WRAP)
AC_SUBST(COLM_SHARE)