1dnl ##define([AC_CACHE_LOAD], )dnl 2dnl--------------------------------------------------------------------------- 3dnl configure-script template 4dnl 5dnl--------------------------------------------------------------------------- 6dnl TODO: allow the use of hosts/<foo>/machine.h.in resp Makefile.in 7dnl TODO:: when existing instead of the normal ones. 8 9dnl 10dnl some helper macros 11dnl 12 13dnl Check if the compiler in use supports the given argument as command-line 14dnl switch and adds it to the list of variables given as second argument if 15dnl supported. 16AC_DEFUN([LD_CHECK_CC_SWITCH], [ 17 ld_cc_switch_savecflags="$CFLAGS" 18 CFLAGS="${CFLAGS} $1" 19 AC_MSG_CHECKING([whether compiler supports $1]) 20 AC_COMPILE_IFELSE( 21 [AC_LANG_PROGRAM( 22 [[]], 23 [[]])], 24 [AC_MSG_RESULT([yes])] 25 CFLAGS="$ld_cc_switch_savecflags" 26 for v in $2; do 27 todo="$v=\"\$$v $1\"" 28 eval "$todo"; 29 done, 30 [AC_MSG_RESULT([no])] 31 CFLAGS="$ld_cc_switch_savecflags" 32 ) 33 ] 34) 35 36AC_DEFUN([AC_UPDATE_VAR], 37[if test "x$[$1]" = "x" && test "x$DEFAULT[$1]" != "x"; then 38 [$1]=$DEFAULT[$1] 39fi] 40) 41 42AC_DEFUN([AC_CDEF_FROM_ENABLE], 43[AC_UPDATE_VAR(enable_[$1]) 44if test "x$enable_[$1]" = "xyes"; then 45 cdef_[$1]="#define" 46else 47 cdef_[$1]="#undef" 48fi 49]) 50 51AC_DEFUN([AC_INT_VAL_FROM_WITH], 52[if test "x$with_[$1]" != "x"; then 53 with_[$1]=`echo $with_[$1]| 54changequote(, )dnl 55 sed -e 's/^\(-\?\(0x[0-9a-fA-F]\+\)\?[0-9]*\)[^0-9]\?.*$/\1/'` 56changequote([, ])dnl 57fi 58AC_UPDATE_VAR(with_[$1]) 59val_[$1]=$with_[$1]] 60) 61 62AC_DEFUN([AC_STRING_VAL_FROM_WITH], 63[if test "x$with_[$1]" != "x"; then 64 with_[$1]=`echo $with_[$1]| 65changequote(, )dnl 66 sed -e 's/^\([^"]*\)\?.*$/\1/'` 67changequote([, ])dnl 68fi 69AC_UPDATE_VAR(with_[$1]) 70val_[$1]="\"$with_[$1]\""] 71) 72 73AC_DEFUN([AC_TEXT_VAL_FROM_WITH], 74[if test "x$with_[$1]" != "x"; then 75 with_[$1]=`echo $with_[$1]| 76changequote(, )dnl 77 sed -e 's/^\([^"]*\)\?.*$/\1/'` 78changequote([, ])dnl 79fi 80AC_UPDATE_VAR(with_[$1]) 81val_[$1]="$with_[$1]"] 82) 83 84AC_DEFUN([AC_FORM_HELP],[ --$1[]dnl 85ifelse([$2],,,dnl 86builtin(format,%[.]builtin(eval,(len([$1])<50)*(50-len([$1])))s,) [default=$2])[]dnl 87ifelse([$3],,,[[ 88]patsubst([$3],[^],[ ])])[]dnl 89]) 90 91 92AC_DEFUN([AC_MY_ARG_ENABLE], 93[DEFAULTenable_[]translit([$1],[-],[_])=[$2] 94AC_ARG_ENABLE([$1],[AC_FORM_HELP([enable-$1]ifelse([$3],,,[=($3)]), 95ifelse([$2],,[disabled],[$2],no,[disabled],[$2],yes,[enabled],[enabled($2)]), 96[$4])],[$5],[$6]) 97]) 98 99AC_DEFUN([AC_MY_ARG_WITH], 100[DEFAULTwith_[]translit([$1],[-],[_])=[$2] 101AC_ARG_WITH([$1],[AC_FORM_HELP([with-$1]ifelse([$3],,[=VALUE],[=$3]), 102[$2], 103[$4])],[$5],[$6]) 104]) 105 106AC_DEFUN([AC_NOT_AVAILABLE], 107[if test "x$not_available" = "x"; then 108 not_available="$1" 109else 110 not_available="[$not_available], $1" 111fi]) 112 113dnl Search for library $2. 114dnl First try using pkg-config, put its results into $1_LIBS and $1_CFLAGS. 115dnl Then try searching in /usr/include, /usr/include/$4 and ${$5}. 116dnl Try to compile $6. 117dnl Look for library $7 with function $8 118dnl If successful set $3 to yes, otherwise to no. 119dnl Only do this if $9 is set to "yes" 120AC_DEFUN([AC_MY_SEARCH_LIB], 121[ 122 if test "x$[$9]" = "xyes"; then 123 saveflags="$CFLAGS" 124 saveeflags="$EXTRA_CFLAGS" 125 126 ifdef([PKG_CHECK_MODULES],[ 127 PKG_CHECK_MODULES([$1],[$2],[$3]=yes,[$3]=no) 128 ],[ 129 [$3]=no 130 ]) 131 132 # No pkg-config, search manually. 133 if test "$[$3]" = "no"; then 134 AC_MSG_CHECKING(for [$4] support) 135 for TESTPATH in "" "${[$5]}" "${[$5]}/include" "${[$5]}/include/[$4]" "/usr/include/[$4]" "/usr/local/include" "/usr/local/include/[$4]" ; do 136 if test "x$TESTPATH" != "x"; then 137 CFLAGS="$saveflags -I$TESTPATH" 138 else 139 CFLAGS="$saveflags" 140 fi 141 AC_TRY_COMPILE([$6],, 142 [$3]=yes 143 if test "x$TESTPATH" != "x"; then 144 EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" 145 fi 146 break; 147 , 148 CFLAGS="$saveflags" 149 ) 150 done 151 AC_MSG_RESULT($[$3]) 152 elif test "x$[$1]_CFLAGS" != "x"; then 153 EXTRA_CFLAGS="$[$1]_CFLAGS $EXTRA_CFLAGS" 154 fi 155 156 if test "$[$3]" = "yes"; then 157 if test "x$[$1]_LIBS" != "x"; then 158 PKGLIBS="$PKGLIBS $[$1]_LIBS" 159 else 160 tmp="" 161 162 for TESTPATH in "" "${[$5]}" "${[$5]}/lib" "${[$5]}/lib/[$4]" "/usr/lib/[$4]" "/usr/local/lib" "/usr/local/lib/[$4]" ; do 163 if test "x$TESTPATH" != "x"; then 164 CFLAGS="$saveflags -L$TESTPATH" 165 else 166 CFLAGS="$saveflags" 167 fi 168 169 AC_CHECK_LIB([$7],[$8], 170 if test "x$TESTPATH" != "x"; then 171 tmp="$PKGLIBS -L$TESTPATH -l[$7]" 172 else 173 tmp="$PKGLIBS -l[$7]" 174 fi 175 break 176 ) 177 done 178 179 if test "x$tmp" = "x"; then 180 [$3]=no 181 182 EXTRA_CFLAGS="$saveeflags" 183 else 184 PKGLIBS="$tmp" 185 fi 186 fi 187 188 CFLAGS="$saveflags" 189 fi 190 fi 191]) 192 193dnl 194dnl let's start 195AC_INIT(prolang.y) 196 197dnl set the default prefix 198AC_PREFIX_DEFAULT(/usr/local/mud) 199 200dnl 201dnl This variable collects those requested features for which the system 202dnl doesn't offer the right support. 203 204not_available="" 205 206dnl 207dnl define default values for package arguments 208dnl and declare the package arguments 209dnl 210 211AC_MY_ARG_ENABLE(erq,erq,[no/erq/xerq],[Enables and or selects ERQ demon]) 212AC_MY_ARG_ENABLE(access-control,yes,,[Enable access control]) 213AC_MY_ARG_ENABLE(access-log,no,,[Log all connection attempts]) 214AC_MY_ARG_ENABLE(compat-mode,no,,[Enable compat mode]) 215AC_MY_ARG_ENABLE(strict-euids,no,,[Enforce euids for loading objects]) 216AC_MY_ARG_ENABLE(filename-spaces,no,,[Allow space characters in filenames]) 217AC_MY_ARG_ENABLE(share-variables,no,,[Enable clone initialization from blueprint variable values]) 218AC_MY_ARG_ENABLE(use-ipv6,no,,[Enables support for IPv6]) 219AC_MY_ARG_ENABLE(use-alists,no,,[Enables alist support]) 220AC_MY_ARG_ENABLE(use-mccp,no,,[Enables MCCP support]) 221AC_MY_ARG_ENABLE(use-mysql,no,,[Enables mySQL support]) 222AC_MY_ARG_ENABLE(use-pgsql,no,,[Enables PostgreSQL support]) 223AC_MY_ARG_ENABLE(use-sqlite,no,,[Enables SQLite support]) 224AC_MY_ARG_ENABLE(use-pcre,yes,,[Enables PCRE: no/yes/builtin/no-builtin]) 225AC_MY_ARG_ENABLE(use-xml,no,,[Enables XML support: no/xml2/iksemel/yes]) 226AC_MY_ARG_WITH(xml-path,,,[Optional location of the XML include/ and lib/ directory]) 227AC_MY_ARG_ENABLE(use-deprecated,yes,,[Enables obsolete and deprecated efuns]) 228AC_MY_ARG_ENABLE(use-structs,yes,,[Enables structs]) 229AC_MY_ARG_ENABLE(use-tls,no,,[Enables Transport Layer Security over Telnet: no/gnu/ssl/yes]) 230AC_MY_ARG_WITH(tls-path,,,[Optional location of the TLS include/ and lib/ directory]) 231AC_MY_ARG_WITH(tls-keyfile,key.pem,,[Default x509 keyfile]) 232AC_MY_ARG_WITH(tls-certfile,cert.pem,,[Default x509 certificate file]) 233AC_MY_ARG_WITH(tls-trustfile,no,,[Default filename holding trusted PEM certificates]) 234AC_MY_ARG_WITH(tls-trustdirectory,no,,[Default directory holding trusted PEM certificates]) 235AC_MY_ARG_WITH(tls-crlfile,no,,[Default filename holding certificate revocation lists]) 236AC_MY_ARG_WITH(tls-crldirectory,no,,[Default directory holding certificate revocation lists]) 237AC_MY_ARG_ENABLE(use-gcrypt,yes,,[Enables support for libgcrypt]) 238AC_MY_ARG_ENABLE(use-new-inlines,yes,,[Enables new inline syntax]) 239AC_MY_ARG_ENABLE(use-set-light,yes,,[Enables efun set_light()]) 240AC_MY_ARG_ENABLE(use-set-is-wizard,yes,,[Enables efun set_is_wizard()]) 241AC_MY_ARG_ENABLE(use-parse-command,yes,,[Enables efun parse_command()]) 242AC_MY_ARG_ENABLE(use-process-string,yes,,[Enables efun process_string()]) 243AC_MY_ARG_ENABLE(lpc-array-calls,yes,,[Enables call_others on arrays of objects]) 244AC_MY_ARG_ENABLE(comm-stat,yes,,[Enable statistics for outgoing packets]) 245AC_MY_ARG_ENABLE(apply-cache_stat,yes,,[Enable statistics for apply cache]) 246AC_MY_ARG_ENABLE(malloc-sbrk,yes,,[Use sbrk() if possible (smalloc,slaballoc)]) 247AC_MY_ARG_ENABLE(malloc-check,yes,,[Enable simple malloc checks (smalloc,slaballoc)]) 248AC_MY_ARG_ENABLE(malloc-trace,no,,[Annotate allocations with source file:line]) 249AC_MY_ARG_ENABLE(malloc-lpc-trace,no,,[Annotate allocations with LPC object info]) 250AC_MY_ARG_ENABLE(malloc-sbrk-trace,no,,[Log all esbrk() calls (smalloc,slaballoc)]) 251AC_MY_ARG_ENABLE(dynamic-costs,no,,[Assign eval costs dynamically]) 252AC_MY_ARG_ENABLE(eval-cost-trace,no,,[Writes the evaluation costs in the stracktrace]) 253AC_MY_ARG_ENABLE(trace-code,yes,,[trace the most recently executed bytecode]) 254 255AC_MY_ARG_ENABLE(rxcache_table,yes,,[Cache compiled regular expressions]) 256AC_MY_ARG_ENABLE(synchronous-heart-beat,yes,,[Do all heart beats at once.]) 257 258AC_MY_ARG_ENABLE(opcprof,no,,[create VM instruction usage statistics]) 259AC_MY_ARG_ENABLE(verbose-opcprof,no,,[with opcprof: include instruction names]) 260AC_MY_ARG_ENABLE(debug,yes,,[enable sanity checks]) 261AC_MY_ARG_ENABLE(yydebug,no,,[enable LPC compiler debug output]) 262AC_MY_ARG_ENABLE(no-inlines,no,,[disable inlining]) 263AC_MY_ARG_ENABLE(debug-telnet,no,,[enable telnet machine diagnostics]) 264AC_MY_ARG_ENABLE(debug-malloc-allocs,no,,[enable small block diagnostics]) 265 266AC_MY_ARG_ENABLE(check-object-stat,no,,[trace changes to the object statistics]) 267AC_MY_ARG_ENABLE(check-mapping-total,no,,[check the mapping statistic]) 268AC_MY_ARG_ENABLE(check-object-ref,no,,[check object references]) 269AC_MY_ARG_ENABLE(check-object-gc-ref,yes,,[check object references in GC]) 270AC_MY_ARG_ENABLE(dump-gc-refs,no,,[trace GC references]) 271 272AC_MY_ARG_WITH(optimize,med,,[Optimization level: no/low/med/high]) 273 274AC_MY_ARG_WITH(access-file,ACCESS.ALLOW,,[access permissions file]) 275AC_MY_ARG_WITH(access-log,access.allow.log,,[access log file]) 276 277AC_MY_ARG_WITH(write-buffer-max-size,100000,,[max size of write buffer per interactive]) 278AC_MY_ARG_WITH(erq-max-reply,1024,,[max size of replies from ERQ]) 279AC_MY_ARG_WITH(erq-max-send,1024,,[max size of commands sent to ERQ, xerq only]) 280AC_MY_ARG_WITH(erq-debug,0,,[ERQ debug level]) 281 282AC_MY_ARG_WITH(read-file-max-size,50000,[BYTES], 283 [maximum size of a file allowed to be read by 'read_file()']) 284 285AC_MY_ARG_WITH(master-name,secure/master,,[name of the master object]) 286AC_MY_ARG_WITH(input-escape,"!",,[input escape character]) 287AC_MY_ARG_WITH(time-to-clean_up,3600,[SECONDS],[time before cleaning up unused objects]) 288AC_MY_ARG_WITH(time-to-swap,900,[SECONDS],[time before swapping out unused objects]) 289AC_MY_ARG_WITH(time-to-swap-variables,1800,[SECONDS],[time before swapping out variables]) 290AC_MY_ARG_WITH(time-to-reset,1800,[SECONDS],[time between resetting objects]) 291AC_MY_ARG_WITH(alarm-time,2,[SECONDS],[timer granularity]) 292AC_MY_ARG_WITH(heart-beat-interval,2,[SECONDS],[time between heartbeats]) 293AC_MY_ARG_WITH(evaluator-stack-size,2000,,[virtual machine stack size]) 294AC_MY_ARG_WITH(max-user-trace,60,,[maximum user function call depth]) 295AC_MY_ARG_WITH(max-trace,65,,[maximum function call depth during error handling]) 296AC_MY_ARG_WITH(compiler-stack-size,400,,[depth of parser stack]) 297AC_MY_ARG_WITH(max-bits,6144,,[maximum number of bits in a bit string]) 298AC_MY_ARG_WITH(portno,4242,,[tcp port to listen on]) 299AC_MY_ARG_WITH(udp-port,4246,,[udp port to listen on]) 300AC_MY_ARG_WITH(maxnumports,20,,[maximum number of tcp ports to listen on]) 301AC_MY_ARG_WITH(max-cost,1000000,,[maximum eval cost for a single evaluation]) 302AC_MY_ARG_WITH(catch-reserved-cost,2000,,[eval cost reserved for catch()]) 303AC_MY_ARG_WITH(master-reserved-cost,512,,[eval cost reserved for master]) 304AC_MY_ARG_WITH(swap-file,LP_SWAP,,[name of the swap file]) 305AC_MY_ARG_WITH(max-array-size,5000,,[max number of array elements]) 306AC_MY_ARG_WITH(max-mapping-keys,5000,,[max number of mapping entries]) 307AC_MY_ARG_WITH(max-mapping-size,15000,,[max number of mapping elements]) 308AC_MY_ARG_WITH(max-callouts,0,,[max number of callouts; 0=unlimited]) 309AC_MY_ARG_WITH(max-players,50,,[maximum number of simultaneous players]) 310AC_MY_ARG_WITH(max-local,50,,[maximum number of local variables per function]) 311AC_MY_ARG_WITH(allowed-ed-cmds,20,,[number of ed commands per backend cycle]) 312AC_MY_ARG_WITH(max-command-length,1000,,[maximum length of a command]) 313AC_MY_ARG_WITH(reserved-user-size,700000,,[memory reserved for user usage]) 314AC_MY_ARG_WITH(reserved-master-size,100000,,[memory reserved for master usage]) 315AC_MY_ARG_WITH(reserved-system-size,200000,,[memory reserved for internal usage]) 316AC_MY_ARG_WITH(htable-size,4096,,[shared string hash table size]) 317AC_MY_ARG_WITH(itable-size,256,,[identifier hash table size]) 318AC_MY_ARG_WITH(otable-size,1024,,[object hash table size]) 319AC_MY_ARG_WITH(defmax,65000,,[maximum expanded size of preprocessor macro]) 320AC_MY_ARG_WITH(apply-cache-bits,12,,[2^N = size of apply cache]) 321AC_MY_ARG_WITH(rxcache-table,8192,,[cache size for compiled regular expressions]) 322AC_MY_ARG_WITH(max-byte-transfer,50000,,[maximum write/read size for read/write_bytes]) 323AC_MY_ARG_WITH(set-buffer-size-max,65536,,[maximum size of socket send buffer]) 324AC_MY_ARG_WITH(malloc,default,[default/smalloc/slaballoc/sysmalloc/ptmalloc],[memory manager to use]) 325AC_MY_ARG_WITH(min-malloced,0,,[amount of memory to allocate on startup]) 326AC_MY_ARG_WITH(min-small-malloced,0,,[amount of memory to allocate for small blocks on startup]) 327AC_MY_ARG_WITH(hard-malloc-limit,0x4000000,,[maximum amount of memory to allocate; 0=unlimited]) 328AC_MY_ARG_WITH(soft-malloc-limit,0,,[soft limit for the amount of memory to allocate; 0=unlimited]) 329AC_MY_ARG_WITH(total-trace-length,4096,,[number of operations stored in bytecode trace]) 330AC_MY_ARG_WITH(pcre-recursion-limit,3000,,[maximum number of recursions in PCRE package]) 331AC_MY_ARG_WITH(wizlist-file,WIZLIST,,[name of the wizlist file]) 332AC_MY_ARG_WITH(max_net_connects,10,,[maximum number of concurrent connection attempts]) 333AC_MY_ARG_WITH(random-period-length,19937,[607 / 1279 / 2281 / 4253 / 11213 / 19937 / 44497 / 86243 / 132049 / 216091],[period length of the random number generator]) 334 335AC_ARG_WITH(setting,[ --with-setting=SETTING include a predefined setting],[ 336if test -f "settings/$withval" ; then 337cat >conftest.sed <<\EOF 338/^#.*/ d 339/^[[ \t]]*$/ d 340s/#.*$// 341s/disable_\([[^= \t]]*\)/enable_\1=no/ 342/^enable_/ s/^/DEFAULT/p 343/^with_/ s/^/DEFAULT/p 344[] 345EOF 346eval `sed -n -f conftest.sed <settings/$withval` 347rm conftest.sed 348else 349AC_MSG_ERROR(Setting \"$withval\" not available) 350fi 351]) 352 353dnl 354dnl process package arguments 355dnl (here the variable names are used; with a "_" instead of a dash "-" !) 356dnl 357 358AC_UPDATE_VAR(enable_erq) 359if test "x$enable_erq" = "xerq" || test "x$enable_erq" = "xyes"; then 360 cdef_erq_demon="#define" 361 erq_sub=erq 362 AC_DEFINE(ERQ_INCLUDE,"util/erq/erq.h",[define the erq include file.]) 363elif test "x$enable_erq" = "xxerq"; then 364 cdef_erq_demon="#define" 365 erq_sub=xerq 366 AC_DEFINE(ERQ_INCLUDE,"util/xerq/erq.h") 367else 368 cdef_erq_demon="#undef" 369 erq_sub= 370fi 371 372AC_UPDATE_VAR(enable_use_pcre) 373if test "x$enable_use_pcre" = "x" || test "x$enable_use_pcre" = "xyes"; then 374 cdef_use_pcre="#define" 375 cdef_use_builtin_pcre="#undef" 376 enable_use_builtin_pcre="no" 377elif test "x$enable_use_pcre" = "xbuiltin"; then 378 cdef_use_pcre="#define" 379 cdef_use_builtin_pcre="#define" 380 enable_use_pcre="yes" 381 enable_use_builtin_pcre="yes" 382elif test "x$enable_use_pcre" = "xno-builtin"; then 383 cdef_use_pcre="#undef" 384 cdef_use_builtin_pcre="#define" 385 enable_use_pcre="no" 386 enable_use_builtin_pcre="yes" 387else 388 cdef_use_pcre="#undef" 389 cdef_use_builtin_pcre="#undef" 390 enable_use_pcre="no" 391 enable_use_builtin_pcre="no" 392fi 393 394AC_UPDATE_VAR(enable_use_mysql) 395if test "x$enable_use_mysql" = "x" || test "x$enable_use_mysql" = "xyes"; then 396 cdef_use_mysql="#define" 397 mysql_path= 398 enable_use_mysql="yes" 399elif test "x$enable_use_mysql" = "xno"; then 400 cdef_use_mysql="#undef" 401 mysql_path= 402else 403 cdef_use_mysql="#define" 404 mysql_path="$enable_use_mysql" 405 enable_use_mysql="yes" 406fi 407 408AC_UPDATE_VAR(enable_use_pgsql) 409if test "x$enable_use_pgsql" = "x" || test "x$enable_use_pgsql" = "xyes"; then 410 cdef_use_pgsql="#define" 411 pgsql_path= 412 enable_use_pgsql="yes" 413elif test "x$enable_use_pgsql" = "xno"; then 414 cdef_use_pgsql="#undef" 415 pgsql_path= 416else 417 cdef_use_pgsql="#define" 418 pgsql_path="$enable_use_pgsql" 419 enable_use_pgsql="yes" 420fi 421 422AC_UPDATE_VAR(enable_use_sqlite) 423if test "x$enable_use_sqlite" = "x" || test "x$enable_use_sqlite" = "xyes"; then 424 cdef_use_sqlite="#define" 425 sqlite_path= 426 enable_use_sqlite="yes" 427elif test "x$enable_use_sqlite" = "xno"; then 428 cdef_use_sqlite="#undef" 429 sqlite_path= 430else 431 cdef_use_sqlite="#define" 432 sqlite_path="$enable_use_sqlite" 433 enable_use_sqlite="yes" 434fi 435 436AC_UPDATE_VAR(enable_use_xml) 437if test "x$enable_use_xml" = "x" || test "x$enable_use_xml" = "xyes"; then 438 cdef_use_xml="#define" 439 xml_package="any" 440 enable_use_xml="yes" 441elif test "x$enable_use_xml" = "xno"; then 442 cdef_use_xml="#undef" 443 xml_package="any" 444else 445 cdef_use_xml="#define" 446 xml_package="$enable_use_xml" 447 enable_use_xml="yes" 448fi 449AC_UPDATE_VAR(with_xml_path) 450if test "x$with_xml_path" = "x" -o "x$with_xml_path" = "xno" ; then 451 xml_path="" 452else 453 xml_path="$with_xml_path" 454fi 455 456AC_UPDATE_VAR(enable_use_tls) 457if test "x$enable_use_tls" = "x" || test "x$enable_use_tls" = "xyes"; then 458 cdef_use_tls="#define" 459 tls_package="any" 460 enable_use_tls="yes" 461elif test "x$enable_use_tls" = "xno"; then 462 cdef_use_tls="#undef" 463 tls_package="any" 464else 465 cdef_use_tls="#define" 466 tls_package="$enable_use_tls" 467 enable_use_tls="yes" 468fi 469AC_UPDATE_VAR(with_tls_path) 470if test "x$with_tls_path" = "x" -o "x$with_tls_path" = "xno" ; then 471 tls_include_path="" 472 tls_lib_path="" 473else 474 tls_include_path="${with_tls_path}/include" 475 tls_lib_path="${with_tls_path}/lib" 476fi 477AC_UPDATE_VAR(enable_use_gcrypt) 478if test "x$enable_use_gcrypt" = "x" || test "x$enable_use_gcrypt" = "xyes"; then 479 cdef_use_gcrypt="#define" 480 gcrypt_path= 481 enable_use_gcrypt="yes" 482elif test "x$enable_use_gcrypt" = "xno"; then 483 cdef_use_gcrypt="#undef" 484 gcrypt_path= 485else 486 cdef_use_gcrypt="#define" 487 gcrypt_path="$enable_use_gcrypt" 488 enable_use_gcrypt="yes" 489fi 490 491AC_CDEF_FROM_ENABLE(access_control) 492AC_CDEF_FROM_ENABLE(access_log) 493AC_CDEF_FROM_ENABLE(compat_mode) 494AC_CDEF_FROM_ENABLE(strict_euids) 495AC_CDEF_FROM_ENABLE(filename_spaces) 496AC_CDEF_FROM_ENABLE(share_variables) 497AC_CDEF_FROM_ENABLE(use_alists) 498AC_CDEF_FROM_ENABLE(use_mccp) 499AC_CDEF_FROM_ENABLE(use_ipv6) 500AC_CDEF_FROM_ENABLE(use_deprecated) 501AC_CDEF_FROM_ENABLE(use_structs) 502AC_CDEF_FROM_ENABLE(use_new_inlines) 503AC_CDEF_FROM_ENABLE(use_set_light) 504AC_CDEF_FROM_ENABLE(use_set_is_wizard) 505AC_CDEF_FROM_ENABLE(use_parse_command) 506AC_CDEF_FROM_ENABLE(use_process_string) 507AC_CDEF_FROM_ENABLE(lpc_array_calls) 508AC_CDEF_FROM_ENABLE(comm_stat) 509AC_CDEF_FROM_ENABLE(apply_cache_stat) 510AC_CDEF_FROM_ENABLE(malloc_sbrk) 511AC_CDEF_FROM_ENABLE(malloc_check) 512AC_CDEF_FROM_ENABLE(malloc_trace) 513AC_CDEF_FROM_ENABLE(malloc_lpc_trace) 514AC_CDEF_FROM_ENABLE(malloc_sbrk_trace) 515AC_CDEF_FROM_ENABLE(dynamic_costs) 516AC_CDEF_FROM_ENABLE(eval_cost_trace) 517AC_CDEF_FROM_ENABLE(trace_code) 518 519AC_CDEF_FROM_ENABLE(rxcache_table) 520AC_CDEF_FROM_ENABLE(synchronous_heart_beat) 521 522AC_CDEF_FROM_ENABLE(opcprof) 523AC_CDEF_FROM_ENABLE(verbose_opcprof) 524AC_CDEF_FROM_ENABLE(debug) 525AC_CDEF_FROM_ENABLE(yydebug) 526AC_CDEF_FROM_ENABLE(no_inlines) 527AC_CDEF_FROM_ENABLE(debug_telnet) 528AC_CDEF_FROM_ENABLE(debug_malloc_allocs) 529 530AC_CDEF_FROM_ENABLE(check_object_stat) 531AC_CDEF_FROM_ENABLE(check_mapping_total) 532AC_CDEF_FROM_ENABLE(check_object_ref) 533AC_CDEF_FROM_ENABLE(check_object_gc_ref) 534AC_CDEF_FROM_ENABLE(dump_gc_refs) 535 536AC_TEXT_VAL_FROM_WITH(optimize) 537 538AC_STRING_VAL_FROM_WITH(access_file) 539AC_STRING_VAL_FROM_WITH(access_log) 540AC_STRING_VAL_FROM_WITH(swap_file) 541AC_STRING_VAL_FROM_WITH(wizlist_file) 542AC_STRING_VAL_FROM_WITH(master_name) 543AC_STRING_VAL_FROM_WITH(input_escape) 544AC_STRING_VAL_FROM_WITH(tls_keyfile) 545AC_STRING_VAL_FROM_WITH(tls_certfile) 546AC_STRING_VAL_FROM_WITH(tls_trustfile) 547AC_STRING_VAL_FROM_WITH(tls_trustdirectory) 548AC_STRING_VAL_FROM_WITH(tls_crlfile) 549AC_STRING_VAL_FROM_WITH(tls_crldirectory) 550 551AC_TEXT_VAL_FROM_WITH(malloc) 552 553AC_INT_VAL_FROM_WITH(write_buffer_max_size) 554AC_INT_VAL_FROM_WITH(erq_max_reply) 555AC_INT_VAL_FROM_WITH(erq_max_send) 556AC_INT_VAL_FROM_WITH(erq_debug) 557AC_INT_VAL_FROM_WITH(read_file_max_size) 558AC_INT_VAL_FROM_WITH(time_to_clean_up) 559AC_INT_VAL_FROM_WITH(time_to_swap) 560AC_INT_VAL_FROM_WITH(time_to_swap_variables) 561AC_INT_VAL_FROM_WITH(time_to_reset) 562AC_INT_VAL_FROM_WITH(alarm_time) 563AC_INT_VAL_FROM_WITH(heart_beat_interval) 564AC_INT_VAL_FROM_WITH(evaluator_stack_size) 565AC_INT_VAL_FROM_WITH(max_user_trace) 566AC_INT_VAL_FROM_WITH(max_trace) 567AC_INT_VAL_FROM_WITH(compiler_stack_size) 568AC_INT_VAL_FROM_WITH(max_bits) 569AC_INT_VAL_FROM_WITH(portno) 570AC_INT_VAL_FROM_WITH(maxnumports) 571AC_INT_VAL_FROM_WITH(max_cost) 572AC_INT_VAL_FROM_WITH(catch_reserved_cost) 573AC_INT_VAL_FROM_WITH(master_reserved_cost) 574AC_INT_VAL_FROM_WITH(max_array_size) 575AC_INT_VAL_FROM_WITH(max_mapping_keys) 576AC_INT_VAL_FROM_WITH(max_mapping_size) 577AC_INT_VAL_FROM_WITH(max_callouts) 578AC_INT_VAL_FROM_WITH(max_players) 579AC_INT_VAL_FROM_WITH(max_local) 580AC_INT_VAL_FROM_WITH(allowed_ed_cmds) 581AC_INT_VAL_FROM_WITH(max_command_length) 582AC_INT_VAL_FROM_WITH(reserved_user_size) 583AC_INT_VAL_FROM_WITH(reserved_master_size) 584AC_INT_VAL_FROM_WITH(reserved_system_size) 585AC_INT_VAL_FROM_WITH(htable_size) 586AC_INT_VAL_FROM_WITH(itable_size) 587AC_INT_VAL_FROM_WITH(otable_size) 588AC_INT_VAL_FROM_WITH(defmax) 589AC_INT_VAL_FROM_WITH(apply_cache_bits) 590AC_INT_VAL_FROM_WITH(rxcache_table) 591AC_INT_VAL_FROM_WITH(max_byte_transfer) 592AC_INT_VAL_FROM_WITH(udp_port) 593AC_INT_VAL_FROM_WITH(set_buffer_size_max) 594AC_INT_VAL_FROM_WITH(min_malloced) 595AC_INT_VAL_FROM_WITH(min_small_malloced) 596AC_INT_VAL_FROM_WITH(hard_malloc_limit) 597AC_INT_VAL_FROM_WITH(soft_malloc_limit) 598AC_INT_VAL_FROM_WITH(total_trace_length) 599AC_INT_VAL_FROM_WITH(pcre_recursion_limit) 600AC_INT_VAL_FROM_WITH(max_net_connects) 601AC_INT_VAL_FROM_WITH(random_period_length) 602 603if test "x$cdef_access_control" = "x#undef"; then 604 cdef_access_log="#undef" 605 val_access_file= 606 val_access_log= 607fi 608 609if test "x$cdef_access_log" = "x#undef"; then 610 val_access_log= 611fi 612 613if test "x$cdef_rxcache_table" = "x#undef"; then 614 val_rxcache_table= 615fi 616 617if test "x$with_wizlist_file" != "xno"; then 618 cdef_wizlist_file="#define" 619 if test "x$with_wizlist_file" = "xyes"; then 620 with_wizlist_file="" 621 fi 622else 623 cdef_wizlist_file="#undef" 624fi 625 626if test "x$cdef_wizlist_file" = "x#undef"; then 627 val_wizlist_file= 628fi 629 630if test "x$with_tls_keyfile" != "xno"; then 631 cdef_tls_keyfile="#define" 632else 633 cdef_tls_keyfile="#undef" 634fi 635 636if test "x$cdef_tls_keyfile" = "x#undef"; then 637 val_tls_keyfile= 638fi 639 640if test "x$with_tls_certfile" != "xno"; then 641 cdef_tls_certfile="#define" 642else 643 cdef_tls_certfile="#undef" 644fi 645 646if test "x$cdef_tls_certfile" = "x#undef"; then 647 val_tls_certfile= 648fi 649 650if test "x$with_tls_trustfile" != "xno"; then 651 cdef_tls_trustfile="#define" 652else 653 cdef_tls_trustfile="#undef" 654fi 655 656if test "x$cdef_tls_trustfile" = "x#undef"; then 657 val_tls_trustfile= 658fi 659 660if test "x$with_tls_trustdirectory" != "xno"; then 661 cdef_tls_trustdirectory="#define" 662else 663 cdef_tls_trustdirectory="#undef" 664fi 665 666if test "x$cdef_tls_trustdirectory" = "x#undef"; then 667 val_tls_trustdirectory= 668fi 669 670if test "x$with_tls_crlfile" != "xno"; then 671 cdef_tls_crlfile="#define" 672else 673 cdef_tls_crlfile="#undef" 674fi 675 676if test "x$cdef_tls_crlfile" = "x#undef"; then 677 val_tls_crlfile= 678fi 679 680if test "x$with_tls_crldirectory" != "xno"; then 681 cdef_tls_crldirectory="#define" 682else 683 cdef_tls_crldirectory="#undef" 684fi 685 686if test "x$cdef_tls_crldirectory" = "x#undef"; then 687 val_tls_crldirectory= 688fi 689 690if test "x$cdef_opcprof" = "x#undef"; then 691 cdef_verbose_opcprof="#undef" 692fi 693 694val_optimize=`echo ${val_optimize} | tr '[a-z]' '[A-Z]'` 695 696 697dnl 698dnl select a C-Compiler 699dnl 700AC_PROG_CC 701 702# check for ANSI-C (for compiling LDMUD project) 703AC_PROG_CC_STDC 704if test "${ac_cv_prog_cc_stdc}" = "no"; then 705 AC_MSG_ERROR(You need an ANSI-C89 or ISO-C (C99) compiler! sorry..) 706fi 707 708# --- check for support of various command line switches --- 709# -fwrapv is currently needed to enforce defined signed integr overflow (wrap) 710# in gcc. 711LD_CHECK_CC_SWITCH(-fwrapv, EXTRA_CFLAGS CFLAGS) 712# gcc should warn about optimizations based on the assumption, signed integers 713# do not overflow/wrap. 714LD_CHECK_CC_SWITCH(-Wall, WCFLAGS) 715LD_CHECK_CC_SWITCH(-Wparentheses, WCFLAGS) 716LD_CHECK_CC_SWITCH(-Wshadow, WCFLAGS) 717LD_CHECK_CC_SWITCH(-Wstrict-overflow=2, WCFLAGS) 718AC_MSG_CHECKING(warning CFLAGS) 719AC_MSG_RESULT($WCFLAGS) 720 721# does the compile have an inline keyword? 722AC_C_INLINE 723if test "x$ac_cv_c_inline" != "xno"; then 724 AC_DEFINE(HAS_INLINE, 1, [Does the compiler provide inline functions?]) 725fi 726 727# does the compile have an restrict keyword? 728# temporarily deactivated because it introduces an #if defined x into 729# machine.h and mkfunc.c can't deal with 'defined' without parentheses. 730#AC_C_RESTRICT 731 732# does the compile have an typeof keyword? 733AC_C_TYPEOF 734 735# does the preprocessor support the stringenizing operator? 736AC_C_STRINGIZE 737 738# does the compiler support variable length arrays? 739AC_C_VARARRAYS 740 741# does the compuler support the volatile keyword? 742AC_C_VOLATILE 743 744# check for some types 745AC_TYPE_INT8_T 746AC_TYPE_INT16_T 747AC_TYPE_INT32_T 748AC_TYPE_INT64_T 749AC_TYPE_INTMAX_T 750AC_TYPE_INTPTR_T 751AC_TYPE_UINT8_T 752AC_TYPE_UINT16_T 753AC_TYPE_UINT32_T 754AC_TYPE_UINT64_T 755AC_TYPE_UINTMAX_T 756AC_TYPE_UINTPTR_T 757AC_TYPE_LONG_LONG_INT 758AC_TYPE_UNSIGNED_LONG_LONG_INT 759AC_TYPE_LONG_DOUBLE 760AC_TYPE_LONG_DOUBLE_WIDER 761AC_TYPE_SSIZE_T 762AC_TYPE_SIZE_T 763AC_TYPE_OFF_T 764AC_TYPE_MODE_T 765AC_TYPE_PID_T 766AC_TYPE_SIGNAL 767 768# Check some sizes 769AC_CHECK_SIZEOF(char *) 770AC_CHECK_SIZEOF(int) 771AC_CHECK_SIZEOF(short) 772AC_CHECK_SIZEOF(long) 773AC_CHECK_SIZEOF(long long) 774AC_CHECK_SIZEOF(intptr_t) 775AC_CHECK_SIZEOF(intmax_t) 776 777 778# Checking for programs 779AC_PROG_INSTALL 780AC_CONFIG_HEADERS(machine.h) 781AC_CHECK_PROGS(YACC, byacc "bison -y", yacc) 782AC_PROG_CPP 783 784AH_TOP([ 785#ifndef MACHINE_H 786#define MACHINE_H]) 787AH_BOTTOM([ 788#endif]) 789 790dnl Recognize some unusual systems. 791dnl Not all checks happen here - the check for solaris for example requires 792dnl some library checks first. 793 794AC_EGREP_CPP(yes,[ 795#if defined(__CYGWIN32__) || defined(__CYGWIN__) 796yes 797#endif 798], 799[ EXTRA_CFLAGS="${EXTRA_CFLAGS} -DMSWIN" ]) 800 801dnl Checking for headers 802AC_HEADER_STDBOOL 803AC_CHECK_HEADERS(sys/rusage.h sys/time.h unistd.h stdlib.h libc.h memory.h) 804AC_CHECK_HEADERS(string.h bstring.h netdb.h crypt.h sys/param.h sys/termios.h) 805 806dnl extra check for <limits.h>; must be there! 807AC_CHECK_HEADERS(limits.h) 808AC_HEADER_DIRENT 809 810 811dnl check for some functions 812AC_FUNC_MKTIME 813AC_FUNC_ALLOCA 814AC_CHECK_FUNCS(fchmod getrusage bzero memset memcpy memmem strdup strcspn) 815AC_CHECK_FUNCS(strchr strrchr getcwd memmove sysconf gettimeofday wait3 waitpid) 816AC_CHECK_FUNCS(fcntl getdomainname poll strtoul trunc) 817AC_CHECK_FUNCS(mmap getpagesize) 818 819if test "x$ac_cv_type_signal" = "xvoid"; then 820 AC_DEFINE(RETSIGTYPE_VOID, 1, 821 [Set in response to the signal handler return type, since not all 822 compilers understand direct definition comparisons. 823 ]) 824fi 825 826# --- Check for common system libraries --- 827 828AC_CHECK_LIB(m,main) 829AC_CHECK_LIB(socket,main) 830AC_CHECK_LIB(nsl,main) 831 832ERQ_LIBS="$LIBS" 833 834AC_CHECK_LIB(ucb,main, LIBS="$LIBS -lc -lucb") 835if test "$ac_cv_lib_socket_main" = "yes" || test "$ac_cv_lib_ucb_main" = "yes"; then 836 AC_CHECK_LIB(nsl,main) 837fi 838 839AC_CACHE_CHECK(if -lresolv is needed, lp_cv_need_lib_resolv, 840 AC_TRY_RUN([ 841#include <netdb.h> 842void t (void) 843{ 844 herror("foo"); 845} 846int main(void) 847{ 848 return 0; 849} 850 ], 851 lp_cv_need_lib_resolv=no, 852 lp_cv_need_lib_resolv=yes 853)) 854if test "$lp_cv_need_lib_resolv" = "yes"; then 855 AC_CHECK_LIB(resolv,main, LIBS="$LIBS -lresolv") 856fi 857 858# --- Check if we need the crypto libraries --- 859AC_CHECK_FUNCS(crypt _crypt) 860for lp_lib in crypt crypto; do 861 if test "$ac_cv_func_crypt" != "yes" -a "$ac_cv_func__crypt" != "yes"; then 862 # Try linking with lib$lp_lib 863 unset ac_cv_func_crypt 864 unset ac_cv_func__crypt 865 lp_save_libs="$LIBS" 866 AC_CHECK_LIB($lp_lib,main, LIBS="$LIBS -l$lp_lib") 867 868 if test "$SAVE_LIBS" != "$LIBS" ; then 869 AC_CHECK_FUNCS(crypt _crypt) 870 if test "$ac_cv_func_crypt" != "yes" -a "$ac_cv_func__crypt" != "yes"; then 871 # They are not in this library 872 LIBS="$lp_save_libs" 873 else 874 eval "lp_cv_need_lib_${lp_lib}=yes" 875 fi 876 fi 877 fi 878done 879 880AC_CACHE_CHECK(if inet_ntoa() ok,lp_cv_func_inet_ntoa_ok, 881AC_TRY_RUN([ 882#include <sys/types.h> /* needed for netinet/in.h */ 883#include <netinet/in.h> 884#include <arpa/inet.h> 885main() { 886 char addr1[[]] = "176.88.1.16"; 887 char addr2[[]] = "88.176.128.2"; 888 struct in_addr tmp; 889 890#if SIZEOF_INT == 4 891#define ADDR_TYPE unsigned int 892#else 893#define ADDR_TYPE unsigned long 894#endif 895 *((ADDR_TYPE *)&tmp) = inet_addr(addr1); 896 if (strcmp(addr1, inet_ntoa(tmp))) 897 exit(1); 898 *((ADDR_TYPE *)&tmp) = inet_addr(addr2); 899 if (strcmp(addr2, inet_ntoa(tmp))) 900 exit(1); 901 exit(0); 902} 903],lp_cv_func_inet_ntoa_ok=yes, 904lp_cv_func_inet_ntoa_ok=no, 905AC_TRY_COMPILE([ 906#if defined(sun) && !defined(__svr4__) 907#include <sys/types.h> /* needed for netinet/in.h */ 908#include <netinet/in.h> 909#include <arpa/inet.h> 910char *inet_ntoa(ad) 911 struct in_addr ad; 912{ 913 static char addr[[[20]]]; 914 return addr; 915} 916#else 917use inet_ntoa() from the library. 918#endif 919],,lp_cv_func_inet_ntoa_ok=no, 920lp_cv_func_inet_ntoa_ok=yes 921))) 922if test "$lp_cv_func_inet_ntoa_ok" = "yes" ; then 923dnl TODO: Is there any platform where this is not the case? 924 AC_DEFINE(INET_NTOA_OK, 1, [Is the library function inet_ntoa() compatible with the compiler?]) 925fi 926 927# --- IPV6 --- 928 929AC_CACHE_CHECK(for IPv6 support,lp_cv_has_ipv6, 930 saveflags="$CFLAGS" 931 CFLAGS="$CFLAGS -I/usr/inet6/include" 932 AC_TRY_COMPILE([ 933#include <sys/types.h> 934#include <netinet/in.h> 935 936struct sockaddr_in6 foo(void) 937{ 938 static struct sockaddr_in6 ad; 939 940 return ad; 941} 942 ],,lp_cv_has_ipv6=yes, 943 lp_cv_has_ipv6=no 944 CFLAGS="$saveflags" 945)) 946if test "$lp_cv_has_ipv6" = "yes"; then 947 AC_DEFINE(HAS_IPV6, 1, [Does the machine offer IPv6?]) 948 if test "$enable_use_ipv6" = "yes"; then 949 AC_CACHE_CHECK(if -linet6 is needed, lp_cv_need_lib_inet6, 950 AC_TRY_RUN([ 951#include <sys/types.h> 952#include <netinet/in.h> 953void t (void) 954{ 955 struct sockaddr_in6 ad; 956 inet6_ntoa(ad.sin_addr); 957} 958int main(void) 959{ 960 return 0; 961} 962 ], 963 lp_cv_need_lib_inet6=no, 964 lp_cv_need_lib_inet6=yes 965 )) 966 if test "$lp_cv_need_lib_inet6" = "yes"; then 967 AC_CHECK_LIB(inet6,main, LIBS="$LIBS -linet6") 968 fi 969 fi 970else 971 if test "$enable_use_ipv6" = "yes"; then 972 echo "IPV6 not supported - disabling IPV6 support." 973 AC_NOT_AVAILABLE(use-ipv6) 974 fi 975 cdef_use_ipv6="#undef" 976 enable_use_ipv6=no 977fi 978 979# --- TLS --- 980 981has_tls=no 982 983saveflags="$CFLAGS" 984saveeflags="$EXTRA_CFLAGS" 985savelibs="$LIBS" 986savepkglibs="$PKGLIBS" 987 988# Check for OpenSSL unless not desired 989# Check for the libraries only if tls is actually enabled. 990 991if test ! "x${tls_include_path}" = "x"; then 992 CFLAGS="$CFLAGS -I${tls_include_path}" 993 EXTRA_CFLAGS="$EXTRA_CFLAGS -I${tls_include_path}" 994fi 995 996if test ! "x${tls_lib_path}" = "x"; then 997 LIBS="$LIBS -L${tls_lib_path}" 998 PKGLIBS="$PKGLIBS -L${tls_lib_path}" 999fi 1000 1001if test "$tls_package" = "any" -o "$tls_package" = "ssl"; then 1002 1003 AC_CACHE_CHECK(for OpenSSL support,lp_cv_has_openssl, 1004 AC_TRY_COMPILE([ 1005 #include <openssl/ssl.h> 1006 1007 void foo(void) 1008 { 1009 int i = SSL_MAX_SSL_SESSION_ID_LENGTH; 1010 } 1011 ],,lp_cv_has_openssl=yes, 1012 lp_cv_has_openssl=no 1013 )) 1014 1015 if test "$lp_cv_has_openssl" = "yes"; then 1016 has_tls=yes 1017 tls_package=ssl 1018 AC_DEFINE(HAS_OPENSSL, 1, [Does the machine offer OpenSSL/SSL?]) 1019 1020 if test "$enable_use_tls" = "yes"; then 1021 AC_CACHE_CHECK(if -lssl or similar is needed, lp_cv_need_lib_ssl, 1022 AC_TRY_RUN([ 1023 #include <openssl/ssl.h> 1024 void t (void) 1025 { 1026 SSL_library_init(); 1027 } 1028 int main(void) 1029 { 1030 return 0; 1031 } 1032 ], 1033 lp_cv_need_lib_ssl=no, 1034 lp_cv_need_lib_ssl=yes 1035 )) 1036 if test "$lp_cv_need_lib_ssl" = "yes"; then 1037 lp_cv_has_lib_ssl=no 1038 AC_CHECK_LIB(ssl,SSL_library_init, 1039 PKGLIBS="$PKGLIBS -lssl" 1040 lp_cv_has_lib_ssl=yes 1041 ) 1042 fi 1043 1044 if test "x$lp_cv_need_lib_crypto" != "xyes"; then 1045 AC_CACHE_CHECK(if -lcrypto is needed for SSL, lp_cv_need_lib_crypto, 1046 AC_TRY_RUN([ 1047#include <openssl/ssl.h> 1048void t (void) 1049{ 1050 DH *dhe1024 = NULL; 1051 DH_free(dhe1024); 1052} 1053int main(void) 1054{ 1055 return 0; 1056} 1057 ], 1058 lp_cv_need_lib_crypto=no, 1059 lp_cv_need_lib_crypto=yes 1060 )) 1061 if test "$lp_cv_need_lib_crypto" = "yes"; then 1062 AC_CHECK_LIB(crypto,main, PKGLIBS="$PKGLIBS -lcrypto") 1063 fi 1064 fi 1065 fi 1066 else 1067 has_tls=no 1068 fi 1069fi 1070 1071# Check for GnuTLS unless not desired 1072 1073if test "$tls_package" = "any" -o "$tls_package" = "gnu"; then 1074 1075 AC_CACHE_CHECK(for GnuTLS support,lp_cv_has_gnutls, 1076 AC_TRY_COMPILE([ 1077 #include <gnutls/gnutls.h> 1078 1079 void foo(void) 1080 { 1081 int i = GNUTLS_CIPHER_RIJNDAEL_256_CBC; 1082 } 1083 ],,lp_cv_has_gnutls=yes, 1084 lp_cv_has_gnutls=no 1085 )) 1086 1087 if test "$lp_cv_has_gnutls" = "yes"; then 1088 has_tls=yes 1089 tls_package=gnu 1090 AC_DEFINE(HAS_GNUTLS, 1, [Does the machine offer GnuTLS?]) 1091 1092 if test "$enable_use_tls" = "yes"; then 1093 AC_CACHE_CHECK(if -lgnutls or similar is needed, lp_cv_need_lib_gnutls, 1094 AC_TRY_RUN([ 1095 #include <gnutls/gnutls.h> 1096 void t (void) 1097 { 1098 gnutls_global_init(); 1099 gnutls_global_deinit(); 1100 } 1101 int main(void) 1102 { 1103 return 0; 1104 } 1105 ], 1106 lp_cv_need_lib_gnutls=no, 1107 lp_cv_need_lib_gnutls=yes 1108 )) 1109 if test "$lp_cv_need_lib_gnutls" = "yes"; then 1110 lp_cv_has_lib_gnutls=no 1111 AC_CHECK_LIB(gnutls,gnutls_global_init, 1112 PKGLIBS="$PKGLIBS -lgnutls" 1113 lp_cv_has_lib_gnutls=yes 1114 ) 1115 fi 1116 AC_CACHE_CHECK(gnutls version, lp_cv_has_gnutls_version, 1117 savelibs="$LIBS" 1118 LIBS="$PKGLIBS" 1119 AC_TRY_RUN([ 1120 #include <gnutls/gnutls.h> 1121 void t (void) 1122 { 1123 gnutls_dh_params dh_params; 1124 gnutls_dh_params_generate2( dh_params, 1024); 1125 } 1126 int main(void) 1127 { 1128 return 0; 1129 } 1130 ], 1131 lp_cv_has_gnutls_version=8, 1132 lp_cv_has_gnutls_version=7 1133 )) 1134 LIBS="$savelibs" 1135 AC_DEFINE_UNQUOTED(HAS_GNUTLS_VERSION, $lp_cv_has_gnutls_version, [version of GNUTLS library]) 1136 fi 1137 1138 else 1139 has_tls=no 1140 fi 1141fi 1142 1143# Evaluate the results of the checks 1144 1145if test "$has_tls" = "no"; then 1146 if test "$enable_use_tls" = "yes"; then 1147 echo "TLS not supported - disabling TLS support." 1148 AC_NOT_AVAILABLE(use-tls) 1149 fi 1150 cdef_use_tls="#undef" 1151 enable_use_tls=no 1152 EXTRA_CFLAGS="$saveeflags" 1153 PKGLIBS="$savepkglibs" 1154fi 1155 1156CFLAGS="$saveflags" 1157LIBS="$savelibs" 1158 1159# --- Gcrypt --- 1160 1161if test "$tls_package" != "ssl"; then 1162 1163 AC_CACHE_CHECK(for libgcrypt,lp_cv_has_gcrypt, 1164 for TESTPATH in "" "$gcrypt_path" "$gcrypt_path/include" "/usr/local/include" ; do 1165 saveflags="$CFLAGS" 1166 if test "x$TESTPATH" != "x"; then 1167 CFLAGS="$saveflags -I$TESTPATH" 1168 fi 1169 AC_TRY_COMPILE([ 1170 #include <gcrypt.h> 1171 1172 void foo(void) 1173 { 1174 int algo = GCRY_MD_SHA1; 1175 } 1176 ],, 1177 lp_cv_has_gcrypt=yes 1178 if test "x$TESTPATH" != "x"; then 1179 EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" 1180 fi 1181 break; 1182 , 1183 lp_cv_has_gcrypt=no 1184 CFLAGS="$saveflags" 1185 ) 1186 done 1187 ) 1188 1189 if test "$lp_cv_has_gcrypt" = "yes"; then 1190 saveflags="$CFLAGS" 1191 AC_DEFINE(HAS_GCRYPT, 1, [Does the machine offer libgcrypt?]) 1192 1193 if test "$enable_use_gcrypt" = "yes"; then 1194 tmp="" 1195 1196 AC_CHECK_LIB(gcrypt,gcry_check_version, tmp="$PKGLIBS -lgcrypt") 1197 1198 if test "x$tmp" == "x" && test "x$gcrypt_path" != "x"; then 1199 unset ac_cv_lib_gcrypt_main 1200 if test -d "${gcrypt_path}/lib/gcrypt"; then 1201 CFLAGS="$saveflags -L${gcrypt_path}/lib/gcrypt" 1202 AC_CHECK_LIB(gcrypt,gcry_check_version, tmp="$PKGLIBS -L${gcrypt_path}/lib/gcrypt -lgcrypt") 1203 elif test -d "${gcrypt_path}/lib"; then 1204 CFLAGS="$saveflags -L${gcrypt_path}/lib" 1205 AC_CHECK_LIB(gcrypt,gcry_check_version, tmp="$PKGLIBS -L${gcrypt_path}/lib -lgcrypt") 1206 elif test -d "${gcrypt_patch}"; then 1207 CFLAGS="$saveflags -L$gcrypt_path" 1208 AC_CHECK_LIB(gcrypt,gcry_check_version, tmp="$PKGLIBS -L$gcrypt_path -lgcrypt") 1209 fi 1210 fi 1211 1212 if test "x$tmp" == "x"; then 1213 echo "libgcrypt library not found - disabling gcrypt support" 1214 AC_NOT_AVAILABLE(use-gcrypt) 1215 cdef_use_gcrypt="#undef" 1216 enable_use_gcrypt="no" 1217 lp_cv_has_gcrypt="no" 1218 else 1219 PKGLIBS="$tmp" 1220 fi 1221 fi 1222 1223 CFLAGS="$saveflags" 1224 else 1225 if test "$enable_use_gcrypt" = "yes"; then 1226 AC_NOT_AVAILABLE(use-gcrypt) 1227 cdef_use_gcrypt="#undef" 1228 enable_use_gcrypt=no 1229 fi 1230 fi 1231else 1232 cdef_use_gcrypt="#undef" 1233 enable_use_gcrypt=no 1234fi 1235 1236# --- PCRE --- 1237 1238lp_cv_has_pcre_lib="no" 1239AC_CHECK_LIB(pcre,main, lp_cv_has_pcre_lib="yes") 1240 1241if test "$lp_cv_has_pcre_lib" = "yes"; then 1242 saveflags="$CFLAGS" 1243 CFLAGS="$CFLAGS -lpcre" 1244 AC_CACHE_CHECK(for PCRE usability,lp_cv_has_pcre, 1245 AC_TRY_RUN([ 1246#include <pcre.h> 1247 1248pcre_extra foo(void) 1249{ 1250 pcre_version(); 1251} 1252int main(void) 1253{ 1254 return 0; 1255} 1256 ], 1257 lp_cv_has_pcre=yes, 1258 lp_cv_has_pcre=no 1259 )) 1260 CFLAGS="$saveflags" 1261 1262 if test "$lp_cv_has_pcre" = "yes"; then 1263 AC_DEFINE(HAS_PCRE, 1, [Does the machine offer PCRE?]) 1264 PKGLIBS="$PKGLIBS -lpcre" 1265 else 1266 if test "$enable_use_builtin_pcre" = "no" ; then 1267 echo "PCRE not available in the system - using builtin version." 1268 enable_use_builtin_pcre="yes" 1269 cdef_use_builtin_pcre="#define" 1270 fi 1271 fi 1272fi 1273 1274# --- iconv --- 1275 1276# iconv in glibc 2.2.5 is broken - but not every system even 1277# uses glibc. 1278changequote(,)dnl 1279echo "$as_me:$LINENO: checking for broken iconv in glibc 2.0-2.2" >&5 1280echo $ECHO_N "checking for broken iconv in glibc 2.0-2.2... $ECHO_C" >&6 1281if test -f /usr/sbin/iconvconfig; then 1282 if /usr/sbin/iconvconfig -V | egrep ' 2\.[0-2]' >/dev/null 2>&1; then 1283 lp_cv_has_broken_iconv="yes" 1284 lp_cv_has_iconv="no" 1285 else 1286 lp_cv_has_broken_iconv="no" 1287 fi 1288else 1289 lp_cv_has_broken_iconv="no" 1290fi 1291echo "$as_me:$LINENO: result: $lp_cv_has_broken_iconv" >&5 1292echo "${ECHO_T}$lp_cv_has_broken_iconv" >&6 1293changequote([,])dnl 1294 1295AC_CACHE_CHECK(for iconv,lp_cv_has_iconv, 1296for TESTPATH in "" "/usr/local/include"; do 1297 saveflags="$CFLAGS" 1298 if test "x$TESTPATH" != "x"; then 1299 CFLAGS="-I$TESTPATH $saveflags" 1300 fi 1301AC_TRY_COMPILE([ 1302#include <iconv.h> 1303 1304iconv_t * foo(void) 1305{ 1306 return 0; 1307} 1308],, 1309lp_cv_has_iconv=yes 1310if test "x$TESTPATH" != "x"; then 1311 EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" 1312fi 1313break; 1314, 1315lp_cv_has_iconv=no 1316CFLAGS="$saveflags" 1317) 1318done 1319) 1320 1321 1322# The system has the include files - now perform further checks 1323if test "x$lp_cv_has_iconv" = "xyes"; then 1324 saveflags="$CFLAGS" 1325 1326 # Some systems define iconv() to take a non-const 'char**' as first arg. 1327 AC_MSG_CHECKING(if iconv takes a non-const char**) 1328 1329 CFLAGS="$CFLAGS $EXTRA_CFLAGS" 1330 tcomp2='${CC-cc} ${CFLAGS} -o conftest.o -c conftest.c 2>&1' 1331 cat > conftest.c <<EOF 1332#include <stdlib.h> 1333#include <iconv.h> 1334 1335int foo(void) 1336{ 1337 const char * in; 1338 1339 return iconv(NULL, &in, NULL, NULL, NULL); 1340} 1341EOF 1342 1343 changequote(,)dnl 1344 1345 if echo `eval $tcomp2` | egrep '[a-z]' >/dev/null; then 1346 # Success means 'we got output' here :-( 1347 lp_cv_has_iconv_nonconst_in=yes 1348 else 1349 lp_cv_has_iconv_nonconst_in=no 1350 fi 1351 CFLAGS="$saveflags" 1352 1353 changequote([,])dnl 1354 1355 AC_MSG_RESULT($lp_cv_has_iconv_nonconst_in) 1356 1357 # Does the system need to link in libiconv? 1358 AC_CACHE_CHECK(if -liconv is needed, lp_cv_need_lib_iconv, 1359 AC_TRY_RUN([ 1360#include <stdlib.h> 1361#include <iconv.h> 1362int t (void) 1363{ 1364 return iconv(NULL, NULL, NULL, NULL, NULL); 1365} 1366int main(void) 1367{ 1368 return 0; 1369} 1370 ], 1371 lp_cv_need_lib_iconv=no, 1372 lp_cv_need_lib_iconv=yes 1373 )) 1374 if test "$lp_cv_need_lib_iconv" = "yes"; then 1375 # Search the libraries 1376 1377 tmp="" 1378 1379 AC_CHECK_LIB(iconv,libiconv_close, tmp="$PKGLIBS -liconv") 1380 1381 if test "x$tmp" = "x"; then 1382 CFLAGS="$saveflags -L/usr/local/lib" 1383 AC_CHECK_LIB(iconv,libiconv_close, tmp="$PKGLIBS -L/usr/local/lib -liconv") 1384 fi 1385 1386 if test "x$tmp" = "x"; then 1387 echo "iconv library not found." 1388 lp_cv_has_iconv="no" 1389 else 1390 PKGLIBS="$tmp" 1391 fi 1392 1393 CFLAGS="$saveflags" 1394 fi 1395fi 1396 1397if test "x$lp_cv_has_iconv" = "xyes"; then 1398 AC_DEFINE(HAS_ICONV, 1, [Does the machine offer iconv?]) 1399fi 1400 1401if test "x$lp_cv_has_iconv_nonconst_in" = "xyes"; then 1402 AC_DEFINE(HAS_ICONV_NONCONST_IN, 1, [Does the machine's iconv take a non-const 'char**' as first arg?]) 1403fi 1404 1405# --- libidn --- 1406AC_CHECK_HEADER(idna.h, lp_cv_has_idn=yes,lp_cv_has_idn=no) 1407AC_CHECK_HEADER(stringprep.h, lp_cv_has_idn=yes,lp_cv_has_idn=no) 1408AC_CHECK_LIB(idn, stringprep_check_version, 1409 [lp_cv_has_idn=yes LIBS="${LIBS} -lidn"],lp_cv_has_idn=no) 1410if test "x$lp_cv_has_idn" = "xyes"; then 1411 AC_DEFINE(HAS_IDN, 1, [Does the machine offer IDNA?]) 1412fi 1413 1414# --- mySQL --- 1415 1416# Note: Some compilers don't have /usr/local/include in their standard 1417# searchpath. 1418# Note: Some systems require zlib together with mysqlclient, but don't 1419# like it if -lz precedes the -lmysqlclient in the link command. 1420 1421AC_CACHE_CHECK(for mySQL,lp_cv_has_mysql, 1422for TESTPATH in "" "${mysql_path}/include/mysql" "${mysql_path}/include" "${mysql_path}" "/usr/local/mysql/include/mysql" "/usr/local/mysql/include" "/usr/local/include/mysql" "/usr/local/include" "/usr/lib/mysql/include" "/usr/lib/mysql/mysql" "/usr/lib/mysql" "/usr/include/mysql"; do 1423 saveflags="$CFLAGS" 1424 if test "x$TESTPATH" != "x"; then 1425 CFLAGS="-I$TESTPATH $saveflags" 1426 fi 1427AC_TRY_COMPILE([ 1428#include <sys/types.h> 1429#include <mysql.h> 1430#include <errmsg.h> 1431 1432struct MYSQL * foo(void) 1433{ 1434 static MYSQL var; 1435 1436 return &var; 1437} 1438],, 1439lp_cv_has_mysql=yes 1440if test "x$TESTPATH" != "x"; then 1441 EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" 1442fi 1443break; 1444, 1445lp_cv_has_mysql=no 1446CFLAGS="$saveflags" 1447) 1448done 1449) 1450 1451# The system has the include files - now search for the libraries. 1452if test "$lp_cv_has_mysql" = "yes"; then 1453 saveflags="$CFLAGS" 1454 AC_DEFINE(HAS_MYSQL, 1, [Does the machine offer mySQL?]) 1455 1456 if test "$enable_use_mysql" = "yes"; then 1457 tmp="" 1458 1459 if test "x$mysql_path" = "x"; then 1460 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -lmysqlclient") 1461 if test "x$tmp" = "x"; then 1462 if test -d "/usr/local/mysql/lib/mysql"; then 1463 unset ac_cv_lib_mysqlclient_main 1464 CFLAGS="$saveflags -L/usr/local/mysql/lib/mysql" 1465 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L/usr/local/mysql/lib/mysql -lmysqlclient") 1466 elif test -d "/usr/local/mysql/lib"; then 1467 unset ac_cv_lib_mysqlclient_main 1468 CFLAGS="$saveflags -L/usr/local/mysql/lib" 1469 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L/usr/local/mysql/lib -lmysqlclient") 1470 elif test -d "/usr/local/lib"; then 1471 unset ac_cv_lib_mysqlclient_main 1472 CFLAGS="$saveflags -L/usr/local/lib" 1473 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L/usr/local/lib -lmysqlclient") 1474 elif test -d "/usr/lib/mysql/lib"; then 1475 unset ac_cv_lib_mysqlclient_main 1476 CFLAGS="$saveflags -L/usr/lib/mysql/lib" 1477 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L/usr/lib/mysql/lib -lmysqlclient") 1478 fi 1479 fi 1480 else 1481 if test -d "${mysql_path}/lib/mysql"; then 1482 CFLAGS="$saveflags -L${mysql_path}/lib/mysql" 1483 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L${mysql_path}/lib/mysql -lmysqlclient") 1484 elif test -d "${mysql_path}/lib"; then 1485 CFLAGS="$saveflags -L${mysql_path}/lib" 1486 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L${mysql_path}/lib -lmysqlclient") 1487 else 1488 CFLAGS="$saveflags -L$mysql_path" 1489 AC_CHECK_LIB(mysqlclient,main, tmp="$PKGLIBS -L$mysql_path -lmysqlclient") 1490 fi 1491 fi 1492 1493 if test "x$tmp" = "x"; then 1494 echo "mysqlclient library not found - disabling mySQL support" 1495 AC_NOT_AVAILABLE(use-mysql) 1496 cdef_use_mysql="#undef" 1497 enable_use_mysql="no" 1498 mysql_path= 1499 lp_cv_has_mysql="no" 1500 else 1501 PKGLIBS="$tmp" 1502 fi 1503 fi 1504 1505 if test "$enable_use_mysql" = "yes"; then 1506 # Some systems need additional libraries 1507 savelibs="$LIBS" 1508 LIBS="$LIBS $PKGLIBS" 1509 1510 AC_CACHE_CHECK(if -lz is needed, lp_cv_need_lib_z, 1511 AC_TRY_RUN([ 1512#include <mysql/mysql.h> 1513void t (void) 1514{ 1515 MYSQL *dat; 1516 1517 mysql_real_connect(dat, "localhost", "user", "pwd", "db", 0, 0, 0); 1518} 1519int main(void) 1520{ 1521 return 0; 1522} 1523 ], 1524 lp_cv_need_lib_z=no, 1525 lp_cv_need_lib_z=yes 1526 )) 1527 if test "$lp_cv_need_lib_z" = "yes"; then 1528 AC_CHECK_LIB(z,main, PKGLIBS="$PKGLIBS -lz") 1529 fi 1530 1531 AC_CACHE_CHECK(if -lnsl is needed, lp_cv_need_lib_nsl, 1532 AC_TRY_RUN([ 1533#include <mysql/mysql.h> 1534void t (void) 1535{ 1536 MYSQL *dat; 1537 1538 mysql_real_connect(dat, "localhost", "user", "pwd", "db", 0, 0, 0); 1539} 1540int main(void) 1541{ 1542 return 0; 1543} 1544 ], 1545 lp_cv_need_lib_nsl=no, 1546 lp_cv_need_lib_nsl=yes 1547 )) 1548 if test "$lp_cv_need_lib_nsl" = "yes"; then 1549 AC_CHECK_LIB(nsl,main, PKGLIBS="$PKGLIBS -lnsl") 1550 fi 1551 1552 LIBS="$savelibs" 1553 fi 1554 1555 CFLAGS="$saveflags" 1556else 1557 if test "$enable_use_mysql" = "yes"; then 1558 AC_NOT_AVAILABLE(use-mysql) 1559 cdef_use_mysql="#undef" 1560 enable_use_mysql=no 1561 fi 1562fi 1563 1564# --- 1565 1566# --- PostgreSQL --- 1567 1568# Note: Some compilers don't have /usr/local/include in their standard 1569# searchpath. 1570 1571AC_CACHE_CHECK(for PostgresSQL,lp_cv_has_pgsql, 1572for TESTPATH in "" "$pgsql_path" "$pgsql_path/include" "/usr/local/pgsql/include" "/usr/local/include/pgsql" "/usr/include/pgsql" "/usr/lib/pgsql" "/usr/local/include"; do 1573 saveflags="$CFLAGS" 1574 if test "x$TESTPATH" != "x"; then 1575 CFLAGS="$saveflags -I$TESTPATH" 1576 fi 1577AC_TRY_COMPILE([ 1578#include <libpq-fe.h> 1579 1580PGconn * foo(void) 1581{ 1582 static PGconn * var; 1583 1584 return var; 1585} 1586],, 1587lp_cv_has_pgsql=yes 1588if test "x$TESTPATH" != "x"; then 1589 EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" 1590fi 1591break; 1592, 1593lp_cv_has_pgsql=no 1594CFLAGS="$saveflags" 1595) 1596done 1597) 1598 1599# The system has the include files - now search for the libraries. 1600if test "$lp_cv_has_pgsql" = "yes"; then 1601 saveflags="$CFLAGS" 1602 AC_DEFINE(HAS_PGSQL, 1, [Does the machine offer PostgreSQL?]) 1603 1604 if test "$enable_use_pgsql" = "yes"; then 1605 tmp="" 1606 1607 AC_CHECK_LIB(pq,main, tmp="$PKGLIBS -lpq") 1608 1609 if test "x$pgsql_path" == "x"; then 1610 unset ac_cv_lib_pq_main 1611 if test -d "${pgsql_path}/lib/pgsql"; then 1612 CFLAGS="$saveflags -L${pgsql_path}/lib/pgsql" 1613 AC_CHECK_LIB(pq,main, tmp="$PKGLIBS -L${pgsql_path}/lib/pgsql -lpq") 1614 elif test -d "${pgsql_path}/lib"; then 1615 CFLAGS="$saveflags -L${pgsql_path}/lib" 1616 AC_CHECK_LIB(pq,main, tmp="$PKGLIBS -L${pgsql_path}/lib -lpq") 1617 elif test -d "${pgsql_patch}"; then 1618 CFLAGS="$saveflags -L$pgsql_path" 1619 AC_CHECK_LIB(pq,main, tmp="$PKGLIBS -L$pgsql_path -lpq") 1620 fi 1621 fi 1622 1623 if test "x$tmp" == "x"; then 1624 unset ac_cv_lib_pq_main 1625 if test -d "/usr/local/pgsql/lib"; then 1626 CFLAGS="$saveflags -L/usr/local/pgsql/lib" 1627 AC_CHECK_LIB(pq,main, tmp="$PKGLIBS -L/usr/local/pgsql/lib -lpq") 1628 fi 1629 fi 1630 1631 if test "x$tmp" == "x"; then 1632 echo "libpq library not found - disabling PostgreSQL support" 1633 AC_NOT_AVAILABLE(use-pgsql) 1634 cdef_use_pgsql="#undef" 1635 enable_use_pgsql="no" 1636 pgsql_path= 1637 lp_cv_has_pgsql="no" 1638 else 1639 PKGLIBS="$tmp" 1640 fi 1641 fi 1642 1643 if test "x$enable_use_pgsql" = "xyes"; then 1644 # Some systems need additional libraries 1645 savelibs="$LIBS" 1646 LIBS="$LIBS $PKGLIBS" 1647 1648 AC_CACHE_CHECK(if -lssl is needed, lp_cv_need_lib_ssl, 1649 AC_TRY_RUN([ 1650#include <libpq-fe.h> 1651void t (void) 1652{ 1653 PQconnectStart(""); 1654} 1655int main(void) 1656{ 1657 return 0; 1658} 1659 ], 1660 lp_cv_need_lib_ssl=no, 1661 lp_cv_need_lib_ssl=yes 1662 )) 1663 if test "$lp_cv_need_lib_ssl" = "yes"; then 1664 AC_CHECK_LIB(ssl,main, PKGLIBS="$PKGLIBS -lssl") 1665 fi 1666 1667 if test "x$lp_cv_need_lib_crypto" != "xyes"; then 1668 AC_CACHE_CHECK(if -lcrypto is needed, lp_cv_need_lib_crypto, 1669 AC_TRY_RUN([ 1670#include <libpq-fe.h> 1671void t (void) 1672{ 1673 PQconnectStart(""); 1674} 1675int main(void) 1676{ 1677 return 0; 1678} 1679 ], 1680 lp_cv_need_lib_crypto=no, 1681 lp_cv_need_lib_crypto=yes 1682 )) 1683 if test "$lp_cv_need_lib_crypto" = "yes"; then 1684 AC_CHECK_LIB(crypto,main, PKGLIBS="$PKGLIBS -lcrypto") 1685 fi 1686 fi 1687 1688 LIBS="$savelibs" 1689 fi 1690 1691 CFLAGS="$saveflags" 1692else 1693 if test "$enable_use_pgsql" = "yes"; then 1694 AC_NOT_AVAILABLE(use-pgsql) 1695 cdef_use_pgsql="#undef" 1696 enable_use_pgsql=no 1697 fi 1698fi 1699 1700# --- SQLite3 --- 1701 1702ifdef([PKG_PROG_PKG_CONFIG],[PKG_PROG_PKG_CONFIG()],[]) 1703 1704AC_MY_SEARCH_LIB(SQLITE3,sqlite3,lp_cv_has_sqlite3,sqlite3,xml_path, 1705[ 1706 #include <sqlite3.h> 1707 1708 sqlite3 * foo(void) 1709 { 1710 return (sqlite3*)0; 1711 } 1712],sqlite3,sqlite3_exec,enable_use_sqlite) 1713 1714 1715if test "$lp_cv_has_sqlite3" = "yes"; then 1716 AC_DEFINE(HAS_SQLITE3, 1, [Does the machine offer SQLite3?]) 1717 1718 if test "x$enable_use_sqlite" = "xyes"; then 1719 savelibs="$LIBS" 1720 LIBS="$LIBS $PKGLIBS" 1721 1722 # Check if it uses pthreads 1723 1724 AC_SEARCH_LIBS(pthread_create,, 1725 lp_cv_sqlite3_uses_pthreads=yes, 1726 lp_cv_sqlite3_uses_pthreads=no 1727 ) 1728 1729 if test "$lp_cv_sqlite3_uses_pthreads" = "yes" ; then 1730 AC_DEFINE(SQLITE3_USES_PTHREADS, 1, [Does SQLite3 use pthreads?]) 1731 fi 1732 1733 LIBS="$savelibs" 1734 fi 1735else 1736 if test "$enable_use_sqlite" = "yes"; then 1737 echo "libsqlite3 library not found - disabling SQLite support" 1738 AC_NOT_AVAILABLE(use-sqlite) 1739 fi 1740 1741 cdef_use_sqlite="#undef" 1742 enable_use_sqlite="no" 1743 sqlite= 1744fi 1745 1746# --- XML --- 1747 1748has_xml=no 1749 1750if test "$xml_package" = "any" -o "$xml_package" = "xml2"; then 1751 1752 AC_MY_SEARCH_LIB(XML2,libxml-2.0,lp_cv_has_xml2,libxml2,xml_path, 1753 [ 1754 #include <libxml/parser.h> 1755 1756 void foo(void) 1757 { 1758 xmlElementType type = XML_ELEMENT_NODE; 1759 } 1760 ],xml2,xmlParseFile,enable_use_xml) 1761 1762 if test "$lp_cv_has_xml2" = "yes"; then 1763 if test "$enable_use_xml" = "yes"; then 1764 has_xml=yes 1765 xml_package=xml2 1766 AC_DEFINE(HAS_XML2, 1, [Does the machine have libxml2?]) 1767 fi 1768 fi 1769fi 1770 1771if test "$xml_package" = "any" -o "$xml_package" = "iksemel"; then 1772 1773 AC_MY_SEARCH_LIB(IKSEMEL,iksemel,lp_cv_has_iksemel,iksemel,xml_path, 1774 [ 1775 #include <iksemel.h> 1776 1777 iks * foo(void) 1778 { 1779 return (iks*)0; 1780 } 1781 ],iksemel,iks_parse,enable_use_xml) 1782 1783 if test "$lp_cv_has_iksemel" = "yes"; then 1784 if test "$enable_use_xml" = "yes"; then 1785 has_xml=yes 1786 xml_package=iksemel 1787 AC_DEFINE(HAS_IKSEMEL, 1, [Does the machine have Iksemel?]) 1788 fi 1789 fi 1790fi 1791 1792if test "$has_xml" = "no"; then 1793 if test "$enable_use_xml" = "yes"; then 1794 echo "XML not supported - disabling XML support." 1795 AC_NOT_AVAILABLE(use-xml) 1796 fi 1797 1798 cdef_use_xml="#undef" 1799 enable_use_xml=no 1800fi 1801 1802 1803# --- Check if we need zlib libraries for mccp --- 1804 1805if test "x$enable_use_mccp" = "x" || test "x$enable_use_mccp" = "xyes"; then 1806 if test "$lp_cv_need_lib_z" != "yes"; then 1807 AC_CHECK_LIB(z,main, 1808 PKGLIBS="$PKGLIBS -lz" 1809 lp_cv_need_lib_z="yes" 1810 ) 1811 fi 1812 if test "$lp_cv_need_lib_z" != "yes"; then 1813 echo "libz library not found - disabling MCCP support" 1814 AC_NOT_AVAILABLE(use-mccp) 1815 cdef_use_mccp="#undef" 1816 enable_use_mccp="no" 1817 fi 1818fi 1819 1820# --- 1821 1822AC_CACHE_CHECK(if rename handles directories, 1823lp_cv_sys_rename_handles_directories, 1824AC_TRY_RUN([ 1825main() { 1826 mkdir("conftestdirfrom", 0770); 1827 exit(rename("conftestdirfrom", "conftestdirto")); 1828} 1829], 1830lp_cv_sys_rename_handles_directories=yes, 1831lp_cv_sys_rename_handles_directories=no)) 1832if test "$lp_cv_sys_rename_handles_directories" = "yes"; then 1833 AC_DEFINE(RENAME_HANDLES_DIRECTORIES, 1, [Can rename handle directories?]) 1834fi 1835rmdir conftestdirfrom conftestdirto 2> /dev/null 1836 1837if test "$ac_cv_func_getrusage" = "yes" ; then 1838AC_CACHE_CHECK(full availability of struct rusage members, 1839lp_cv_struct_rusage_full, 1840AC_TRY_COMPILE([ 1841#include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ 1842#include <sys/time.h> 1843#ifdef HAVE_SYS_RUSAGE_H 1844#include <sys/rusage.h> 1845#endif 1846#include <sys/resource.h> 1847#ifndef RUSAGE_SELF 1848#define RUSAGE_SELF 0 1849#endif 1850],[ 1851 struct rusage rus; 1852 long *v = (long *)main; 1853 getrusage(RUSAGE_SELF, &rus); 1854 *v++ = rus.ru_maxrss; 1855 *v++ = rus.ru_ixrss; 1856 *v++ = rus.ru_idrss; 1857 *v++ = rus.ru_isrss; 1858 *v++ = rus.ru_minflt; 1859 *v++ = rus.ru_majflt; 1860 *v++ = rus.ru_nswap; 1861 *v++ = rus.ru_inblock; 1862 *v++ = rus.ru_oublock; 1863 *v++ = rus.ru_msgsnd; 1864 *v++ = rus.ru_msgrcv; 1865 *v++ = rus.ru_nsignals; 1866 *v++ = rus.ru_nvcsw; 1867 *v++ = rus.ru_nivcsw; 1868],lp_cv_struct_rusage_full=yes,lp_cv_struct_rusage_full=no)) 1869if test "$lp_cv_struct_rusage_full" = "no"; then 1870 AC_DEFINE(GETRUSAGE_RESTRICTED, 1, [If so, is it restricted to user and system time?]) 1871fi 1872AC_CACHE_CHECK(struct rusage timeval members with tv_usec, 1873lp_cv_struct_rusage_usec, 1874AC_TRY_COMPILE([ 1875#include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ 1876#include <sys/time.h> 1877#ifdef HAVE_SYS_RUSAGE_H 1878#include <sys/rusage.h> 1879#endif 1880#include <sys/resource.h> 1881#ifndef RUSAGE_SELF 1882#define RUSAGE_SELF 0 1883#endif 1884],[ 1885 struct rusage rus; 1886 long *v = (long *)main; 1887 getrusage(RUSAGE_SELF, &rus); 1888 *v++ = rus.ru_utime.tv_sec * 1000 + rus.ru_utime.tv_usec / 1000; 1889 *v++ = rus.ru_stime.tv_sec * 1000 + rus.ru_stime.tv_usec / 1000; 1890], lp_cv_struct_rusage_usec=yes, lp_cv_struct_rusage_usec=no)) 1891if test "$lp_cv_struct_rusage_usec" = "yes"; then 1892 AC_DEFINE(RUSAGE_USEC, 1, [Can ru_utime / ru_stime be accessed as a timeval with tv_sec and tv_usec?]) 1893fi 1894else 1895AC_CACHE_CHECK(for getrusage() via syscall(), 1896lp_cv_func_getrusage_via_syscall, 1897AC_TRY_COMPILE([ 1898#include <sys/types.h> /* BSDI 2.0.1 / 2.1 needs this for resource.h */ 1899#include <sys/syscall.h> 1900#include <sys/resource.h> 1901#ifndef RUSAGE_SELF 1902#define RUSAGE_SELF 0 1903#endif 1904],[ 1905struct rusage rus; 1906syscall(SYS_GETRUSAGE, RUSAGE_SELF, rus); 1907], lp_cv_func_getrusage_via_syscall=yes, lp_cv_func_getrusage_via_syscall=no)) 1908if test "$lp_cv_func_getrusage_via_syscall" = "yes"; then 1909 AC_DEFINE(HAVE_GETRUSAGE, 1, [Does the system have a getrusage call?]) 1910 AC_DEFINE(GETRUSAGE_VIA_SYSCALL, 1, [Is it available as a subfunction of syscall()?]) 1911fi 1912fi 1913 1914dnl I have seen malloc() being declared in <memory.h> on some machines. 1915AC_CACHE_CHECK(if return type of free is void, 1916lp_cv_prop_free_returns_void, 1917AC_TRY_COMPILE([ 1918#ifdef HAVE_STDLIB_H 1919#include <stdlib.h> 1920#endif 1921#ifdef HAVE_UNISTD_H 1922#include <unistd.h> 1923#endif 1924#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) 1925#include <memory.h> 1926#endif 1927void free(); 1928],, lp_cv_prop_free_returns_void=yes, lp_cv_prop_free_returns_void=no)) 1929if test "$lp_cv_prop_free_returns_void" = "yes"; then 1930 AC_DEFINE(FREE_RETURNS_VOID, 1, [does free() have void as its returntype?]) 1931fi 1932 1933AC_CACHE_CHECK(if void* or char* from malloc, 1934lp_cv_prop_malloc_return_type, 1935AC_TRY_COMPILE([ 1936#include <sys/types.h> 1937#ifdef HAVE_STDLIB_H 1938#include <stdlib.h> 1939#endif 1940#ifdef HAVE_UNISTD_H 1941#include <unistd.h> 1942#endif 1943#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) 1944#include <memory.h> 1945#endif 1946#ifdef __STDC__ 1947#define PROT(x) x 1948#else 1949#define PROT(x) () 1950#endif 1951#define POINTER void * 1952POINTER malloc(size_t); 1953#ifdef FREE_RETURNS_VOID 1954void free PROT((POINTER)); 1955#else 1956int free PROT((POINTER)); 1957#endif 1958],,lp_cv_prop_malloc_return_type="void *", 1959lp_cv_prop_malloc_return_type="char *")) 1960AC_DEFINE_UNQUOTED(POINTER,$lp_cv_prop_malloc_return_type,[what kind of pointer is used by malloc() et al]) 1961 1962AC_CACHE_CHECK(if CHAR_BIT == 8 or undef, 1963lp_cv_prop_charbits_eq_8, 1964AC_TRY_COMPILE([ 1965#include <stdio.h> 1966#include <string.h> 1967#include <ctype.h> 1968#include <limits.h> 1969#ifdef HAVE_VALUES_H 1970#include <values.h> 1971#endif 1972int i=[1/(CHAR_BIT-8)]; 1973],,lp_cv_prop_charbits_eq_8=no, lp_cv_prop_charbits_eq_8=yes)) 1974if test "$lp_cv_prop_charbits_eq_8" = "yes"; then 1975 AC_DEFINE(CHARBIT_MASK, 0xff, [A mask that allows to extract an unsigned char from a signed]) 1976else 1977dnl TODO: this is something I don't really understand... am I too stupid? 1978dnl TODO:: bitmask set to number of bits ?????? *shudder* [Mubo] 1979 AC_DEFINE(CHARBIT_MASK, CHAR_BIT) 1980fi 1981 1982AC_CACHE_CHECK(if strtol broken, lp_cv_prop_strtol_broken, 1983dnl the quoting hell wants two start quotes here, but only one end quote... 1984dnl M4 can be wonderful... :-( [Mubo] 1985AC_TRY_RUN([[ 1986#ifdef HAVE_STDLIB_H 1987#include <stdlib.h> 1988#endif 1989#ifdef HAVE_UNISTD_H 1990#include <unistd.h> 1991#endif 1992int main() { 1993 if (strtol("1]", (char **)0, 10) != 1) exit(1); 1994 exit(0); 1995} 1996], lp_cv_prop_strtol_broken=no, 1997lp_cv_prop_strtol_broken=yes)) 1998if test "$lp_cv_prop_strtol_broken" = "yes"; then 1999 AC_DEFINE(STRTOL_BROKEN, 1, [the atari strtol() used to consider characters '9' < c < 'A' to be numeric]) 2000fi 2001 2002dnl the following three tests would better be nested, but it seems to overflow 2003dnl internal buffers of m4 2004AC_CACHE_CHECK(nonblocking using ioctl with FIONBIO, 2005lp_cv_prop_use_ioctl_fionbio, 2006AC_TRY_RUN([ 2007#include <sys/types.h> /* needed for netinet/in.h */ 2008#include <sys/socket.h> 2009#include <netinet/in.h> 2010#include <netdb.h> 2011#include <errno.h> 2012#include <sys/ioctl.h> 2013#include <stdio.h> 2014#include <stdlib.h> 2015main() { 2016 int port, tmp, s; 2017 struct sockaddr_in my_sin; 2018 struct hostent *hp; 2019 char *host_name; 2020 2021 host_name = malloc(100); 2022 if (gethostname(host_name, 100) == -1) exit(1); 2023 hp = gethostbyname(host_name); 2024 if (hp == 0) exit(1); 2025 memset((char *)&my_sin, '\0', sizeof my_sin); 2026 memcpy((char *)&my_sin.sin_addr, hp->h_addr, hp->h_length); 2027 my_sin.sin_family = hp->h_addrtype; 2028 my_sin.sin_addr.s_addr = INADDR_ANY; 2029 alarm(10); 2030 for (port = 2000; port < 10000; port++) { 2031 my_sin.sin_port = htons((u_short)port); 2032 s = socket(hp->h_addrtype, SOCK_STREAM, 0); 2033 if (s == -1) exit(1); 2034 tmp = 1; 2035 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, 2036 (char *) &tmp, sizeof (tmp)) < 0) 2037 exit (1); 2038 if (bind(s, (struct sockaddr *)&my_sin, sizeof my_sin) == -1) { 2039 if (errno == EADDRINUSE) { 2040 close(s); 2041 continue; 2042 } 2043 exit(1); 2044 } 2045 if (listen(s, 5) == -1) exit(1); 2046 tmp = 1; 2047 if (ioctl(s, FIONBIO, &tmp) == -1) exit(1); 2048 tmp = sizeof my_sin; 2049 s = accept(s, (struct sockaddr *)&my_sin, &tmp); 2050 if (s == -1) { 2051 if (errno == EWOULDBLOCK || 2052 errno == EAGAIN) 2053 { 2054 /* hpux has special problems with sockets from pipe() */ 2055 int sockets[[2]]; 2056 FILE *fp_read; 2057 2058 if(pipe(sockets) < 0) 2059 exit(1); 2060 fp_read = fdopen(sockets[[0]], "r"); 2061 if (fp_read == NULL) 2062 exit(1); 2063 if (ioctl(fileno(fp_read) , FIONBIO, &tmp) == -1) 2064 exit(1); 2065 exit(0); 2066 } 2067 if (errno == EINTR) { close(s); continue; } 2068 } 2069 break; 2070 } 2071 exit(1); 2072} 2073], 2074lp_cv_prop_use_ioctl_fionbio=yes, 2075lp_cv_prop_use_ioctl_fionbio=no, 2076lp_cv_prop_use_ioctl_fionbio=unknown 2077AC_MSG_WARN(You have to supply the correct way to set sockets non-blocking by hand.) 2078)) 2079if test "$lp_cv_prop_use_ioctl_fionbio" = "yes"; then 2080 AC_DEFINE(USE_IOCTL_FIONBIO, 1, [How to set a socket non-blocking]) 2081fi 2082 2083AC_CACHE_CHECK(nonblocking using fcntl with O_NDELAY, 2084lp_cv_prop_use_fnctl_o_ndelay, 2085AC_TRY_RUN([ 2086#include <sys/types.h> /* needed for netinet/in.h */ 2087#include <sys/socket.h> 2088#include <netinet/in.h> 2089#include <netdb.h> 2090#include <errno.h> 2091#include <fcntl.h> 2092#include <stdlib.h> 2093main() { 2094 int port, tmp, s; 2095 struct sockaddr_in my_sin; 2096 struct hostent *hp; 2097 char *host_name; 2098 2099 host_name = malloc(100); 2100 if (gethostname(host_name, 100) == -1) exit(1); 2101 hp = gethostbyname(host_name); 2102 if (hp == 0) exit(1); 2103 memset((char *)&my_sin, '\0', sizeof my_sin); 2104 memcpy((char *)&my_sin.sin_addr, hp->h_addr, hp->h_length); 2105 my_sin.sin_family = hp->h_addrtype; 2106 my_sin.sin_addr.s_addr = INADDR_ANY; 2107 alarm(10); 2108 for (port = 2000; port < 10000; port++) { 2109 my_sin.sin_port = htons((u_short)port); 2110 s = socket(hp->h_addrtype, SOCK_STREAM, 0); 2111 if (s == -1) exit(1); 2112 tmp = 1; 2113 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, 2114 (char *) &tmp, sizeof (tmp)) < 0) 2115 exit (1); 2116 if (bind(s, (struct sockaddr *)&my_sin, sizeof my_sin) == -1) { 2117 if (errno == EADDRINUSE) { 2118 close(s); 2119 continue; 2120 } 2121 exit(1); 2122 } 2123 if (listen(s, 5) == -1) exit(1); 2124 if (fcntl(s, F_SETFL, O_NDELAY) == -1) exit(1); 2125 tmp = sizeof my_sin; 2126 s = accept(s, (struct sockaddr *)&my_sin, &tmp); 2127 if (s == -1) { 2128 if (errno == EWOULDBLOCK) exit(0); 2129 if (errno == EAGAIN) exit(0); 2130 if (errno == EINTR) { close(s); continue; } 2131 } 2132 break; 2133 } 2134 exit(1); 2135} 2136], lp_cv_prop_use_fnctl_o_ndelay=yes, 2137lp_cv_prop_use_fnctl_o_ndelay=no, 2138lp_cv_prop_use_fnctl_o_ndelay=unknown)) 2139if test "$lp_cv_prop_use_fnctl_o_ndelay" = "yes"; then 2140 AC_DEFINE(USE_FCNTL_O_NDELAY, 1, [nonblocking using fcntl with O_NDELAY]) 2141fi 2142 2143AC_CACHE_CHECK(nonblocking using fcntl with FNDELAY, 2144lp_cv_prop_use_fcntl_fndelay, 2145AC_TRY_RUN([ 2146#include <sys/types.h> /* needed for netinet/in.h */ 2147#include <sys/socket.h> 2148#include <netinet/in.h> 2149#include <netdb.h> 2150#include <errno.h> 2151#include <fcntl.h> 2152#include <stdlib.h> 2153main() { 2154 int port, tmp, s; 2155 struct sockaddr_in my_sin; 2156 struct hostent *hp; 2157 char *host_name; 2158 2159 host_name = malloc(100); 2160 if (gethostname(host_name, 100) == -1) exit(1); 2161 hp = gethostbyname(host_name); 2162 if (hp == 0) exit(1); 2163 memset((char *)&my_sin, '\0', sizeof my_sin); 2164 memcpy((char *)&my_sin.sin_addr, hp->h_addr, hp->h_length); 2165 my_sin.sin_family = hp->h_addrtype; 2166 my_sin.sin_addr.s_addr = INADDR_ANY; 2167 alarm(10); 2168 for (port = 2000; port < 10000; port++) { 2169 my_sin.sin_port = htons((u_short)port); 2170 s = socket(hp->h_addrtype, SOCK_STREAM, 0); 2171 if (s == -1) exit(1); 2172 tmp = 1; 2173 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, 2174 (char *) &tmp, sizeof (tmp)) < 0) 2175 exit (1); 2176 if (bind(s, (struct sockaddr *)&my_sin, sizeof my_sin) == -1) { 2177 if (errno == EADDRINUSE) { 2178 close(s); 2179 continue; 2180 } 2181 exit(1); 2182 } 2183 if (listen(s, 5) == -1) exit(1); 2184 if (fcntl(s, F_SETFL, FNDELAY) == -1) exit(1); 2185 tmp = sizeof my_sin; 2186 s = accept(s, (struct sockaddr *)&my_sin, &tmp); 2187 if (s == -1) { 2188 if (errno == EWOULDBLOCK) exit(0); 2189 if (errno == EAGAIN) exit(0); 2190 if (errno == EINTR) { close(s); continue; } 2191 } 2192 break; 2193 } 2194 exit(1); 2195} 2196],lp_cv_prop_use_fcntl_fndelay=yes, 2197lp_cv_prop_use_fcntl_fndelay=no, 2198lp_cv_prop_use_fcntl_fndelay=unknown)) 2199if test "$lp_cv_prop_use_fcntl_fndelay" = "yes"; then 2200 AC_DEFINE(USE_FCNTL_FNDELAY, 1, [nonblocking using fcntl with FNDELAY]) 2201fi 2202 2203 2204AC_CACHE_CHECK(if fcntl with SETOWN works, 2205lp_cv_prop_use_fcntl_setown, 2206AC_TRY_RUN([ 2207#include <sys/types.h> /* needed for netinet/in.h */ 2208#include <sys/socket.h> 2209#include <netinet/in.h> 2210#include <netdb.h> 2211#include <errno.h> 2212#include <fcntl.h> 2213#include <stdlib.h> 2214main() { 2215 int port, tmp, s; 2216 struct sockaddr_in my_sin; 2217 struct hostent *hp; 2218 char *host_name; 2219 2220 host_name = malloc(100); 2221 if (gethostname(host_name, 100) == -1) exit(1); 2222 hp = gethostbyname(host_name); 2223 if (hp == 0) exit(1); 2224 memset((char *)&my_sin, '\0', sizeof my_sin); 2225 memcpy((char *)&my_sin.sin_addr, hp->h_addr, hp->h_length); 2226 my_sin.sin_family = hp->h_addrtype; 2227 my_sin.sin_addr.s_addr = INADDR_ANY; 2228 alarm(10); 2229 for (port = 2000; port < 10000; port++) { 2230 my_sin.sin_port = htons((u_short)port); 2231 s = socket(hp->h_addrtype, SOCK_STREAM, 0); 2232 if (s == -1) exit(1); 2233 tmp = 1; 2234 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, 2235 (char *) &tmp, sizeof (tmp)) < 0) 2236 exit (1); 2237 if (bind(s, (struct sockaddr *)&my_sin, sizeof my_sin) == -1) { 2238 if (errno == EADDRINUSE) { 2239 close(s); 2240 continue; 2241 } 2242 exit(1); 2243 } 2244 if (listen(s, 5) == -1) exit(1); 2245#ifndef F_SETOWN 2246 exit(1); 2247#else 2248 if (fcntl(s, F_SETOWN, getpid()) == -1) exit(1); 2249 exit(0); 2250#endif 2251 } 2252 exit(1); 2253} 2254],lp_cv_prop_use_fcntl_setown=yes, 2255lp_cv_prop_use_fcntl_setown=no, 2256lp_cv_prop_use_fcntl_setown=unknown)) 2257if test "$lp_cv_prop_use_fcntl_setown" = "yes"; then 2258 AC_DEFINE(USE_FCNTL_SETOWN, 1, [Can F_SETOWN be used on a socket?]) 2259fi 2260 2261AC_CACHE_CHECK(if OOBINLINE works, 2262lp_cv_prop_use_oobinline, 2263AC_TRY_RUN([ 2264#include <sys/types.h> /* needed for netinet/in.h */ 2265#include <sys/socket.h> 2266#include <netinet/in.h> 2267#include <netdb.h> 2268#include <errno.h> 2269#include <fcntl.h> 2270#include <stdlib.h> 2271main() { 2272 int port, tmp, s; 2273 struct sockaddr_in my_sin; 2274 struct hostent *hp; 2275 char *host_name; 2276 2277 host_name = malloc(100); 2278 if (gethostname(host_name, 100) == -1) exit(1); 2279 hp = gethostbyname(host_name); 2280 if (hp == 0) exit(1); 2281 memset((char *)&my_sin, '\0', sizeof my_sin); 2282 memcpy((char *)&my_sin.sin_addr, hp->h_addr, hp->h_length); 2283 my_sin.sin_family = hp->h_addrtype; 2284 my_sin.sin_addr.s_addr = INADDR_ANY; 2285 alarm(10); 2286 for (port = 2000; port < 10000; port++) { 2287 int on; 2288 my_sin.sin_port = htons((u_short)port); 2289 s = socket(hp->h_addrtype, SOCK_STREAM, 0); 2290 if (s == -1) exit(1); 2291 tmp = 1; 2292 if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, 2293 (char *) &tmp, sizeof (tmp)) < 0) 2294 exit (1); 2295 if (bind(s, (struct sockaddr *)&my_sin, sizeof my_sin) == -1) { 2296 if (errno == EADDRINUSE) { 2297 close(s); 2298 continue; 2299 } 2300 exit(1); 2301 } 2302 if (listen(s, 5) == -1) exit(1); 2303#ifndef SO_OOBINLINE 2304 exit(1); 2305#else 2306 on = 1; 2307 if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof on) == -1) 2308 exit(1); 2309 exit(0); 2310#endif 2311 } 2312 exit(1); 2313} 2314],lp_cv_prop_use_oobinline=yes, 2315lp_cv_prop_use_oobinline=no, 2316lp_cv_prop_use_oobinline=unknown)) 2317if test "$lp_cv_prop_use_oobinline" = "yes"; then 2318 AC_DEFINE(USE_OOBINLINE, 1, [Can SO_OOBINLINE be used on a socket?]) 2319fi 2320 2321 2322AC_CACHE_CHECK(for overlapping bcopy, 2323lp_cv_prop_overlapping_bcopy, 2324AC_TRY_RUN([ 2325main(){ 2326 char str[[99]] = "hello world"; 2327 bcopy(str, str+2, 12); 2328 if(strcmp("hehello world", str)) 2329 exit(1); 2330 bcopy(str+2, str, 11); 2331 if(strcmp("hello worldld", str)) 2332 exit(1); 2333 exit(0); 2334} 2335], lp_cv_prop_overlapping_bcopy=yes, 2336lp_cv_prop_overlapping_bcopy=no, 2337lp_cv_prop_overlapping_bcopy=yes)) 2338if test "$lp_cv_prop_overlapping_bcopy" = "yes"; then 2339 AC_DEFINE(OVERLAPPING_BCOPY, 1, [Define if you have bcopy, and it handles overlapping ranges correctly.]) 2340fi 2341 2342AC_CACHE_CHECK(if strtol needs const char*, 2343lp_cv_prop_strtol_const_charp, 2344AC_TRY_COMPILE([#ifdef HAVE_STDLIB_H 2345#include <stdlib.h> 2346#endif 2347long strtol(str, ptr, base) char *str; char **ptr; int base; { return 0; } 2348],,lp_cv_prop_strtol_const_charp=no, 2349lp_cv_prop_strtol_const_charp=yes)) 2350if test "$lp_cv_prop_strtol_const_charp" = "yes"; then 2351 AC_DEFINE(STRTOL_CONST_CHARP, 1, [needs the first argument of strtol be declared as const?]) 2352fi 2353 2354# --- Check for compiler options --- 2355 2356tcomp='${CC-cc} ${CFLAGS} ${TESTFLAG} -o conftest conftest.c >/dev/null 2>&1' 2357tcomp2='${CC-cc} ${CFLAGS} ${TESTFLAG} -o conftest conftest.c 2>&1' 2358tcomp3='${CC-cc} ${CFLAGS} ${TESTFLAG} -c conftest.c >/dev/null 2>&1' 2359 2360cat > conftest.c <<EOF 2361#include <stdio.h> 2362#include <math.h> 2363double d = 4.5; 2364int main(void) { printf("hello world\n"); return 0; } 2365EOF 2366 2367AC_MSG_CHECKING(low optimization CFLAGS) 2368changequote(,)dnl 2369for TESTFLAG in -O; do 2370 if eval $tcomp; then 2371 if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then 2372 : 2373 #the [e]grep option -v will not give a failure exit status on the atari 2374 else 2375 if eval $tcomp; then 2376 CFLAGS=$TESTFLAG 2377 break 2378 fi 2379 fi 2380 fi 2381done 2382changequote([,])dnl 2383for TESTFLAG in -g; do 2384 if eval $tcomp; then 2385 CFLAGS="$CFLAGS $TESTFLAG" 2386 fi 2387done 2388LCFLAGS=$CFLAGS 2389AC_MSG_RESULT($LCFLAGS) 2390 2391AC_MSG_CHECKING(medium optimization CFLAGS) 2392changequote(,)dnl 2393for TESTFLAG in -O2 -O; do 2394 if eval $tcomp; then 2395 if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then 2396 : 2397 #the [e]grep option -v will not give a failure exit status on the atari 2398 else 2399 if eval $tcomp; then 2400 CFLAGS=$TESTFLAG 2401 break 2402 fi 2403 fi 2404 fi 2405done 2406for TESTFLAG in -g; do 2407 if eval $tcomp; then 2408 OPTFLAGS="$OPTFLAGS $TESTFLAG" 2409 CFLAGS="$CFLAGS $TESTFLAG" 2410 fi 2411done 2412changequote([,])dnl 2413MCFLAGS=$CFLAGS 2414AC_MSG_RESULT($MCFLAGS) 2415 2416AC_MSG_CHECKING(highest optimization CFLAGS) 2417changequote(,)dnl 2418for TESTFLAG in -O4 -O3 -O2 -O; do 2419 if eval $tcomp; then 2420 if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then 2421 : 2422 #the [e]grep option -v will not give a failure exit status on the atari 2423 else 2424 if eval $tcomp; then 2425 CFLAGS=$TESTFLAG 2426 break 2427 fi 2428 fi 2429 fi 2430done 2431if test "$ac_cv_c_compiler_gnu" = "no"; then 2432 for TESTFLAG in -qstrict -qipa -ipo; do 2433 if eval $tcomp; then 2434 if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then 2435 : 2436 #the [e]grep option -v will not give a failure exit status on the atari 2437 else 2438 if eval $tcomp; then 2439 CFLAGS="$CFLAGS $TESTFLAG" 2440 break 2441 fi 2442 fi 2443 fi 2444 done 2445fi 2446changequote([,])dnl 2447# -funroll-all-loops causes some versions of gcc to produce buggy code 2448for TESTFLAG in -fomit-frame-pointer; do 2449 if eval $tcomp; then 2450 CFLAGS="$CFLAGS $TESTFLAG" 2451 fi 2452done 2453OCFLAGS="$CFLAGS $OPTFLAGS" 2454AC_MSG_RESULT($OCFLAGS) 2455if ${CC-cc} -g -c conftest.c ; then 2456 DCFLAGS='-g' 2457else 2458 DCFLAGS='' 2459fi 2460OPTIMIZE_LINKING='' 2461if ${CC-cc} $OFLAGS -o conftest conftest.c ; then 2462 OPTIMIZE_LINKING='$(OPTIMIZE)' 2463fi 2464 2465rm -f conftest.c 2466 2467if test "$ac_cv_lib_socket_main" = "yes"; then 2468AC_EGREP_CPP(yes,[ 2469#if defined(sun) 2470yes 2471#endif 2472], 2473[ EXTRA_CFLAGS="${EXTRA_CFLAGS} -Dsolaris" ]) 2474fi 2475 2476# Some Unixes require the -n parameter for tail to work properly 2477AC_MSG_CHECKING(if tail accepts the -n parameter) 2478TAIL_N="" 2479if tail -n +2 confdefs.h > /dev/null 2>&1; then 2480 AC_MSG_RESULT(yes) 2481 TAIL_N="-n" 2482else 2483 AC_MSG_RESULT(no) 2484fi 2485 2486AC_MSG_CHECKING(if ${YACC} includes bogus malloc prototypes) 2487cat > conftest.y <<EOF 2488%{ 2489#include "confdefs.h" 2490#ifdef HAVE_UNISTD_H 2491#include <unistd.h> 2492#endif 2493#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) 2494#include <memory.h> 2495#endif 2496#ifdef HAVE_STDLIB_H 2497#include <stdlib.h> 2498#endif 2499%} 2500%% 2501all: 'a'; 2502%% 2503int main(){ return 0; } 2504int yyerror(){} 2505int yylex(){ return 0; } 2506EOF 2507rm -f y.tab.c y_tab.c 2508${YACC} conftest.y 2509if mv y.tab.c conftest.c > /dev/null 2>&1; then 2510 YACCTAB=y.tab. 2511else 2512 mv y_tab.c conftest.c 2513 YACCTAB=y_tab. 2514fi 2515if eval $ac_compile 2>&5; then 2516 MOVE_YACC_TAB='$(MV) $(YACCTAB)c' 2517 CLEAN_YACC_TAB='' 2518 AC_MSG_RESULT(no) 2519else 2520 MOVE_YACC_TAB='tail $TAIL_N +2 $(YACCTAB)c >' 2521 CLEAN_YACC_TAB='$(RM) $(YACCTAB)c' 2522 AC_MSG_RESULT(yes) 2523fi 2524rm -f conftest* 2525 2526AC_MSG_CHECKING(for ${YACC} / <malloc.h> / -DSGI_SOURCE / afree name clash) 2527cat > conftest.y <<EOF 2528%{ 2529#include "confdefs.h" 2530#define afree free 2531%} 2532%% 2533all: 'a'; 2534%% 2535int main(){ return 0; } 2536int yyerror(){} 2537int yylex(){ return 0; } 2538EOF 2539rm -f y.tab.c y_tab.c 2540${YACC} conftest.y 2541if mv y.tab.c conftest.c > /dev/null 2>&1; then 2542 YACCTAB=y.tab. 2543else 2544 mv y_tab.c conftest.c 2545 YACCTAB=y_tab. 2546fi 2547if eval $ac_compile 2>&5 ; then 2548 AC_MSG_RESULT(no) 2549else 2550 EXTRA_CFLAGS="${EXTRA_CFLAGS} -U_SGI_SOURCE" 2551 AC_MSG_RESULT(yes) 2552fi 2553rm -f conftest* 2554 2555 2556SAVE_LIBS="${LIBS}" 2557SAVE_CFLAGS="${CFLAGS}" 2558CFLAGS='' 2559for TESTFLAG in '' -static -Bstatic -n; do 2560 2561 2562AC_MSG_CHECKING(malloc redefinition with linking flag ${TESTFLAG}) 2563LIBS="${SAVE_LIBS} ${TESTFLAG}" 2564cat > conftest.data <<EOF 256542 2566EOF 2567AC_TRY_RUN([ 2568#include <sys/types.h> 2569#include <stdio.h> 2570#ifdef HAVE_UNISTD_H 2571#include <unistd.h> 2572#endif 2573#ifdef HAVE_STDLIB_H 2574#include <stdlib.h> 2575#endif 2576#ifdef HAVE_STRING_H 2577#include <string.h> 2578#else 2579#include <strings.h> 2580#endif 2581#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) 2582#include <memory.h> 2583#endif 2584#undef malloc 2585#undef calloc 2586int my_malloc_used; 2587int main() { 2588 int i, j; 2589 FILE *f; 2590 2591 alarm(10); /* a crash can be an infinite loop... */ 2592 for (i = 0; i < 100; i++) { 2593 my_malloc_used = 0; 2594 /* strdup seems to be partially unavailable */ 2595 f = fopen("conftest.data", "r"); 2596 fscanf(f, "%d", &j); 2597 fclose(f); 2598 if (!my_malloc_used || j != 6*7) exit(1); 2599 } 2600 /* linking in printf called with variable format makes shared libs 2601 * worthwhile. Moreover, calling it is a good test 2602 */ 2603 printf(f?"%f%% successful\n":(char*)f, 100.); 2604 exit(0); 2605} 2606POINTER malloc(size) 2607 size_t size; 2608{ 2609 size_t size2; 2610 static char *current_break = 0; 2611 char *q; 2612 2613 my_malloc_used = 1; 2614 if (!current_break) 2615 current_break = sbrk(0); 2616 size2 = sizeof size + size+7 & ~7; 2617 q = current_break; 2618 if (brk(current_break+=size2)) exit(1); 2619 *(size_t *)q = size; 2620 return q + sizeof size; 2621} 2622POINTER calloc(size, num) 2623 size_t size, num; 2624{ 2625 char *q; 2626 q = malloc(size*num); 2627 memset(q, 0, size); 2628} 2629POINTER realloc(p, size) 2630 POINTER p; 2631 size_t size; 2632{ 2633 char *q; 2634 if (*(size_t *)p >= size) 2635 return p; 2636 q = malloc(size); 2637#ifdef HAVE_MEMCPY 2638 memcpy(q, p, size); 2639#else 2640 bcopy(p, q, size); 2641#endif 2642 *(size_t *)q = size; 2643 return q + sizeof size; 2644} 2645#ifdef FREE_RETURNS_VOID 2646void free(p) 2647 POINTER p; 2648{} 2649#else 2650int free(p) 2651 POINTER p; 2652{ return 1; } 2653#endif 2654],SBRK_OK=1) 2655if test -n "${SBRK_OK}"; then 2656 if test -z "${TESTFLAG}"; then 2657 AC_DEFINE(SBRK_OK, 1, [can we define our own malloc() safely?]) 2658 else 2659 LDFLAGS="${LDFLAGS} ${TESTFLAG}" 2660 EXTRA_CFLAGS="${EXTRA_CFLAGS} -DSBRK_OK" 2661 fi 2662 break 2663 AC_MSG_RESULT(ok) 2664else 2665 AC_MSG_RESULT(failed) 2666fi 2667done 2668 2669LIBS="${SAVE_LIBS}" 2670CFLAGS="${SAVE_CFLAGS}" 2671 2672case "$EXTRA_CFLAGS" in 2673 *-Dsolaris*) 2674 if test "$ac_cv_lib_ucb_main" = "yes"; then 2675 LIBS="${LDFLAGS} -lm -lgcc -lc -lnsl -lgcc -lc -ldl_stubs\ 2676 -lnswnis -lnswnisplus -lnswfiles -lnswcompat -lstraddr -lswitch\ 2677 -ltcpip -lsocket -lnsl -lgcc -lc /usr/ucblib/libucb.a" 2678 LDFLAGS= "-u dgettext -lintl" 2679 fi ;; 2680 *-MSWIN*) 2681 LDFLAGS= "$LDFLAGS -luser32 -lwinmm -lkernel32 -lwsock32" 2682 ;; 2683esac 2684 2685AC_CACHE_CHECK(malloc overhead,lp_cv_sys_malloc_overhead, 2686cat > conftest.c <<EOF 2687#include "confdefs.h" 2688#include "${srcdir}/util/overhead.c" 2689EOF 2690${CC-cc} -o conftest conftest.c 2691lp_cv_sys_malloc_overhead=`./conftest --terse` 2692rm -f conftest* 2693) 2694AC_DEFINE_UNQUOTED(EXTERN_MALLOC_OVERHEAD,$lp_cv_sys_malloc_overhead, 2695 [The following is needed for smalloc without SBRK_OK to use memory 2696 efficiently. smalloc will malloc blocks that are a large power of 2697 two, minus EXTERN_MALLOC_OVERHEAD. If you have no idea what number to 2698 choose, compile & run util/overhead.c 2699 ]) 2700 2701if test -z "${CONFIG_SHELL}"; then 2702 CONFIG_SHELL='/bin/sh' 2703fi 2704 2705 2706dnl 2707dnl --- Postprocessing of settings --- 2708dnl 2709 2710AC_UPDATE_VAR(with_malloc) 2711if test "x$with_malloc" = "x" || test "x$with_malloc" = "xdefault"; then 2712 with_malloc="slaballoc" 2713 AC_TEXT_VAL_FROM_WITH(malloc) 2714fi 2715 2716 2717dnl 2718dnl Standard Replacements: 2719dnl 2720 2721AC_SUBST(val_optimize) 2722AC_SUBST(WCFLAGS) 2723AC_SUBST(OCFLAGS) 2724AC_SUBST(LCFLAGS) 2725AC_SUBST(MCFLAGS) 2726AC_SUBST(DCFLAGS) 2727AC_SUBST(LDFLAGS) 2728AC_SUBST(EXTRA_CFLAGS) 2729AC_SUBST(OPTIMIZE_LINKING) 2730AC_SUBST(MOVE_YACC_TAB) 2731AC_SUBST(CLEAN_YACC_TAB) 2732AC_SUBST(YACCTAB) 2733AC_SUBST(CONFIG_SHELL) 2734AC_SUBST(EXEEXT) 2735 2736dnl 2737dnl additional replacements: 2738dnl 2739 2740dnl first: the conditional defines: 2741dnl 2742AC_SUBST(cdef_erq_demon) 2743AC_SUBST(cdef_access_control) 2744AC_SUBST(cdef_access_log) 2745AC_SUBST(cdef_compat_mode) 2746AC_SUBST(cdef_strict_euids) 2747AC_SUBST(cdef_filename_spaces) 2748AC_SUBST(cdef_share_variables) 2749AC_SUBST(cdef_use_ipv6) 2750AC_SUBST(cdef_use_mysql) 2751AC_SUBST(cdef_use_pgsql) 2752AC_SUBST(cdef_use_sqlite) 2753AC_SUBST(cdef_use_xml) 2754AC_SUBST(cdef_use_alists) 2755AC_SUBST(cdef_use_mccp) 2756AC_SUBST(cdef_use_pcre) 2757AC_SUBST(cdef_use_builtin_pcre) 2758AC_SUBST(cdef_use_deprecated) 2759AC_SUBST(cdef_use_structs) 2760AC_SUBST(cdef_use_tls) 2761AC_SUBST(cdef_use_gcrypt) 2762AC_SUBST(cdef_use_new_inlines) 2763AC_SUBST(cdef_use_set_light) 2764AC_SUBST(cdef_use_set_is_wizard) 2765AC_SUBST(cdef_use_parse_command) 2766AC_SUBST(cdef_use_process_string) 2767AC_SUBST(cdef_lpc_array_calls) 2768AC_SUBST(cdef_comm_stat) 2769AC_SUBST(cdef_trace_code) 2770AC_SUBST(cdef_apply_cache_stat) 2771AC_SUBST(cdef_malloc_sbrk) 2772AC_SUBST(cdef_malloc_check) 2773AC_SUBST(cdef_malloc_trace) 2774AC_SUBST(cdef_malloc_lpc_trace) 2775AC_SUBST(cdef_malloc_sbrk_trace) 2776AC_SUBST(cdef_dynamic_costs) 2777AC_SUBST(cdef_eval_cost_trace) 2778 2779AC_SUBST(cdef_rxcache_table) 2780AC_SUBST(cdef_wizlist_file) 2781AC_SUBST(cdef_synchronous_heart_beat) 2782AC_SUBST(cdef_tls_keyfile) 2783AC_SUBST(cdef_tls_certfile) 2784AC_SUBST(cdef_tls_trustfile) 2785AC_SUBST(cdef_tls_trustdirectory) 2786AC_SUBST(cdef_tls_crlfile) 2787AC_SUBST(cdef_tls_crldirectory) 2788 2789AC_SUBST(cdef_opcprof) 2790AC_SUBST(cdef_verbose_opcprof) 2791AC_SUBST(cdef_debug) 2792AC_SUBST(cdef_yydebug) 2793AC_SUBST(cdef_no_inlines) 2794AC_SUBST(cdef_debug_telnet) 2795AC_SUBST(cdef_debug_malloc_allocs) 2796 2797AC_SUBST(cdef_check_object_stat) 2798AC_SUBST(cdef_check_mapping_total) 2799AC_SUBST(cdef_check_object_ref) 2800AC_SUBST(cdef_check_object_gc_ref) 2801AC_SUBST(cdef_dump_gc_refs) 2802 2803dnl second: valued defines 2804dnl 2805AC_SUBST(val_access_file) 2806AC_SUBST(val_access_log) 2807AC_SUBST(val_erq_max_reply) 2808AC_SUBST(val_erq_max_send) 2809AC_SUBST(val_erq_debug) 2810AC_SUBST(val_write_buffer_max_size) 2811AC_SUBST(val_read_file_max_size) 2812AC_SUBST(val_time_to_clean_up) 2813AC_SUBST(val_time_to_swap) 2814AC_SUBST(val_time_to_swap_variables) 2815AC_SUBST(val_time_to_reset) 2816AC_SUBST(val_alarm_time) 2817AC_SUBST(val_heart_beat_interval) 2818AC_SUBST(val_evaluator_stack_size) 2819AC_SUBST(val_max_user_trace) 2820AC_SUBST(val_max_trace) 2821AC_SUBST(val_compiler_stack_size) 2822AC_SUBST(val_max_bits) 2823AC_SUBST(val_portno) 2824AC_SUBST(val_maxnumports) 2825AC_SUBST(val_max_cost) 2826AC_SUBST(val_max_local) 2827AC_SUBST(val_catch_reserved_cost) 2828AC_SUBST(val_master_reserved_cost) 2829AC_SUBST(val_swap_file) 2830AC_SUBST(val_max_array_size) 2831AC_SUBST(val_max_mapping_keys) 2832AC_SUBST(val_max_mapping_size) 2833AC_SUBST(val_max_callouts) 2834AC_SUBST(val_max_players) 2835AC_SUBST(val_allowed_ed_cmds) 2836AC_SUBST(val_max_command_length) 2837AC_SUBST(val_reserved_user_size) 2838AC_SUBST(val_reserved_master_size) 2839AC_SUBST(val_reserved_system_size) 2840AC_SUBST(val_htable_size) 2841AC_SUBST(val_itable_size) 2842AC_SUBST(val_otable_size) 2843AC_SUBST(val_defmax) 2844AC_SUBST(val_apply_cache_bits) 2845AC_SUBST(val_rxcache_table) 2846AC_SUBST(val_master_name) 2847AC_SUBST(val_input_escape) 2848AC_SUBST(val_max_byte_transfer) 2849AC_SUBST(val_udp_port) 2850AC_SUBST(val_set_buffer_size_max) 2851AC_SUBST(val_malloc) 2852AC_SUBST(val_min_malloced) 2853AC_SUBST(val_min_small_malloced) 2854AC_SUBST(val_hard_malloc_limit) 2855AC_SUBST(val_soft_malloc_limit) 2856AC_SUBST(val_total_trace_length) 2857AC_SUBST(val_wizlist_file) 2858AC_SUBST(val_pcre_recursion_limit) 2859AC_SUBST(val_max_net_connects) 2860AC_SUBST(val_random_period_length) 2861AC_SUBST(val_tls_keyfile) 2862AC_SUBST(val_tls_certfile) 2863AC_SUBST(val_tls_trustfile) 2864AC_SUBST(val_tls_trustdirectory) 2865AC_SUBST(val_tls_crlfile) 2866AC_SUBST(val_tls_crldirectory) 2867 2868dnl finally: some remaining stuff 2869dnl 2870AC_SUBST(erq_sub) 2871AC_SUBST(PKGLIBS) 2872AC_SUBST(ERQ_LIBS) 2873 2874dnl 2875dnl Ok. now lets make the Makefiles; also these in subdirs! [Mubo] 2876dnl make config.h, too. [Mubo] 2877dnl 2878AC_OUTPUT(Makefile config.h util/Makefile util/indent/Makefile 2879util/xerq/Makefile util/erq/Makefile) 2880 2881dnl 2882dnl At last, warn if any feature could not be enabled 2883dnl 2884if test "x$not_available" != "x"; then 2885 echo "" 2886 echo "WARNING: The following options were disabled because the system" 2887 echo "lacked the necessary support: $not_available." 2888 exit 1 2889fi 2890