5e993f12 |
1 | Index: configure.ac |
2 | =================================================================== |
3 | RCS file: /sqlite/sqlite/configure.ac,v |
4 | retrieving revision 1.26 |
5 | diff -u -p -r1.26 configure.ac |
6 | --- configure.ac 3 Jun 2006 18:02:18 -0000 1.26 |
7 | +++ configure.ac 16 Feb 2007 23:31:32 -0000 |
8 | @@ -592,16 +592,68 @@ AC_SUBST(HAVE_TCL) |
9 | # Figure out what C libraries are required to compile programs |
10 | # that use "readline()" library. |
11 | # |
12 | -if test "$config_TARGET_READLINE_LIBS" != ""; then |
13 | - TARGET_READLINE_LIBS="$config_TARGET_READLINE_LIBS" |
14 | -else |
15 | - CC=$TARGET_CC |
16 | - LIBS="" |
17 | - AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap]) |
18 | - AC_CHECK_LIB([readline], [readline]) |
19 | - TARGET_READLINE_LIBS="$LIBS" |
20 | +TARGET_READLINE_LIBS="" |
21 | +TARGET_READLINE_INC="" |
22 | +TARGET_HAVE_READLINE=0 |
23 | +AC_ARG_ENABLE([readline], |
24 | + [AC_HELP_STRING([--disable-readline],[disable readline support [default=detect]])], |
25 | + [with_readline=$enableval], |
26 | + [with_readline=auto]) |
27 | + |
28 | +if test x"$with_readline" != xno; then |
29 | + found="yes" |
30 | + |
31 | + AC_ARG_WITH([readline-lib], |
32 | + [AC_HELP_STRING([--with-readline-lib],[specify readline library])], |
33 | + [with_readline_lib=$withval], |
34 | + [with_readline_lib="auto"]) |
35 | + if test "x$with_readline_lib" = xauto; then |
36 | + save_LIBS="$LIBS" |
37 | + LIBS="" |
38 | + AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap], [term_LIBS="$LIBS"], [term_LIBS=""]) |
39 | + AC_CHECK_LIB([readline], [readline], [TARGET_READLINE_LIBS="-lreadline"], [found="no"]) |
40 | + TARGET_READLINE_LIBS="$TARGET_READLINE_LIBS $term_LIBS" |
41 | + LIBS="$save_LIBS" |
42 | + else |
43 | + TARGET_READLINE_LIBS="$with_readline_lib" |
44 | + fi |
45 | + |
46 | + AC_ARG_WITH([readline-inc], |
47 | + [AC_HELP_STRING([--with-readline-inc],[specify readline include paths])], |
48 | + [with_readline_inc=$withval], |
49 | + [with_readline_inc="auto"]) |
50 | + if test "x$with_readline_inc" = xauto; then |
51 | + AC_CHECK_HEADER(readline.h, [found="yes"], [ |
52 | + found="no" |
53 | + if test "$cross_compiling" != yes; then |
54 | + for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do |
55 | + for subdir in include include/readline; do |
56 | + AC_CHECK_FILE($dir/$subdir/readline.h, found=yes) |
57 | + if test "$found" = "yes"; then |
58 | + TARGET_READLINE_INC="-I$dir/$subdir" |
59 | + break |
60 | + fi |
61 | + done |
62 | + test "$found" = "yes" && break |
63 | + done |
64 | + fi |
65 | + ]) |
66 | + else |
67 | + TARGET_READLINE_INC="$with_readline_inc" |
68 | + fi |
69 | + |
70 | + if test x"$found" = xno; then |
71 | + TARGET_READLINE_LIBS="" |
72 | + TARGET_READLINE_INC="" |
73 | + TARGET_HAVE_READLINE=0 |
74 | + else |
75 | + TARGET_HAVE_READLINE=1 |
76 | + fi |
77 | fi |
78 | + |
79 | AC_SUBST(TARGET_READLINE_LIBS) |
80 | +AC_SUBST(TARGET_READLINE_INC) |
81 | +AC_SUBST(TARGET_HAVE_READLINE) |
82 | |
83 | ########## |
84 | # Figure out what C libraries are required to compile programs |
85 | @@ -612,47 +664,6 @@ LIBS=$TARGET_LIBS |
86 | AC_SEARCH_LIBS(fdatasync, [rt]) |
87 | TARGET_LIBS="$LIBS" |
88 | |
89 | -########## |
90 | -# Figure out where to get the READLINE header files. |
91 | -# |
92 | -AC_MSG_CHECKING([readline header files]) |
93 | -found=no |
94 | -if test "$config_TARGET_READLINE_INC" != ""; then |
95 | - TARGET_READLINE_INC=$config_TARGET_READLINE_INC |
96 | - found=yes |
97 | -fi |
98 | -if test "$found" = "yes"; then |
99 | - AC_MSG_RESULT($TARGET_READLINE_INC) |
100 | -else |
101 | - AC_MSG_RESULT(not specified: still searching...) |
102 | - AC_CHECK_HEADER(readline.h, [found=yes]) |
103 | -fi |
104 | -if test "$found" = "no"; then |
105 | - for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do |
106 | - AC_CHECK_FILE($dir/include/readline.h, found=yes) |
107 | - if test "$found" = "yes"; then |
108 | - TARGET_READLINE_INC="-I$dir/include" |
109 | - break |
110 | - fi |
111 | - AC_CHECK_FILE($dir/include/readline/readline.h, found=yes) |
112 | - if test "$found" = "yes"; then |
113 | - TARGET_READLINE_INC="-I$dir/include/readline" |
114 | - break |
115 | - fi |
116 | - done |
117 | -fi |
118 | -if test "$found" = "yes"; then |
119 | - if test "$TARGET_READLINE_LIBS" = ""; then |
120 | - TARGET_HAVE_READLINE=0 |
121 | - else |
122 | - TARGET_HAVE_READLINE=1 |
123 | - fi |
124 | -else |
125 | - TARGET_HAVE_READLINE=0 |
126 | -fi |
127 | -AC_SUBST(TARGET_READLINE_INC) |
128 | -AC_SUBST(TARGET_HAVE_READLINE) |
129 | - |
130 | ######### |
131 | # check for debug enabled |
132 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]), |