AC_INIT(src/gtkhx.c) AM_CONFIG_HEADER(config.h) PACKAGE="gtkhx" VERSION="0.9.3" AM_INIT_AUTOMAKE("$PACKAGE", "$VERSION") AC_PROG_CC ALL_LINGUAS="fr" AM_GNU_GETTEXT AC_CHECK_PROGS(BUILD_CC, gcc cc) AC_ISC_POSIX AC_HEADER_STDC AC_ARG_PROGRAM AC_C_CONST AC_C_INLINE CC=$BUILD_CC AC_C_BIGENDIAN AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_CHECK_TYPE(ssize_t, int) AC_CHECK_HEADERS(sys/select.h stdarg.h) AC_CHECK_HEADERS(sys/stat.h) AC_PATH_PROG(sedpath, sed) if test "_$sedpath" = _; then AC_MSG_ERROR("Cannot find sed: I need it\!") fi AC_PATH_PROG(unamepath, uname) if test "_$unamepath" = _; then system="unknown" else AC_MSG_CHECKING(system type) system=`$unamepath -s` AC_MSG_RESULT($system) if test "$system" = "Linux"; then AC_DEFINE(USING_LINUX) fi if test "$system" = "FreeBSD"; then AC_DEFINE(USING_FREEBSD) fi fi AC_ARG_ENABLE(debug, [ --enable-debug print debug messages to stdout (default off)], debug=$enableval, debug=no) AC_ARG_ENABLE(xlib, [ --disable-xlib disable use of xlib (for non X11 systems)], xlib=$enableval, xlib=yes) AC_ARG_ENABLE(windows, [ --enable-windows enable this if you want to compile on windows], windows=$enableval, windows=no) AC_ARG_ENABLE(pixbuf, [ --disable-gdk-pixbuf disable use of gdk-pixbuf lib], pixbuf=$enableval, pixbuf=yes) AC_ARG_ENABLE(plugin, [ --disable-plugin disable plugin support], plugin=$enableval, plugin=yes) AC_ARG_ENABLE(ipv6, [ --disable-ipv6 disable ipv6 support], ipv6=$enableval, ipv6=yes) AC_ARG_ENABLE(compress, [ --disable-compress disable compression support], compress=$enableval, compress=yes) AC_ARG_ENABLE(cipher, [ --disable-cipher disable cipher support], cipher=$enableval, cipher=yes) AC_ARG_ENABLE(,,,) AC_CHECK_FUNCS(snprintf, AC_CHECK_FUNCS(vsnprintf, , LIBOBJS="$LIBOBJS snprintf.o"; ac_cv_func_snprintf=no), LIBOBJS="$LIBOBJS snprintf.o"; ac_cv_func_snprintf=no) AC_DEFINE(CONFIG_NO_IDEA) AC_REPLACE_FUNCS(localtime_r inet_aton) AC_CHECK_FUNCS(getrlimit getdtablesize) AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) AC_CHECK_FUNC(getopt_long, GETOPT=yes, GETOPT=no) AC_CHECK_LIB(pthread, pthread_create, pthread_lib=yes, pthread_lib=no) AC_CHECK_LIB(c_r, pthread_create, c_rlib=yes, c_rlib=no) AM_PATH_GLIB(1.2.0, , havenoglib=yes) #CFLAGS="$CFLAGS" CFLAGS="-g -Wall" if test "$debug" = no ; then CFLAGS="$CFLAGS -O2" fi LIBS="$LIBS $GLIB_LIBS $INTLLIBS" AM_PATH_GTK(1.2.0, , havenogtk=yes) CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" if test "$pixbuf" = yes ; then AC_PATH_PROG(gdkpixbufpath, gdk-pixbuf-config) AC_MSG_CHECKING(for gdk-pixbuf >= 0.8) GDK_PIXBUF_CFLAGS=`$gdkpixbufpath --cflags 2>/dev/null` GDK_PIXBUF_LIBS=`$gdkpixbufpath --libs 2>/dev/null` if test "_$GDK_PIXBUF_CFLAGS" = _; then AC_MSG_RESULT([not found, building without gdk-pixbuf.]) pixbuf=no else vers=`$gdkpixbufpath --version` case $vers in gdk-pixbuf-0.[[01234567]]) gdk_pixbuf_ok=false ;; *) gdk_pixbuf_ok=true ;; esac if $gdk_pixbuf_ok; then AC_MSG_RESULT(found) pixbuf=yes AC_DEFINE(USE_GDK_PIXBUF) CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" LIBS="$LIBS $GDK_PIXBUF_LIBS" else pixbuf=no AC_MSG_RESULT([version to old, building without gdk-pixbuf.]) fi fi fi if test "$cipher" = yes; then AC_CHECK_LIB(crypto, RAND_bytes, cipher=yes ; LIBS="$LIBS -lcrypto" ; AC_DEFINE(CONFIG_CIPHER), cipher=no) AC_CHECK_LIB(crypto, RAND_egd, old_openssl=no, old_openssl=yes) if test $old_openssl = yes; then AC_DEFINE(USE_OLD_OPENSSL) fi fi if test "$compress" = yes; then AC_CHECK_LIB(z, deflate, compress=yes ; LIBS="$LIBS -lz" ; AC_DEFINE(CONFIG_COMPRESS), compress=no) fi if test "$ipv6" = yes; then AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes) AC_MSG_CHECKING(whether to enable IPv6 support) if test "$have_getaddrinfo" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(USE_IPV6) else AC_MSG_RESULT(no) ipv6=no fi fi if test "$plugin" = yes; then AC_CHECK_FUNCS(dlopen, have_dl=yes) if test "$have_dl" = yes; then AC_CHECK_FUNCS(dlerror) AC_DEFINE(USE_PLUGIN) else plugin=no fi fi AM_CONDITIONAL(PLUGINS, test "$plugin" = yes) AC_CHECK_FUNC(basename, AC_DEFINE(HAVE_BASENAME), ) AC_CHECK_FUNCS(hstrerror tcgetattr tcsetattr) if test "$pthread_lib" = yes; then LIBS="$LIBS -lpthread" else if test "$c_rlib" = yes; then LIBS="$LIBS -lc_r" fi fi if test "$prefix" = NONE; then prefix="/usr/local" fi if test "$debug" = yes; then AC_DEFINE(USE_DEBUG) fi if test "$windows" = yes; then CFLAGS="$CFLAGS -fnative-struct" AC_DEFINE(WIN32) fi if test "$xlib" = yes; then AC_DEFINE(USE_XLIB) fi if test "$GETOPT" = yes; then AC_DEFINE(USE_GETOPT) fi if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") fi AC_DEFINE_UNQUOTED(PREFIX, "$prefix") if test "$system" = "Darwin"; then CFLAGS="$CFLAGS -traditional-cpp" AC_DEFINE(USING_DARWIN) fi if test "$system" = "OpenBSD"; then CFLAGS="$CFLAGS -pthread" fi AC_SUBST(CFLAGS) AC_SUBST(LIBS) AC_OUTPUT([Makefile src/Makefile intl/Makefile po/Makefile.in sounds/Makefile plugins/Makefile ]) echo echo GtkHx $VERSION echo echo "compiling for system ....:" $system echo "debug ...................:" $debug echo "plugins .................:" $plugin echo "gdk-pixbuf ..............:" $pixbuf echo "ipv6 support ............:" $ipv6 echo "compress support ........:" $compress echo "cipher support ..........:" $cipher echo echo The binary will be installed in $prefix/bin echo Data will be installed in $prefix/share/gtkhx