~ubuntu-branches/debian/sid/ncurses/sid-200908151540

« back to all changes in this revision

Viewing changes to test/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-05-24 15:13:01 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090524151301-uixgxq2zonfov2nr
Tags: 5.7+20090523-1
MergingĀ upstreamĀ versionĀ 5.7+20090523.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
dnl***************************************************************************
2
 
dnl Copyright (c) 2003-2007,2008 Free Software Foundation, Inc.              *
 
2
dnl Copyright (c) 2003-2008,2009 Free Software Foundation, Inc.              *
3
3
dnl                                                                          *
4
4
dnl Permission is hereby granted, free of charge, to any person obtaining a  *
5
5
dnl copy of this software and associated documentation files (the            *
26
26
dnl authorization.                                                           *
27
27
dnl***************************************************************************
28
28
dnl
29
 
dnl $Id: aclocal.m4,v 1.22 2008/02/09 18:22:17 tom Exp $
 
29
dnl $Id: aclocal.m4,v 1.25 2009/03/28 20:09:37 tom Exp $
30
30
dnl
31
31
dnl Author: Thomas E. Dickey
32
32
dnl
40
40
dnl
41
41
dnl ---------------------------------------------------------------------------
42
42
dnl ---------------------------------------------------------------------------
43
 
dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30
 
43
dnl CF_ADD_CFLAGS version: 8 updated: 2009/01/06 19:33:30
44
44
dnl -------------
45
45
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
46
46
dnl The second parameter if given makes this macro verbose.
110
110
 
111
111
if test -n "$cf_new_cppflags" ; then
112
112
        ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
113
 
        CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
 
113
        CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
114
114
fi
115
115
 
116
116
if test -n "$cf_new_extra_cppflags" ; then
122
122
 
123
123
])dnl
124
124
dnl ---------------------------------------------------------------------------
125
 
dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34
 
125
dnl CF_ADD_INCDIR version: 12 updated: 2009/01/18 10:00:47
126
126
dnl -------------
127
127
dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
128
128
dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
149
149
                fi
150
150
 
151
151
                if test "$cf_have_incdir" = no ; then
152
 
          if test "$cf_add_incdir" = /usr/local/include ; then
 
152
                  if test "$cf_add_incdir" = /usr/local/include ; then
153
153
                        if test "$GCC" = yes
154
154
                        then
155
155
                          cf_save_CPPFLAGS=$CPPFLAGS
165
165
 
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"
169
169
 
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"
173
173
                else
174
174
                  break
175
175
                fi
179
179
fi
180
180
])dnl
181
181
dnl ---------------------------------------------------------------------------
182
 
dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34
 
182
dnl CF_ADD_LIBDIR version: 8 updated: 2009/01/18 10:01:08
183
183
dnl -------------
184
184
dnl     Adds to the library-path
185
185
dnl
208
208
      fi
209
209
      if test "$cf_have_libdir" = no ; then
210
210
        CF_VERBOSE(adding $cf_add_libdir to library-path)
211
 
        ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)"
 
211
        ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,$2)"
212
212
      fi
213
213
    fi
214
214
  done
289
289
fi
290
290
])dnl
291
291
dnl ---------------------------------------------------------------------------
292
 
dnl CF_ANSI_CC_REQD version: 3 updated: 1997/09/06 13:40:44
 
292
dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
293
293
dnl ---------------
294
294
dnl For programs that must use an ANSI compiler, obtain compiler options that
295
295
dnl will make it recognize prototypes.  We'll do preprocessor checks in other
298
298
AC_DEFUN([CF_ANSI_CC_REQD],
299
299
[AC_REQUIRE([CF_ANSI_CC_CHECK])
300
300
if test "$cf_cv_ansi_cc" = "no"; then
301
 
        AC_ERROR(
 
301
        AC_MSG_ERROR(
302
302
[Your compiler does not appear to recognize prototypes.
303
303
You have the following choices:
304
304
        a. adjust your compiler options
342
342
])dnl
343
343
  ])])dnl
