view configure.ac @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
line source
1 ###############################################################################
2 ##
3 ## $Id: configure.ac,v 1.38 2006/08/06 17:26:39 hexwab Exp $
4 ##
5 ## Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
6 ##
7 ## This program is free software; you can redistribute it and/or modify it
8 ## under the terms of the GNU General Public License as published by the
9 ## Free Software Foundation; either version 2, or (at your option) any
10 ## later version.
11 ##
12 ## This program is distributed in the hope that it will be useful, but
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ## General Public License for more details.
16 ##
17 ###############################################################################
19 dnl ###########################################################################
20 dnl Initialize autoconf...
21 dnl ###########################################################################
23 AC_PREREQ(2.53)
25 AC_INIT(gift-gnutella, 0.0.11)
26 AC_CONFIG_SRCDIR([src/gt_gnutella.h])
28 AC_DEFINE(GT_MAJOR_VERSION, ["0"], [Major])
29 AC_DEFINE(GT_MINOR_VERSION, ["0"], [Minor])
30 AC_DEFINE(GT_MICRO_VERSION, ["11"], [Micro])
32 if test -e "$srcdir/CVS"; then
33 AC_DEFINE(GT_EXTRA_VERSION, ["-cvs"], [Extra])
34 else
35 AC_DEFINE(GT_EXTRA_VERSION, [""], [Extra])
36 fi
38 dnl ###########################################################################
39 dnl Initialize automake...
40 dnl ###########################################################################
42 AM_INIT_AUTOMAKE([dist-bzip2])
43 AM_CONFIG_HEADER(config.h)
45 AM_MAINTAINER_MODE
47 dnl ###########################################################################
48 dnl Initialize autoheader...
49 dnl ###########################################################################
51 AH_VERBATIM([USE_ZLIB], [#undef USE_ZLIB])
52 AH_VERBATIM([USE_LIBXML2], [#undef USE_LIBXML2])
54 dnl ###########################################################################
55 dnl Check for the necessary build tools and configure libtool
56 dnl ###########################################################################
58 AC_PROG_CC
59 AM_PROG_CC_STDC
60 AC_HEADER_STDC
61 AC_PROG_INSTALL
63 AM_DISABLE_STATIC
64 AC_PROG_LIBTOOL
66 PLUGIN_LDFLAGS="-module -avoid-version"
67 AC_SUBST(PLUGIN_LDFLAGS)
69 # work around a bug where need_version is set to no by the above
70 # -avoid-version call when this is not supported on OpenBSD (or am I
71 # completely wrong about this?)
72 OPENBSD_LIBTOOL_WORKAROUND
74 dnl ###########################################################################
75 dnl Test for libgift and libgiftproto...
76 dnl ###########################################################################
78 GIFT_PLUGIN_PKGCONFIG(GNUTELLA, 0.11.4, 0.12.0)
79 AC_SUBST(GNUTELLA_CFLAGS)
80 AC_SUBST(GNUTELLA_LIBS)
82 # Get rid of -g[0-9] -Wall -O[0-9] and add them unconditionally if
83 # compiling in maintainer mode
84 if test x"$USE_MAINTAINER_MODE" = xyes; then
85 CFLAGS=`echo "$CFLAGS" | sed 's/-Wall\>//; s/-O[[0-9]]//; s/-g\([[0-9]]\)*//'`
86 CFLAGS="$CFLAGS -Wall -g3 -O0"
87 fi
89 dnl ###########################################################################
90 dnl Check for platform functions
91 dnl ###########################################################################
93 AC_CHECK_FUNCS(getpid getppid)
95 dnl ###########################################################################
96 dnl Check for gethostbyname/h_errno/hstrerror
97 dnl ###########################################################################
99 dnl This is not really the best that can be done but it's enough atm
100 AC_CHECK_FUNCS(hstrerror)
102 dnl ###########################################################################
103 dnl Test for zlib...
104 dnl ###########################################################################
106 dnl Default to compiler & linker defaults for files & libraries.
107 OPT_ZLIB=
108 AC_ARG_WITH(zlib,dnl
109 [ --with-zlib[=DIR] where to look for ZLIB [compiler/linker default paths]
110 DIR points to the ZLIB installation prefix [/usr/local]],
111 OPT_ZLIB=$withval,
112 )
114 if test x"$OPT_ZLIB" = xno; then
115 AC_MSG_ERROR([zlib support is required])
116 fi
118 GIFT_PLUGIN_CHECK_ZLIB
120 dnl ###########################################################################
121 dnl Test for libxml...
122 dnl ###########################################################################
124 OPT_LIBXML=no
125 AC_ARG_WITH(libxml,dnl
126 [ --with-libxml[=DIR] where to look for libxml [compiler/linker default paths]
127 DIR points to the libxml installation prefix [/usr/local]],
128 OPT_LIBXML=$withval,
129 )
131 AC_MSG_CHECKING([whether libxml should be used])
132 use_libxml=no
134 if test x"$OPT_LIBXML" != xno; then
135 AC_MSG_RESULT([yes])
136 GIFT_GNUTELLA_CHECK_LIBXML
137 use_libxml=yes
138 else
139 AC_MSG_RESULT([no])
140 fi
142 dnl ###########################################################################
143 dnl Finish generation of the build environment
144 dnl ###########################################################################
146 AC_CONFIG_FILES([
147 Makefile
148 m4/Makefile
149 src/Makefile
150 src/encoding/Makefile
151 src/io/Makefile
152 src/message/Makefile
153 src/transfer/Makefile
154 data/Makefile
155 gnutella.spec
156 ])
158 AC_OUTPUT
160 dnl ###########################################################################
161 dnl Print summary to the user...
162 dnl ###########################################################################
164 echo
165 echo "$PACKAGE_NAME $VERSION"
166 echo
167 echo "-------------------- core ---"
168 echo
169 echo "libgift.................: $libgift_version"
170 echo "libgiftproto............: $libgift_version"
171 echo
172 echo "-------------- extensions ---"
173 echo
174 echo "use zlib................: yes (required)"
175 echo "use libxml..............: $use_libxml"
176 echo
177 echo "-----------------------------"
178 echo
180 dnl ###########################################################################
181 dnl Sanity check the prefix where we're installing
182 dnl ###########################################################################
184 GIFT_PLUGIN_CHECK_PREFIX
186 dnl ###########################################################################
187 dnl Warn about needing GNU make
188 dnl ###########################################################################
190 echo
191 echo "Type 'make' ('gmake' on some systems) to compile gift-gnutella."
192 echo