diff --git a/configure.ac b/configure.ac index 66ca5a625..bbe597b2e 100644 --- a/configure.ac +++ b/configure.ac @@ -707,14 +707,11 @@ AC_CHECK_FUNCS([dirname], [], [AC_DEFINE([HAVE_DIRNAME], [1], [Have dirname in libgen]) LIBS="$LIBS -lgen"])]) -AC_CHECK_HEADERS([getopt.h], [getopt_h=true]) -AM_CONDITIONAL([HAVE_GETOPT_H_WANTED], [test "x$getopt_h" = xtrue]) +AC_CHECK_HEADERS([getopt.h]) +AM_CONDITIONAL([HAVE_GETOPT_H], [test "x$ac_cv_header_getopt_h" = xyes]) -AC_CHECK_FUNC([getopt_long], [getopt_long=true]) -if test "x$getopt_long" = xtrue; then - AC_DEFINE([HAVE_GETOPT_LONG], [1], [Have fcn getopt_long()]) -fi -AM_CONDITIONAL([HAVE_GETOPT_LONG_WANTED], [test "x$getopt_long" = xtrue]) +AC_CHECK_FUNC([getopt_long], [AC_DEFINE([HAVE_GETOPT_LONG], [1], [Have fcn getopt_long()])]) +AM_CONDITIONAL([HAVE_GETOPT_LONG], [test "x$ac_cv_func_getopt_long" = xyes]) AC_DEFINE_UNQUOTED([NGSPICEBINDIR], ["`echo $dprefix/bin`"], [Define the directory for executables]) AC_DEFINE_UNQUOTED([NGSPICEDATADIR], ["`echo $dprefix/share/ngspice`"], [Define the directory for architecture independent data files]) diff --git a/src/misc/Makefile.am b/src/misc/Makefile.am index f474b8494..79e2c9523 100644 --- a/src/misc/Makefile.am +++ b/src/misc/Makefile.am @@ -27,14 +27,14 @@ libmisc_la_SOURCES = \ ### getopt_long_bsd.c ### -if !HAVE_GETOPT_H_WANTED -if !HAVE_GETOPT_LONG_WANTED +if !HAVE_GETOPT_H +if !HAVE_GETOPT_LONG libmisc_la_SOURCES += getopt_long_bsd.c getopt_bsd.h else libmisc_la_SOURCES += getopt_long_bsd.c getopt_bsd.h endif else -if !HAVE_GETOPT_LONG_WANTED +if !HAVE_GETOPT_LONG libmisc_la_SOURCES += getopt_long_bsd.c getopt_bsd.h endif endif