libqrc Code
Status: Pre-Alpha
Brought to you by:
nagadomi
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#
# $Id$
# Autoconfの必要条件
# AC_INIT(package, version, bug-report-address)
# パッケージの情報
# プログラムの調査
# ライブラリの調査
# ヘッダファイルの調査
# 型の調査
# 構造体の調査
# コンパイラの特徴の調査
# ライブラリ関数の調査
# システムサービスの調査
# AC_CONFIG_FILES([file...])
# AC_OUTPUT
## init
#AC_PREREQ(2.56)
AC_INIT(libqrc, 0.8.0, nagadomi@nurs.or.jp)
AM_INIT_AUTOMAKE
AH_TOP(
/**
* \file qrc_config.h
* \brief QRC
*
*/
/*
* $Id$
*/
)
QRC_MAJOR=0
QRC_MINOR=8
QRC_DESCRIPTION='The QR-code encode Library'
AC_CONFIG_SRCDIR([src/qrc.c])
AC_CONFIG_HEADER([src/qrc_config.h])
## Checks for programs.
AC_PROG_CXX
AC_PROG_CC
## Checks for libraries.
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
## Checks for header files.
# stdc
AH_TEMPLATE(QRC_HAVE_STDIO_H, Define to 1 if you have the <stdio.h>)
AC_CHECK_HEADER(
[stdio.h],
[AC_DEFINE(QRC_HAVE_STDIO_H)],
[AC_MSG_ERROR(*** Check for stdio.h failed.)]
)
AH_TEMPLATE(QRC_HAVE_STDDEF_H, Define to 1 if you have the <stddef.h>)
AC_CHECK_HEADER(
[stddef.h],
[AC_DEFINE(QRC_HAVE_STDDEF_H)]
)
AH_TEMPLATE(QRC_HAVE_SYS_TYPES_H, Define to 1 if you have the <sys/types.h>)
AC_CHECK_HEADER(
[sys/types.h],
[AC_DEFINE(QRC_HAVE_SYS_TYPES_H)]
)
AH_TEMPLATE(QRC_HAVE_SYS_STAT_H, Define to 1 if you have the <sys/stat.h>)
AC_CHECK_HEADER(
[sys/stat.h],
[AC_DEFINE(QRC_HAVE_SYS_STAT_H)]
)
AH_TEMPLATE(QRC_HAVE_STDLIB_H, Define to 1 if you have the <stdlib.h>)
AC_CHECK_HEADER(
[stdlib.h],
[AC_DEFINE(QRC_HAVE_STDLIB_H)]
)
AH_TEMPLATE(QRC_HAVE_STRING_H, Define to 1 if you have the <string.h>)
AC_CHECK_HEADER(
[string.h],
[AC_DEFINE(QRC_HAVE_STRING_H)]
)
AH_TEMPLATE(QRC_HAVE_STRINGS_H, Define to 1 if you have the <strings.h>)
AC_CHECK_HEADER(
[strings.h],
[AC_DEFINE(QRC_HAVE_STRINGS_H)]
)
AH_TEMPLATE(QRC_HAVE_MEMORY_H, Define to 1 if you have the <memory.h>)
AC_CHECK_HEADER(
[memory.h],
[AC_DEFINE(QRC_HAVE_MEMORY_H)]
)
AH_TEMPLATE(QRC_HAVE_INTTYPES_H, Define to 1 if you have the <inttypes.h>)
AC_CHECK_HEADER(
[inttypes.h],
[AC_DEFINE(QRC_HAVE_INTTYPES_H)]
)
AH_TEMPLATE(QRC_HAVE_STDINT_H, Define to 1 if you have the <stdint.h>)
AC_CHECK_HEADER(
[stdint.h],
[AC_DEFINE(QRC_HAVE_STDINT_H)]
)
# libpng
AH_TEMPLATE(QRC_HAVE_PNG_H, Define to 1 if you have the <png.h>)
AC_CHECK_HEADER(
[png.h],
[AC_DEFINE(QRC_HAVE_PNG_H)],
[AC_MSG_ERROR(PNG header file not found.
****************
Check for png.h failed.
Please either install libpng or libpng-devel package.
See: http://www.libpng.org/
You can build without it by passing --disable-encode-png to configure
but some functions using libpng can not use.
****************
)]
)
# libZ
AH_TEMPLATE(QRC_HAVE_ZLIB_H, Define to 1 if you have the <zlib.h>)
AC_CHECK_HEADER(
[zlib.h],
[AC_DEFINE(QRC_HAVE_ZLIB_H)],
[AC_MSG_ERROR(Zlib header file not found.
****************
Check for zlib.h failed.
Please either install libpng or libpng-devel package.
See: http://www.zlib.org/
You can build without it by passing --disable-encode-png to configure
but some functions using libpng can not use.
****************
)]
)
## Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
## Checks for library functions.
AH_TEMPLATE(QRC_HAVE_MEMSET, Define to 1 if you have the memset)
AC_CHECK_FUNC(
[memset],
[AC_DEFINE(QRC_HAVE_MEMSET)]
)
AH_TEMPLATE(QRC_HAVE_MEMMOVE, Define to 1 if you have the memmove)
AC_CHECK_FUNC(
[memmove],
[AC_DEFINE(QRC_HAVE_MEMMOVE)]
)
AH_TEMPLATE(QRC_HAVE_MEMCPY, Define to 1 if you have the memcpy)
AC_CHECK_FUNC(
[memcpy],
[AC_DEFINE(QRC_HAVE_MEMCPY)]
)
AH_TEMPLATE(QRC_HAVE_STRCHR, Define to 1 if you have the strchr)
AC_CHECK_FUNC(
[strchr],
[AC_DEFINE(QRC_HAVE_STRCHR)]
)
AH_TEMPLATE(QRC_HAVE_STRRCHR, Define to 1 if you have the strrchr)
AC_CHECK_FUNC(
[strrchr],
[AC_DEFINE(QRC_HAVE_STRRCHR)]
)
# check for libpng
AH_TEMPLATE(QRC_HAVE_LIBPNG, Define to 1 if you have the -lpng)
AC_CHECK_LIB(
png, png_create_write_struct,
[AC_DEFINE(QRC_HAVE_LIBPNG)],
[AC_MSG_ERROR(PNG library not found.
****************
Check for libpng(-lpng) failed.
Please either install libpng or libpng-devel package.
See: http://www.libpng.org/
You can build without it by passing --disable-encode-png to configure
but some functions using libpng can not use.
****************
)]
)
# check for libz
AH_TEMPLATE(QRC_HAVE_LIBZ, Define to 1 if you have the -lz)
AC_CHECK_LIB(
z, zlibVersion,
[AC_DEFINE(QRC_HAVE_LIBZ)],
[AC_MSG_ERROR(Z library not found.
****************
Check for libz(-lz) failed.
Please either install libpng or libpng-devel package.
See: http://www.zlib.org/
You can build without it by passing --disable-encode-png to configure
but some functions using libpng can not use.
****************
)]
)
## Additional arguments
# Allow the pkg-config directory to be set
AC_ARG_WITH(pkgconfigdir,
AC_HELP_STRING([--with-pkgconfigdir],
[Use the specified pkgconfig dir (default is libdir/pkgconfig)]),
[pkgconfigdir=${withval}],
[pkgconfigdir='${libdir}/pkgconfig'])
AC_MSG_NOTICE([pkgconfig directory is ${pkgconfigdir}])
## subst
AC_SUBST(QRC_MAJOR)
AC_SUBST(QRC_MINOR)
AC_SUBST(QRC_DESCRIPTION)
AC_SUBST([pkgconfigdir])
# Output
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
AC_CONFIG_FILES([src/libqrc.pc:src/libqrc.pc.in])
AC_OUTPUT