configure.ac, fix `NO_X' and `has_no_help'

drop configure options `--enable-x' and `--disable-x'
use `--with-x' and `--without-x' provided by AC_PATH_X

bug tracker item:
  [ngspice-Bugs-3515015] Startup error message without x11
  https://sourceforge.net/tracker/index.php?func=detail&aid=3515015&group_id=38962&atid=423915
This commit is contained in:
rlar 2012-04-06 16:19:49 +02:00
parent 7641450b29
commit e889c821d1
2 changed files with 7 additions and 10 deletions

View File

@ -167,10 +167,6 @@ dnl Xgraph is a plotting package for X11 once very popular.
AC_ARG_ENABLE(xgraph, AC_ARG_ENABLE(xgraph,
AS_HELP_STRING([--enable-xgraph],[Enable xgraph compilation.])) AS_HELP_STRING([--enable-xgraph],[Enable xgraph compilation.]))
dnl --enable-x: Compile software using x libraries. A GUI will be provided then.
AC_ARG_ENABLE(x,
AS_HELP_STRING([--enable-x],[Enable X11 gui]))
dnl --with-readline: Includes GNU readline support into CLI. Default is "no". dnl --with-readline: Includes GNU readline support into CLI. Default is "no".
AC_ARG_WITH(readline, AC_ARG_WITH(readline,
AS_HELP_STRING([--with-readline[=yes/no]],[Enable GNU readline support for CLI. Default=no.])) AS_HELP_STRING([--with-readline[=yes/no]],[Enable GNU readline support for CLI. Default=no.]))
@ -490,7 +486,7 @@ case $with_windows in
if test "x$enable_help" = "xyes"; then if test "x$enable_help" = "xyes"; then
has_no_help=false has_no_help=false
else else
Has_no_help=true has_no_help=true
fi fi
CFLAGS="$CFLAGS -mwindows";; CFLAGS="$CFLAGS -mwindows";;
* ) * )
@ -502,7 +498,10 @@ dnl Checks for X11 header files and libraries - X11 support can be disabled
dnl by passing the '--without-x' option to configure: dnl by passing the '--without-x' option to configure:
dnl Try to locate the X-Windows include files and libraries dnl Try to locate the X-Windows include files and libraries
dnl will set no_x="yes" or no_x=""
AC_PATH_X AC_PATH_X
dnl will set X_CFLAGS, X_LIBS, and might define X_DISPLAY_MISSING
AC_PATH_XTRA AC_PATH_XTRA
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
@ -586,10 +585,8 @@ dnl for MacOSX or Linux, but
dnl -lXaw -lXmu -lXt -lXext -lX11 dnl -lXaw -lXmu -lXt -lXext -lX11
dnl seems to be the popular choice. dnl seems to be the popular choice.
dnl (The previous order was -lX11 -lXt -lXext -lXmu -lXaw) dnl (The previous order was -lX11 -lXt -lXext -lXmu -lXaw)
if test "x$enable_x" = "xno"; then
no_x = "no" if test "x$no_x" != "xyes" ; then
fi
if test ! "$no_x" = "yes" ; then
AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw library),$X_LIBS $X_EXTRA_LIBS) AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw library),$X_LIBS $X_EXTRA_LIBS)
AC_CHECK_LIB(Xmu,main,X_LIBS="$X_LIBS -lXmu",AC_MSG_ERROR(Couldn't find Xmu library), $X_LIBS $X_EXTRA_LIBS) AC_CHECK_LIB(Xmu,main,X_LIBS="$X_LIBS -lXmu",AC_MSG_ERROR(Couldn't find Xmu library), $X_LIBS $X_EXTRA_LIBS)
X_LIBS="$X_LIBS -lXt" X_LIBS="$X_LIBS -lXt"

View File

@ -171,7 +171,7 @@ DevInit(void)
/* console application under MS Windows */ /* console application under MS Windows */
#if !defined(HAS_WINDOWS) && !defined(TCL_MODULE) && (defined(_MSC_VER) || defined(__MINGW32__)) #if !defined(HAS_WINDOWS) && !defined(TCL_MODULE) && (defined(_MSC_VER) || defined(__MINGW32__))
fprintf(cp_err, "Warning: no graphics interface!\n You may use command 'gnuplot'\n if GnuPlot is installed.\n"); fprintf(cp_err, "Warning: no graphics interface!\n You may use command 'gnuplot'\n if GnuPlot is installed.\n");
#else #elif !defined(X_DISPLAY_MISSING)
externalerror( externalerror(
"no graphics interface;\n please check if X-server is running,\n or ngspice is compiled properly (see INSTALL)"); "no graphics interface;\n please check if X-server is running,\n or ngspice is compiled properly (see INSTALL)");
#endif #endif