344
344
dnl ---------------------------------------------------------------------------
345
 
dnl CF_CHECK_CACHE version: 10 updated: 2004/05/23 13:03:31
 
345
dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
346
346
dnl --------------
347
347
dnl Check if we're accidentally using a cache from a different machine.
348
348
dnl Derive the system name, as a check for reusing the autoconf cache.
373
373
 
374
374
if test ".$system_name" != ".$cf_cv_system_name" ; then
375
375
        AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
376
 
        AC_ERROR("Please remove config.cache and try again.")
 
376
        AC_MSG_ERROR("Please remove config.cache and try again.")
377
377
fi
378
378
])dnl
379
379
dnl ---------------------------------------------------------------------------
399
399
fi
400
400
])dnl
401
401
dnl ---------------------------------------------------------------------------
402
 
dnl CF_CURSES_ACS_MAP version: 3 updated: 2003/05/17 22:19:02
 
402
dnl CF_CURSES_ACS_MAP version: 5 updated: 2009/03/28 16:08:10
403
403
dnl -----------------
404
404
dnl Check for likely values of acs_map[]:
405
405
AC_DEFUN([CF_CURSES_ACS_MAP],
406
406
[
 
407
AC_REQUIRE([CF_NCURSES_WRAP_PREFIX])dnl
407
408
AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[
408
409
cf_cv_curses_acs_map=unknown
409
 
for name in acs_map _acs_map __acs_map _nc_acs_map
 
410
for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
410
411
do
411
412
AC_TRY_LINK([
412
413
#include <${cf_cv_ncurses_header-curses.h}>
441
442
fi
442
443
])dnl
443
444
dnl ---------------------------------------------------------------------------
444
 
dnl CF_CURSES_CPPFLAGS version: 9 updated: 2006/02/04 19:44:43
 
445
dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11
445
446
dnl ------------------
446
447
dnl Look for the curses headers.
447
448
AC_DEFUN([CF_CURSES_CPPFLAGS],[
460
461
        ;;
461
462
esac
462
463
])
463
 
test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
 
464
test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
464
465
 
465
466
CF_CURSES_HEADER
466
467
CF_TERM_HEADER
549
550
AC_CHECK_HEADERS($cf_cv_ncurses_header)
550
551
])dnl
551
552
dnl ---------------------------------------------------------------------------
552
 
dnl CF_CURSES_LIBS version: 26 updated: 2007/07/29 10:32:40
 
553
dnl CF_CURSES_LIBS version: 29 updated: 2009/01/06 19:34:57
553
554
dnl --------------
554
555
dnl Look for the curses libraries.  Older curses implementations may require
555
556
dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
576
577
    AC_CHECK_LIB(Hcurses,initscr,[
577
578
        # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
578
579
        LIBS="-lHcurses $LIBS"
579
 
        CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
 
580
        CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
580
581
        ac_cv_func_initscr=yes
581
582
        ])])
582
583
    ;;
615
616
 
616
617
    # Check for library containing initscr
617
618
    test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
618
 
    for cf_curs_lib in $cf_check_list xcurses jcurses unknown
 
619
        for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
619
620
    do
620
621
        AC_CHECK_LIB($cf_curs_lib,initscr,[break])
621
622
    done
622
 
    test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
 
623
    test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
623
624
 
624
625
    LIBS="-l$cf_curs_lib $cf_save_LIBS"
625
626
    if test "$cf_term_lib" = unknown ; then
629
630
            [cf_result=yes],
630
631
            [cf_result=no])
631
632
        AC_MSG_RESULT($cf_result)
632
 
        test $cf_result = no && AC_ERROR(Cannot link curses library)
 
633
        test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
633
634
    elif test "$cf_curs_lib" = "$cf_term_lib" ; then
634
635
        :
635
636
    elif test "$cf_term_lib" != predefined ; then
772
773
fi
773
774
])dnl
774
775
dnl ---------------------------------------------------------------------------
775
 
