diff --git a/INSTALL b/INSTALL index 22f556f84577027baf78697817bbb96d4225db1f..bb48cffdfd71a6266dee58e7f54d5e7db0adba8b 100644 --- a/INSTALL +++ b/INSTALL @@ -286,6 +286,16 @@ PostgreSQL: for archive libraries. (Typical use will need --with-libraries=/usr/local/lib) + --with-CC=compiler + Use a specific C compiler that the configure + script cannot find. + + --with-CXX=compiler + --without-CXX + Use a specific C++ compiler that the configure + script cannot find, or exclude C++ compilation + altogether. + As an example, here is the configure script I use on a Sparc Solaris 2.5 system with /opt/postgres being the install base. diff --git a/src/configure.in b/src/configure.in index aa65848bc678b325e7098fff60c5c88949875014..987ee1e25333f89bb4e6d568fdec08b4735eaa9c 100644 --- a/src/configure.in +++ b/src/configure.in @@ -280,12 +280,18 @@ AC_ARG_ENABLE( AC_MSG_RESULT(disabled) ) -if test "X$with_compiler" != "X" -then - CC=$with_compiler -else - AC_PROG_CC -fi +dnl Check for C support (allow override if needed) +AC_ARG_WITH(CC, + [ --with-CC=compiler use specific C compiler], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([*** You must supply an argument to the --with-CC option.]) + ;; + esac + CC="$withval" + ], + [ AC_PROG_CC]) if test "$CC" = "gcc" then @@ -320,21 +326,24 @@ AC_SUBST(USE_TCL) AC_SUBST(USE_PERL) AC_SUBST(MB) -dnl **************************************************************** -dnl Hold off on the C++ stuff until we can figure out why it doesn't -dnl work under Solaris.. -dnl -dnl AC_PROG_CXX -dnl -dnl Check if we should set Have_Cplusplus -dnl if test -n "$CXX"; then -dnl export HAVECXX -dnl HAVECXX='HAVE_Cplusplus=true' -dnl fi -dnl AC_SUBST(HAVECXX) -dnl **************************************************************** -HAVECXX='HAVE_Cplusplus=false' +dnl Check for C++ support (allow override if needed) +HAVECXX='HAVE_Cplusplus=true' +AC_ARG_WITH(CXX, + [ --with-CXX=compiler use specific C++ compiler], + [ + case "$withval" in + "" | y | ye | yes) + AC_MSG_ERROR([*** You must supply an argument to the --with-CC option.]) + ;; + n | no) + HAVECXX='HAVE_Cplusplus=false' + ;; + esac + CXX="$withval" + ], + [ AC_PROG_CXX]) AC_SUBST(HAVECXX) + INSTALLPATH="/usr/ucb:$PATH" AC_PATH_PROGS(INSTALL, ginstall installbsd bsdinst scoinst install, NONE, $INSTALLPATH) if test $INSTALL = "NONE"