分类: C/C++
2007-03-22 21:45:36
AC_INIT()
AM_INIT_AUTOMAKE(dsrc, 0.1)
AM_CONFIG_HEADER(config.h)
# Checks for programs.
AC_PROG_CC
AC_PROG_INTLTOOL
# Checks for libraries.
# PKG_CHECK_MODULES可直接在Makefile.am中引用$(xxx_CFLAGS)和$(xxx_LIBS)
PKG_CHECK_MODULES(xml2, [xml2])
PKG_CHECK_MODULES(openssl, [openssl])
AC_CHECK_LIB([pthread], [main])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h libintl.h locale.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([inet_ntoa memset setlocale socket strcasecmp strncasecmp])
# gettext
GETTEXT_PACKAGE=dsrc
AC_SUBST(GETTEXT_PACKAGE)
ALL_LINGUAS="zh_CN"
AM_GLIB_GNU_GETTEXT
AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
])
SUBDIRS = src po
dsrcdocdir = ${prefix}/doc/dsrc
dsrcdoc_DATA = \
README\
COPYING\
AUTHORS\
ChangeLog\
INSTALL\
NEWS
EXTRA_DIST = $(dsrcdoc_DATA)
INCLUDES = -DLOCALEDIR=\""$(prefix)/share/locale"\"
AM_CFLAGS = -DDEBUG -g $(xml2_CFLAGS)
LIBS = $(xml2_LIBS) $(openssl_LIBS) -lpthread
# AM_LDFLAGS =
bin_PROGRAMS = dsrc
dsrc_SOURCES = main.c security.c XML_utils.c DSRC_handler.c DSRC_builder.c
# dsrc_CFLAGS =
# dsrc_LDFLAGS =
#include
#include
#define _(string) gettext(string)
#define N_(string) string
void
i18n_init(void)
{
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
}