Commit 6c5bdc21 authored by David E. O'Brien's avatar David E. O'Brien
Browse files

Moving libxo to properly tracked, 3rd-Party imported handling.

Reviewed by: phil, sjg
parents
language: c
script: printenv && uname -a && ls -l && /bin/sh -x ./bin/setup.sh && cd build && ../configure --enable-warnings && make && sudo make install && make test
notifications:
recipients:
- libslax-noise@googlegroups.com
branches:
only:
- master
- develop
Copyright (c) 2014 Juniper Networks, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
<!---
# $Id$
#
# Copyright 2015, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
#-->
## Instructions for building libxo
Instructions for building libxo are now available in the
[wiki](http://juniper.github.io/libxo/libxo-manual.html#getting-libxo).
Copyright (c) 2014, Juniper Networks
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# $Id$
#
# Copyright 2014, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libxo xo xopo xolint xohtml tests doc encoder
bin_SCRIPTS=libxo-config
dist_doc_DATA = Copyright
EXTRA_DIST = \
libxo-config.in \
warnings.mk \
README.md \
INSTALL.md \
packaging/libxo.spec
.PHONY: test tests
test tests:
@(cd tests ; ${MAKE} test)
errors:
@(cd tests/errors ; ${MAKE} test)
docs:
@(cd doc ; ${MAKE} docs)
DIST_FILES_DIR = ~/Dropbox/dist-files/
GH_PAGES_DIR = gh-pages/
GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION}
PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz
upload: dist upload-docs
@echo "Remember to run:"
@echo " gt tag ${PACKAGE_VERSION}"
upload-docs: docs
@echo "Uploading libxo-manual.html ... "
@-[ -d ${GH_PAGES_DIR} ] \
&& echo "Updating manual on gh-pages ..." \
&& mkdir -p ${GH_PAGES_DIR_VER} \
&& cp doc/libxo-manual.html ${GH_PAGES_DIR} \
&& cp doc/libxo-manual.html ${GH_PAGES_DIR_VER} \
&& (cd ${GH_PAGES_DIR} \
&& git add ${PACKAGE_VERSION} \
&& git add libxo-manual.html \
&& git commit -m 'new docs' \
libxo-manual.html ${PACKAGE_VERSION} \
&& git push origin gh-pages ) ; true
pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA = packaging/${PACKAGE_NAME}.pc
get-wiki:
git clone https://github.com/Juniper/${PACKAGE_NAME}.wiki.git wiki
get-gh-pages:
git clone https://github.com/Juniper/${PACKAGE_NAME}.git \
gh-pages -b gh-pages
UPDATE_PACKAGE_FILE = \
-e "s;__SHA1__;$$SHA1;" \
-e "s;__SHA256__;SHA256 (textproc/${PACKAGE_FILE}) = $$SHA256;" \
-e "s;__SIZE__;SIZE (textproc/${PACKAGE_FILE}) = $$SIZE;"
GH_PACKAGING_DIR = ${PACKAGE_VERSION}/packaging
GH_PAGES_PACKAGE_DIR = ${GH_PAGES_DIR}/${GH_PACKAGING_DIR}
packages:
@-[ -d ${GH_PAGES_DIR} ] && set -x \
&& echo "Updating packages on gh-pages ..." \
&& SHA1="`openssl sha1 ${PACKAGE_FILE} | awk '{print $$2}'`" \
&& SHA256="`openssl sha256 ${PACKAGE_FILE} | awk '{print $$2}'`" \
&& SIZE="`ls -l ${PACKAGE_FILE} | awk '{print $$5}'`" \
&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb ..." \
&& sed ${UPDATE_PACKAGE_FILE} \
packaging/${PACKAGE_NAME}.rb.base \
> ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.rb \
&& echo "... ${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec ..." \
&& cp packaging/${PACKAGE_NAME}.spec \
${GH_PAGES_PACKAGE_DIR}/${PACKAGE_NAME}.spec \
&& (cd ${GH_PAGES_DIR} \
&& git add ${GH_PACKAGING_DIR} \
&& git add ${GH_PACKAGING_DIR}/libxo.rb \
${GH_PACKAGING_DIR}/libxo.spec \
&& git commit -m 'new packaging data' \
${GH_PACKAGING_DIR} \
&& git push origin gh-pages ) ; true
ANALYZE_DIR = ~/trash/libxo
ANALYZE_CMD = scan-build-mp-3.6
analyze:
${ANALYZE_CMD} -o ${ANALYZE_DIR} ${MAKE}
libxo
=====
libxo - A Library for Generating Text, XML, JSON, and HTML Output
The libxo library allows an application to generate text, XML, JSON,
and HTML output using a common set of function calls. The application
decides at run time which output style should be produced. The
application calls a function "xo_emit" to product output that is
described in a format string. A "field descriptor" tells libxo what
the field is and what it means.
```
xo_emit(" {:lines/%7ju/%ju} {:words/%7ju/%ju} "
"{:characters/%7ju/%ju}{d:filename/%s}\n",
linect, wordct, charct, file);
```
Output can then be generated in various style, using the "--libxo"
option:
```
% wc /etc/motd
25 165 1140 /etc/motd
% wc --libxo xml,pretty,warn /etc/motd
<wc>
<file>
<filename>/etc/motd</filename>
<lines>25</lines>
<words>165</words>
<characters>1140</characters>
</file>
</wc>
% wc --libxo json,pretty,warn /etc/motd
{
"wc": {
"file": [
{
"filename": "/etc/motd",
"lines": 25,
"words": 165,
"characters": 1140
}
]
}
}
% wc --libxo html,pretty,warn /etc/motd
<div class="line">
<div class="text"> </div>
<div class="data" data-tag="lines"> 25</div>
<div class="text"> </div>
<div class="data" data-tag="words"> 165</div>
<div class="text"> </div>
<div class="data" data-tag="characters"> 1140</div>
<div class="text"> </div>
<div class="data" data-tag="filename">/etc/motd</div>
</div>
```
View the beautiful documentation at:
http://juniper.github.io/libxo/libxo-manual.html
[![Analytics](https://ga-beacon.appspot.com/UA-56056421-1/Juniper/libxo/Readme)](https://github.com/Juniper/libxo)
#
# Copyright 2013, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = gt setup.sh
GT_INSTALL_DIR = ${prefix}/bin
GT_INSTALL_FILES = gt
install-data-hook:
@echo "Installing gt ... "
@-mkdir -p ${GT_INSTALL_DIR}
@for file in ${GT_INSTALL_FILES} ; do \
if [ -f $$file ]; then \
rfile=$$file ; \
else \
rfile=${srcdir}/$$file ; \
fi ; \
mdir=${GT_INSTALL_DIR}/ ; \
mkdir -p $$mdir ; \
cp $$rfile $$mdir/ ; \
done
@${CHMOD} a+x ${GT_INSTALL_DIR}/gt
set top_src=`pwd`
alias Zautoreconf "(cd $top_src ; autoreconf)"
set opts=' \
--with-libslax-prefix=/Users/phil/work/root \
--enable-debug \
--enable-warnings \
--enable-printflike \
--with-gettext=/opt/local \
--prefix ${HOME}/work/root \
'
set opts=`echo $opts`
setenv CONFIGURE_OPTS "$opts"
setenv ADB_PATH $top_src/build/libxo/.libs
alias Zconfigure "(cd $top_src/build; ../configure $opts)"
alias Zbuild "(cd $top_src/build; make \!* )"
alias mi "(cd $top_src/build; make && make install); ."
mkdir -p build
cd build
alias xx 'cc -I.. -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Werror -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wformat -Wimplicit -Wmissing-declarations -Wnested-externs -Wparentheses -Wreturn-type -Wshadow -Wswitch -Wtrigraphs -Wuninitialized -Wunused -Wwrite-strings -fno-inline-functions-called-once -g -O2 -o xtest -DUNIT_TEST libxo.c'
alias mm "make CFLAGS='-O0 -g'"
alias mmi 'mm && mi'
#
# Copyright 2013, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
if [ ! -f configure ]; then
vers=`autoreconf --version | head -1`
echo "Using" $vers
mkdir -p m4
autoreconf --install
if [ ! -f configure ]; then
echo "Failed to create configure script"
exit 1
fi
fi
echo "Creating build directory ..."
mkdir build
echo "Setup is complete. To build libslax:"
echo " 1) Type 'cd build ; ../configure' to configure libslax"
echo " 2) Type 'make' to build libslax"
echo " 3) Type 'make install' to install libslax"
exit 0
#
# $Id$
#
# See ./INSTALL for more info
#
#
# Release numbering: even numbered dot releases are official ones, and
# odd numbers are development ones. The svn version of this file will
# only (ONLY!) ever (EVER!) contain odd numbers, so I'll always know if
# a particular user has the dist or svn release.
#
AC_PREREQ(2.2)
AC_INIT([libxo], [0.4.5], [phil@juniper.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
# Support silent build rules. Requires at least automake-1.11.
# Disable with "configure --disable-silent-rules" or "make V=1"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_PROG_CC
AM_PROG_AR
AC_PROG_INSTALL
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_LN_S
# Must be after AC_PROG_AR
LT_INIT([dlopen shared])
AC_PATH_PROG(BASENAME, basename, /usr/bin/basename)
AC_PATH_PROG(BISON, bison, /usr/bin/bison)
AC_PATH_PROG(CAT, cat, /bin/cat)
AC_PATH_PROG(CHMOD, chmod, /bin/chmod)
AC_PATH_PROG(CP, cp, /bin/cp)
AC_PATH_PROG(DIFF, diff, /usr/bin/diff)
AC_PATH_PROG(MKDIR, mkdir, /bin/mkdir)
AC_PATH_PROG(MV, mv, /bin/mv)
AC_PATH_PROG(RM, rm, /bin/rm)
AC_PATH_PROG(SED, sed, /bin/sed)
AC_STDC_HEADERS
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero memmove strchr strcspn strerror strspn])
AC_CHECK_FUNCS([sranddev srand strlcpy])
AC_CHECK_FUNCS([fdopen getrusage])
AC_CHECK_FUNCS([gettimeofday ctime])
AC_CHECK_FUNCS([getpass])
AC_CHECK_FUNCS([getprogname])
AC_CHECK_FUNCS([sysctlbyname])
AC_CHECK_FUNCS([flock])
AC_CHECK_FUNCS([asprintf])
AC_CHECK_FUNCS([__flbf])
AC_CHECK_FUNCS([sysctlbyname])
AC_CHECK_HEADERS([dlfcn.h])
AC_CHECK_HEADERS([dlfcn.h])
AC_CHECK_HEADERS([stdio_ext.h])
AC_CHECK_HEADERS([tzfile.h])
AC_CHECK_HEADERS([stdtime/tzfile.h])
AC_CHECK_FUNCS([dlfunc])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([ctype.h errno.h stdio.h stdlib.h])
AC_CHECK_HEADERS([string.h sys/param.h unistd.h ])
AC_CHECK_HEADERS([sys/sysctl.h])
AC_CHECK_HEADERS([threads.h])
dnl humanize_number(3) is a great function, but it's not standard.
dnl Note Macosx has the function in libutil.a but doesn't ship the
dnl header file, so I'll need to carry my own implementation. See:
dnl https://devforums.apple.com/thread/271121
AC_CHECK_HEADERS([libutil.h])
AC_CHECK_LIB([util], [humanize_number],
[HAVE_HUMANIZE_NUMBER=$ac_cv_header_libutil_h],
[HAVE_HUMANIZE_NUMBER=no])
AC_MSG_RESULT(humanize_number results: :${HAVE_HUMANIZE_NUMBER}:${ac_cv_header_libutil_h}:)
if test "$HAVE_HUMANIZE_NUMBER" = "yes"; then
AC_DEFINE([HAVE_HUMANIZE_NUMBER], [1], [humanize_number(3)])
fi
AM_CONDITIONAL([HAVE_HUMANIZE_NUMBER], [test "$HAVE_HUMANIZE_NUMBER" = "yes"])
AC_ARG_ENABLE([gettext],
[ --disable-gettext Turn off support for gettext],
[GETTEXT_ENABLE=$enableval],
[GETTEXT_ENABLE=yes])
dnl Looking for gettext(), assumably in libintl
AC_ARG_WITH(gettext,
[ --with-gettext=[PFX] Specify location of gettext installation],
[GETTEXT_PREFIX=$withval],
[GETTEXT_PREFIX=/usr],
)
HAVE_GETTEXT=no
if test "$GETTEXT_ENABLE" != "no"; then
AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}])
_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl"
AC_LINK_IFELSE([AC_LANG_SOURCE([[#include <libintl.h>]
[int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])],
[HAVE_GETTEXT=yes],
[HAVE_GETTEXT=no])
CFLAGS="$_save_cflags"
AC_MSG_RESULT([$HAVE_GETTEXT])
if test "$HAVE_GETTEXT" != "yes"; then
GETTEXT_PREFIX=/opt/local
AC_MSG_CHECKING([gettext in ${GETTEXT_PREFIX}])
_save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -I${GETTEXT_PREFIX}/include -L${GETTEXT_PREFIX}/lib -Werror -lintl"
AC_LINK_IFELSE([AC_LANG_SOURCE([[#include <libintl.h>]
[int main() {char *cp = dgettext(NULL, "xx"); return 0; }]])],
[HAVE_GETTEXT=yes],
[HAVE_GETTEXT=no])
CFLAGS="$_save_cflags"
AC_MSG_RESULT([$HAVE_GETTEXT])
fi
fi
if test "$HAVE_GETTEXT" = "yes"; then
AC_DEFINE([HAVE_GETTEXT], [1], [gettext(3)])
GETTEXT_CFLAGS="-I${GETTEXT_PREFIX}/include"
GETTEXT_LIBS="-L${GETTEXT_PREFIX}/lib -lintl"
else
GETTEXT_PREFIX=none
GETTEXT_CFLAGS=
GETTEXT_LIBS=
fi
AC_SUBST(GETTEXT_CFLAGS)
AC_SUBST(GETTEXT_LIBS)
GETTEXT_BINDIR=${GETTEXT_PREFIX}/bin
AC_SUBST(GETTEXT_BINDIR)
GETTEXT_LIBDIR=${GETTEXT_PREFIX}/lib
AC_SUBST(GETTEXT_LIBDIR)
AM_CONDITIONAL([HAVE_GETTEXT], [test "$HAVE_GETTEXT" = "yes"])
dnl Looking for how to do thread-local variables
AC_ARG_WITH(threads,
[ --with-threads=[STYLE] Specify style of thread-local support (none)],
[THREAD_LOCAL=$withval],
[THREAD_LOCAL=unknown],
)
AC_MSG_CHECKING([thread-locals are ${THREAD_LOCAL}])
if test "$THREAD_LOCAL" = "unknown"; then
AC_LINK_IFELSE([AC_LANG_SOURCE([[]
[__thread int foo; int main() { foo++; return foo; }]])],
[THREAD_LOCAL=before],
[THREAD_LOCAL=unknown])
AC_MSG_RESULT([$THREAD_LOCAL])
fi
if test "$THREAD_LOCAL" = "unknown"; then
AC_LINK_IFELSE([AC_LANG_SOURCE([[]
[int __thread foo; int main() { foo++; return foo; }]])],
[THREAD_LOCAL=after],
[THREAD_LOCAL=unknown])
AC_MSG_RESULT([$THREAD_LOCAL])
fi
if test "$THREAD_LOCAL" = "unknown"; then
AC_LINK_IFELSE([AC_LANG_SOURCE([[]
[__declspec(int) foo; int main() { foo++; return foo; }]])],
[THREAD_LOCAL=declspec],
[THREAD_LOCAL=unknown])
AC_MSG_RESULT([$THREAD_LOCAL])
fi
if test "$THREAD_LOCAL" != "unknown"; then
AC_DEFINE_UNQUOTED([HAVE_THREAD_LOCAL],
THREAD_LOCAL_${THREAD_LOCAL}, [thread-local setting])
fi
dnl Looking for libcrypto....
AC_CHECK_LIB([crypto], [MD5_Init])
AM_CONDITIONAL([HAVE_LIBCRYPTO], [test "$HAVE_LIBCRYPTO" != "no"])
AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[HAVE_SUN_LEN=yes ;
AC_DEFINE([HAVE_SUN_LEN], [1], [Have struct sockaddr_un.sun_len])],
[HAS_SUN_LEN=no], [[#include <sys/un.h>]])
AC_CHECK_DECLS([__isthreaded], [], [], [#include <stdio.h>])
HAVE_ISTHREADED=${ac_cv_have_decl___isthreaded}
dnl
dnl Some packages need to be checked against version numbers so we
dnl define a function here for later use
dnl
AC_DEFUN([VERSION_TO_NUMBER],
[`$1 | sed -e 's/lib.* //' | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'`])
LIBSLAX_CONFIG_PREFIX=""
LIBSLAX_SRC=""
AC_ARG_WITH(libslax-prefix,
[ --with-libslax-prefix=[PFX] Specify location of libslax config],
LIBSLAX_CONFIG_PREFIX=$withval
)
AC_MSG_CHECKING(for libslax)
if test "x$LIBSLAX_CONFIG_PREFIX" != "x"
then
SLAX_CONFIG=${LIBSLAX_CONFIG_PREFIX}/bin/slax-config
else
SLAX_CONFIG=slax-config
fi
dnl
dnl make sure slax-config is executable,
dnl test version and init our variables
dnl
if ${SLAX_CONFIG} --libs > /dev/null 2>&1
then
LIBSLAX_VERSION=`$SLAX_CONFIG --version`
SLAX_BINDIR="`$SLAX_CONFIG --bindir | head -1`"
SLAX_OXTRADOCDIR="`$SLAX_CONFIG --oxtradoc | head -1`"
AC_MSG_RESULT($LIBSLAX_VERSION found)
HAVE_OXTRADOC=yes
else
LIBSLAX_VERSION=
SLAX_BINDIR=
SLAX_OXTRADOCDIR=
AC_MSG_RESULT([no])
HAVE_OXTRADOC=no
fi
AM_CONDITIONAL([HAVE_OXTRADOC], [test "$HAVE_OXTRADOC" != "no"])
AC_SUBST(SLAX_BINDIR)
AC_SUBST(SLAX_OXTRADOCDIR)
AC_MSG_CHECKING([whether to build with warnings])
AC_ARG_ENABLE([warnings],
[ --enable-warnings Turn on compiler warnings],
[LIBXO_WARNINGS=$enableval],
[LIBXO_WARNINGS=no])
AC_MSG_RESULT([$LIBXO_WARNINGS])
AM_CONDITIONAL([LIBXO_WARNINGS_HIGH], [test "$LIBXO_WARNINGS" != "no"])
AC_MSG_CHECKING([whether to build with debugging])
AC_ARG_ENABLE([debug],
[ --enable-debug Turn on debugging],
[LIBXO_DEBUG=yes; AC_DEFINE([LIBXO_DEBUG], [1], [Enable debugging])],
[LIBXO_DEBUG=no])
AC_MSG_RESULT([$LIBXO_DEBUG])
AM_CONDITIONAL([LIBXO_DEBUG], [test "$LIBXO_DEBUG" != "no"])
AC_MSG_CHECKING([whether to build with text-only rendering])
AC_ARG_ENABLE([text-only],
[ --enable-text-only Turn on text-only rendering],
[LIBXO_TEXT_ONLY=yes; AC_DEFINE([LIBXO_TEXT_ONLY], [1], [Enable text-only rendering])],
[LIBXO_TEXT_ONLY=no])
AC_MSG_RESULT([$LIBXO_TEXT_ONLY])
AM_CONDITIONAL([LIBXO_TEXT_ONLY], [test "$LIBXO_TEXT_ONLY" != "no"])
AC_MSG_CHECKING([whether to build with local wcwidth implementation])
AC_ARG_ENABLE([wcwidth],
[ --disable-wcwidth Disable local wcwidth implementation],
[LIBXO_WCWIDTH=$enableval],
[LIBXO_WCWIDTH=yes])
AC_MSG_RESULT([$LIBXO_WCWIDTH])
if test "${LIBXO_WCWIDTH}" != "no"; then
AC_DEFINE([LIBXO_WCWIDTH], [1], [Enable local wcwidth implementation])
fi
AC_CHECK_LIB([m], [lrint])
AM_CONDITIONAL([HAVE_LIBM], [test "$HAVE_LIBM" != "no"])
AC_MSG_CHECKING([compiler for gcc])
HAVE_GCC=no
if test "${CC}" != ""; then
HAVE_GCC=`${CC} --version 2>&1 | grep GCC`
if test "${HAVE_GCC}" != ""; then
HAVE_GCC=yes
else
HAVE_GCC=no
fi
fi
AC_MSG_RESULT([$HAVE_GCC])
AM_CONDITIONAL([HAVE_GCC], [test "$HAVE_GCC" = "yes"])
AC_MSG_CHECKING([whether to build with printflike])
AC_ARG_ENABLE([printflike],
[ --enable-printflike Enable use of GCC __printflike attribute],