summaryrefslogtreecommitdiff
blob: 3c2e269be0297d970651b52b2fb17e7e0647773f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
use $PKG_CONFIG rather than `pkg-config`

https://bugs.gentoo.org/497362
get ncurses info via pkg-config while we're at it

patch by Mike Frysinger <vapier@gentoo.org>

--- a/configure.in
+++ b/configure.in
@@ -163,6 +163,7 @@ AC_SUBST(xawresdir)
 
 # Checks for programs.
 AM_PATH_LISPDIR
+PKG_PROG_PKG_CONFIG
 AC_PROG_CC
 AC_PROG_GCC_TRADITIONAL
 AC_PROG_INSTALL
@@ -1348,8 +1349,8 @@ AC_MSG_CHECKING(enable_audio=jack)
 if test "x$au_enable_jack" = xyes; then
   AC_MSG_RESULT(yes)
   SYSEXTRAS="$SYSEXTRAS jack_a.c"
-  EXTRALIBS="$EXTRALIBS $(pkg-config --libs jack)"
-  EXTRADEFS="$EXTRADEFS -DAU_JACK $(pkg-config --cflags jack)"
+  EXTRALIBS="$EXTRALIBS $(${PKG_CONFIG} --libs jack)"
+  EXTRADEFS="$EXTRADEFS -DAU_JACK $(${PKG_CONFIG} --cflags jack)"
 else
   AC_MSG_RESULT(no)
 fi
@@ -1665,69 +1666,8 @@ dnl ncurses
 AM_CONDITIONAL(ENABLE_NCURSES, false)
 CONFIG_INTERFACE(ncurses,NCURSES,n,
   AS_HELP_STRING([--enable-ncurses], [Enable ncurses interface        (default is no)]),
-  [ AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h)
-
-dnl #include <ncurses/curses.h> is failure on Plamo Linux 1.3/ncurses 1.9.9e
-dnl because <ncurses/curses.h> includes <unctrl.h>:
-dnl /usr/include/ncurses/curses.h:34: unctrl.h: No such file or directory
-dnl But surely there is unctl.h at /usr/include/ncurses/unctrl.h.
-dnl configure must check ncurses header with -I/usr/include/ncurses option.
-
-  case "$ac_cv_header_curses_h$ac_cv_header_ncurses_curses_h$ac_cv_header_ncurses_h" in
-    *yes*);;
-    *)	for i in /usr/include /usr/local/include; do
-	  if test -f "$i/ncurses/curses.h" -a -f "$i/ncurses/unctrl.h"; then
-	    AC_MSG_WARN(ncurses test is failure.  Please check config.h and common.makefile later)
-	    CPPFLAGS="$CPPFLAGS -I$i/ncurses"
-	    break
-	  fi
-	done
-	;;
-    esac
-
-    AC_CHECK_LIB(ncurses,initscr,lib_curses_opt=-lncurses,
-      [ dnl checking pdcurses
-	AC_CHECK_LIB(curses,PDC_set_ctrl_break,
-          [ lib_curses_opt=-lcurses
-	    AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
-	    lib_user32_opt="$lib_user32_test"
-	    AC_CHECK_LIB(curses, vwprintw,
-	      AC_DEFINE(HAVE_VWPRINTW, 1,
-	        [Define to 1 if you have the `vwprintw' function.]))
-	  ],
-	  [ dnl checking libpdcurses
-	    AC_CHECK_LIB(pdcurses,PDC_set_ctrl_break,
-	    [ lib_curses_opt=-lpdcurses
-	      AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
-	      lib_user32_opt="$lib_user32_test"
-	      AC_CHECK_LIB(pdcurses, vwprintw,
-	        AC_DEFINE(HAVE_VWPRINTW, 1,
-	          [Define to 1 if you have the `vwprintw' function.]))
-	    ],
-	    [ dnl OpenBSD use -lcurses instead of -lncurses.
-	      case "$target" in
-		*openbsd*)
-		  AC_CHECK_LIB(curses,initscr,lib_curses_opt=-lcurses,
-		    [ AC_MSG_WARN(ncurses interface is not enabled)
-		      enable_ncurses=no ])
-		  ;;
-		*)
-		  if test "x$VCPP" = xyes || test "x$BORLANDC" = xyes || test "x$WATCOM_C" = xyes || test "x$DMC" = xyes || test "x$POCC" = xyes; then
-		    lib_curses_opt=libpdcurses.lib
-		    AC_DEFINE(USE_PDCURSES,1,Define to 1 if you use PDcurses)
-		    AC_CHECK_LIB(pdcurses, vwprintw,
-		      AC_DEFINE(HAVE_VWPRINTW, 1,
-		        [Define to 1 if you have the `vwprintw' function.]))
-		  else
-		    AC_MSG_WARN(ncurses interface is not enabled)
-		    enable_ncurses=no
-		  fi
-		  ;;
-	      esac
-	    ])
-	],
-	$lib_user32_test)
-      ])
+  [ CPPFLAGS="$CPPFLAGS $(${PKG_CONFIG} --cflags ncurses)"
+    lib_curses_opt=$(${PKG_CONFIG} --libs ncurses)
   ],
   [ LIBS="$LIBS $lib_curses_opt"
     case "$target" in
@@ -1894,7 +1834,7 @@ CONFIG_INTERFACE(xaw,XAW,a,
     lib_xmu_opt=-lXmu
     lib_xt_opt=-lXt
     if test "x$enable_xft" = "xyes" && test "x$have_xaw" != "xno"; then
-      XFT_CFLAGS="$(pkg-config --cflags xft)";
+      XFT_CFLAGS="$(${PKG_CONFIG} --cflags xft)";
       EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$XFT_CFLAGS)
       lib_xft_opt="-lXft";
     fi
@@ -1948,7 +1888,7 @@ CONFIG_INTERFACE(xaw,XAW,a,
 	;;
     esac
     if test "x$enable_xft" = "xyes" && test "x$have_xaw" != "xno"; then
-      XFT_CFLAGS="$(pkg-config --cflags xft)";
+      XFT_CFLAGS="$(${PKG_CONFIG} --cflags xft)";
       EXTRACT_CPPFLAGS(CPPFLAGS,CFLAGS,$XFT_CFLAGS)
       a_so_libs="$a_so_libs -lXft";
     fi