From 0f1223a07e9e71af0ae5f8378de132e084a5d735 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 20 Nov 2019 18:26:59 -0700 Subject: [PATCH] configure: rework the way TIRPC is detected and handled Previously we would detect whether TIRPC is installed or not, and set TIRPCINC to the include directory with the -DOPT_TIRPC macro defined. Then, pretty much every Makefile.am needs to be sure that $(TIRPCINC) is specified in the cpp/c/cxx flags. Since we can never be sure that an RPC header file might be indirectly included, a better approach is to simply add TIRPCINC to the global list of CXXFLAGS and CFLAGS in configure.ac for everybody. This way, it is always specified properly on tirpc systems, and we don't need to always add it to every individual Makefile.am since everyone will get it by default. TIRPCLIB is still marked as a dep in libtt, so as long as libtt is linked, you should automatically get the tirpc library too. This is still unchanged. --- cde/configure.ac | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cde/configure.ac b/cde/configure.ac index 16417613b..bc1af5c68 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -265,10 +265,15 @@ AC_CHECK_HEADERS([locale.h]) dnl libraries AC_CHECK_LIB(m, cosf) AC_CHECK_LIB(crypt, crypt) -AC_CHECK_LIB(tirpc, main, [TIRPCINC="-DOPT_TIRPC -I/usr/include/tirpc"; TIRPCLIB=-ltirpc]) -AC_SUBST(TIRPCINC) +AC_CHECK_LIB(Xinerama, XineramaQueryScreens, , + [AC_MSG_ERROR([libXinerama not found])]) + +dnl Special check for tirpc... +AC_CHECK_LIB(tirpc, svc_register, + [CFLAGS="${CFLAGS} -DOPT_TIRPC -I/usr/include/tirpc"; + CXXFLAGS="${CXXFLAGS} -DOPT_TIRPC -I/usr/include/tirpc"; + TIRPCLIB=-ltirpc]) AC_SUBST(TIRPCLIB) -AC_CHECK_LIB(Xinerama, XineramaQueryScreens, ,[AC_MSG_ERROR([libXinerama not found])]) dnl Setup XTOOLLIB - we do it in this specific order to avoid ordering dnl issues