diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 120 |
1 files changed, 53 insertions, 67 deletions
diff --git a/configure.in b/configure.in index a7fef723..6ddf8642 100644 --- a/configure.in +++ b/configure.in @@ -1,12 +1,14 @@ dnl Process this file with aclocal, autoconf and automake. -AC_INIT(src/dillo.cc) +AC_INIT([dillo], [2.2]) -dnl Detect the canonical host and target build environment -AC_CANONICAL_SYSTEM +dnl Detect the canonical target build environment +AC_CANONICAL_TARGET + +AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR([src/dillo.cc]) +AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE(dillo, 2.2) -AM_CONFIG_HEADER(config.h) sysconfdir=${sysconfdir}/${PACKAGE} dnl Options @@ -38,7 +40,6 @@ AC_ARG_ENABLE(threaded-dns,[ --disable-threaded-dns Disable the advantage of a AC_ARG_ENABLE(rtfl, [ --enable-rtfl Build with rtfl messages]) AC_PROG_CC AC_PROG_CXX -AM_PROG_CC_STDC AC_PROG_RANLIB AC_PROG_CPP @@ -52,43 +53,10 @@ AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(void *) -case 2 in -$ac_cv_sizeof_short) gint16=short;; -$ac_cv_sizeof_int) gint16=int;; -esac -case 4 in -$ac_cv_sizeof_short) gint32=short;; -$ac_cv_sizeof_int) gint32=int;; -$ac_cv_sizeof_long) gint32=long;; -esac - -cat >d_size.h <<_______EOF -#ifndef __D_SIZE_H__ -#define __D_SIZE_H__ - - -#include "config.h" - -#if HAVE_STDINT_H == 0 -#include <stdint.h> -#elif defined(HAVE_INTTYPES_H) -#include <inttypes.h> -#else -typedef signed $gint16 int16_t; -typedef unsigned $gint16 uint16_t; -typedef signed $gint32 int32_t; -typedef unsigned $gint32 uint32_t; -#endif -typedef unsigned char uchar_t; -typedef unsigned short ushort_t; -typedef unsigned long ulong_t; -typedef unsigned int uint_t; -typedef unsigned char bool_t; - - -#endif /* __D_SIZE_H__ */ -_______EOF - +AC_TYPE_INT16_T +AC_TYPE_UINT16_T +AC_TYPE_INT32_T +AC_TYPE_UINT32_T dnl -------------------------------------- dnl Check whether to add /usr/local or not @@ -114,21 +82,21 @@ dnl -------------------- dnl AC_MSG_CHECKING([for socklen_t]) ac_cv_socklen_t="" -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/socket.h> -],[ +]],[[ socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a); -], +]])], ac_cv_socklen_t="socklen_t", -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <sys/types.h> #include <sys/socket.h> -],[ +]],[[ int a=0; getsockname(0,(struct sockaddr*)0, &a); -], +]])], ac_cv_socklen_t="int", ac_cv_socklen_t="size_t" ) @@ -150,9 +118,9 @@ if sh -c "fltk2-config --version" >/dev/null 2>&1 then AC_MSG_RESULT(yes) LIBFLTK_CXXFLAGS=`fltk2-config --cxxflags` LIBFLTK_CFLAGS=`fltk2-config --cflags` - LIBFLTK_LIBS=`fltk2-config --use-images --ldflags` + LIBFLTK_LIBS=`fltk2-config --ldflags` else AC_MSG_RESULT(no) - AC_ERROR(FLTK2 must be installed!) + AC_MSG_ERROR(FLTK2 must be installed!) fi @@ -201,7 +169,7 @@ fi if test "x$libz_ok" = xyes; then LIBZ_LIBS="-lz" else - AC_ERROR(zlib must be installed!) + AC_MSG_ERROR(zlib must be installed!) fi dnl --------------- @@ -317,8 +285,12 @@ if test "x$iconv_ok" = "xno"; then dnl Test for OpenBSD old_libs="$LIBS" LIBS="$old_libs -liconv" - AC_TRY_COMPILE([#include <iconv.h>],[iconv_open("","");], - iconv_ok=yes, iconv_ok=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <iconv.h> +]],[[ +iconv_open("",""); +]])], +iconv_ok=yes,iconv_ok=no) LIBS="$old_libs" if test "x$iconv_ok" = "xyes"; then LIBICONV_LIBS="-liconv" @@ -326,7 +298,7 @@ if test "x$iconv_ok" = "xno"; then fi if test "x$iconv_ok" = "xno"; then - AC_ERROR(libiconv must be installed!) + AC_MSG_ERROR(libiconv must be installed!) fi dnl ---------------------- @@ -340,14 +312,15 @@ if test "x$iconv_ok" = "xyes"; then old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_LANG_PUSH([C++]) - AC_TRY_COMPILE([#include <iconv.h>], -[ - const char *inPtr; - char *outPtr; - size_t inLeft = 0, outRoom = 0; - iconv_t encoder = iconv_open("ASCII", "UTF-8"); - iconv(encoder, &inPtr, &inLeft, &outPtr, &outRoom); -], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <iconv.h> +]],[[ +const char *inPtr; +char *outPtr; +size_t inLeft = 0, outRoom = 0; +iconv_t encoder = iconv_open("ASCII", "UTF-8"); +iconv(encoder, &inPtr, &inLeft, &outPtr, &outRoom); +]])], iconv_old=yes,iconv_old=no) AC_LANG_POP([C++]) LIBS="$old_libs" @@ -386,7 +359,8 @@ case $target in AC_MSG_CHECKING(whether threads work with -pthread) LDSAVEFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -pthread" - AC_TRY_LINK_FUNC(pthread_create, pthread_ok=yes, pthread_ok=no) + AC_LINK_IFELSE([AC_LANG_CALL([],[pthread_create])], +pthread_ok=yes, pthread_ok=no) LDFLAGS=$LDSAVEFLAGS if test "x$pthread_ok" = "xyes"; then @@ -448,7 +422,6 @@ dnl ----------------------- dnl Checks for header files dnl ----------------------- dnl -AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h unistd.h sys/uio.h) dnl -------------------------- @@ -511,5 +484,18 @@ AC_SUBST(LIBFLTK_LIBS) AC_SUBST(LIBICONV_LIBS) AC_SUBST(datadir) -AC_OUTPUT(Makefile dlib/Makefile dpip/Makefile dpid/Makefile dpi/Makefile doc/Makefile dw/Makefile lout/Makefile src/Makefile src/IO/Makefile test/Makefile) - +AC_CONFIG_FILES([ + Makefile + dlib/Makefile + dpip/Makefile + dpid/Makefile + dpi/Makefile + doc/Makefile + dw/Makefile + lout/Makefile + src/Makefile + src/IO/Makefile + test/Makefile +]) + +AC_OUTPUT |