configure: Several changes related to locating cpp and ksh
authorJon Trulson <jon@radscan.com>
Wed, 30 Oct 2019 23:42:31 +0000 (17:42 -0600)
committerJon Trulson <jon@radscan.com>
Wed, 30 Oct 2019 23:42:31 +0000 (17:42 -0600)
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

index 4e9a22194f33c24e39a67b3072766e31b83a3b66..7b285f5eeac127263b7b61a4972037478bfcedde 100644 (file)
@@ -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
 
 ])