comparison configure.ac @ 14477:ca36763497d9

[gaim-migrate @ 17195] Build libgnt with ncurses if ncursesw is not found. I uninstalled ncursesw and it's still working for me .. of course, with no wide-character support. Improve the mouse support a bit. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 09 Sep 2006 02:19:16 +0000
parents 885168774b68
children f309a5b3f184
comparison
equal deleted inserted replaced
14476:218a36c1c9e2 14477:ca36763497d9
351 GNT_CFLAGS="" 351 GNT_CFLAGS=""
352 if test "x$enable_consoleui" = "xyes"; then 352 if test "x$enable_consoleui" = "xyes"; then
353 AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_consoleui=no]) 353 AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_consoleui=no])
354 AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"], [enable_consoleui=no]) 354 AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"], [enable_consoleui=no])
355 355
356 LIBS_save="$LIBS" 356 if test "x$enable_consoleui" = "xyes"; then
357 LIBS="$LIBS $GNT_LIBS" 357 dnl # Some distros put the headers in ncursesw/, some don't
358 358 found_ncurses_h=no
359 dnl # Some distros put the headers in ncursesw/, some don't 359 for f in /usr/include/ncursesw/ncurses.h /usr/include/ncurses.h
360 found_ncurses_h=no 360 do
361 for f in /usr/include/ncursesw/ncurses.h /usr/include/ncurses.h 361 AC_CHECK_HEADER($f,[
362 do 362 AC_MSG_CHECKING([if $f supports wide characters])
363 AC_CHECK_HEADER($f,[ 363 AC_TRY_COMPILE([
364 AC_MSG_CHECKING([if $f supports wide characters]) 364 #define _XOPEN_SOURCE_EXTENDED
365 AC_TRY_COMPILE([ 365 #include <$f>
366 #define _XOPEN_SOURCE_EXTENDED 366 ], [
367 #include <$f> 367 #ifndef get_wch
368 ], [ 368 # error get_wch not found!
369 #ifndef get_wch 369 #endif
370 # error get_wch not found! 370 ], [
371 #endif 371 dir=`dirname $f`
372 ], [ 372 if test x"$dir" != x"." ; then
373 dir=`dirname $f` 373 GNT_CFLAGS="-I$dir/"
374 if test x"$dir" != x"." ; then 374 else
375 GNT_CFLAGS="-I$dir/" 375 GNT_CFLAGS=""
376 else 376 fi
377 GNT_CFLAGS="" 377
378 fi 378 found_ncurses_h=yes
379 379 AC_MSG_RESULT([yes])
380 found_ncurses_h=yes 380 break
381 AC_MSG_RESULT([yes]) 381 ], [
382 break 382 AC_MSG_RESULT([no])
383 ], [ 383 ])
384 AC_MSG_RESULT([no])
385 ]) 384 ])
386 ]) 385 done
387 done 386
388 387 if test x"$found_ncurses_h" = x"no" ; then
389 LIBS="$LIBS_save" 388 GNT_LIBS=""
390 389 GNT_CFLAGS=""
391 if test x"$found_ncurses_h" = x"no" ; then 390 enable_consoleui=no
392 GNT_LIBS="" 391 AC_MSG_RESULT([no])
393 GNT_CFLAGS="" 392 else
394 enable_consoleui=no 393 AC_MSG_RESULT([yes])
395 AC_MSG_RESULT([no]) 394 fi
396 else 395 else
397 AC_MSG_RESULT([yes]) 396 # ncursesw was not found. Look for plain old ncurses
397 enable_consoleui=yes
398 AC_CHECK_LIB(ncurses, initscr, [GNT_LIBS="-lncurses"], [enable_consoleui=no])
399 AC_CHECK_LIB(panel, update_panels, [GNT_LIBS="$GNT_LIBS -lpanel"], [enable_consoleui=no])
400 AC_DEFINE(NO_WIDECHAR, 1, [Define to 1 if you don't have wide-character support.])
398 fi 401 fi
399 402
400 PKG_CHECK_MODULES(X11, x11, 403 PKG_CHECK_MODULES(X11, x11,
401 [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])], [AC_MSG_RESULT(no)]) 404 [AC_DEFINE(HAVE_X11, 1, [Define to 1 if you have X11])], [AC_MSG_RESULT(no)])
402 AC_SUBST(X11_LIBS) 405 AC_SUBST(X11_LIBS)
405 408
406 AC_SUBST(GNT_LIBS) 409 AC_SUBST(GNT_LIBS)
407 AC_SUBST(GNT_CFLAGS) 410 AC_SUBST(GNT_CFLAGS)
408 AM_CONDITIONAL(ENABLE_GNT, test "x$enable_consoleui" = "xyes") 411 AM_CONDITIONAL(ENABLE_GNT, test "x$enable_consoleui" = "xyes")
409 412
410 AC_CHECK_FUNC(wcwidth, [AC_DEFINE([HAVE_WCWIDTH], [1], [Define to 1 if you have wcwidth function.])]) 413 #AC_CHECK_FUNC(wcwidth, [AC_DEFINE([HAVE_WCWIDTH], [1], [Define to 1 if you have wcwidth function.])])
411 414
412 dnl ####################################################################### 415 dnl #######################################################################
413 dnl # Check for LibXML2 (required) 416 dnl # Check for LibXML2 (required)
414 dnl ####################################################################### 417 dnl #######################################################################
415 PKG_CHECK_MODULES(LIBXML, [libxml-2.0], , [ 418 PKG_CHECK_MODULES(LIBXML, [libxml-2.0], , [