From 2b8803a8fbee0a4b28b16511936df5da72b94961 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 30 Oct 2019 17:42:31 -0600 Subject: [PATCH] configure: Several changes related to locating cpp and ksh For ksh, we need a full pathname. AC_CHECK_PROGS only sets the name, so we can't use that (think of a "#!" in a shell script. We use some shell scripting to locate the ksh pathname. While on that subject, the current use of CPP (gcc -E) as a general preprocessor does not work very well. I messes up whitespace, adds/translates random whitespace, and complains bitterly about single quotes (') in various places like comments. It's not usable for what CDE needs. So, now we use GENCPP. Using shell scripting like that used for ksh, we locate the cpp program, and set GENCPP to "/full/path/to/cpp -traditional -nostdinc". This is what Linux uses now in an Imake build, and it works fine. We'll have to see what the BSD/Solari do. We might need to just include BSD's "tradcpp" into the build and use that. It too works well in limited testing, but eats blank lines. We can live with that if we have to. --- cde/configure.ac | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/cde/configure.ac b/cde/configure.ac index 4e9a22194..7b285f5ee 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -206,7 +206,20 @@ AC_SUBST(CDE_USER_TOP) AC_PROG_CC AC_PROG_CXX + AC_PROG_CPP + +dnl we need a real preprocessor, not gcc -E. We will call it GENCPP. We may +dnl just bite the bullet and go with BSD's tradcpp here... +CPP_PATH="`which cpp`" +if test -z "$CPP_PATH" +then + AC_MSG_ERROR([Could not find a C preprocessor (cpp). Please install it.]); +else + AC_SUBST(GENCPP, "$CPP_PATH -traditional -nostdinc", [CPP command]) +fi + + AM_PROG_LIBTOOL AC_PROG_YACC AM_PROG_LEX @@ -238,7 +251,19 @@ AC_PATH_XTRA AC_FUNC_FORK dnl programs -AC_CHECK_PROGS(KSH, ksh) + +dnl we have to treat ksh specially, as we need it's full path for +dnl various scripts. + +KSH_PATH="`which ksh`" +if test -z "$KSH_PATH" +then + AC_MSG_ERROR([Could not find the Korn shell (ksh). Please install it.]); +else + AC_SUBST(KSH, $KSH_PATH, [Path to ksh]) +fi + + AC_CHECK_PROGS(BDFTOPCF, bdftopcf) AC_CHECK_PROGS(MKFONTIDR, mkfontdir) AC_CHECK_PROGS(GZIP, gzip) @@ -368,6 +393,7 @@ programs/dtfile/dtcopy/Makefile programs/dtwm/Makefile programs/dtlogin/Makefile +programs/dtlogin/config/Makefile ])