forked from bip/bip
1
0
Fork 0

[autostuff] Rewrite. Use non recursive make. Drop src/config.h.in that must be populated by autoheader

This commit is contained in:
Arnaud Cornet 2009-08-24 21:26:46 +02:00
parent 889f3cc1b7
commit 31ae5ac0bf
6 changed files with 93 additions and 118 deletions

View File

@ -1,2 +1,17 @@
SUBDIRS = src samples
bin_PROGRAMS = src/bip src/bipmkpw
src_bip_SOURCES = src/conf.y src/lex.l src/bip.c src/connection.c src/irc.c src/line.c src/log.c src/md5.c src/util.c
src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c
AM_YFLAGS= -d
BUILT_SOURCES = src/conf.c src/conf.h src/lex.c
if DEBUG
AM_CFLAGS+=-Wall -g
AM_LDFLAGS+=-g
else
AM_CFLAGS+=-Wall
endif
man_MANS = bip.1 bip.conf.5
examplesdir = $(prefix)/share/doc/bip/examples/
examples_DATA = samples/bip.conf samples/bip.vim

77
configure.ac Normal file
View File

@ -0,0 +1,77 @@
AC_PREREQ([2.64])
AC_INIT([bip], [0.8.2], [nohar@t1r.net])
AM_INIT_AUTOMAKE([subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_CONFIG_SRCDIR([src/bip.h])
AC_CONFIG_HEADERS([src/config.h])
# Checks for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AM_PROG_LEX
AC_PROG_YACC
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_CHECK_FUNCS([ftruncate gethostname gettimeofday localtime_r memmove memset mkdir select socket strcasecmp strchr strcspn strdup strerror strrchr strstr])
# Deal with parameters
AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [Enable debug build]))
AC_ARG_WITH([openssl], AS_HELP_STRING([--without-openssl], [Disable SSL using OpenSSL]))
AC_ARG_ENABLE([oidentd], AS_HELP_STRING([--enable-oidentd], [Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)]))
AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
AS_IF([test "x$enable_debug" = "xyes"], [
CFLAGS="-O0 -g -W -Wall"
LDFLAGS="-g"
AC_CHECK_FUNC(backtrace_symbols_fd, [
AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()])
LDFLAGS="-rdynamic $LDFLAGS"
backtrace="(with backtrace)"
])
], [
CFLAGS="-O2 -g -W -Wall"
LDFLAGS="-g"
])
AS_IF([test "x$enable_debug" = "xyes"], [
AC_DEFINE([HAVE_OIDENTD], [], [Have bip edit ~/.oidentd.conf])
])
AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes)
AS_IF([test "x$with_openssl" != "xno"], [
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [
AC_MSG_ERROR([library 'crypto' is required for OpenSSL support])
], -lcrypto)
AC_CHECK_LIB(ssl, SSL_read, [with_openssl=yes], [
AC_MSG_ERROR([library 'ssl' is required for OpenSSL support])
])
])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo OPENSSL: $with_openssl
echo DEBUG: $enable_debug $backtrace
echo OIDENTD: $enable_oidentd

View File

@ -1,63 +0,0 @@
AC_INIT(src/bip.c)
AM_CONFIG_HEADER(src/config.h)
AM_INIT_AUTOMAKE(bip,0.8.0)
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LEX
AC_PROG_YACC
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on debugging],
[ enable_debug=$enableval ],
[ enable_debug=no ])
AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
case $enable_debug in
yes)
CFLAGS="-O0 -g -W -Wall"
;;
no)
CFLAGS="-O2 -W -Wall"
;;
*)
AC_MSG_ERROR(bad value ${enable_debug} for --enable-debug)
esac
backtrace=
if test x$enable_debug = xyes ; then
AC_CHECK_FUNC(backtrace_symbols_fd, [
AC_DEFINE(HAVE_BACKTRACE, [], [Use Glibcs backtrace function on fatal()])
LDFLAGS="-rdynamic $LDFLAGS"
backtrace="(with backtrace)"
])
fi
AC_ARG_ENABLE(oidentd,
[ --enable-oidentd Enable oidentd support (bip overwrites ~/.oidentd.conf with this on!)],
enable_oidentd=yes
AC_DEFINE([HAVE_OIDENTD], [], [Enable oidentd.conf management support]),
[enable_oidentd=no]
)
AM_CONDITIONAL(OIDENTD, test x$enable_identd = xyes)
AC_ARG_ENABLE(openssl,
[ --disable-openssl Drop OpenSSL support],
[ enable_openssl=$enableval ],
[ enable_openssl=yes ])
if test "x$enable_openssl" = "xyes" ; then
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [
AC_MSG_ERROR([library 'crypto' is required for OpenSSL support])
], -lcrypto)
AC_CHECK_LIB(ssl, SSL_read, [], [
AC_MSG_ERROR([library 'ssl' is required for OpenSSL support])
])
fi
AC_OUTPUT(Makefile src/Makefile samples/Makefile)
echo OPENSSL: $enable_openssl
echo DEBUG: $enable_debug $backtrace
echo OIDENTD: $enable_oidentd

View File

@ -1,2 +0,0 @@
examplesdir = $(prefix)/share/doc/bip/examples/
examples_DATA = bip.conf bip.vim

View File

@ -1,11 +0,0 @@
bin_PROGRAMS = bip bipmkpw
bip_SOURCES = conf.y lex.l bip.c connection.c irc.c line.c log.c md5.c util.c
bipmkpw_SOURCES = bipmkpw.c md5.c util.c
AM_YFLAGS= -d
BUILT_SOURCES = conf.h
if DEBUG
AM_CFLAGS+=-Wall -g
AM_LDFLAGS+=-g
else
AM_CFLAGS+=-Wall
endif

View File

@ -1,41 +0,0 @@
/* src/config.h.in. Generated from configure.in by autoheader. */
/* Use Glibcs backtrace function on fatal() */
#undef HAVE_BACKTRACE
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_LIBCRYPTO
/* Define to 1 if you have the `ssl' library (-lssl). */
#undef HAVE_LIBSSL
/* Enable oidentd.conf management support */
#undef HAVE_OIDENTD
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER