166
166
if test "$cf_have_incdir" = no ; then
167
167
CF_VERBOSE(adding $cf_add_incdir to include-path)
168
ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)"
168
ifelse($2,,CPPFLAGS,$2)="$ifelse($2,,CPPFLAGS,$2) -I$cf_add_incdir"
170
cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
171
test "$cf_top_incdir" = "$cf_add_incdir" && break
172
cf_add_incdir="$cf_top_incdir"
170
cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
171
test "$cf_top_incdir" = "$cf_add_incdir" && break
172
cf_add_incdir="$cf_top_incdir"
817
818
eval 'cf_found_library=[$]cf_cv_have_lib_'$1
819
820
if test $cf_found_library = no ; then
820
AC_ERROR(Cannot link $1 library)
821
AC_MSG_ERROR(Cannot link $1 library)
824
825
dnl ---------------------------------------------------------------------------
826
dnl CF_FIND_LINKAGE version: 13 updated: 2008/12/24 07:59:55
828
dnl Find a library (specifically the linkage used in the code fragment),
829
dnl searching for it if it is not already in the library path.
830
dnl See also CF_ADD_SEARCHPATH.
832
dnl Parameters (4-on are optional):
833
dnl $1 = headers for library entrypoint
834
dnl $2 = code fragment for library entrypoint
835
dnl $3 = the library name without the "-l" option or ".so" suffix.
836
dnl $4 = action to perform if successful (default: update CPPFLAGS, etc)
837
dnl $5 = action to perform if not successful
838
dnl $6 = module name, if not the same as the library name
839
dnl $7 = extra libraries
841
dnl Sets these variables:
842
dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
843
dnl $cf_cv_header_path_$3 - include-directory if needed
844
dnl $cf_cv_library_path_$3 - library-directory if needed
845
dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
846
AC_DEFUN([CF_FIND_LINKAGE],[
848
# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
849
# will be set on completion of the AC_TRY_LINK below.
850
cf_cv_header_path_$3=
851
cf_cv_library_path_$3=
853
CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
855
AC_TRY_LINK([$1],[$2],
856
cf_cv_find_linkage_$3=yes,[
857
cf_cv_find_linkage_$3=no
859
CF_VERBOSE(find linkage for $3 library)
860
CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
862
cf_save_CPPFLAGS="$CPPFLAGS"
863
cf_test_CPPFLAGS="$CPPFLAGS"
865
CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
866
for cf_cv_header_path_$3 in $cf_search
868
if test -d $cf_cv_header_path_$3 ; then
869
CF_VERBOSE(... testing $cf_cv_header_path_$3)
870
CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
871
AC_TRY_COMPILE([$1],[$2],[
872
CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
873
cf_cv_find_linkage_$3=maybe
874
cf_test_CPPFLAGS="$CPPFLAGS"
876
CPPFLAGS="$cf_save_CPPFLAGS"
881
if test "$cf_cv_find_linkage_$3" = maybe ; then
883
CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
886
cf_save_LDFLAGS="$LDFLAGS"
889
CPPFLAGS="$cf_test_CPPFLAGS"
890
LIBS="-l$3 $7 $cf_save_LIBS"
891
AC_TRY_LINK([$1],[$2],[
892
CF_VERBOSE(... found $3 library in system)
893
cf_cv_find_linkage_$3=yes])
894
CPPFLAGS="$cf_save_CPPFLAGS"
898
if test "$cf_cv_find_linkage_$3" != yes ; then
899
CF_LIBRARY_PATH(cf_search,$3)
900
for cf_cv_library_path_$3 in $cf_search
902
if test -d $cf_cv_library_path_$3 ; then
903
CF_VERBOSE(... testing $cf_cv_library_path_$3)
904
CPPFLAGS="$cf_test_CPPFLAGS"
905
LIBS="-l$3 $7 $cf_save_LIBS"
906
LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
907
AC_TRY_LINK([$1],[$2],[
908
CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
909
cf_cv_find_linkage_$3=yes
910
cf_cv_library_file_$3="-l$3"
912
CPPFLAGS="$cf_save_CPPFLAGS"
914
LDFLAGS="$cf_save_LDFLAGS"
919
CPPFLAGS="$cf_save_CPPFLAGS"
920
LDFLAGS="$cf_save_LDFLAGS"
924
cf_cv_find_linkage_$3=no
928
if test "$cf_cv_find_linkage_$3" = yes ; then
930
CF_ADD_INCDIR($cf_cv_header_path_$3)
931
CF_ADD_LIBDIR($cf_cv_library_path_$3)
935
ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
938
dnl ---------------------------------------------------------------------------
825
939
dnl CF_FUNC_CURSES_VERSION version: 4 updated: 2007/04/28 09:15:55
826
940
dnl ----------------------
827
941
dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
1074
1186
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1076
1188
dnl ---------------------------------------------------------------------------
1077
dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59
1189
dnl CF_HEADER_PATH version: 9 updated: 2008/12/07 19:38:31
1078
1190
dnl --------------
1079
dnl Construct a search-list for a nonstandard header-file
1191
dnl Construct a search-list of directories for a nonstandard header-file
1194
dnl $1 = the variable to return as result
1195
dnl $2 = the package name
1080
1196
AC_DEFUN([CF_HEADER_PATH],
1081
[CF_SUBDIR_PATH($1,$2,include)
1198
cf_header_path_list=""
1199
if test -n "${CFLAGS}${CPPFLAGS}" ; then
1200
for cf_header_path in $CPPFLAGS $CFLAGS
1202
case $cf_header_path in #(vi
1204
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
1205
CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
1206
cf_header_path_list="$cf_header_path_list [$]$1"
1212
CF_SUBDIR_PATH($1,$2,include)
1082
1214
test "$includedir" != NONE && \
1083
1215
test "$includedir" != "/usr/include" && \
1084
1216
test -d "$includedir" && {
1142
1275
dnl ---------------------------------------------------------------------------
1143
dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59
1276
dnl CF_LIBRARY_PATH version: 8 updated: 2008/12/07 19:38:31
1144
1277
dnl ---------------
1145
dnl Construct a search-list for a nonstandard library-file
1278
dnl Construct a search-list of directories for a nonstandard library-file
1281
dnl $1 = the variable to return as result
1282
dnl $2 = the package name
1146
1283
AC_DEFUN([CF_LIBRARY_PATH],
1147
[CF_SUBDIR_PATH($1,$2,lib)])dnl
1285
cf_library_path_list=""
1286
if test -n "${LDFLAGS}${LIBS}" ; then
1287
for cf_library_path in $LDFLAGS $LIBS
1289
case $cf_library_path in #(vi
1291
cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
1292
CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
1293
cf_library_path_list="$cf_library_path_list [$]$1"
1299
CF_SUBDIR_PATH($1,$2,lib)
1301
$1="$cf_library_path_list [$]$1"
1148
1303
dnl ---------------------------------------------------------------------------
1149
1304
dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
1189
1344
dnl ---------------------------------------------------------------------------
1345
dnl CF_NCURSES_CONFIG version: 5 updated: 2009/01/11 15:31:22
1346
dnl -----------------
1347
dnl Tie together the configure-script macros for ncurses.
1348
dnl Prefer the "-config" script from ncurses 5.6, to simplify analysis.
1349
dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
1351
dnl $1 is the root library name (default: "ncurses")
1352
AC_DEFUN([CF_NCURSES_CONFIG],
1354
cf_ncuconfig_root=ifelse($1,,ncurses,$1)
1356
echo "Looking for ${cf_ncuconfig_root}-config"
1357
AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
1359
if test "$NCURSES_CONFIG" != none ; then
1361
cf_cv_ncurses_header=curses.h
1363
CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
1364
LIBS="`$NCURSES_CONFIG --libs` $LIBS"
1366
dnl like CF_NCURSES_CPPFLAGS
1369
dnl like CF_NCURSES_LIBS
1370
CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
1371
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
1373
dnl like CF_NCURSES_VERSION
1374
cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
1378
CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
1379
CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
1383
dnl ---------------------------------------------------------------------------
1190
1384
dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20
1191
1385
dnl -------------------
1192
1386
dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
1435
1629
test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
1437
1631
dnl ---------------------------------------------------------------------------
1438
dnl CF_PATH_SYNTAX version: 11 updated: 2006/09/02 08:55:46
1632
dnl CF_NCURSES_WRAP_PREFIX version: 1 updated: 2009/03/28 16:08:10
1633
dnl ----------------------
1634
dnl Check for ncurses "wrap-prefix" used for public variables which have been
1635
dnl wrapped with a function to help with concurrency control.
1636
AC_DEFUN([CF_NCURSES_WRAP_PREFIX],
1638
AC_MSG_CHECKING(for ncurses wrap-prefix)
1639
AC_ARG_WITH(ncurses-wrap-prefix,
1640
[ --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables],
1641
[NCURSES_WRAP_PREFIX=$withval],
1642
[NCURSES_WRAP_PREFIX=_nc_])
1643
AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
1645
AC_SUBST(NCURSES_WRAP_PREFIX)
1647
dnl ---------------------------------------------------------------------------
1648
dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59
1439
1649
dnl --------------
1440
1650
dnl Check the argument to see that it looks like a pathname. Rewrite it if it
1441
1651
dnl begins with one of the prefix/exec_prefix variables, and then again if the