dnl CF_FIND_LIBRARY version: 8 updated: 2004/11/23 20:14:58
 
776
dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
776
777
dnl ---------------
777
778
dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
778
779
dnl prefer a standard location, and use -L options only if we do not find the
817
818
eval 'cf_found_library=[$]cf_cv_have_lib_'$1
818
819
ifelse($6,,[
819
820
if test $cf_found_library = no ; then
820
 
        AC_ERROR(Cannot link $1 library)
 
821
        AC_MSG_ERROR(Cannot link $1 library)
821
822
fi
822
823
])
823
824
])dnl
824
825
dnl ---------------------------------------------------------------------------
 
826
dnl CF_FIND_LINKAGE version: 13 updated: 2008/12/24 07:59:55
 
827
dnl ---------------
 
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.
 
831
dnl
 
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
 
840
dnl
 
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],[
 
847
 
 
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=
 
852
 
 
853
CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
 
854
 
 
855
AC_TRY_LINK([$1],[$2],
 
856
    cf_cv_find_linkage_$3=yes,[
 
857
    cf_cv_find_linkage_$3=no
 
858
 
 
859
    CF_VERBOSE(find linkage for $3 library)
 
860
    CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
 
861
 
 
862
    cf_save_CPPFLAGS="$CPPFLAGS"
 
863
    cf_test_CPPFLAGS="$CPPFLAGS"
 
864
 
 
865
    CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
 
866
    for cf_cv_header_path_$3 in $cf_search
 
867
    do
 
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"
 
875
            break],[
 
876
            CPPFLAGS="$cf_save_CPPFLAGS"
 
877
            ])
 
878
      fi
 
879
    done
 
880
 
 
881
    if test "$cf_cv_find_linkage_$3" = maybe ; then
 
882
 
 
883
      CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
 
884
 
 
885
      cf_save_LIBS="$LIBS"
 
886
      cf_save_LDFLAGS="$LDFLAGS"
 
887
 
 
888
      ifelse([$6],,,[
 
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"
 
895
            LIBS="$cf_save_LIBS"
 
896
            ])
 
897
 
 
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
 
901
        do
 
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"
 
911
                break],[
 
912
                CPPFLAGS="$cf_save_CPPFLAGS"
 
913
                LIBS="$cf_save_LIBS"
 
914
                LDFLAGS="$cf_save_LDFLAGS"
 
915
                ])
 
916
          fi
 
917
        done
 
918
        LIBS="$cf_save_LIBS"
 
919
        CPPFLAGS="$cf_save_CPPFLAGS"
 
920
        LDFLAGS="$cf_save_LDFLAGS"
 
921
      fi
 
922
 
 
923
    else
 
924
      cf_cv_find_linkage_$3=no
 
925
    fi
 
926
    ],$7)
 
927
 
 
928
if test "$cf_cv_find_linkage_$3" = yes ; then
 
929
ifelse([$4],,[
 
930
  CF_ADD_INCDIR($cf_cv_header_path_$3)
 
931
  CF_ADD_LIBDIR($cf_cv_library_path_$3)
 
932
  LIBS="-l$3 $LIBS"
 
933
],[$4])
 
934
else
 
935
ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
 
936
fi
 
937
])dnl
 
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.
933
1047
fi
934
1048
])dnl
935
1049
dnl ---------------------------------------------------------------------------
936
 
dnl CF_GCC_WARNINGS version: 22 updated: 2007/07/29 09:55:12
 
1050
dnl CF_GCC_WARNINGS version: 24 updated: 2009/02/01 15:21:00
937
1051
dnl ---------------
938
1052
dnl Check if the compiler supports useful warning options.  There's a few that
939
1053
dnl we don't use, simply because they're too noisy:
966
1080
then
967
1081
# The "-wdXXX" options suppress warnings:
968
1082
# remark #1419: external declaration in primary source file
969
 
# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
970
1083
# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
971
1084
# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
972
1085
# remark #193: zero used for undefined preprocessing identifier
974
1087
# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
975
1088
# remark #869: parameter "tw" was never referenced
976
1089
# remark #981: operands are evaluated in unspecified order
977
 
# warning #269: invalid format string conversion
 
1090
# warning #279: controlling expression is constant
978
1091
 
979
1092
        AC_CHECKING([for $CC warning options])
980
1093
        cf_save_CFLAGS="$CFLAGS"
981
1094
        EXTRA_CFLAGS="-Wall"
982
1095
        for cf_opt in \
983
1096
                wd1419 \
984
 
                wd1682 \
985
1097
                wd1683 \
986
1098
                wd1684 \
987
1099
                wd193 \
 
1100
                wd593 \
988
1101
                wd279 \
989
 
                wd593 \
990
1102
                wd810 \
991
1103
                wd869 \
992
1104
                wd981
1028
1140
                                ;;
1029
1141
                        Winline) #(vi
1030
1142
                                case $GCC_VERSION in
1031
 
                                3.3*)
 
1143
                                [[34]].*)
1032
1144
                                        CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
1033
1145
                                        continue;;
1034
1146
                                esac
1074
1186
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
1075
1187
])dnl
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
 
1192
dnl
 
1193
dnl Parameters
 
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)
 
1197
[
 
1198
cf_header_path_list=""
 
1199
if test -n "${CFLAGS}${CPPFLAGS}" ; then
 
1200
        for cf_header_path in $CPPFLAGS $CFLAGS
 
1201
        do
 
1202
                case $cf_header_path in #(vi
 
1203
                -I*)
 
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"
 
1207
                        ;;
 
1208
                esac
 
1209
        done
 
1210
fi
 
1211
 
 
1212
CF_SUBDIR_PATH($1,$2,include)
 
1213
 
1082
1214
test "$includedir" != NONE && \
1083
1215
test "$includedir" != "/usr/include" && \
1084
1216
test -d "$includedir" && {
1093
1225
        test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
1094
1226
}
1095
1227
 
 
1228
$1="$cf_header_path_list [$]$1"
1096
1229
])dnl
1097
1230
dnl ---------------------------------------------------------------------------
1098
1231
dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42
1140
1273
fi
1141
1274
])dnl
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
 
1279
dnl
 
1280
dnl Parameters
 
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
 
1284
[
 
1285
cf_library_path_list=""
 
1286
if test -n "${LDFLAGS}${LIBS}" ; then
 
1287
        for cf_library_path in $LDFLAGS $LIBS
 
1288
        do
 
1289
                case $cf_library_path in #(vi
 
1290
                -L*)
 
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"
 
1294
                        ;;
 
1295
                esac
 
1296
        done
 
1297
fi
 
1298
 
 
1299
CF_SUBDIR_PATH($1,$2,lib)
 
1300
 
 
1301
$1="$cf_library_path_list [$]$1"
 
1302
])dnl
1148
1303
dnl ---------------------------------------------------------------------------
1149
1304
dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12
1150
1305
dnl ----------
1187
1342
        ,[$1=no])
1188
1343
])dnl
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.
 
1350
dnl
 
1351
dnl $1 is the root library name (default: "ncurses")
 
1352
AC_DEFUN([CF_NCURSES_CONFIG],
 
1353
[
 
1354
cf_ncuconfig_root=ifelse($1,,ncurses,$1)
 
1355
 
 
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)
 
1358
 
 
1359
if test "$NCURSES_CONFIG" != none ; then
 
1360
 
 
1361
cf_cv_ncurses_header=curses.h
 
1362
 
 
1363
CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
 
1364
LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
1365
 
 
1366
dnl like CF_NCURSES_CPPFLAGS
 
1367
AC_DEFINE(NCURSES)
 
1368
 
 
1369
dnl like CF_NCURSES_LIBS
 
1370
CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
 
1371
AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
 
1372
 
 
1373
dnl like CF_NCURSES_VERSION
 
1374
cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
 
1375
 
 
1376
else
 
1377
 
 
1378
CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
 
1379
CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
 
1380
 
 
1381
fi
 
1382
])dnl
 
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
1238
1432
CF_NCURSES_VERSION
1239
1433
])dnl
1240
1434
dnl ---------------------------------------------------------------------------
1241
 
