Fri, 24 Aug 2001 01:36:05 +0000
[gaim-migrate @ 2172]
couple fixes. Max Horn told me about one of them.
| 2129 | 1 | dnl Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT(src/aim.c) | |
| 3 | AM_CONFIG_HEADER(config.h) | |
| 4 | AM_INIT_AUTOMAKE([gaim], [0.11.0]) | |
| 5 | ||
| 6 | AC_PATH_PROG(sedpath, sed) | |
| 7 | ||
| 8 | dnl Checks for programs. | |
| 9 | AC_PROG_CC | |
| 10 | AC_DISABLE_STATIC | |
| 11 | AM_PROG_LIBTOOL | |
| 12 | LIBTOOL="$LIBTOOL --silent" | |
| 13 | AC_PROG_INSTALL | |
| 14 | ||
| 15 | ||
| 16 | ALL_LINGUAS="de es fr ko ru zh_CN" | |
| 17 | AM_GNU_GETTEXT | |
| 18 | ||
| 19 | AC_CYGWIN | |
| 20 | ||
| 21 | ||
| 22 | dnl Checks for header files. | |
| 23 | AC_HEADER_STDC | |
| 24 | AC_HEADER_SYS_WAIT | |
| 25 | AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h locale.h signal.h) | |
| 26 | ||
| 27 | dnl Checks for typedefs, structures, and compiler characteristics. | |
| 28 | AC_C_CONST | |
| 29 | AC_STRUCT_TM | |
| 30 | ||
| 31 | dnl Checks for library functions. | |
| 32 | AC_TYPE_SIGNAL | |
| 33 | AC_FUNC_STRFTIME | |
| 34 | AC_CHECK_FUNCS(socket strdup strstr atexit getaddrinfo) | |
|
2162
2a9f076b0af9
[gaim-migrate @ 2172]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2129
diff
changeset
|
35 | AC_TRY_COMPILE([#include <sys/types.h> |
|
2a9f076b0af9
[gaim-migrate @ 2172]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2129
diff
changeset
|
36 | #include <sys/socket.h>], typedef unsigned int socklen_t;, AC_DEFINE(NEED_SOCKLEN_T),) |
| 2129 | 37 | |
| 38 | dnl Checks for getopt in standard library | |
| 39 | AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"] ) | |
| 40 | AC_SUBST(LIBOBJS) | |
| 41 | ||
| 42 | dnl This is a bad, bad hack. I am a bad, bad man. | |
| 43 | CFLAGS="$CFLAGS -I/usr/local/include -I/opt/include -I\$(top_srcdir)" | |
| 44 | ||
| 45 | AC_ARG_ENABLE(distrib,,,enable_distrib=no) | |
| 46 | AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes") | |
| 47 | AC_ARG_ENABLE(multi, [ --disable-multi disable multiple connections],,enable_multi=yes) | |
| 48 | AC_ARG_ENABLE(prpls, [ --disable-prpls don't build dynamic protocol plugins],,enable_prpls=yes) | |
| 49 | AC_ARG_WITH(static-prpls, [ --with-static-prpls link in certain protocols statically],[STATIC_PRPLS=`echo $withval | $sedpath 's/,/ /g'`],STATIC_PRPLS="oscar toc") | |
| 50 | if test "x$STATIC_PRPLS" = "xall" ; then | |
| 51 | STATIC_PRPLS="icq irc jabber msn napster oscar toc yahoo zephyr" | |
| 52 | fi | |
| 53 | AC_SUBST(STATIC_PRPLS) | |
| 54 | STATIC_LINK_LIBS= | |
| 55 | extern_init= | |
| 56 | load_proto= | |
| 57 | for i in $STATIC_PRPLS ; do | |
| 58 | STATIC_LINK_LIBS="$STATIC_LINK_LIBS protocols/$i/lib$i.a" | |
| 59 | extern_init="$extern_init extern void ${i}_init(struct prpl *);" | |
| 60 | load_proto="$load_proto load_protocol(${i}_init, sizeof(struct prpl));" | |
| 61 | case $i in | |
| 62 | icq) AM_CONDITIONAL(STATIC_ICQ, true) ;; | |
| 63 | irc) AM_CONDITIONAL(STATIC_IRC, true) ;; | |
| 64 | jabber) AM_CONDITIONAL(STATIC_JABBER, true) ;; | |
| 65 | msn) AM_CONDITIONAL(STATIC_MSN, true) ;; | |
| 66 | napster) AM_CONDITIONAL(STATIC_NAPSTER, true) ;; | |
| 67 | oscar) AM_CONDITIONAL(STATIC_OSCAR, true) ;; | |
| 68 | toc) AM_CONDITIONAL(STATIC_TOC, true) ;; | |
| 69 | yahoo) AM_CONDITIONAL(STATIC_YAHOO, true) ;; | |
| 70 | zephyr) AM_CONDITIONAL(STATIC_ZEPHYR, true) ;; | |
| 71 | *) echo "Invalid static protocol $i!!" ; exit ;; | |
| 72 | esac | |
| 73 | done | |
| 74 | AC_SUBST(STATIC_LINK_LIBS) | |
| 75 | AC_DEFINE_UNQUOTED(STATIC_PROTO_INIT, $extern_init void static_proto_init() { $load_proto }) | |
| 76 | ||
| 77 | AC_ARG_ENABLE(gnome, [ --disable-gnome compile without Gnome bits],,enable_gnome=yes) | |
| 78 | AC_ARG_ENABLE(pixbuf, [ --disable-pixbuf compile without GdkPixbuf (needed for Buddy Icons)],,enable_pixbuf=yes) | |
| 79 | AC_ARG_ENABLE(panel, [ --enable-panel compile as a GNOME applet],,enable_panel=$enable_distrib) | |
| 80 | ||
| 81 | AM_CONDITIONAL(GNOMEAPPLET, test "x$enable_panel" = "xyes") | |
| 82 | AC_ARG_ENABLE(esd, [ --disable-esd Turn off ESD (default=auto)],,enable_esd=yes) | |
| 83 | AC_ARG_ENABLE(nas, [ --enable-nas Enable NAS (Network Audio System) support],,enable_nas=no) | |
| 84 | ||
| 85 | AC_ARG_ENABLE(plugins, [ --disable-plugins compile without plugin support],,enable_plugins=yes) | |
| 86 | AC_ARG_ENABLE(perl, [ --disable-perl compile without perl scripting],,enable_perl=yes) | |
| 87 | ||
| 88 | AC_ARG_ENABLE(debug, [ --enable-debug compile with debugging support],,enable_debug=no) | |
| 89 | AC_ARG_ENABLE(screensaver, [ --disable-screensaver compile without X screensaver extension],,enable_xss=yes) | |
| 90 | AC_ARG_WITH(krb4, [ --with-krb4=PREFIX Compile Zephyr plugin with Kerberos 4 support],kerberos="$withval",kerberos="no") | |
| 91 | ||
| 92 | if test "$enable_debug" = yes ; then | |
| 93 | CFLAGS="$CFLAGS -Wall -g" | |
| 94 | AC_DEFINE(DEBUG) | |
| 95 | fi | |
| 96 | ||
| 97 | if test "x$enable_gnome" = "xyes" ; then | |
| 98 | if test "x$enable_panel" = "xyes" ; then | |
| 99 | GNOME_INIT(applets) | |
| 100 | GNOME_X_CHECKS | |
| 101 | CFLAGS="$CFLAGS $GNOME_INCLUDEDIR" | |
| 102 | AC_DEFINE(USE_APPLET) | |
| 103 | AC_DEFINE(USE_GNOME) | |
| 104 | LIBS="$LIBS $GTK_LIBS $GNOME_LIBDIR $GNOME_APPLETS_LIBS $GNOMEUI_LIBS" | |
| 105 | AC_PATH_PROG(gaimpath, gaim_applet) | |
| 106 | else | |
| 107 | AC_PATH_PROG(gnomepath, gnome-config) | |
| 108 | AC_MSG_CHECKING(for Gnome compile flags) | |
| 109 | GNOME_CFLAGS=`$gnomepath gnomeui --cflags 2>/dev/null` | |
| 110 | if test "x$GNOME_CFLAGS" = "x" ; then | |
| 111 | enable_gnome=no | |
| 112 | AC_MSG_RESULT([Gnome not found, building without it.]) | |
| 113 | else | |
| 114 | GNOME_VER=`$gnomepath --version |$sedpath 's/gnome-libs //' 2>/dev/null` | |
| 115 | GNOME_MAJOR=`echo $GNOME_VER |$sedpath 's/\([[0-9]*]*\).\([[0-9]*]*\).\([[0-9]*]*\)/\1/' 2>/dev/null` | |
| 116 | if test "x$GNOME_MAJOR" = "x0" ; then | |
| 117 | enable_gnome = no | |
| 118 | AC_MSG_RESULT([old Gnome found, building without it.]) | |
| 119 | else | |
| 120 | AC_MSG_RESULT(ok) | |
| 121 | CFLAGS="$CFLAGS $GNOME_CFLAGS" | |
| 122 | LIBS="$LIBS `$gnomepath gnomeui --libs 2>/dev/null`" | |
| 123 | AC_DEFINE(USE_GNOME) | |
| 124 | GNOME_CONFIG="$gnomepath" | |
| 125 | AC_SUBST(GNOME_CONFIG) | |
| 126 | AC_PATH_PROG(gaimpath, gaim) | |
| 127 | fi | |
| 128 | fi | |
| 129 | fi | |
| 130 | fi | |
| 131 | ||
| 132 | if test "x$enable_gnome" != "xyes" ; then | |
| 133 | AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR([ | |
| 134 | *** GLib is required to build Gaim; please make sure you have the GLib | |
| 135 | *** development headers installed. The latest version of GLib is | |
| 136 | *** always available at http://www.gtk.org/.])) | |
| 137 | AM_PATH_GTK(1.2.0,,AC_MSG_ERROR([ | |
| 138 | *** GTK+ is required to build Gaim; please make sure you have the GTK+ | |
| 139 | *** development headers installed. The latest version of GTK+ is | |
| 140 | *** always available at http://www.gtk.org/.]),gthread) | |
| 141 | LIBS="$LIBS $GTK_LIBS" | |
| 142 | AC_PATH_PROG(gaimpath, gaim) | |
| 143 | fi | |
| 144 | CFLAGS="$CFLAGS $GTK_CFLAGS" | |
| 145 | ||
| 146 | use_pixbuf=no | |
| 147 | if test "x$enable_pixbuf" = "xyes" ; then | |
| 148 | AC_PATH_PROG(pixbufcfg, gdk-pixbuf-config) | |
| 149 | if test "x$pixbufcfg" != "x" ; then | |
| 150 | GDK_PIXBUF_CFLAGS=`$pixbufcfg --cflags` | |
| 151 | GDK_PIXBUF_LIBS=`$pixbufcfg --libs` | |
| 152 | GDK_PIXBUF_CONFIG="$pixbufcfg" | |
| 153 | AC_SUBST(GDK_PIXBUF_CONFIG) | |
| 154 | AC_SUBST(GDK_PIXBUF_CFLAGS) | |
| 155 | AC_SUBST(GDK_PIXBUF_LIBS) | |
| 156 | CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" | |
| 157 | LIBS="$LIBS $GDK_PIXBUF_LIBS" | |
| 158 | dnl We should be doing checks to see that the header files and functions exist. eh. | |
| 159 | AC_DEFINE(USE_PIXBUF) | |
| 160 | use_pixbuf=yes | |
| 161 | fi | |
| 162 | fi | |
| 163 | ||
| 164 | dnl Check for XScreenSaver | |
| 165 | if test "x$enable_xss" = "xyes" ; then | |
| 166 | XSS_LIBS="no" | |
| 167 | XSS_HEADERS="no" | |
| 168 | AC_CHECK_LIB(Xext, XScreenSaverRegister,[XSS_LIBS=""],[],[-lX11 -lXext -lm]) | |
| 169 | AC_CHECK_LIB(Xss, XScreenSaverRegister,[XSS_LIBS="-lXss"],[],[-lX11 -lXext -lm]) | |
| 170 | if test \! "$XSS_LIBS" = "no"; then | |
| 171 | AC_TRY_COMPILE([ | |
| 172 | #include <X11/extensions/scrnsaver.h> | |
| 173 | ],[],[enable_xss=no],[ | |
| 174 | AC_DEFINE(USE_SCREENSAVER) | |
| 175 | ]) | |
| 176 | else | |
| 177 | XSS_LIBS="" | |
| 178 | enable_xss=no | |
| 179 | fi | |
| 180 | else | |
| 181 | XSS_LIBS="" | |
| 182 | enable_xss=no | |
| 183 | fi | |
| 184 | AC_SUBST(XSS_LIBS) | |
| 185 | ||
| 186 | ||
| 187 | ||
| 188 | dnl This was taken straight from X-Chat. | |
| 189 | dnl X-Chat is the greatest application ever, not only | |
| 190 | dnl because it's a rocking IRC client but also because | |
| 191 | dnl it's very easy to learn from. | |
| 192 | if test "$enable_perl" = yes ; then | |
| 193 | AC_PATH_PROG(perlpath, perl) | |
| 194 | AC_MSG_CHECKING(for Perl compile flags) | |
| 195 | PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null` | |
| 196 | if test "_$PERL_CFLAGS" = _ ; then | |
| 197 | AC_MSG_RESULT([not found, building without perl.]) | |
| 198 | enable_perl = no | |
| 199 | else | |
| 200 | PERL_LIBS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null |$sedpath 's/-lgdbm //'` | |
| 201 | PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-ldb //'` | |
| 202 | PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lndbm //'` | |
| 203 | if test "$system" = "Linux"; then | |
| 204 | PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lnsl //'` | |
| 205 | PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lposix //'` | |
| 206 | fi | |
| 207 | PERL_LIBS=`echo $PERL_LIBS |$sedpath 's/-lc //'` | |
| 208 | AC_MSG_RESULT(ok) | |
| 209 | AC_SUBST(PERL_CFLAGS) | |
| 210 | AC_SUBST(PERL_LIBS) | |
| 211 | AC_DEFINE(USE_PERL) | |
| 212 | AC_CHECK_FUNCS(Perl_eval_pv) | |
| 213 | fi | |
| 214 | fi | |
| 215 | ||
| 216 | if test "$enable_nas" = yes ; then | |
| 217 | AC_DEFINE(NAS_SOUND) | |
| 218 | LIBS="$LIBS -laudio -lXt" | |
| 219 | fi | |
| 220 | ||
| 221 | if test "$enable_esd" = yes ; then | |
| 222 | AM_PATH_GESD | |
| 223 | if test "$no_esd" != yes ; then | |
| 224 | CFLAGS="$CFLAGS $ESD_CFLAGS" | |
| 225 | AC_DEFINE(ESD_SOUND) | |
| 226 | LDADD="$LDADD $ESD_LIBS" | |
| 227 | else | |
| 228 | enable_esd=no | |
| 229 | fi | |
| 230 | fi | |
| 231 | ||
| 232 | if test "$ac_cv_cygwin" = yes ; then | |
| 233 | LDADD="$LDADD -static" | |
| 234 | CFLAGS="$CFLAGS -Wall -g" | |
| 235 | AC_DEFINE(DEBUG) | |
| 236 | fi | |
| 237 | ||
| 238 | AC_SUBST(CFLAGS) | |
| 239 | AC_SUBST(LDADD) | |
| 240 | AC_SUBST(LIBS) | |
| 241 | ||
| 242 | if test "x$enable_multi" != "xyes" ; then | |
| 243 | AC_DEFINE(NO_MULTI) | |
| 244 | enable_multi=no | |
| 245 | fi | |
| 246 | ||
| 247 | if test "x$enable_plugins" = "xyes" ; then | |
| 248 | AC_DEFINE(GAIM_PLUGINS) | |
| 249 | AM_CONDITIONAL(PLUGINS, test "x$enable_plugins" = "xyes") | |
| 250 | else | |
| 251 | enable_plugins=no | |
| 252 | enable_prpls=no | |
| 253 | fi | |
| 254 | ||
| 255 | if test "x$enable_prpls" = "xyes" ; then | |
| 256 | AM_CONDITIONAL(PRPLS, test "x$enable_plugins" = "xyes") | |
| 257 | else | |
| 258 | enable_prpls=no | |
| 259 | fi | |
| 260 | ||
| 261 | dnl checks for icqlib | |
| 262 | AC_CHECK_HEADERS(asm/byteorder.h byteswap.h endian.h machine/endian.h arpa/nameser_compat.h) | |
| 263 | AC_CHECK_FUNCS(bswap_32 bswap_16) | |
| 264 | AC_C_BIGENDIAN | |
| 265 | ||
| 266 | dnl checks for jabber | |
| 267 | dnl AC_CHECK_SIZEOF(short) | |
| 268 | AC_CHECK_FUNCS(snprintf connect) | |
| 269 | AC_CHECK_LIB(nsl, gethostent) | |
| 270 | ||
| 271 | dnl checks for zephyr | |
| 272 | AC_DEFINE(ZEPHYR_INT32, long) | |
| 273 | AC_SUBST(KRB4_CFLAGS) | |
| 274 | AC_SUBST(KRB4_LDFLAGS) | |
| 275 | AC_SUBST(KRB4_LIBS) | |
| 276 | if test "$kerberos" != "no" ; then | |
| 277 | if test "$kerberos" != "yes" ; then | |
| 278 | KRB4_CFLAGS="-I${kerberos}/include" | |
| 279 | if test -d "$kerberos/include/kerberosIV" ; then | |
| 280 | KRB4_CFLAGS="$KRB4_CFLAGS -I${kerberos}/include/kerberosIV" | |
| 281 | fi | |
| 282 | KRB4_LDFLAGS="-L${kerberos}/lib" | |
| 283 | elif test -d /usr/local/include/kerberosIV ; then | |
| 284 | KRB4_CFLAGS="-I/usr/local/include/kerberosIV" | |
| 285 | elif test -d /usr/include/kerberosIV ; then | |
| 286 | KRB4_CFLAGS="-I/usr/include/kerberosIV" | |
| 287 | fi | |
| 288 | AC_DEFINE(ZEPHYR_USES_KERBEROS) | |
| 289 | ||
| 290 | orig_LDFLAGS="$LDFLAGS" | |
| 291 | LDFLAGS="$LDFLAGS $KRB4_LDFLAGS" | |
| 292 | AC_CHECK_LIB(krb4, krb_rd_req, | |
| 293 | [KRB4_LIBS="-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err"], | |
| 294 | [AC_CHECK_LIB(krb, krb_rd_req, | |
| 295 | [KRB4_LIBS="-lkrb -ldes"], | |
| 296 | [AC_ERROR(Kerberos 4 libraries not found)], | |
| 297 | -ldes)], | |
| 298 | -ldes425 -lkrb5 -lk5crypto -lcom_err) | |
| 299 | orig_LIBS="$LIBS" | |
| 300 | LIBS="$LIBS $KRB4_LIBS" | |
| 301 | AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm) | |
| 302 | AC_CHECK_FUNCS(krb_get_err_text krb_log) | |
| 303 | LIBS="$orig_LIBS" | |
| 304 | LDFLAGS="$orig_LDFLAGS" | |
| 305 | fi | |
| 306 | AC_CHECK_FUNCS(gethostid lrand48) | |
| 307 | AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf) | |
| 308 | AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h) | |
| 309 | AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h) | |
| 310 | AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h) | |
| 311 | AC_CHECK_HEADERS(termios.h) | |
| 312 | ||
| 313 | AC_OUTPUT([Makefile | |
| 314 | doc/Makefile | |
| 315 | intl/Makefile | |
| 316 | m4/Makefile | |
| 317 | pixmaps/Makefile | |
| 318 | plugins/Makefile | |
| 319 | po/Makefile.in | |
| 320 | sounds/Makefile | |
| 321 | src/Makefile | |
| 322 | src/protocols/Makefile | |
| 323 | src/protocols/icq/Makefile | |
| 324 | src/protocols/irc/Makefile | |
| 325 | src/protocols/jabber/Makefile | |
| 326 | src/protocols/msn/Makefile | |
| 327 | src/protocols/napster/Makefile | |
| 328 | src/protocols/oscar/Makefile | |
| 329 | src/protocols/toc/Makefile | |
| 330 | src/protocols/yahoo/Makefile | |
| 331 | src/protocols/zephyr/Makefile | |
| 332 | gaim.spec | |
| 333 | ]) | |
| 334 | ||
| 335 | echo | |
| 336 | echo $PACKAGE $VERSION | |
| 337 | ||
| 338 | echo | |
| 339 | echo Allow Multiple Connections.. : $enable_multi | |
| 340 | echo Build Protocol Plugins...... : $enable_prpls | |
| 341 | echo Protocols to link statically : $STATIC_PRPLS | |
| 342 | echo | |
| 343 | echo Build with GNOME bits....... : $enable_gnome | |
| 344 | echo Use GdkPixbuf for Icons..... : $use_pixbuf | |
| 345 | echo Build as GNOME applet....... : $enable_panel | |
| 346 | echo | |
| 347 | echo Build with Plugin support... : $enable_plugins | |
| 348 | echo Build with Perl support..... : $enable_perl | |
| 349 | echo | |
| 350 | echo Use XScreenSaver Extension.. : $enable_xss | |
| 351 | echo | |
| 352 | echo Build with ESD.............. : $enable_esd | |
| 353 | echo Build with NAS.............. : $enable_nas | |
| 354 | echo | |
| 355 | echo Print debugging messages.... : $enable_debug | |
| 356 | echo | |
| 357 | echo Gaim will be installed in $prefix/bin. | |
| 358 | if test "x$gaimpath" != "x" ; then | |
| 359 | echo Warning: You have an old copy of gaim at $gaimpath. | |
| 360 | fi | |
| 361 | echo | |
| 362 | echo configure complete, now type \'make\' | |
| 363 | echo |