From 6c0c619df3da427d76471764c976b103acd255f1 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Sun, 15 Dec 2019 12:47:57 -0700 Subject: [PATCH] configure: set a compiler search option ... and move the PROG_CC and PROG_CXX checks toward the beginning. Without the move the compiler search arguments are ignored. We search for 'cc gcc clang' and 'c++ g++ clang++', in that order for CC and CXX respectively. This means there should be no need to override the CC and CXX variables on the configure command line for BSD systems. On OpenBSD for example, cc links to clang. On Linux, cc links to gcc. You can still override these if you like with CC=... and CXX=... on the configure command line. gmake (MAKE=gmake) still needs to be used on the BSD's though. With these and previous changes, CDE builds, installs, and runs correctly on OpenBSD 6.5 now. --- cde/configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cde/configure.ac b/cde/configure.ac index fd5b94fdd..f327e100d 100644 --- a/cde/configure.ac +++ b/cde/configure.ac @@ -2,6 +2,11 @@ AC_INIT([cde-desktop], [2.3.1], [jon@radscan.com]) AC_CONFIG_HEADERS([include/autotools_config.h]) AC_CONFIG_MACRO_DIRS([m4]) AM_INIT_AUTOMAKE([foreign subdir-objects]) + +dnl These must be up here for the compiler search list to actually work +AC_PROG_CC([cc gcc clang]) +AC_PROG_CXX([c++ g++ clang++]) + LT_INIT AC_PREFIX_DEFAULT(/usr/dt) @@ -218,9 +223,6 @@ AC_SUBST(CDE_CONFIGURATION_TOP) AC_SUBST(CDE_LOGFILES_TOP) 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. @@ -320,7 +322,7 @@ dnl deal, or modify them here directly. CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS} ${OSVERSION}" CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}" CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}" -LIBS="${LIBS} ${PTHREAD_LIBS}" +LIBS="${X_LIBS} ${LIBS} ${PTHREAD_LIBS}" dnl All of the makefiles we need to generate go here... AC_CONFIG_FILES([