dnl CF_NCURSES_HEADER version: 1 updated: 2005/12/31 13:28:37
 
1435
dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
1242
1436
dnl -----------------
1243
1437
dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
1244
1438
dnl variations of ncurses' installs.
1273
1467
                CPPFLAGS="$cf_save2_CPPFLAGS"
1274
1468
                test "$cf_cv_ncurses_h2" != no && break
1275
1469
        done
1276
 
        test "$cf_cv_ncurses_h2" = no && AC_ERROR(not found)
 
1470
        test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
1277
1471
        ])
1278
1472
 
1279
1473
        CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
1435
1629
test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
1436
1630
])dnl
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],
 
1637
[
 
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)
 
1644
 
 
1645
AC_SUBST(NCURSES_WRAP_PREFIX)
 
1646
])
 
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
1467
1677
  $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
1468
1678
  ;;
1469
1679
*)
1470
 
  ifelse($2,,[AC_ERROR([expected a pathname, not \"[$]$1\"])],$2)
 
1680
  ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
1471
1681
  ;;
1472
1682
esac
1473
1683
])dnl
1474
1684
dnl ---------------------------------------------------------------------------
1475
 
dnl CF_PDCURSES_X11 version: 7 updated: 2006/11/12 17:31:59
 
1685
dnl CF_PDCURSES_X11 version: 9 updated: 2009/01/11 15:31:37
1476
1686
dnl ---------------
1477
1687
dnl Configure for PDCurses' X11 library
1478
1688
AC_DEFUN([CF_PDCURSES_X11],[
1482
1692
 
1483
1693
if test "$XCURSES_CONFIG" != none ; then
1484
1694
 
1485
 
CPPFLAGS="`$XCURSES_CONFIG --cflags` $CPPFLAGS"
 
1695
CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
1486
1696
LIBS="`$XCURSES_CONFIG --libs` $LIBS"
1487
1697
 
1488
1698
cf_cv_lib_XCurses=yes
1511
1721
        AC_DEFINE(XCURSES)
1512
1722
        AC_DEFINE(HAVE_XCURSES)
1513
1723
else
1514
 
        AC_ERROR(Cannot link with XCurses)
 
1724
        AC_MSG_ERROR(Cannot link with XCurses)
1515
1725
fi
1516
1726
])dnl
1517
1727
dnl ---------------------------------------------------------------------------
1790
2000
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
1791
2001
])dnl
1792
2002
dnl ---------------------------------------------------------------------------
1793
 
dnl CF_UTF8_LIB version: 4 updated: 2003/03/01 18:36:42
 
2003
dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52
1794
2004
dnl -----------
1795
2005
dnl Check for multibyte support, and if not found, utf8 compatibility library
1796
2006
AC_DEFUN([CF_UTF8_LIB],
1800
2010
        AC_TRY_LINK([
1801
2011
#include <stdlib.h>],[putwc(0,0);],
1802
2012
        [cf_cv_utf8_lib=yes],
1803
 
        [LIBS="-lutf8 $LIBS"
1804
 
         AC_TRY_LINK([
1805
 
#include <libutf8.h>],[putwc(0,0);],
 
2013
        [CF_FIND_LINKAGE([
 
2014
#include <libutf8.h>],[putwc(0,0);],utf8,
1806
2015
                [cf_cv_utf8_lib=add-on],
1807
2016
                [cf_cv_utf8_lib=no])
1808
 
        LIBS="$cf_save_LIBS"
1809
2017
])])
1810
2018
 
1811
2019
# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
1812
2020
# ncurses/ncursesw:
1813
2021
if test "$cf_cv_utf8_lib" = "add-on" ; then
1814
2022
        AC_DEFINE(HAVE_LIBUTF8_H)
 
2023
        CF_ADD_INCDIR($cf_cv_header_path_utf8)
 
2024
        CF_ADD_LIBDIR($cf_cv_library_path_utf8)
1815
2025
        LIBS="-lutf8 $LIBS"
1816
2026
fi
1817
2027
])dnl
1866
2076
test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
1867
2077
])dnl
1868
2078
dnl ---------------------------------------------------------------------------
1869
 
dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38
 
2079
dnl CF_XOPEN_SOURCE version: 28 updated: 2008/12/27 12:30:03
1870
2080
dnl ---------------
1871
2081
dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
1872
2082
dnl or adapt to the vendor's definitions to get equivalent functionality,
1883
2093
cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2)
1884
2094
 
1885
2095
case $host_os in #(vi
1886
 
aix[[45]]*) #(vi
 
2096
aix[[456]]*) #(vi
1887
2097
        CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
1888
2098
        ;;
1889
 
freebsd*) #(vi
 
2099
freebsd*|dragonfly*) #(vi
1890
2100
        # 5.x headers associate
1891
2101
        #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
1892
2102
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
1900
2110
irix[[56]].*) #(vi
1901
2111
        CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
1902
2112
        ;;
1903
 
linux*|gnu*|k*bsd*-gnu) #(vi
 
2113
linux*|gnu*|mint*|k*bsd*-gnu) #(vi
1904
2114
        CF_GNU_SOURCE
1905
2115
        ;;
1906
2116
mirbsd*) #(vi
2005
2215
CF_X_ATHENA_LIBS($cf_x_athena)
2006
2216
])dnl
2007
2217
dnl ---------------------------------------------------------------------------
2008
 
dnl CF_X_ATHENA_CPPFLAGS version: 2 updated: 2002/10/09 20:00:37
 
2218
dnl CF_X_ATHENA_CPPFLAGS version: 3 updated: 2009/01/11 15:33:39
2009
2219
dnl --------------------
2010
2220
dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
2011
2221
dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
2024
2234
                cf_save="$CPPFLAGS"
2025
2235
                cf_test=X11/$cf_x_athena_root/SimpleMenu.h
2026
2236
                if test $cf_path != default ; then
2027
 
                        CPPFLAGS="-I$cf_path/include $cf_save"
 
2237
                        CPPFLAGS="$cf_save -I$cf_path/include"
2028
2238
                        AC_MSG_CHECKING(for $cf_test in $cf_path)
2029
2239
                else
2030
2240
                        AC_MSG_CHECKING(for $cf_test)
2052
2262
fi
2053
2263
])
2054
2264
dnl ---------------------------------------------------------------------------
2055
 
dnl CF_X_ATHENA_LIBS version: 6 updated: 2006/11/30 17:57:11
 
2265
dnl CF_X_ATHENA_LIBS version: 7 updated: 2008/03/23 14:46:03
2056
2266
dnl ----------------
2057
2267
dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
2058
2268
dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
2096
2306
done
2097
2307
 
2098
2308
if test -z "$cf_x_athena_lib" ; then
2099
 
        AC_ERROR(
 
2309
        AC_MSG_ERROR(
2100
2310
[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
2101
2311
fi
2102
2312
 
2104
2314
AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
2105
2315
])
2106
2316
dnl ---------------------------------------------------------------------------
2107
 
dnl CF_X_TOOLKIT version: 11 updated: 2006/11/29 19:05:14
 
2317
dnl CF_X_TOOLKIT version: 12 updated: 2008/03/23 15:04:54
2108
2318
dnl ------------
2109
2319
dnl Check for X Toolkit libraries
2110
2320
dnl
2133
2343
        [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
2134
2344
 
2135
2345
if test $cf_have_X_LIBS = no ; then
2136
 
        AC_WARN(
 
2346
        AC_MSG_WARN(
2137
2347
[Unable to successfully link X Toolkit library (-lXt) with
2138
2348
test program.  You will have to check and add the proper libraries by hand
2139
2349
to makefile.])