From cfd89e7e487f27b1e178b94c5cd8748e4bd78263 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 21 May 2009 23:43:45 +0200 Subject: [PATCH] new autoconf is always a pain in the diff! --- src/autoconf/Makefile | 3 +- src/autoconf/aclocal.m4 | 123 +++++++++++ src/autoconf/configure.in | 433 ++++++++++++++++++++++++-------------- 3 files changed, 400 insertions(+), 159 deletions(-) create mode 100644 src/autoconf/aclocal.m4 diff --git a/src/autoconf/Makefile b/src/autoconf/Makefile index 7950b31..60fb6b0 100644 --- a/src/autoconf/Makefile +++ b/src/autoconf/Makefile @@ -1,7 +1,8 @@ ../configure: configure.in configure.head Makefile - autoconf + autoreconf rm -f $@ cat configure.head configure >>$@ chmod +x $@ @rm configure + mv machine.h.in .. diff --git a/src/autoconf/aclocal.m4 b/src/autoconf/aclocal.m4 new file mode 100644 index 0000000..0ab2771 --- /dev/null +++ b/src/autoconf/aclocal.m4 @@ -0,0 +1,123 @@ +# generated automatically by aclocal 1.10.2 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# longlong.m4 serial 13 +dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG_INT if 'long long int' works. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. + +# Note: If the type 'long long int' exists but is only 32 bits large +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be +# defined. In this case you can treat 'long long int' like 'long int'. + +AC_DEFUN([AC_TYPE_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], + [AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug isn't important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [ac_cv_type_long_long_int=yes], + [ac_cv_type_long_long_int=no], + [ac_cv_type_long_long_int=yes])], + [ac_cv_type_long_long_int=no])]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `long long int'.]) + fi +]) + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [ac_cv_type_unsigned_long_long_int=yes], + [ac_cv_type_unsigned_long_long_int=no])]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `unsigned long long int'.]) + fi +]) + +# Expands to a C program that can be used to test for simultaneous support +# of 'long long' and 'unsigned long long'. We don't want to say that +# 'long long' is available if 'unsigned long long' is not, or vice versa, +# because too many programs rely on the symmetry between signed and unsigned +# integer types (excluding 'bool'). +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], +[ + AC_LANG_PROGRAM( + [[/* Test preprocessor. */ + #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + error in preprocessor; + #endif + #if ! (18446744073709551615ULL <= -1ull) + error in preprocessor; + #endif + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) + diff --git a/src/autoconf/configure.in b/src/autoconf/configure.in index 3b0d764..a74d791 100644 --- a/src/autoconf/configure.in +++ b/src/autoconf/configure.in @@ -1,7 +1,8 @@ dnl ##define([AC_CACHE_LOAD], )dnl dnl--------------------------------------------------------------------------- dnl configure-script template - +dnl +dnl--------------------------------------------------------------------------- dnl TODO: allow the use of hosts//machine.h.in resp Makefile.in dnl TODO:: when existing instead of the normal ones. @@ -9,7 +10,6 @@ dnl dnl some helper macros dnl -dnl--------------------------------------------------------------------------- AC_DEFUN([AC_UPDATE_VAR], [if test "x$[$1]" = "x" && test "x$DEFAULT[$1]" != "x"; then [$1]=$DEFAULT[$1] @@ -60,27 +60,27 @@ val_[$1]="$with_[$1]"] AC_DEFUN([AC_FORM_HELP],[ --$1[]dnl ifelse([$2],,,dnl -builtin(format,%[]builtin(eval,(len([$1])<32)*(32-len([$1])))s,) [default=$2])[]dnl +builtin(format,%[.]builtin(eval,(len([$1])<50)*(50-len([$1])))s,) [default=$2])[]dnl ifelse([$3],,,[ ]patsubst([$3],[^],[ ]))[]dnl ]) -AC_DEFUN(AC_MY_ARG_ENABLE, +AC_DEFUN([AC_MY_ARG_ENABLE], [DEFAULTenable_[]translit([$1],[-],[_])=ifelse($2,,no,[$2]) AC_ARG_ENABLE([$1],AC_FORM_HELP([enable-$1]ifelse($3,,,[=($3)]), ifelse([$2],,[disabled],[$2],no,[disabled],[$2],yes,[enabled],[enabled($2)]), [$4]),[$5],[$6]) ]) -AC_DEFUN(AC_MY_ARG_WITH, +AC_DEFUN([AC_MY_ARG_WITH], [DEFAULTwith_[]translit([$1],[-],[_])=ifelse($2,,no,[$2]) AC_ARG_WITH([$1],AC_FORM_HELP([with-$1]ifelse($3,,[=VALUE],[=$3]), [$2], [$4]),[$5],[$6]) ]) -AC_DEFUN(AC_NOT_AVAILABLE, +AC_DEFUN([AC_NOT_AVAILABLE], [if test "x$not_available" = "x"; then not_available="$1" else @@ -105,7 +105,7 @@ dnl define default values for package arguments dnl and declare the package arguments dnl -AC_MY_ARG_ENABLE(erq,erq,[no/erq],[Enables or disables the ERQ daemon]) +AC_MY_ARG_ENABLE(erq,erq,[no/erq/xerq],[Enables and or selects ERQ demon]) AC_MY_ARG_ENABLE(access-control,yes,,) AC_MY_ARG_ENABLE(access-log,no,,) AC_MY_ARG_ENABLE(align-functions,yes,,) @@ -124,6 +124,7 @@ AC_MY_ARG_ENABLE(use-sqlite,no,,[Enables SQLite support]) AC_MY_ARG_ENABLE(use-json,no,,[Enables JSON-C Support]) AC_MY_ARG_ENABLE(use-expat,no,,[Enables Expat XML Support]) +AC_MY_ARG_ENABLE(use-iksemel,no,,[Enables Iksemel XML Support]) AC_MY_ARG_ENABLE(use-srv,no,,[Enables DNS SRV Support]) AC_MY_ARG_ENABLE(use-actions,yes,,[Enables regular MUD command parser]) AC_MY_ARG_ENABLE(use-builtin-editor,yes,,[Enables built-in text editor 'ed']) @@ -141,10 +142,11 @@ AC_MY_ARG_ENABLE(use-ldmud-compatibility,yes,,[Makes psyclpc behave more like LD AC_MY_ARG_ENABLE(use-pthreads,no,,[Enables using of threads for socket writes]) AC_MY_ARG_ENABLE(use-pcre,yes,,[Enables PCRE: no/yes/builtin/no-builtin]) +AC_MY_ARG_ENABLE(use-iksemel,no,,[Enables use of iksemel for XML parsing]) AC_MY_ARG_ENABLE(use-deprecated,yes,,[Enables obsolete and deprecated efuns]) AC_MY_ARG_ENABLE(use-structs,yes,,[Enables structs]) AC_MY_ARG_ENABLE(use-tls,no,,[Enables Transport Layer Security over Telnet: no/gnu/ssl/yes]) -AC_MY_ARG_WITH(tls-path,,[Optional location of the TLS include/ and lib/ directory]) +AC_MY_ARG_WITH(tls-path,,,[Optional location of the TLS include/ and lib/ directory]) AC_MY_ARG_ENABLE(use-new-inlines,yes,,[Enables new inline syntax]) AC_MY_ARG_ENABLE(use-set-light,yes,,[Enables efun set_light()]) AC_MY_ARG_ENABLE(use-set-is-wizard,yes,,[Enables efun set_is_wizard()]) @@ -159,6 +161,7 @@ AC_MY_ARG_ENABLE(malloc-trace,no,,[Annotate allocations with source file:line]) AC_MY_ARG_ENABLE(malloc-lpc-trace,no,,[Annotate allocations with LPC object info]) AC_MY_ARG_ENABLE(malloc-sbrk-trace,no,,[Log all esbrk() calls (smalloc,slaballoc)]) AC_MY_ARG_ENABLE(dynamic-costs,no,,) +AC_MY_ARG_ENABLE(eval-cost-trace,no,,[Writes the evaluation costs in the stracktrace]) AC_MY_ARG_ENABLE(trace-code,yes,,[trace the most recently executed bytecode]) AC_MY_ARG_ENABLE(rxcache_table,yes,,) @@ -237,7 +240,10 @@ AC_MY_ARG_WITH(min-malloced,0,,) AC_MY_ARG_WITH(min-small-malloced,0,,) AC_MY_ARG_WITH(max-malloced,0x4000000,,) AC_MY_ARG_WITH(total-trace-length,0x1000,,) +AC_MY_ARG_WITH(pcre-recursion-limit,3000,,[maximum number of recursions in PCRE package]) AC_MY_ARG_WITH(wizlist-file,WIZLIST,,[name of the wizlist file]) +AC_MY_ARG_WITH(max_net_connects,10,,[maximum number of concurrent connection attempts]) +AC_MY_ARG_WITH(random-period-length,19937,[607 / 1279 / 2281 / 4253 / 11213 / 19937 / 44497 / 86243 / 132049 / 216091],[period length of the random number generator]) AC_ARG_WITH(setting,[ --with-setting=SETTING include a predefined setting],[ if test -f "settings/$withval" ; then @@ -266,7 +272,11 @@ AC_UPDATE_VAR(enable_erq) if test "x$enable_erq" = "xerq" || test "x$enable_erq" = "xyes"; then cdef_erq_demon="#define" erq_sub=erq - AC_DEFINE(ERQ_INCLUDE,"util/erq/erq.h") + AC_DEFINE(ERQ_INCLUDE,"util/erq/erq.h",[define the erq include file.]) +elif test "x$enable_erq" = "xxerq"; then + cdef_erq_demon="#define" + erq_sub=xerq + AC_DEFINE(ERQ_INCLUDE,"util/xerq/erq.h") else cdef_erq_demon="#undef" erq_sub= @@ -336,6 +346,20 @@ else enable_use_sqlite="yes" fi +AC_UPDATE_VAR(enable_use_iksemel) +if test "x$enable_use_iksemel" = "x" || test "x$enable_use_iksemel" = "xyes"; then + cdef_use_iksemel="#define" + iksemel_path= + enable_use_iksemel="yes" +elif test "x$enable_use_iksemel" = "xno"; then + cdef_use_iksemel="#undef" + iksemel_path= +else + cdef_use_iksemel="#define" + iksemel_path="$enable_use_iksemel" + enable_use_iksemel="yes" +fi + AC_UPDATE_VAR(enable_use_json) if test "x$enable_use_json" = "x" || test "x$enable_use_json" = "xyes"; then cdef_use_json="#define" @@ -364,6 +388,20 @@ else enable_use_expat="yes" fi +AC_UPDATE_VAR(enable_use_iksemel) +if test "x$enable_use_iksemel" = "x" || test "x$enable_use_iksemel" = "xyes"; then + cdef_use_iksemel="#define" + iksemel_path= + enable_use_iksemel="yes" +elif test "x$enable_use_iksemel" = "xno"; then + cdef_use_iksemel="#undef" + iksemel_path= +else + cdef_use_iksemel="#define" + iksemel_path="$enable_use_iksemel" + enable_use_iksemel="yes" +fi + # --- SRV --- AC_CHECK_HEADER(arpa/nameser_compat.h, enable_use_srv=yes,enable_use_srv=no) @@ -432,6 +470,7 @@ AC_CDEF_FROM_ENABLE(malloc_trace) AC_CDEF_FROM_ENABLE(malloc_lpc_trace) AC_CDEF_FROM_ENABLE(malloc_sbrk_trace) AC_CDEF_FROM_ENABLE(dynamic_costs) +AC_CDEF_FROM_ENABLE(eval_cost_trace) AC_CDEF_FROM_ENABLE(trace_code) AC_CDEF_FROM_ENABLE(rxcache_table) @@ -523,6 +562,9 @@ AC_INT_VAL_FROM_WITH(min_malloced) AC_INT_VAL_FROM_WITH(min_small_malloced) AC_INT_VAL_FROM_WITH(max_malloced) AC_INT_VAL_FROM_WITH(total_trace_length) +AC_INT_VAL_FROM_WITH(pcre_recursion_limit) +AC_INT_VAL_FROM_WITH(max_net_connects) +AC_INT_VAL_FROM_WITH(random_period_length) if test "x$cdef_access_control" = "x#undef"; then cdef_access_log="#undef" @@ -605,27 +647,76 @@ fi # Restore the CFLAGS CFLAGS=$save_cflags -dnl check for ANSI-C (for compiling LDMUD project) -dnl TODO: check for 'c89' if CC="cc" and 'cc' not ANSI-C -dnl -AC_TRY_COMPILE([ -#ifndef __STDC__ -#error need STDC -guarantee an compiling error here... -#endif -],, -:, -AC_MSG_ERROR(You need an ANSI-C compiler! sorry..) -) +# check for ANSI-C (for compiling LDMUD project) +AC_PROG_CC_STDC +if test "${ac_cv_prog_cc_stdc}" = no; then + AC_MSG_ERROR(You need an ANSI-C89 or ISO-C (C99) compiler! sorry..) +fi -dnl Checking for programs +# does the compile have an inline keyword? +AC_C_INLINE +if test "x$ac_cv_c_inline" != "xno"; then + AC_DEFINE(HAS_INLINE, 1, [Does the compiler provide inline functions?]) +fi +# does the compile have an restrict keyword? +# temporarily deactivated because it introduces an #if defined x into +# machine.h and mkfunc.c can't deal with 'defined' without parentheses. +#AC_C_RESTRICT + +# does the compile have an typeof keyword? +AC_C_TYPEOF + +# does the preprocessor support the stringenizing operator? +AC_C_STRINGIZE + +# check for some types +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INTMAX_T +AC_TYPE_INTPTR_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINTMAX_T +AC_TYPE_UINTPTR_T +AC_TYPE_LONG_LONG_INT +AC_TYPE_UNSIGNED_LONG_LONG_INT +AC_TYPE_LONG_DOUBLE +AC_TYPE_LONG_DOUBLE_WIDER +AC_TYPE_SSIZE_T +AC_TYPE_SIZE_T +AC_TYPE_OFF_T +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_TYPE_SIGNAL + +# Check some sizes +AC_CHECK_SIZEOF(char *) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) +AC_CHECK_SIZEOF(intptr_t) +AC_CHECK_SIZEOF(intmax_t) + + +# Checking for programs AC_PROG_INSTALL -AC_CONFIG_HEADER(machine.h) +AC_CONFIG_HEADERS(machine.h) AC_CHECK_PROGS(YACC, byacc "bison -y", yacc) AC_PROG_CPP +AH_TOP([ +#ifndef MACHINE_H +#define MACHINE_H]) +AH_BOTTOM([ +#endif]) + dnl Recognize some unusual systems. dnl Not all checks happen here - the check for solaris for example requires dnl some library checks first. @@ -645,18 +736,22 @@ yes [ EXTRA_CFLAGS="${EXTRA_CFLAGS} -DMSWIN" ]) dnl Checking for headers - -AC_HEADER_STDC +AC_HEADER_STDBOOL AC_CHECK_HEADERS(sys/rusage.h sys/time.h unistd.h stdlib.h libc.h memory.h) -AC_CHECK_HEADERS(values.h string.h bstring.h netdb.h crypt.h sys/param.h sys/termios.h) +AC_CHECK_HEADERS(string.h bstring.h netdb.h crypt.h sys/param.h sys/termios.h) + dnl extra check for ; must be there! AC_CHECK_HEADERS(limits.h) AC_HEADER_DIRENT -AC_CHECK_SIZEOF(char *) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(long) + +dnl check for some functions +AC_FUNC_MKTIME +AC_FUNC_ALLOCA +AC_CHECK_FUNCS(fchmod getrusage bzero memset memcpy memmem strdup strcspn) +AC_CHECK_FUNCS(strchr strrchr getcwd memmove sysconf gettimeofday wait3 waitpid) +AC_CHECK_FUNCS(fcntl getdomainname poll strtoul trunc) + AC_CACHE_CHECK(for needed malloc() alignment,lp_cv_sys_malloc_align, AC_TRY_COMPILE([struct ts {double d; char *p; double e;}; @@ -664,52 +759,14 @@ int i = 96/(sizeof(struct ts)-20); ],, lp_cv_sys_malloc_align=8, lp_cv_sys_malloc_align=4)) -AC_DEFINE_UNQUOTED(MALLOC_ALIGN,$lp_cv_sys_malloc_align) +AC_DEFINE_UNQUOTED(MALLOC_ALIGN,$lp_cv_sys_malloc_align,[word alignment]) -AC_CACHE_CHECK(for uint32_t and friends,lp_cv_inttypes, -AC_TRY_COMPILE([#include -uint32_t i;],, -lp_cv_inttypes=yes, -lp_cv_inttypes=no)) -if test $lp_cv_inttypes = yes; then - AC_DEFINE(HAVE_INTTYPES) -fi - -AC_CACHE_CHECK(for ssize_t,lp_cv_type_ssize_t, -AC_TRY_COMPILE([#include -ssize_t i;],, -lp_cv_type_ssize_t=yes, -lp_cv_type_ssize_t=no)) -if test $lp_cv_type_ssize_t = yes; then - AC_DEFINE(HAVE_SSIZE_T) -fi - -AC_CHECK_SIZEOF(long long) dnl Also checks for the existance -if test $ac_cv_type_long_long = yes; then - AC_DEFINE(HAVE_LONG_LONG) -fi - -AC_CACHE_CHECK(for bool,lp_cv_type_bool, -AC_TRY_COMPILE([bool b;],, -lp_cv_type_bool=yes, -lp_cv_type_bool=no)) -if test $lp_cv_type_bool = yes; then - AC_DEFINE(HAVE_BOOL) -fi - -AC_C_INLINE -if test "x$ac_cv_c_inline" != "xno"; then - AC_DEFINE(HAS_INLINE) -fi - -AC_TYPE_SIZE_T -AC_TYPE_PID_T -AC_TYPE_SIGNAL if test "x$ac_cv_type_signal" = "xvoid"; then - cat >> confdefs.h < + +iks * foo(void) +{ + + return (iks*)0; +} +],, +lp_cv_has_iksemel=yes +if test "x$TESTPATH" != "x"; then + EXTRA_CFLAGS="-I$TESTPATH $EXTRA_CFLAGS" +fi +break; +, +lp_cv_has_iksemel=no +CFLAGS="$saveflags" +) +done +) + +# The system has the include files - now search for the libraries. +if test $lp_cv_has_iksemel = yes; then + saveflags="$CFLAGS" + AC_DEFINE(HAS_IKSEMEL, 1, [Does the machine offer iksemel?]) + + if test $enable_use_iksemel = yes; then + tmp="" + + AC_CHECK_LIB(iksemel,main, tmp="$PKGLIBS -liksemel") + + if test "x$iksemel_path" == "x"; then + unset ac_cv_lib_iksemel_main + if test -d "${iksemel_path}/lib/iksemel"; then + CFLAGS="$saveflags -L${iksemel_path}/lib/iksemel" + AC_CHECK_LIB(iksemel,main, tmp="$PKGLIBS -L${iksemel_path}/lib/iksemel -liksemel") + elif test -d "${iksemel_path}/lib"; then + CFLAGS="$saveflags -L${iksemel_path}/lib" + AC_CHECK_LIB(iksemel,main, tmp="$PKGLIBS -L${iksemel_path}/lib -liksemel") + elif test -d "${iksemel_patch}"; then + CFLAGS="$saveflags -L$iksemel_path" + AC_CHECK_LIB(iksemel,main, tmp="$PKGLIBS -L$iksemel_path -liksemel") + fi + fi + + if test "x$tmp" == "x"; then + unset ac_cv_lib_iksemel_main + if test -d "/usr/local/lib"; then + CFLAGS="$saveflags -L/usr/local/lib" + AC_CHECK_LIB(iksemel,main, tmp="$PKGLIBS -L/usr/local/lib -liksemel") + fi + fi + + if test "x$tmp" == "x"; then + echo "libiksemel library not found - disabling Iksemel support" + AC_NOT_AVAILABLE(use-iksemel) + cdef_use_iksemel="#undef" + enable_use_iksemel="no" + iksemel= + lp_cv_has_iksemel="no" + else + PKGLIBS="$tmp" + fi + fi + + CFLAGS="$saveflags" +else + if test $enable_use_iksemel = yes; then + AC_NOT_AVAILABLE(use-iksemel) + cdef_use_iksemel="#undef" + enable_use_iksemel=no + fi +fi + # --- JSON --- cdef_enable_use_json="#undef" AC_CHECK_HEADER(json/json.h,,[ @@ -1725,7 +1859,7 @@ AC_CHECK_HEADER(json/json.h,,[ # The system has the json include files - now search for the libraries. if test "x$enable_use_json" = "x" || test "x$enable_use_json" = "xyes"; then AC_CHECK_LIB(json, main, [ - AC_DEFINE(HAS_JSON) + AC_DEFINE(HAS_JSON, 1, [Does the machine offer native json?]) PKGLIBS="$PKGLIBS -ljson" lp_cv_has_json=yes cdef_use_json="#define" @@ -1742,7 +1876,7 @@ AC_CHECK_HEADER(expat.h,,[ # search for the libraries if test "x$enable_use_expat" = "x" || test "x$enable_use_expat" = "xyes"; then AC_CHECK_LIB(expat, XML_ParserCreate, [ - AC_DEFINE(HAS_EXPAT) + AC_DEFINE(HAS_EXPAT, 1, [Does the machine offer expat?]) PKGLIBS="$PKGLIBS -lexpat" lp_cv_has_expat=yes cdef_use_expat="#define" @@ -1779,7 +1913,7 @@ main() { lp_cv_sys_rename_handles_directories=yes, lp_cv_sys_rename_handles_directories=no)) if test $lp_cv_sys_rename_handles_directories = yes; then - AC_DEFINE(RENAME_HANDLES_DIRECTORIES) + AC_DEFINE(RENAME_HANDLES_DIRECTORIES, 1, [Can rename handle directories?]) fi rmdir conftestdirfrom conftestdirto 2> /dev/null @@ -1816,7 +1950,7 @@ AC_TRY_COMPILE([ *v++ = rus.ru_nivcsw; ],lp_cv_struct_rusage_full=yes,lp_cv_struct_rusage_full=no)) if test $lp_cv_struct_rusage_full = no; then - AC_DEFINE(GETRUSAGE_RESTRICTED) + AC_DEFINE(GETRUSAGE_RESTRICTED, 1, [If so, is it restricted to user and system time?]) fi AC_CACHE_CHECK(struct rusage timeval members with tv_usec, lp_cv_struct_rusage_usec, @@ -1838,7 +1972,7 @@ AC_TRY_COMPILE([ *v++ = rus.ru_stime.tv_sec * 1000 + rus.ru_stime.tv_usec / 1000; ], lp_cv_struct_rusage_usec=yes, lp_cv_struct_rusage_usec=no)) if test $lp_cv_struct_rusage_usec = yes; then - AC_DEFINE(RUSAGE_USEC) + AC_DEFINE(RUSAGE_USEC, 1, [Can ru_utime / ru_stime be accessed as a timeval with tv_sec and tv_usec?]) fi else AC_CACHE_CHECK(for getrusage() via syscall(), @@ -1855,7 +1989,8 @@ struct rusage rus; syscall(SYS_GETRUSAGE, RUSAGE_SELF, rus); ], lp_cv_func_getrusage_via_syscall=yes, lp_cv_func_getrusage_via_syscall=no)) if test $lp_cv_func_getrusage_via_syscall=yes; then - AC_DEFINE(GETRUSAGE_VIA_SYSCALL) AC_DEFINE(HAVE_GETRUSAGE) + AC_DEFINE(HAVE_GETRUSAGE, 1, [Does the system have a getrusage call?]) + AC_DEFINE(GETRUSAGE_VIA_SYSCALL, 1, [Is it available as a subfunction of syscall()?]) fi fi @@ -1875,7 +2010,7 @@ AC_TRY_COMPILE([ void free(); ],, lp_cv_prop_free_returns_void=yes, lp_cv_prop_free_returns_void=no)) if test $lp_cv_prop_free_returns_void = yes; then - AC_DEFINE(FREE_RETURNS_VOID) + AC_DEFINE(FREE_RETURNS_VOID, 1, [does free() have void as its returntype?]) fi AC_CACHE_CHECK(if void* or char* from malloc, @@ -1905,7 +2040,7 @@ int free PROT((POINTER)); #endif ],,lp_cv_prop_malloc_return_type="void *", lp_cv_prop_malloc_return_type="char *")) -AC_DEFINE_UNQUOTED(POINTER,$lp_cv_prop_malloc_return_type) +AC_DEFINE_UNQUOTED(POINTER,$lp_cv_prop_malloc_return_type,[what kind of pointer is used by malloc() et al]) AC_CACHE_CHECK(if CHAR_BIT == 8 or undef, lp_cv_prop_charbits_eq_8, @@ -1920,7 +2055,7 @@ AC_TRY_COMPILE([ int i=[1/(CHAR_BIT-8)]; ],,lp_cv_prop_charbits_eq_8=no, lp_cv_prop_charbits_eq_8=yes)) if test $lp_cv_prop_charbits_eq_8 = yes; then - AC_DEFINE(CHARBIT_MASK, 0xff) + AC_DEFINE(CHARBIT_MASK, 0xff, [A mask that allows to extract an unsigned char from a signed]) else dnl TODO: this is something I don't really understand... am I too stupid? dnl TODO:: bitmask set to number of bits ?????? *shudder* [Mubo] @@ -1944,7 +2079,7 @@ int main() { ], lp_cv_prop_strtol_broken=no, lp_cv_prop_strtol_broken=yes)) if test $lp_cv_prop_strtol_broken = yes; then - AC_DEFINE(STRTOL_BROKEN) + AC_DEFINE(STRTOL_BROKEN, 1, [the atari strtol() used to consider characters '9' < c < 'A' to be numeric]) fi dnl the following three tests would better be nested, but it seems to overflow @@ -2025,7 +2160,7 @@ lp_cv_prop_use_ioctl_fionbio=unknown AC_MSG_WARN(You have to supply the correct way to set sockets non-blocking by hand.) )) if test $lp_cv_prop_use_ioctl_fionbio = yes; then - AC_DEFINE(USE_IOCTL_FIONBIO) + AC_DEFINE(USE_IOCTL_FIONBIO, 1, [How to set a socket non-blocking]) fi AC_CACHE_CHECK(nonblocking using fcntl with O_NDELAY, @@ -2085,7 +2220,7 @@ main() { lp_cv_prop_use_fnctl_o_ndelay=no, lp_cv_prop_use_fnctl_o_ndelay=unknown)) if test $lp_cv_prop_use_fnctl_o_ndelay = yes; then - AC_DEFINE(USE_FCNTL_O_NDELAY) + AC_DEFINE(USE_FCNTL_O_NDELAY, 1, [nonblocking using fcntl with O_NDELAY]) fi AC_CACHE_CHECK(nonblocking using fcntl with FNDELAY, @@ -2145,7 +2280,7 @@ main() { lp_cv_prop_use_fcntl_fndelay=no, lp_cv_prop_use_fcntl_fndelay=unknown)) if test $lp_cv_prop_use_fcntl_fndelay = yes; then - AC_DEFINE(USE_FCNTL_FNDELAY) + AC_DEFINE(USE_FCNTL_FNDELAY, 1, [nonblocking using fcntl with FNDELAY]) fi @@ -2203,7 +2338,7 @@ main() { lp_cv_prop_use_fcntl_setown=no, lp_cv_prop_use_fcntl_setown=unknown)) if test $lp_cv_prop_use_fcntl_setown = yes; then - AC_DEFINE(USE_FCNTL_SETOWN) + AC_DEFINE(USE_FCNTL_SETOWN, 1, [Can F_SETOWN be used on a socket?]) fi AC_CACHE_CHECK(if OOBINLINE works, @@ -2263,7 +2398,7 @@ main() { lp_cv_prop_use_oobinline=no, lp_cv_prop_use_oobinline=unknown)) if test $lp_cv_prop_use_oobinline = yes; then - AC_DEFINE(USE_OOBINLINE) + AC_DEFINE(USE_OOBINLINE, 1, [Can SO_OOBINLINE be used on a socket?]) fi @@ -2284,7 +2419,7 @@ main(){ lp_cv_prop_overlapping_bcopy=no, lp_cv_prop_overlapping_bcopy=yes)) if test $lp_cv_prop_overlapping_bcopy = yes; then - AC_DEFINE(OVERLAPPING_BCOPY) + AC_DEFINE(OVERLAPPING_BCOPY, 1, [Define if you have bcopy, and it handles overlapping ranges correctly.]) fi AC_CACHE_CHECK(if strtol needs const char*, @@ -2296,7 +2431,7 @@ long strtol(str, ptr, base) char *str; char **ptr; int base; { return 0; } ],,lp_cv_prop_strtol_const_charp=no, lp_cv_prop_strtol_const_charp=yes)) if test $lp_cv_prop_strtol_const_charp = yes; then - AC_DEFINE(STRTOL_CONST_CHARP) + AC_DEFINE(STRTOL_CONST_CHARP, 1, [needs the first argument of strtol be declared as const?]) fi # --- Check for compiler options --- @@ -2346,19 +2481,6 @@ for TESTFLAG in -O; do fi fi done -for TESTFLAG in -qmaxmem=65536; do - if eval $tcomp; then - if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then - : - #the [e]grep option -v will not give a failure exit status on the atari - else - if eval $tcomp; then - CFLAGS="$CFLAGS $TESTFLAG" - break - fi - fi - fi -done changequote([,])dnl for TESTFLAG in -g; do if eval $tcomp; then @@ -2383,40 +2505,12 @@ for TESTFLAG in -O2 -O; do fi fi done -for TESTFLAG in -qmaxmem=97204; do - if eval $tcomp; then - if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then - : - #the [e]grep option -v will not give a failure exit status on the atari - else - if eval $tcomp; then - OPTFLAGS="$OPTFLAGS $TESTFLAG" - CFLAGS="$CFLAGS $TESTFLAG" - break - fi - fi - fi -done -for TESTFLAG in -g -fstrength-reduce -fno-force-addr -fomit-default-branch; do +for TESTFLAG in -g; do if eval $tcomp; then OPTFLAGS="$OPTFLAGS $TESTFLAG" CFLAGS="$CFLAGS $TESTFLAG" fi done -#if using gcc, inlining is already handled explicit. When explicit inlining -#is left out, this is usually done for a good reason. Use -# -print-libgcc-filename to test for gcc. -TESTFLAG='-print-libgcc-filename -O3 -fno-inline-functions' -if eval $tcomp; then - if echo `eval $tcomp2` | egrep '[uU]n(recognized|known) [oO]ption' >/dev/null; then - : - else - if eval $tcomp; then - OPTFLAGS="$OPTFLAGS -fno-inline-functions" - CFLAGS="$CFLAGS -fno-inline-functions" - fi - fi -fi changequote([,])dnl MCFLAGS=$CFLAGS AC_MSG_RESULT($MCFLAGS) @@ -2483,6 +2577,16 @@ fi AC_ARG_WITH(target,[ --with-target ??], EXTRA_CFLAGS="${EXTRA_CFLAGS} -D${withval}") +# Some Unixes require the -n parameter for tail to work properly +AC_MSG_CHECKING(if tail accepts the -n parameter) +TAIL_N="" +if tail -n +2 confdefs.h > /dev/null 2>&1; then + AC_MSG_RESULT(yes) + TAIL_N="-n" +else + AC_MSG_RESULT(no) +fi + AC_MSG_CHECKING(if ${YACC} includes bogus malloc prototypes) cat > conftest.y <&5; then CLEAN_YACC_TAB='' AC_MSG_RESULT(no) else - MOVE_YACC_TAB='tail +2 $(YACCTAB)c >' + MOVE_YACC_TAB='tail $TAIL_N +2 $(YACCTAB)c >' CLEAN_YACC_TAB='$(RM) $(YACCTAB)c' AC_MSG_RESULT(yes) fi @@ -2557,6 +2661,8 @@ SAVE_LIBS="${LIBS}" SAVE_CFLAGS="${CFLAGS}" CFLAGS='' for TESTFLAG in '' -static -Bstatic -n; do + + AC_MSG_CHECKING(malloc redefinition with linking flag ${TESTFLAG}) LIBS="${SAVE_LIBS} ${TESTFLAG}" cat > conftest.data <