1# configure.ac script for ngspice 2# 3# This file is part of ngspice. 4# 5# (Process this file with autoconf to produce a configure script.) 6# 7# This configure file has been updated to mostly follow the guidance in the 8# GNU Autoconf manual for version 2.59 9 10 11# Initialization 12# --------------- 13 14# Ensure a recent version of Autoconf is in use 15# Older versions may not work with this script and this will report the 16# problem to the user. 17AC_PREREQ([2.59]) 18 19m4_define([ngspice_major_version], [35]) 20m4_define([ngspice_minor_version], [0]) 21m4_define([ngspice_version], 22 [ngspice_major_version]) 23 24# Initialization of configure 25AC_INIT([ngspice], [ngspice_version], [http://ngspice.sourceforge.net/bugrep.html]) 26 27# Revision stamp the generated ./configure script 28AC_REVISION([$Revision: ngspice_version$]) 29 30# Unique file in the source directory 31AC_CONFIG_SRCDIR([src/ngspice.c]) 32 33# Create a configuration header 34AC_CONFIG_HEADER([src/include/ngspice/config.h]) 35 36# Initialize automake stuff 37AM_INIT_AUTOMAKE([-Wall -Werror nostdinc serial-tests]) 38m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 39 40ext_CFLAGS="${CFLAGS+yes}" 41 42AC_PROG_CC 43AC_PROG_CXX 44AX_PROG_CC_FOR_BUILD 45 46m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 47 48AC_SUBST([AM_CPPFLAGS], ['-I. -I$(srcdir) -I$(top_builddir)/src/include']) 49 50AC_CONFIG_MACRO_DIR([m4]) 51 52# Enable the automatically build of shared and static libraries 53LT_INIT([shared static]) 54 55# Setting the libtool versioning 56################################################################################### 57# # 58# To set the version of the library, libtool provides the -version-info # 59# parameter, which accepts three numbers, separated by colons, that are called # 60# respectively, current, revision and age. Both their name and their behavior, # 61# nowadays, have to be considered fully arbitrary, as the explanation provided # 62# in the official documentation is confusing to say the least, and can be, in # 63# some cases, considered completely wrong. # 64# https://autotools.io/libtool/version.html # 65# # 66################################################################################### 67# 68# How to work with the libtool versioning? 69# 70# Follow the following steps from top to bottom. This means always start at point 1 71# if you plan to make a release and change the values. 72# Every new library starts with a version 'current' (short 'c') = 0 73# 'revision' (short 'r') = 0 74# 'age' (short 'a') = 0 75# 76# Update the libtool versioning only after the release of a public release of ngspice. 77# Go through the following checklist from top to bottom and check your needs, following 78# the reminded changes if you can say "Yes" for specific check. 79# 80# 1. Only existing code has changed, no functional changes. 81# If the library source code has changed but *no* new symbols were added at all 82# since the last update, then increment the revision (c:r:a becomes c:r+1:a). 83# This is usually happen if the existing source of a function was changed for 84# bug fixing e.g. 85# 86# --> Increase the 'LT_NGSPICE_REVISION' value with *every* new software release 87# within one release cycle. 88# 89# 2. Interfaces were added, functions have changed or are removed. 90# If any interfaces [exported functions or data] have been added, got internal 91# changes that implies a different behavior or removed and by this the visible 92# symbols have changed since the last update, increment current, and set the 93# revision to 0 (c:r:a becomes c+1:r=0:a). 94# The new modified behavior of the library isn't backward compatible! 95# 96# --> Increase the 'LT_NGSPICE_CURRENT' value whenever as an interface has been added 97# or removed. This implies also a API change! You mostly have to change the 98# 'ngspice_major_version'! 99# --> Set 'LT_NGSPICE_REVISION' to 0. 100# 101# 3. Interfaces were added but none removed or changed. 102# If any interfaces have been added since the last public release and non of the 103# existing interfaces were removed and existing interfaces have not changed internal 104# functionality then the new library is backward compatible. Existing binaries can 105# use the new library the same way than as the existing old library without loosing 106# existing functionality or breakage. 107# Increase age by 1 (c:r:a becomes c:r:a+1). 108# 109# --> Increase the 'LT_NGSPICE_AGE' value only if the changes made to the ABI are 110# backward compatible. 111# 112# 4. Interfaces were removed or have functional changes. 113# If any interfaces within the library have been removed since the last public 114# release or got some internal changes that let the interface act different than 115# before, then set age to 0. The library isn't backwards compatible. 116# 117# --> Set 'LT_NGSPICE_AGE' to 0. 118 119LT_NGSPICE_CURRENT=0 120LT_NGSPICE_REVISION=1 121LT_NGSPICE_AGE=0 122LIBNGSPICE_SO_VERSION=$LT_NGSPICE_CURRENT.$LT_NGSPICE_REVISION.$LT_NGSPICE_AGE 123 124# Announce the libtool version 125AC_SUBST(LT_NGSPICE_CURRENT) 126AC_SUBST(LT_NGSPICE_REVISION) 127AC_SUBST(LT_NGSPICE_AGE) 128AC_SUBST(LIBNGSPICE_SO_VERSION) 129 130# Defining the API Version 131LIBNGSPICE_API_VERSION=0 132AC_SUBST(LIBNGSPICE_API_VERSION) 133 134# Package Options 135# --------------- 136 137# --disable-debug: remove -g and -Wall option to the compiler 138AC_ARG_ENABLE([debug], 139 [AS_HELP_STRING([--disable-debug], [Remove -g option for compilation (default is -g)])]) 140 141 # --enable-oldapps: define OLDAPPS 142AC_ARG_ENABLE([oldapps], 143 [AS_HELP_STRING([--enable-oldapps], [Enable making old, outdated apps.])]) 144 145# --enable-xspice: define XSPICE in the code. This is for xspice support 146AC_ARG_ENABLE([xspice], 147 [AS_HELP_STRING([--enable-xspice], [Enable XSPICE enhancements])]) 148 149# --enable-cider: define CIDER in the code. This is for CIDER support 150AC_ARG_ENABLE([cider], 151 [AS_HELP_STRING([--enable-cider], [Enable CIDER enhancements])]) 152 153# --enable-adms: define ADMS in the code. This is for the adms Verilog-A compiler support 154AC_ARG_ENABLE([adms], 155 [AS_HELP_STRING([--enable-adms], [Enable ADMS code models, (experimental)])]) 156 157# --enable-pss: enable PSS Analysis 158AC_ARG_ENABLE([pss], 159 [AS_HELP_STRING([--enable-pss], [Enable PSS Analysis, (experimental)])]) 160 161# --enable-relpath: Relative path for binary and data. Default is "no". 162# ngspice shared may want relative paths for spinit etc. 163AC_ARG_ENABLE([relpath], 164 [AS_HELP_STRING([--enable-relpath], [Enable relative paths for spinit etc. Default=no])]) 165 166# --with-readline: Includes GNU readline support into CLI. Default is "no". 167AC_ARG_WITH([readline], 168 [AS_HELP_STRING([--with-readline[=yes/no]], [Enable GNU readline support for CLI. Default=no.])]) 169 170# --with-editline: Includes BSD Editline support into CLI. Default is "no". 171AC_ARG_WITH([editline], 172 [AS_HELP_STRING([--with-editline[=yes/no]], [Enable BSD editline support for CLI. Default=no.])]) 173 174# --with-tcl: define TCL_MODULE in the code. This is for tcl support 175AC_ARG_WITH([tcl], 176 [AS_HELP_STRING([--with-tcl=tcldir], [Compiles the tcl module instead, experimental, see README.tcl])]) 177 178# --with-ngshared: define SHARED_MODULE in the code. This is for ngspice as shared library (or dll) 179AC_ARG_WITH([ngshared], 180 [AS_HELP_STRING([--with-ngshared], [Compiles ngspice as shared library (dll)])]) 181 182# --disable-utf8: don't use utf-8 and tchar for string representation, UNICODE support disabled 183AC_ARG_ENABLE([utf8], 184 [AS_HELP_STRING([--disable-utf8], [Don't use utf-8 or tchar (default is UNICODE support with utf-8)])]) 185 186# old options, not maintained, may even not work at all 187 188# --enable-ansi: try to force --ansi option to the compiler 189AC_ARG_ENABLE([ansi], 190 [AS_HELP_STRING([--enable-ansi], [Force --ansi option for compilation])]) 191 192# --enable-gprof: add -pg option to the compiler (GCC) 193AC_ARG_ENABLE([gprof], 194 [AS_HELP_STRING([--enable-gprof], [Produce gprof profiling data in 'gmon.out' (GCC only).])]) 195 196# --enable-nobypass: define NOBYPASS for the code 197AC_ARG_ENABLE([nobypass], 198 [AS_HELP_STRING([--enable-nobypass], [Don't bypass recalculations of slowly changing variables])]) 199 200# --enable-capbypass: define CAPBYPASS for the code 201AC_ARG_ENABLE([capbypass], 202 [AS_HELP_STRING([--enable-capbypass], [Bypass calculation of cbd/cbs in the mosfets if the vbs/vbd voltages are unchanged])]) 203 204# --enable-nodelimiting: define NODELIMITING for the code 205AC_ARG_ENABLE([nodelimiting], 206 [AS_HELP_STRING([--enable-nodelimiting], [Experimental damping scheme.])]) 207 208# --enable-predictor: define PREDICTOR for the code 209AC_ARG_ENABLE([predictor], 210 [AS_HELP_STRING([--enable-predictor], [Enable a predictor method for convergence.])]) 211 212# --enable-newpred: define NEWPRED for the code 213AC_ARG_ENABLE([newpred], 214 [AS_HELP_STRING([--enable-newpred], [Enable NEWPRED whatever it is(?)])]) 215 216# --enable-newtrunc: define NEWTRUNC for the code 217AC_ARG_ENABLE([newtrunc], 218 [AS_HELP_STRING([--enable-newtrunc], [Enable, how we want extrapolate capacitances.])]) 219 220# --enable-sense2: define WANT_SENSE2 for the code 221AC_ARG_ENABLE([sense2], 222 [AS_HELP_STRING([--enable-sense2], [Use spice2 sensitivity analysis.])]) 223 224# --enable-ftedebug: enable frontend debug macros 225AC_ARG_ENABLE([ftedebug], 226 [AS_HELP_STRING([--enable-ftedebug], [Enable ngspice frontend debug])]) 227 228# --enable-cpdebug: enable frontend debug macros 229AC_ARG_ENABLE([cpdebug], 230 [AS_HELP_STRING([--enable-cpdebug], [Enable ngspice shell debug])]) 231 232# --enable-sensdebug: define SENSDEBUG for the code 233AC_ARG_ENABLE([sensdebug], 234 [AS_HELP_STRING([--enable-sensdebug], [Debug sensitivity code *SENSDEBUG*])]) 235 236# --enable-asdebug: define ASDEBUG for the code 237AC_ARG_ENABLE([asdebug], 238 [AS_HELP_STRING([--enable-asdebug], [Debug sensitivity code *ASDEBUG*])]) 239 240# --enable-stepdebug: define STEPDEBUG for the code 241AC_ARG_ENABLE([stepdebug], 242 [AS_HELP_STRING([--enable-stepdebug], [Unknown debug option])]) 243 244# --enable-pzdebug: define PZDEBUG for the code 245AC_ARG_ENABLE([pzdebug], 246 [AS_HELP_STRING([--enable-pzdebug], [Debug pole/zero code])]) 247 248# --enable-blktmsdebug: define D_DBG_BLOCKTIMES for the code 249AC_ARG_ENABLE([blktmsdebug], 250 [AS_HELP_STRING([--enable-blktmsdebug], [Debug distortion code *BLOCKTIMES*])]) 251 252# --enable-smltmsdebug: define D_DBG_SMALLTIMES for the code 253AC_ARG_ENABLE([smltmsdebug], 254 [AS_HELP_STRING([--enable-smltmsdebug], [Debug distortion code *SMALLTIMES*])]) 255 256# --enable-smoketest: a smoketest 257AC_ARG_ENABLE([smoketest], 258 [AS_HELP_STRING([--enable-smoketest], [Enable smoketest compile])]) 259 260# --enable-experimental: define EXPERIMENTAL_CODE for the code 261AC_ARG_ENABLE([experimental], 262 [AS_HELP_STRING([--enable-experimental], [Enable some experimental code])]) 263 264# --enable-expdevices: Enable the compilation of experimental devices 265AC_ARG_ENABLE([expdevices], 266 [AS_HELP_STRING([--enable-expdevices], [Enable experimental devices (they do not compile)])]) 267 268# --enable-ndev: define NDEV in the code. An interface for external device i.e. numerical device 269AC_ARG_ENABLE([ndev], 270 [AS_HELP_STRING([--enable-ndev], [Enable NDEV interface, (experimental)])]) 271 272# --enable-cluster: define CLUSTER in the code. This is for cluster support 273AC_ARG_ENABLE([cluster], 274 [AS_HELP_STRING([--enable-cluster], [Enable cluster support, (experimental)])]) 275 276# --enable-cmathtests: run the ancient tests in src/math/cmaths 277AC_ARG_ENABLE([cmathtests], 278 [AS_HELP_STRING([--enable-cmathtests], [Enable ancient tests in src/math/cmaths])]) 279 280# --enable-help: try to force --ansi option to the compiler 281AC_ARG_ENABLE([help], 282 [AS_HELP_STRING([--enable-help], [Force building nghelp (deprecated)])]) 283 284# --with-fftw3: Use fftw3 for Fourier transforms. Default is "yes". 285AC_ARG_WITH([fftw3], 286 [AS_HELP_STRING([--with-fftw3[=yes/no]], [Use fftw3 for Fourier transforms. Default=yes.])]) 287 288# readline and editline cannot both be enabled 289if test "x$with_editline" = xyes; then 290 if test "x$with_readline" = xyes; then 291 AC_MSG_ERROR([Readline and editline cannot both be enabled]) 292 fi 293fi 294 295 296# Enable maintainer commands only if requested 297AM_MAINTAINER_MODE([enable]) 298 299 300# Compiler checks 301# --------------- 302 303# Work on compiler options according to system: 304# Set default CFLAGS - only use -Wall if we have gcc 305 306# the above AC_PROG_CC may set CFLAGS to "-O2 -g" 307if test "x$ext_CFLAGS" != xyes; then 308 309 if test "x$enable_debug" = xno; then 310 AC_MSG_WARN([Removing debugging option!]) 311 if test "x$GCC" = xyes; then 312 CFLAGS="-O2 -s" 313 else 314 CFLAGS="-O2" 315 fi 316 else 317 AC_DEFINE([NGDEBUG], [1], [Compile with debug info]) 318 if test "x$GCC" = xyes; then 319 CFLAGS="-g -O0" 320 else 321 CFLAGS="-g" 322 fi 323 fi 324 325 if test "x$GCC" = xyes; then 326 CFLAGS="$CFLAGS -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -Wno-unused-but-set-variable" 327 fi 328 329fi 330 331# the profiling option 332if test "x$enable_gprof" = xyes; then 333 # Probably other compilers support -pg or something similar; 334 # feel free to extend this to include them. 335 if test "x$GCC" = xyes; then 336 if test "x$enable_shared" = xyes ; then 337 AC_MSG_ERROR([Can't have --enable-gprof without --disable-shared (we recommend also using --enable-all-static).]) 338 fi 339 if test "x$enable_static" != xyes ; then 340 AC_MSG_WARN([We recommend --enable-static with --enable-gprof.]) 341 fi 342 AC_MSG_NOTICE([Enabling gprof profiling data (to gmon.out).]) 343 CFLAGS="$CFLAGS -pg" 344 LDFLAGS="$LDFLAGS -pg" 345 else 346 AC_MSG_ERROR([We only support --enable-gprof with GCC right now.]) 347 fi 348fi 349 350# Checks for ANSI-C header files. 351AC_HEADER_STDC 352AC_CHECK_HEADERS([strings.h]) 353 354if test "x$enable_ansi" = xyes; then 355 AC_PROG_CC() 356 AC_DIAGNOSE([obsolete], [AM_PROG_CC_STDC: 357 your code should no longer depend upon `am_cv_prog_cc_stdc', but upon 358 `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when 359 you adjust the code. You can also remove the above call to 360 AC_PROG_CC if you already called it elsewhere.]) 361 am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc 362 363 if test "x$am_cv_prog_cc_stdc" != xyes ; then 364 AC_MSG_WARN([Failed to find Ansi flag!]) 365 fi 366fi 367 368if test "x$enable_smoketest" = xyes; then 369# CFLAGS="$CFLAGS -Werror" 370 CFLAGS="$CFLAGS -pedantic -W -Wmissing-prototypes" 371 CFLAGS="$CFLAGS -Wstrict-prototypes -Wtraditional" 372 CFLAGS="$CFLAGS -Wconversion -Wshadow -Wpointer-arith" 373 CFLAGS="$CFLAGS -Wcast-qual -Wcast-align -Wwrite-strings" 374 CFLAGS="$CFLAGS -Waggregate-return -fshort-enums -fno-common" 375 CFLAGS="$CFLAGS -Wnested-externs -Dinline= -g -O4" 376fi 377 378 379# Check system we're on , and tune accordingly 380AC_CANONICAL_HOST 381 382# Expand the prefix variable 383if test "x$prefix" = xNONE ; then 384# with the MS WINDOWS executable we suggest C:/Spice/bin as *.exe-path 385 if test "x$with_wingui" = xyes; then 386 dprefix="C:/Spice" 387 prefix=$dprefix 388 else 389 dprefix=$ac_default_prefix 390 fi 391else 392 dprefix=$prefix 393fi 394 395#### 396### check for operating system at compile time 397case $host_os in 398 *mingw* | *msys* ) 399 AC_DEFINE([OS_COMPILED], [1], [MINGW for MS Windows]) 400 ;; 401 *cygwin* ) 402 AC_DEFINE([OS_COMPILED], [2], [Cygwin for MS Windows]) 403 ;; 404 *freebsd* ) 405 AC_DEFINE([OS_COMPILED], [3], [FreeBSD]) 406 ;; 407 *openbsd* ) 408 AC_DEFINE([OS_COMPILED], [4], [OpenBSD]) 409 ;; 410 *solaris* ) 411 AC_DEFINE([OS_COMPILED], [5], [Solaris]) 412 ;; 413 *linux* ) 414 AC_DEFINE([OS_COMPILED], [6], [Linux]) 415 ;; 416 *darwin* ) 417 AC_DEFINE([OS_COMPILED], [7], [macOS]) 418 ;; 419 * ) 420 AC_DEFINE([OS_COMPILED], [0], [Other Operating System]) 421 ;; 422esac 423 424########################################################################## 425# 426# ngspice as shared library (ngspice.so or ngspice.dll) 427# 428########################################################################## 429 430if test "x$with_ngshared" != x && test "x$with_ngshared" != xno ; then 431 has_shared_module=true 432 AC_DEFINE([SHARED_MODULE], [1], [shared ngspice module]) 433 case $host_os in 434 *mingw* | *msys* ) 435 has_shwin=true 436 has_no_help=true 437 ;; 438 *cygwin* ) 439 has_shcyg=true 440 AC_CHECK_LIB([pthread], [pthread_create]) 441 ;; 442 *) 443 AC_CHECK_LIB([pthread], [pthread_create]) 444 ;; 445 esac 446 if test "x$enable_debug" = xno; then 447 case $host_os in 448 *solaris* ) 449 if test "x$GCC" = xyes; then 450 CFLAGS="$CFLAGS -fvisibility=hidden" 451 else 452 CFLAGS="$CFLAGS -xldscope=hidden" 453 fi 454 ;; 455 *mingw* | *msys* | *cygwin* ) 456 ;; 457 *) 458 CFLAGS="$CFLAGS -fvisibility=hidden" 459 ;; 460 esac 461 fi 462 463 with_x=no 464 with_windows=no 465 466 AC_SUBST([STATIC], [-shared]) 467 468 TCL_PACKAGE_PATH="" 469 TCL_LIB_SPEC="" 470 471 472########################################################################## 473# 474# tcl libraries test 475# 476########################################################################## 477 478# 479# The tclSpice options 480# 481elif test "x$with_tcl" != x && test "x$with_tcl" != xno ; then 482 has_tcl_module=true 483 AC_DEFINE([TCL_MODULE], [1], [Tcl Module]) 484 case $host_os in 485 *mingw* | *msys* ) 486 has_tclwin=true 487 has_no_help=true 488 AC_DEFINE([HAS_TCLWIN], [1], [Tcl Windows]) 489 ;; 490 *cygwin* ) 491 has_tclcyg=true 492 ;; 493 *) 494 ;; 495 esac 496 497 with_x=no 498 499 AC_MSG_CHECKING([for tclConfig.sh]) 500 tcl_config_sh="" 501 if test "x$with_tcl" != xyes ; then 502 for dir in \ 503 $with_tcl 504 do 505 if test -r "$dir/tclConfig.sh" ; then 506 tcl_config_sh="$dir/tclConfig.sh" 507 break 508 elif test -r "$dir/lib/tclConfig.sh" ; then 509 tcl_config_sh="$dir/lib/tclConfig.sh" 510 break 511 elif test -r "$dir/unix/tclConfig.sh" ; then 512 tcl_config_sh="$dir/unix/tclConfig.sh" 513 break 514 fi 515 done 516 else 517 for dir in \ 518 $prefix \ 519 $exec_prefix 520 do 521 if test -r "$dir/tclConfig.sh" ; then 522 tcl_config_sh="$dir/tclConfig.sh" 523 break 524 elif test -r "$dir/lib/tclConfig.sh" ; then 525 tcl_config_sh="$dir/lib/tclConfig.sh" 526 break 527 elif test -r "$dir/unix/tclConfig.sh" ; then 528 tcl_config_sh="$dir/unix/tclConfig.sh" 529 break 530 fi 531 done 532 533 534 if test "x$tcl_config_sh" = x ; then 535 for dir in \ 536 `ls -dr /usr/local/tcltk/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 537 `ls -dr /usr/local/tcl/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 538 `ls -dr /usr/local/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 539 `ls -dr /usr/share/tcltk/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 540 `ls -dr /usr/share/tcl/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 541 `ls -dr /usr/share/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 542 `ls -dr /usr/lib/tcl/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 543 `ls -dr /usr/lib/tcl[[7-9]].[[0-9]]* 2>/dev/null` \ 544 /usr/local/tcl \ 545 /usr/local \ 546 /usr \ 547 /mingw 548 do 549 if test -r "$dir/tclConfig.sh" ; then 550 echo "Automatic research of tclConfig.sh Found one, accepting it and stopping research." 551 tcl_config_sh="$dir/tclConfig.sh" 552 break 553 elif test -r "$dir/lib/tclConfig.sh" ; then 554 echo "Automatic research of tclConfig.sh Found one, accepting it and stopping research." 555 tcl_config_sh="$dir/lib/tclConfig.sh" 556 break 557 fi 558 done 559 fi 560 fi 561 562 AC_MSG_RESULT([${tcl_config_sh}]) 563 564 if test "x$tcl_config_sh" = x ; then 565 echo "can't find Tcl configuration script \"tclConfig.sh\"" 566 find /usr/ -name 'tclConfig.sh' -exec echo "Should you add --with-tcl={} to ./configure arguments?" \; | sed -re "s/\/tclConfig.sh/ /" 567 exit 1 568 fi 569 570 . $tcl_config_sh 571 572 CFLAGS="$CFLAGS $TCL_INCLUDE_SPEC" 573 CPPFLAGS="$CPPFLAGS $TCL_INCLUDE_SPEC" 574 575 AC_CHECK_HEADERS([tcl.h blt.h], [], [AC_MSG_ERROR([Couldn't find Tcl/BLT headers])]) 576 577 if test ! -x "$TCL_EXEC_PREFIX/bin/tclsh$TCL_VERSION" ; then 578 AC_MSG_ERROR([Couldn't find $TCL_EXEC_PREFIX/bin/tclsh$TCL_VERSION]) 579 fi 580 581 AC_MSG_CHECKING([for TCL module BLT]) 582 583 rm -f conftest.tcl 584 cat > conftest.tcl << EOF 585package require BLT; 586exit; 587EOF 588 589 if ($TCL_EXEC_PREFIX/bin/tclsh$TCL_VERSION conftest.tcl; exit) 2>/dev/null 590 then 591 AC_MSG_RESULT([Found]) 592 else 593 AC_MSG_ERROR([Couldn't find BLT]) 594 fi 595 rm -f conftest.tcl 596 597 AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25],, 598 [AC_MSG_ERROR([Couldnt find BLT library.])]) 599 600 AC_CHECK_LIB([pthread], [pthread_create]) 601 602 if test -n "$libdir" ; then 603 AC_SUBST([libdir]) 604 echo "libraries in $libdir" 605 fi 606 607 if test -z "$libdir" ; then 608 for TCL_PACKAGE_PATH_ELEMENT in $TCL_PACKAGE_PATH ; do 609 if test -a "$TCL_PACKAGE_PATH_ELEMENT" ; then 610 libdir=$TCL_PACKAGE_PATH_ELEMENT 611 AC_SUBST([libdir]) 612 echo "library in $libdir" 613 break 614 fi 615 done 616 fi 617 618 AC_SUBST([STATIC], [-shared]) 619 620else 621 TCL_PACKAGE_PATH="" 622 TCL_LIB_SPEC="" 623 AC_SUBST([STATIC], [-static]) 624fi 625 626 627AM_CONDITIONAL([SHARED_MODULE], [test "x$has_shared_module" = xtrue]) 628AM_CONDITIONAL([SHWIN], [test "x$has_shwin" = xtrue]) 629AM_CONDITIONAL([SHCYG], [test "x$has_shcyg" = xtrue]) 630AM_CONDITIONAL([TCL_MODULE], [test "x$has_tcl_module" = xtrue]) 631AM_CONDITIONAL([TCLWIN], [test "x$has_tclwin" = xtrue]) 632AM_CONDITIONAL([TCLCYG], [test "x$has_tclcyg" = xtrue]) 633 634AC_SUBST([TCL_PACKAGE_PATH]) 635AC_SUBST([TCL_LIB_SPEC]) 636################################################################## 637# 638# 639#End of tcl libraries test 640# 641################################################################# 642 643 644 645# Checks for programs 646AC_LIBTOOL_WIN32_DLL 647AC_LIBTOOL_DLOPEN 648AM_PROG_CC_C_O 649## AM_PROG_LIBTOOL 650AC_PROG_LIBTOOL 651 652 653# --with-windows : the user wants to use generate the MS WINDOWS GUI executable 654# old command version, deprecated, use --with-wingui 655AC_ARG_WITH([windows], 656 [AS_HELP_STRING([--with-windows], [MS WINDOWS GUI executable, deprecated])], 657 [if test "x$with_windows" = xyes; then 658 AC_DEFINE([HAS_WINGUI], [1], [define to specify MS Windows executable with simple GUI]) 659 fi], 660 [with_windows=no]) 661 662# --with-wingui : the user wants to use generate the MS WINDOWS GUI executable 663AC_MSG_CHECKING([whether windows code with gui is enabled]) 664AC_ARG_WITH([wingui], 665 [AS_HELP_STRING([--with-wingui], [MS WINDOWS GUI executable])], 666 [if test "x$with_wingui" = xyes; then 667 AC_DEFINE([HAS_WINGUI], [1], [define to specify MS Windows executable with simple GUI]) 668 fi], 669 [if test "x$with_windows" = xyes; then 670 with_wingui=yes 671 else 672 with_wingui=no 673 fi]) 674AC_MSG_RESULT([$with_wingui]) 675AM_CONDITIONAL([WINGUI], [test "x$with_wingui" = xyes]) 676 677case $host_os in 678 *mingw* | *msys* ) 679 has_win32=yes 680 if test "x$with_wingui" = xyes; then 681 has_winconsole=no 682 else 683 if test "x$with_ngshared" = xyes; then 684 has_winconsole=no 685 else 686 has_winconsole=yes 687 fi 688 fi 689 ;; 690 *cygwin* ) 691 has_cyg=yes 692 ;; 693 *) 694 has_win32=no 695 has_cyg=no 696 ;; 697esac 698AM_CONDITIONAL([WINCONSOLE], [test "x$has_winconsole" = xyes]) 699 700if test "x$has_winconsole" = xyes; then 701 AC_CHECK_PROGS([WINRES], [windres windres.exe], [no]) 702 if test "x$WINRES" = xno; then 703 AC_MSG_WARN([If you want adding the icon you should install windres]) 704 fi 705fi 706 707if test "x$with_wingui" = xyes; then 708 AC_CHECK_PROGS([WINRES], [windres windres.exe], [no]) 709 if test "x$WINRES" = xno; then 710 AC_MSG_WARN([If you want adding the icon you should install windres]) 711 fi 712fi 713 714AM_CONDITIONAL([WINRESOURCE], [test "x$WINRES" = xwindres]) 715 716case $with_wingui in 717 yes ) 718 AC_DEFINE([X_DISPLAY_MISSING]) 719 AC_MSG_RESULT([No X display!]) 720 has_no_x=true 721 if test "x$enable_help" = xyes; then 722 has_no_help=false 723 else 724 has_no_help=true 725 fi 726 CFLAGS="$CFLAGS -mwindows" 727 ;; 728 * ) 729 730# Check for /proc (virtual process information file system) 731AC_CHECK_HEADERS([/proc/meminfo]) 732 733# Checks for X11 header files and libraries - X11 support can be disabled 734# by passing the '--without-x' option to configure: 735 736# Try to locate the X-Windows include files and libraries 737# will set no_x="yes" or no_x="" 738AC_PATH_X 739 740# will set X_CFLAGS, X_LIBS, and might define X_DISPLAY_MISSING 741AC_PATH_XTRA 742 743# Checks for typedefs, structures, and compiler characteristics. 744AC_HEADER_STDBOOL 745AC_TYPE_SIZE_T 746 747# Checks for library functions. 748AC_FUNC_CLOSEDIR_VOID 749AC_FUNC_SELECT_ARGTYPES 750AC_FUNC_SETVBUF_REVERSED 751AC_FUNC_VPRINTF 752 753# Check if the user wants to use the appropriate rpath commands to compile in 754# the shared library path for the X libraries. This is off by default since 755# that is how it has been historically. Using --enable-rpath will turn this on 756 757_use_rpath=no 758AC_MSG_CHECKING([if hard-coding of the X11 runtime library path is desired]) 759AC_ARG_ENABLE([rpath], 760 [AS_HELP_STRING([--enable-rpath], [Enable hard-coding the X11 runtime library path])], 761 [ if test "x$enable_rpath" = xno ; then 762 AC_MSG_RESULT([no]) 763 _use_rpath=no 764 else 765 AC_MSG_RESULT([yes]) 766 _use_rpath=yes 767 fi 768 ], 769 [ AC_MSG_RESULT([no]) 770 _use_rpath=no 771 ] 772) 773 774 775if test "x$_use_rpath" = xyes ; then 776 # Try to figure out if we need -Rpath for finding X11 libs 777 # at runtime. Why autoconf doesn't already do this, I don't 778 # know... 779 xlib_path="" 780 for p in $X_LDFLAGS ; do 781 case $p in 782 -L*) 783 xlib_path="$xlib_path $p" 784 ;; 785 esac 786 done 787 788 _save_LIBS=$LIBS 789 LIBS="$LIBS $X_LDFLAGS" 790 rpath="" 791 for fl in "-Wl,-rpath " "-Wl,--rpath " "-rpath " "--rpath " "-Wl,-R" "-R" "-R " ; do 792 xlib_rpath=`echo $xlib_path | sed "s/-L/$fl/g"` 793 LIBS="$_save_LIBS $X_LIBS $xlib_rpath" 794 AC_MSG_CHECKING([if the compiler accepts ${fl}path for runtime libraries]) 795 AC_LINK_IFELSE([AC_LANG_PROGRAM()], 796 [AC_MSG_RESULT([yes]) 797 rpath=$fl], 798 [AC_MSG_RESULT([no])]) 799 test -n "$rpath" && break 800 done 801 if test -n "$rpath"; then 802 X_LDFLAGS="$X_LDFLAGS $xlib_rpath" 803 fi 804 LIBS=$_save_LIBS 805fi 806 807# Checks for X libraries - if X11 wasn't found then don't make following 808# tests and compile without X11 support - otherwise, check if the following 809# libraries are present (error if they are not) 810# XShmAttach is a struct in CYGWIN, not a function 811# Library order is 812# -lXaw -lXmu -lXt -lXext -lX11 (-lXft -lfontconfig -lXrender -lfreetype) 813# Xft is optional, allows text rotation in plots 814 815if test "x$no_x" != xyes ; then 816 AC_CHECK_LIB([Xaw], [main], [X_LIBS="$X_LIBS -lXaw"], 817 [AC_MSG_ERROR([Couldn't find Xaw library])], [$X_LIBS $X_EXTRA_LIBS]) 818 AC_CHECK_LIB([Xmu], [main], [X_LIBS="$X_LIBS -lXmu"], 819 [AC_MSG_ERROR([Couldn't find Xmu library])], [$X_LIBS $X_EXTRA_LIBS]) 820 X_LIBS="$X_LIBS -lXt" 821 AC_CHECK_LIB([Xext], [XShmAttach], [X_LIBS="$X_LIBS -lXext"], 822 [AC_MSG_ERROR([Couldn't find Xext library])], [$X_LIBS $X_EXTRA_LIBS]) 823 X_LIBS="$X_LIBS -lX11" 824 PKG_CHECK_MODULES([XFT], [xft], [X_CFLAGS="$X_CFLAGS $XFT_CFLAGS"; X_LIBS="$X_LIBS $XFT_LIBS"], 825 [AC_MSG_ERROR([Couldn't find freetype library])]) 826 has_no_x=false 827else 828 AC_DEFINE([X_DISPLAY_MISSING]) 829 AC_MSG_RESULT([No X display!]) 830 has_no_x=true 831fi 832 833if test "x$enable_help" = xyes && test "x$no_x" != xyes ; then 834 has_no_help=false 835else 836 has_no_help=true 837fi ;; 838 839esac 840# end of case --with-windows 841 842AM_CONDITIONAL([NO_X], [test "x$has_no_x" = xtrue]) 843AM_CONDITIONAL([NO_HELP], [test "x$has_no_help" = xtrue]) 844 845# Additional libs of hicum group 846AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lstdc++",,) 847AC_SUBST(XTRALIBS, $XTRALIBS) 848 849LIBS="$LIBS $XTRALIBS" 850 851# enabling making of the old and outdated applications 852# ngsconvert ngproc2mod ngmultidec ngmakeidx nghelp 853if test "x$enable_oldapps" = xyes ; then 854 AC_MSG_RESULT([ngnutmeg ngsconvert ngproc2mod ngmultidec ngmakeidx nghelp are made.]) 855else 856 AC_MSG_RESULT([ngnutmeg ngsconvert ngproc2mod ngmultidec ngmakeidx nghelp are not made.]) 857 AC_MSG_RESULT([No internal help available.]) 858 AC_DEFINE([NOINTHELP], [1], [Internal (old) help not available]) 859fi 860AM_CONDITIONAL([OLDAPPS], [test "x$enable_oldapps" = xyes]) 861 862 863# Check for a few typdefs: 864AC_TYPE_PID_T 865AC_TYPE_SIGNAL 866 867# sighandler_t is the type of the signal handler on GNU variants, 868# sig_t is the type of a signal handler on 4.4BSD's, 869# other systems use __sighandler_t. 870AC_CHECK_TYPES([sighandler_t, sig_t, __sighandler_t], [], [], 871 [#include <sys/types.h> 872 #include <signal.h>]) 873 874# Check for a few libraries and headers: 875AC_HEADER_DIRENT 876AC_CHECK_HEADERS([unistd.h ctype.h pwd.h fcntl.h sys/ioctl.h stropts.h]) 877AC_HEADER_SYS_WAIT 878AC_HEADER_STAT 879 880AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h stddef.h sys/file.h sys/param.h sys/socket.h sys/time.h sys/timeb.h sys/io.h]) 881 882 883# Check time and resources headers and functions: 884AC_HEADER_TIME 885AC_STRUCT_TM 886AC_STRUCT_TIMEZONE 887AC_CHECK_FUNCS([localtime]) 888 889AC_CHECK_FUNCS([ftime gettimeofday]) 890# Do not use time or getrusage function for CPU time measurement under OpenMP 891if test "x$enable_openmp" != xyes; then 892 AC_CHECK_FUNCS([time getrusage]) 893fi 894AC_CHECK_FUNCS([utimes]) 895AC_CHECK_FUNCS([getrlimit ulimit], [break]) 896 897AC_CHECK_FUNCS([endpwent gethostbyname memset select socket strdup strerror strncasecmp strstr strtol]) 898 899# Look for termios first (posix) 900AC_CHECK_HEADERS([termios.h termio.h sgtty.h], [break]) 901AC_CHECK_FUNCS([isatty tcgetattr tcsetattr]) 902 903# Check for a few functions: 904AC_FUNC_FORK([]) 905AC_CHECK_FUNCS([access qsort dup2 popen tsearch tdestroy]) 906AC_CHECK_FUNCS([strchr index], [break]) 907AC_CHECK_FUNCS([strrchr rindex], [break]) 908AC_CHECK_FUNCS([getcwd getwd], [break]) 909 910 911AC_MSG_RESULT([Checking mathematical features of the system:]) 912# Look for math library: 913AC_CHECK_LIB([m], [sqrt]) 914AC_CHECK_HEADERS([float.h limits.h values.h ieeefp.h]) 915if test "x$with_fftw3" != xno; then 916 AC_CHECK_HEADERS([fftw3.h]) 917 AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], 918 [AC_DEFINE([HAVE_LIBFFTW3], [], [Have fft routines in libfftw3]) 919 LIBS="$LIBS -lfftw3"]) 920fi 921 922# Check for a few mathematical functions: 923AC_CHECK_FUNCS([erfc logb scalb scalbn asinh acosh atanh finite]) 924# According POSIX we should look for macros first 925AC_CHECK_DECLS([isinf], [], [], [[#include <math.h>]]) 926AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]]) 927# But may be we have still functions 928if test "x$ac_cv_have_decl_isinf" != xyes; then 929 AC_CHECK_FUNC([isinf]) 930fi 931if test "x$ac_cv_have_decl_isnan" != xyes; then 932 AC_CHECK_FUNC([isnan]) 933fi 934 935# If user enables garbage collection, look for garbage collector 936if test "x$TCL_PACKAGE_PATH" = x; then 937 if test "x$enable_gc" = xyes; then 938 AC_MSG_RESULT([Checking for the presence of the Garbage Collector:]) 939 AC_CHECK_LIB([gc], [GC_malloc], 940 [AC_DEFINE([HAVE_LIBGC], [], [Define if we want garbage collection enabled]) 941 LIBS="$LIBS -lgc"]) 942 fi 943fi 944# check, if we have sigsetjmp and siglongjmp. 945# A trivial AC_CHECK_FUNCS(sigsetjmp) won't do because sigsetjmp() might be a 946# macro declared in <setjmp.h>. (joze) 947AC_MSG_CHECKING([for sigsetjmp]) 948AC_TRY_LINK([#include <setjmp.h>],[jmp_buf env; sigsetjmp(env, 1);], 949 [AC_MSG_RESULT([yes]) 950 AC_DEFINE([HAVE_SIGSETJMP], [], [Define if we have sigsetjmp().])], 951 [AC_MSG_RESULT([no])]) 952 953 954# Check for the snprintf function: 955AC_CHECK_FUNCS([snprintf]) 956 957# Check for the dirname function: 958AC_CHECK_FUNCS([dirname], [], 959 [AC_CHECK_LIB([gen], [dirname], 960 [AC_DEFINE([HAVE_DIRNAME], [1], [Have dirname in libgen]) 961 LIBS="$LIBS -lgen"])]) 962 963AC_CHECK_HEADERS([getopt.h]) 964AC_CHECK_FUNC([getopt_long], [getopt_long=true]) 965if test "x$getopt_long" = xtrue; then 966 AC_DEFINE([HAVE_GETOPT_LONG], [1], [Have fcn getopt_long()]) 967fi 968 969AM_CONDITIONAL([RELPATH], [test "x$enable_relpath" = xyes]) 970if test "x$enable_relpath" = xyes; then 971 AC_DEFINE_UNQUOTED([NGSPICEBINDIR], ["`echo ../bin`"], [Define the directory for executables]) 972 AC_DEFINE_UNQUOTED([NGSPICEDATADIR], ["`echo ../share/ngspice`"], [Define the directory for architecture independent data files]) 973 AC_DEFINE([HAS_RELPATH], [1], [rel. path of libraries and scripts]) 974else 975AC_DEFINE_UNQUOTED([NGSPICEBINDIR], ["`echo $dprefix/bin`"], [Define the directory for executables]) 976AC_DEFINE_UNQUOTED([NGSPICEDATADIR], ["`echo $dprefix/share/ngspice`"], [Define the directory for architecture independent data files]) 977fi 978 979# Create timestamp, may be overruled by setting env var SOURCE_DATE_EPOCH 980case $host_os in 981 *freebsd* ) 982 DATE_FMT="%Y-%m-%d" 983 SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" 984 BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT") 985 ;; 986 *openbsd* ) 987 DATE_FMT="%Y-%m-%d" 988 SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" 989 BUILD_DATE=$(date -u -d "@$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "+$DATE_FMT" 2>/dev/null || date -u "+$DATE_FMT") 990 ;; 991 * ) 992 BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}")" 993 ;; 994esac 995 996AC_DEFINE_UNQUOTED([NGSPICEBUILDDATE], ["$BUILD_DATE"], [Define the build date]) 997 998if test "x$with_wingui" = xyes; then 999 AC_MSG_RESULT([WINDOWS GUI code enabled]) 1000 AC_CHECK_FUNCS([memmove]) 1001fi 1002 1003# Recapitulate settings: 1004AC_MSG_RESULT([Settings which were chosen:]) 1005 1006if test "x$enable_nobypass" = xyes; then 1007 AC_DEFINE([NOBYPASS], [], [Define if we want NOBYPASS]) 1008 AC_MSG_RESULT([NOBYPASS option enabled]) 1009fi 1010if test "x$enable_capbypass" = xyes; then 1011 AC_DEFINE([CAPBYPASS], [], [Define if we want to bypass cbd/cbs calculation for non varying vbs/vbd]) 1012 AC_MSG_RESULT([CAPBYPASS option enabled]) 1013fi 1014if test "x$enable_nodelimiting" = xyes; then 1015 AC_DEFINE([NODELIMITING], [], [Experimental code never implemented to damp Newton iterations]) 1016 AC_MSG_RESULT([NODELIMITING option enabled]) 1017fi 1018if test "x$enable_predictor" = xyes; then 1019 AC_DEFINE([PREDICTOR], [], [Define if we want predictor algorithm]) 1020 AC_MSG_RESULT([PREDICTOR algorithm enabled]) 1021fi 1022if test "x$enable_newpred" = xyes; then 1023 AC_DEFINE([NEWPRED], [], [Define if you want to discover :)]) 1024 AC_MSG_RESULT([NEWPRED enabled]) 1025fi 1026if test "x$enable_newtrunc" = xyes; then 1027 AC_DEFINE([NEWTRUNC], [], [Do not trigger unwanted traps by default]) 1028 AC_MSG_RESULT([New truncation error calculation enabled]) 1029fi 1030if test "x$enable_experimental" = xyes; then 1031 AC_DEFINE([EXPERIMENTAL_CODE], [], [Define if we want some experimental code]) 1032 AC_MSG_RESULT([EXPERIMENTAL_CODE enabled]) 1033fi 1034if test "x$enable_cpdebug" = xyes; then 1035 AC_DEFINE([CPDEBUG], [], [Define if you want to debug ngspice shell]) 1036 AC_MSG_RESULT([WARNING: Shell debug is enabled]) 1037fi 1038if test "x$enable_ftedebug" = xyes; then 1039 AC_DEFINE([FTEDEBUG], [], [Define if you want to debug frontend]) 1040 AC_MSG_RESULT([WARNING: Frontend debug is enabled]) 1041fi 1042if test "x$enable_sensdebug" = xyes; then 1043 AC_DEFINE([SENSDEBUG], [], [Define if we want debug sensitivity analysis]) 1044 AC_MSG_RESULT([WARNING: Sensitivity code debug *SENSDEBUG* is enabled]) 1045fi 1046if test "x$enable_asdebug" = xyes; then 1047 AC_DEFINE([ASDEBUG], [], [Define if we want debug sensitivity analysis]) 1048 AC_MSG_RESULT([WARNING: Sensitivity code debug *ASDEBUG* is enabled]) 1049fi 1050if test "x$enable_stepdebug" = xyes; then 1051 AC_DEFINE([STEPDEBUG], [], [Define if we want stepdebug]) 1052 AC_MSG_RESULT([WARNING: STEPDEBUG debug is enabled]) 1053fi 1054if test "x$enable_pzdebug" = xyes; then 1055 AC_DEFINE([PZDEBUG], [], [Define if you want to debug pole-zero analysis]) 1056 AC_MSG_RESULT([WARNING: Pole/Zero analysis debug is enabled]) 1057fi 1058if test "x$enable_pss" = xyes; then 1059 AC_DEFINE([WITH_PSS], [], [Define if you want PSS analysis]) 1060 AC_MSG_RESULT([WARNING: PSS analysis enabled]) 1061fi 1062if test "x$enable_blktmsdebug" = xyes; then 1063 AC_DEFINE([D_DBG_BLOCKTIMES], [], [Define if we want debug distortion analysis (BLOCKTIMES)]) 1064 AC_MSG_RESULT([WARNING: Distortion analysis debug *D_DBG_BLOCKTIMES* is enabled]) 1065fi 1066if test "x$enable_smltmsdebug" = xyes; then 1067 AC_DEFINE([D_DBG_SMALLTIMES], [], [Define if we want debug distortion analysis (SMALLTIMES)]) 1068 AC_MSG_RESULT([WARNING: Distortion analysis debug *D_DBG_SMALLTIMES* is enabled]) 1069fi 1070if test "x$enable_utf8" = xno; then 1071 AC_DEFINE([EXT_ASC], [], [Define if you want to disable UNICODE support]) 1072 AC_MSG_RESULT([WARNING: UNICOPDE support is disabled, extended ascii is enabled instead]) 1073fi 1074 1075AC_PROG_YACC 1076AC_PATH_PROG([BISON], [bison]) 1077AX_PROG_BISON_VERSION([2.7], [], 1078 [AC_DEFINE([OLD_BISON], [], [Bison is older than 2.7]), 1079 AC_MSG_WARN([Bison is older than 2.7])]) 1080AC_PROG_LEX 1081 1082AM_CONDITIONAL([CMATHTESTS], [test "x$enable_cmathtests" = xyes]) 1083 1084################# XSPICE ################################################## 1085# Add new code models to the build by pointing to them here. 1086 1087if test "x$enable_xspice" = xyes; then 1088 VIS_CFLAGS="" 1089 AC_MSG_RESULT([X-Spice features included]) 1090 AC_DEFINE([XSPICE], [1], [The xspice enhancements]) 1091 case $host_os in 1092 *mingw* | *msys* ) 1093 AC_DEFINE([IPC_DEBUG_VIA_STDIO], [1], [Client-Server only via stdio.]) 1094 XSPICEDLLIBS="" 1095 ;; 1096 *cygwin* ) 1097 AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) 1098 XSPICEDLLIBS="" 1099 ;; 1100 *freebsd* ) 1101 AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) 1102 XSPICEDLLIBS="-ldl" 1103 ;; 1104 *openbsd* ) 1105 AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) 1106 XSPICEDLLIBS="-ldl" 1107 ;; 1108 *solaris* ) 1109 AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) 1110 XSPICEDLLIBS="" 1111 if test "x$with_ngshared" != xyes ; then 1112 if test "x$enable_debug" = xno; then 1113 if test "x$GCC" = xyes; then 1114 VIS_CFLAGS="-fvisibility=hidden" 1115 else 1116 VIS_CFLAGS="-xldscope=hidden" 1117 fi 1118 fi 1119 fi 1120 ;; 1121 * ) 1122 AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) 1123 XSPICEDLLIBS="-ldl" 1124 if test "x$with_ngshared" != xyes ; then 1125 if test "x$enable_debug" = xno; then 1126 VIS_CFLAGS="-fvisibility=hidden" 1127 fi 1128 fi 1129 ;; 1130 esac 1131 XSPICEINIT="" 1132 AC_CHECK_FUNCS([modf]) 1133 AC_CHECK_HEADERS([libintl.h malloc.h]) 1134 AC_SUBST([VIS_CFLAGS]) 1135else 1136 XSPICEINIT="*" 1137fi 1138AC_SUBST([XSPICEINIT]) 1139AC_SUBST([XSPICEDLLIBS]) 1140 1141AM_CONDITIONAL([XSPICE_WANTED], [test "x$enable_xspice" = xyes]) 1142 1143 1144# Add CIDER enhancements to ngspice. 1145if test "x$enable_cider" = xyes; then 1146 AC_MSG_RESULT([CIDER features enabled]) 1147 AC_DEFINE([CIDER], [1], [The CIDER enhancements]) 1148fi 1149 1150AM_CONDITIONAL([CIDER_WANTED], [test "x$enable_cider" = xyes]) 1151AM_CONDITIONAL([NUMDEV_WANTED], [test "x$enable_cider" = xyes]) 1152 1153 1154AM_CONDITIONAL([PSS_WANTED], [test "x$enable_pss" = xyes]) 1155 1156AM_CONDITIONAL([SENSE2_WANTED], [test "x$enable_sense2" = xyes]) 1157 1158# adms option 1159if test "x$enable_adms" = xyes ; then 1160 AC_MSG_RESULT([********************************** 1161* ADMS support is experimental * 1162**********************************]) 1163 AC_CHECK_PROGS([ADMSXML], [admsXml admsXml.exe]) 1164 1165 if test "x$ADMSXML" = x; then 1166 AC_MSG_ERROR([If you want Verilog-A models you should install admsXml]) 1167 fi 1168 AC_DEFINE([ADMS], [1], [Support for Verilog-A models]) 1169 1170 VLADEVDIR=" adms/bsimbulk \ 1171 adms/bsimcmg \ 1172 adms/ekv \ 1173 adms/hicum0 \ 1174 adms/mextram \ 1175 adms/psp102 \ 1176 adms/psp103 \ 1177 adms/r2_cmc " 1178 1179# The makefiles for adms (to be added to AC_CONFIG_FILES by ./autogen.sh --adms) 1180#VLAMKF src/spicelib/devices/adms/bsimbulk/Makefile 1181#VLAMKF src/spicelib/devices/adms/bsimcmg/Makefile 1182#VLAMKF src/spicelib/devices/adms/ekv/Makefile 1183#VLAMKF src/spicelib/devices/adms/hicum0/Makefile 1184#VLAMKF src/spicelib/devices/adms/mextram/Makefile 1185#VLAMKF src/spicelib/devices/adms/psp102/Makefile 1186#VLAMKF src/spicelib/devices/adms/psp103/Makefile 1187#VLAMKF src/spicelib/devices/adms/r2_cmc/Makefile 1188 1189 NOTVLADEVDIR="" 1190 1191 VLADEV=" spicelib/devices/adms/bsimbulk/libbsimbulk.la \ 1192 spicelib/devices/adms/bsimcmg/libbsimcmg.la \ 1193 spicelib/devices/adms/ekv/libekv.la \ 1194 spicelib/devices/adms/hicum0/libhicum0.la \ 1195 spicelib/devices/adms/mextram/libbjt504t.la \ 1196 spicelib/devices/adms/psp102/libpsp102.la \ 1197 spicelib/devices/adms/psp103/libpsp103.la \ 1198 spicelib/devices/adms/r2_cmc/libr2_cmc.la " 1199 1200else 1201 1202 VLADEVDIR="" 1203 NOTVLADEVDIR="adms/admst" 1204 1205fi 1206 1207AC_SUBST([VLADEVDIR]) 1208AC_SUBST([VLADEV]) 1209AC_SUBST([NOTVLADEVDIR]) 1210 1211# NDEV option 1212if test "x$enable_ndev" = xyes; then 1213 AC_MSG_RESULT([NDEV features enabled]) 1214 AC_DEFINE([NDEV], [], [The NDEV interface]) 1215fi 1216AM_CONDITIONAL([NDEV_WANTED], [test "x$enable_ndev" = xyes]) 1217 1218 1219# Cluster option 1220if test "x$enable_cluster" = xyes; then 1221 AC_MSG_RESULT([Cluster version is being compiled]) 1222 AC_DEFINE([CLUSTER], [], [Spice cluster support]) 1223 LIBS="$LIBS -lpthread" 1224fi 1225 1226if test "x$enable_expdevices" = xyes; then 1227 AC_DEFINE([EXP_DEV], [], [Define if we want to enable experimental devices]) 1228 AC_MSG_RESULT([WARNING: Experimental devices enabled]) 1229fi 1230 1231# ---- Option to include GNU readline support in ngspice CLI ---- 1232# ---- Default: disabled. ---- 1233# ---- Hope to see in the future readline replacement. ---- 1234 1235if test "x$with_readline" = x || test "x$with_readline" = xno ; then 1236 AC_MSG_RESULT([GNU readline disabled.]) 1237else 1238 if test "x$with_readline" = xyes; then 1239 if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then 1240 AC_MSG_RESULT([Checking for readline:]) 1241 AC_CHECK_HEADERS([readline/readline.h readline/history.h], 1242 [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], 1243 [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) 1244 AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], 1245 [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], 1246 [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) 1247 AC_CHECK_LIB([readline], [readline], 1248 [LIBS="$LIBS -lreadline"], 1249 [AC_MSG_ERROR([Couldn't find readline libraries.])]) 1250 fi 1251 else 1252# Especially defined for macOS (Big Sur), with readline installed from Brew 1253 for dir in \ 1254 $with_readline 1255 do 1256 if test "x$with_tcl" = x || test "x$with_tcl" = xno ; then 1257 AC_MSG_RESULT([Checking for readline:]) 1258 AC_CHECK_HEADERS([$dir/include/readline/readline.h $dir/include/readline/history.h], 1259 [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])], 1260 [AC_MSG_ERROR([Couldn't find GNU readline headers.])]) 1261 AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], 1262 [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], 1263 [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) 1264 AC_CHECK_LIB([readline], [readline], 1265 [LIBS="$LIBS -lreadline"], 1266 [AC_MSG_ERROR([Couldn't find readline libraries.])]) 1267 fi 1268 done 1269 fi 1270fi 1271 1272# ---- Option to include BSD editline support in ngspice CLI ---- 1273# ---- Default: disabled. ---- 1274 1275if test "x$with_editline" != xyes; then 1276 AC_MSG_RESULT([BSD editline disabled.]) 1277else 1278 AC_MSG_RESULT([Checking for editline:]) 1279 AC_CHECK_HEADERS([editline/readline.h], 1280 [AC_DEFINE([HAVE_BSDEDITLINE], [1], [Define to enable BSD editline])], 1281 [AC_MSG_ERROR([Couldn't find BSD editline headers.])]) 1282 AC_SEARCH_LIBS([tputs], [ncurses tinfo termcap], 1283 [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses/terminfo or termcap])], 1284 [AC_MSG_ERROR([Found neither ncurses/terminfo or termcap])]) 1285 AC_CHECK_LIB([edit], [readline], 1286 [LIBS="$LIBS -ledit"], 1287 [AC_MSG_ERROR([Couldn't find editline libraries.])], 1288 [-lncurses]) 1289fi 1290 1291# Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined 1292AC_CHECK_HEADERS([ncurses/termcap.h termcap.h]) 1293 1294# --enable-openmp: Use OpenMP on multi-core processors 1295AC_ARG_ENABLE([openmp], 1296 [AS_HELP_STRING([--enable-openmp], [Use OpenMP parallel processing])]) 1297 1298# Add OpenMP to ngspice. 1299: ${enable_openmp:=no} 1300m4_ifdef([AC_OPENMP], [AC_OPENMP]) 1301 1302if test "x$enable_openmp" = xyes; then 1303 AC_DEFINE([USE_OMP], [1], [OpenMP parallel processing]) 1304 CFLAGS="$CFLAGS $OPENMP_CFLAGS" 1305 AC_MSG_RESULT([OpenMP feature enabled]) 1306fi 1307 1308# Output Files 1309# ------------ 1310 1311AC_CONFIG_FILES([Makefile 1312 man/Makefile 1313 man/man1/Makefile 1314 ngspice.pc 1315 src/Makefile 1316 src/spicelib/Makefile 1317 src/spicelib/analysis/Makefile 1318 src/spicelib/devices/Makefile 1319 src/spicelib/devices/asrc/Makefile 1320 src/spicelib/devices/bjt/Makefile 1321 src/spicelib/devices/bsim1/Makefile 1322 src/spicelib/devices/bsim2/Makefile 1323 src/spicelib/devices/bsim3/Makefile 1324 src/spicelib/devices/bsim3v0/Makefile 1325 src/spicelib/devices/bsim3v1/Makefile 1326 src/spicelib/devices/bsim3v32/Makefile 1327 src/spicelib/devices/bsim4/Makefile 1328 src/spicelib/devices/bsim4v5/Makefile 1329 src/spicelib/devices/bsim4v6/Makefile 1330 src/spicelib/devices/bsim4v7/Makefile 1331 src/spicelib/devices/bsim3soi_pd/Makefile 1332 src/spicelib/devices/bsim3soi_fd/Makefile 1333 src/spicelib/devices/bsim3soi_dd/Makefile 1334 src/spicelib/devices/bsimsoi/Makefile 1335 src/spicelib/devices/cap/Makefile 1336 src/spicelib/devices/cccs/Makefile 1337 src/spicelib/devices/ccvs/Makefile 1338 src/spicelib/devices/csw/Makefile 1339 src/spicelib/devices/cpl/Makefile 1340 src/spicelib/devices/dio/Makefile 1341 src/spicelib/devices/ind/Makefile 1342 src/spicelib/devices/isrc/Makefile 1343 src/spicelib/devices/hfet1/Makefile 1344 src/spicelib/devices/hfet2/Makefile 1345 src/spicelib/devices/hicum2/Makefile 1346 src/spicelib/devices/hisim2/Makefile 1347 src/spicelib/devices/hisimhv1/Makefile 1348 src/spicelib/devices/hisimhv2/Makefile 1349 src/spicelib/devices/jfet/Makefile 1350 src/spicelib/devices/jfet2/Makefile 1351 src/spicelib/devices/ltra/Makefile 1352 src/spicelib/devices/mes/Makefile 1353 src/spicelib/devices/mesa/Makefile 1354 src/spicelib/devices/mos1/Makefile 1355 src/spicelib/devices/mos2/Makefile 1356 src/spicelib/devices/mos3/Makefile 1357 src/spicelib/devices/mos6/Makefile 1358 src/spicelib/devices/mos9/Makefile 1359 src/spicelib/devices/ndev/Makefile 1360 src/spicelib/devices/res/Makefile 1361 src/spicelib/devices/soi3/Makefile 1362 src/spicelib/devices/sw/Makefile 1363 src/spicelib/devices/tra/Makefile 1364 src/spicelib/devices/txl/Makefile 1365 src/spicelib/devices/urc/Makefile 1366 src/spicelib/devices/vbic/Makefile 1367 src/spicelib/devices/vccs/Makefile 1368 src/spicelib/devices/vcvs/Makefile 1369 src/spicelib/devices/vdmos/Makefile 1370 src/spicelib/devices/vsrc/Makefile 1371 src/spicelib/devices/nbjt/Makefile 1372 src/spicelib/devices/nbjt2/Makefile 1373 src/spicelib/devices/numd/Makefile 1374 src/spicelib/devices/numd2/Makefile 1375 src/spicelib/devices/numos/Makefile 1376 src/spicelib/parser/Makefile 1377 src/ciderlib/Makefile 1378 src/ciderlib/input/Makefile 1379 src/ciderlib/support/Makefile 1380 src/ciderlib/oned/Makefile 1381 src/ciderlib/twod/Makefile 1382 src/frontend/Makefile 1383 src/frontend/numparam/Makefile 1384 src/frontend/help/Makefile 1385 src/frontend/parser/Makefile 1386 src/frontend/plotting/Makefile 1387 src/frontend/trannoise/Makefile 1388 src/frontend/wdisp/Makefile 1389 src/include/ngspice/Makefile 1390 src/include/cppduals/duals/Makefile 1391 src/maths/Makefile 1392 src/maths/cmaths/Makefile 1393 src/maths/fft/Makefile 1394 src/maths/misc/Makefile 1395 src/maths/ni/Makefile 1396 src/maths/deriv/Makefile 1397 src/maths/poly/Makefile 1398 src/maths/sparse/Makefile 1399 src/misc/Makefile 1400 src/xspice/Makefile 1401 src/xspice/cm/Makefile 1402 src/xspice/cmpp/Makefile 1403 src/xspice/icm/makedefs 1404 src/xspice/icm/GNUmakefile 1405 src/xspice/mif/Makefile 1406 src/xspice/evt/Makefile 1407 src/xspice/enh/Makefile 1408 src/xspice/ipc/Makefile 1409 src/xspice/idn/Makefile 1410 tests/Makefile 1411 tests/bsim1/Makefile 1412 tests/bsim2/Makefile 1413 tests/bsim3/Makefile 1414 tests/bsim3soidd/Makefile 1415 tests/bsim3soifd/Makefile 1416 tests/bsim3soipd/Makefile 1417 tests/bsim4/Makefile 1418 tests/bsimsoi/Makefile 1419 tests/filters/Makefile 1420 tests/general/Makefile 1421 tests/hfet/Makefile 1422 tests/hicum2/Makefile 1423 tests/hisim/Makefile 1424 tests/hisimhv1/Makefile 1425 tests/hisimhv2/Makefile 1426 tests/jfet/Makefile 1427 tests/mes/Makefile 1428 tests/mesa/Makefile 1429 tests/mos6/Makefile 1430 tests/polezero/Makefile 1431 tests/regression/Makefile 1432 tests/regression/subckt-processing/Makefile 1433 tests/regression/lib-processing/Makefile 1434 tests/regression/parser/Makefile 1435 tests/regression/func/Makefile 1436 tests/regression/model/Makefile 1437 tests/regression/misc/Makefile 1438 tests/regression/sens/Makefile 1439 tests/regression/temper/Makefile 1440 tests/regression/pipe/Makefile 1441 tests/regression/pz/Makefile 1442 tests/sensitivity/Makefile 1443 tests/transient/Makefile 1444 tests/transmission/Makefile 1445 tests/xspice/Makefile 1446 tests/xspice/digital/Makefile 1447 tests/xspice/digital/spinit 1448 tests/resistance/Makefile 1449 tests/vbic/Makefile]) 1450 1451AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = xyes]) 1452 1453if test "x$cross_compiling" = xyes; then 1454 AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P src/xspice/cmpp/build]) 1455 AC_SUBST([CMPP], ['$(top_builddir)/src/xspice/cmpp/build/cmpp$(BUILD_EXEEXT)']) 1456else 1457 AC_SUBST([CMPP], ['$(top_builddir)/src/xspice/cmpp/cmpp$(EXEEXT)']) 1458fi 1459 1460# See https://github.com/kimwalisch/primesieve/issues/16 1461# Silence warning: ar: 'u' modifier ignored since 'D' is the default 1462AC_SUBST(AR_FLAGS, [cr]) 1463 1464 1465AC_OUTPUT 1466