conditional compilation of getopt*.c

This commit is contained in:
Francesco Lannutti 2012-11-17 12:24:20 +01:00 committed by rlar
parent d74150ff44
commit 26715e7738
2 changed files with 7 additions and 10 deletions

View File

@ -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])

View File

@ -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