modification for sun compiler

This commit is contained in:
dwarning 2010-10-06 20:06:05 +00:00
parent 28622b5a75
commit 0d2b618f31
7 changed files with 59 additions and 49 deletions

View File

@ -1,3 +1,9 @@
2010-10-05 Dietmar Warning
* configure.ac: enabling openMP under SunStudio compiler
* terminal.c, ivars.c, ifnewuid.c, inperror.c, main.c:
asprintf definition also for sun compiler - can not be concentrated in
ngspice.h because of libgen - libiberty conflict
============================ Rework-22 ==================================
2010-10-04 Holger Vogt
* miscoms.c: remove bug no. 3080398

View File

@ -182,7 +182,7 @@ AC_ARG_WITH(editline,
dnl --with-tcl: define TCL_MODULE in the code. This is for tcl support
AC_ARG_WITH(tcl,
[ --with-tcl[=tcldir] Compiles the tcl module instead, experimental, see README.Tcl])
[ --with-tcl[=tcldir] Compiles the tcl module instead, experimental, see README.Tcl])
dnl --enable-openmp: Use OpenMP on multi-core processors
AC_ARG_ENABLE(openmp,
@ -244,7 +244,7 @@ if test "$enable_gprof" = "yes"; then
CFLAGS="$CFLAGS -pg"
LDFLAGS="$LDFLAGS -pg"
else
AC_MSG_ERROR(We only support --enable-gprof with GCC right now.)
AC_MSG_ERROR(We only support --enable-gprof with GCC right now.)
fi
fi
@ -940,9 +940,9 @@ if test "$enable_adms" = "yes"; then
AC_CHECK_PROGS(ADMSXML, admsXml admsXml.exe,no)
if test "$ADMSXML" = "no"; then
AC_MSG_ERROR(If you want adms models you should install admsXml)
AC_MSG_ERROR(If you want Verilog-A models you should install admsXml)
fi
AC_DEFINE(ADMS,[1],[Support for Verilog-A(MS) models])
AC_DEFINE(ADMS,[1],[Support for Verilog-A models])
VLADEVDIR=" adms/ekv \
adms/hicum0 \
@ -1056,8 +1056,12 @@ dnl test for header
AC_CHECK_HEADERS([omp.h],
[AC_DEFINE(USE_OMP,[1],[OpenMP parallel processing])],
[AC_MSG_ERROR(Couldn't find OpenMP headers.)])
CFLAGS="$CFLAGS -fopenmp"
dnl test if function is o.k.
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -fopenmp"
else
CFLAGS="$CFLAGS -xopenmp"
fi
dnl test if timing function is o.k.
AC_CHECK_FUNC(omp_get_wtime, [AC_MSG_RESULT(OpenMP features enabled)],
[AC_MSG_ERROR(OpenMP not working correctly.)])
fi
@ -1067,7 +1071,7 @@ dnl ------------
AC_CONFIG_FILES([Makefile
man/Makefile
man/man1/Makefile
man/man1/Makefile
src/Makefile
src/spinit
src/tclspinit

View File

@ -14,6 +14,17 @@ $Id$
#include <stdarg.h>
#ifdef HAVE_ASPRINTF
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);
#endif
#endif
#ifdef HAVE_SGTTY_H
#include <sgtty.h>
#endif
@ -22,17 +33,6 @@ $Id$
#include <sys/ioctl.h>
#endif
#ifdef HAVE_ASPRINTF
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__)/* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);
#endif
#endif
#if 0
/* Bad interaction with bool type in bool.h because curses also
defines this symbol. */

View File

@ -10,20 +10,20 @@
#include "ngspice.h"
#include <setjmp.h>
#include <signal.h>
#ifdef HAVE_ASPRINTF
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__)/* we have asprintf, but not libiberty.h */
#elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);
#endif
#endif
#include <setjmp.h>
#include <signal.h>
/* MINGW: random, srandom in libiberty.a, but not in libiberty.h */
#if defined(__MINGW32__) && defined(HAVE_RANDOM)
extern long int random (void);
@ -648,7 +648,7 @@ read_initialisation_file(char * dir, char * name)
{
#ifndef HAVE_UNISTD_H
FILE * fp = NULL;
#endif /* not HAVE_ASPRINTF */
#endif /* not HAVE_UNISTD_H */
char * path;
bool result = FALSE;

View File

@ -9,7 +9,7 @@ Copyright 1991 Regents of the University of California. All rights reserved.
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__)/* we have asprintf, but not libiberty.h */
#elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);

View File

@ -9,7 +9,7 @@ Author: 1988 Thomas L. Quarles
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__)/* we have asprintf, but not libiberty.h */
#elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);

View File

@ -13,7 +13,7 @@ Author: 1985 Thomas L. Quarles
#ifdef HAVE_LIBIBERTY_H /* asprintf */
#include <libiberty.h>
#undef AND /* obsolete macro in ansidecl.h */
#elif defined(__MINGW32__)/* we have asprintf, but not libiberty.h */
#elif defined(__MINGW32__) || defined(__SUNPRO_C) /* we have asprintf, but not libiberty.h */
#include <stdarg.h>
extern int asprintf(char **out, const char *fmt, ...);
extern int vasprintf(char **out, const char *fmt, va_list ap);