From: Hans-Bernhard B. <br...@us...> - 2001-07-05 18:45:32
|
Update of /cvsroot/cscope/cscope In directory usw-pr-cvs1:/tmp/cvs-serv24008 Modified Files: ChangeLog config.h.in configure configure.in Log Message: Centralization of BSD-specific #ifs, and some further code cleanups Index: ChangeLog =================================================================== RCS file: /cvsroot/cscope/cscope/ChangeLog,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -r1.88 -r1.89 *** ChangeLog 2001/07/05 13:47:53 1.88 --- ChangeLog 2001/07/05 14:30:59 1.89 *************** *** 1,2 **** --- 1,7 ---- + (2001/07/05 - broeker) Centralisation of BSDism configuration stuff. Removal of + some remaining external prototypes from .c files, where + they should never be. Added multiple inclusion guards + to all headers. Ask for feature instead of testing a + list of platform-#defines, wherever possible. (2001/07/05 - broeker) Some post-last-minute DOS/DJGPP build fixes. (2001/07/03 - petrs) Updated the version strings to 16.0a. Index: config.h.in =================================================================== RCS file: /cvsroot/cscope/cscope/config.h.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** config.h.in 2001/06/28 15:12:35 1.8 --- config.h.in 2001/07/05 14:30:59 1.9 *************** *** 58,64 **** --- 58,73 ---- #undef USING_LEX + /* Define if you have the fixkeypad function. */ + #undef HAVE_FIXKEYPAD + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD + /* Define if you have the memcpy function. */ + #undef HAVE_MEMCPY + + /* Define if you have the memset function. */ + #undef HAVE_MEMSET + /* Define if you have the regcmp function. */ #undef HAVE_REGCMP *************** *** 69,72 **** --- 78,84 ---- /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF + + /* Define if you have the strchr function. */ + #undef HAVE_STRCHR /* Define if you have the strerror function. */ Index: configure =================================================================== RCS file: /cvsroot/cscope/cscope/configure,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** configure 2001/07/03 22:09:50 1.13 --- configure 2001/07/05 14:30:59 1.14 *************** *** 2358,2376 **** fi for ac_hdr in fcntl.h sys/window.h sys/termios.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2365: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2370 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then --- 2358,2431 ---- fi + for ac_func in strchr memcpy memset + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:2364: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF + #line 2369 "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ + #include <assert.h> + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func(); + + int main() { + + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF + #define $ac_tr_func 1 + EOF + + else + echo "$ac_t""no" 1>&6 + fi + done + for ac_hdr in fcntl.h sys/window.h sys/termios.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ! echo "configure:2420: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2425 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:2430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then *************** *** 2400,2409 **** echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:2403: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2408 "configure" #include "confdefs.h" --- 2455,2464 ---- echo $ac_n "checking for working const""... $ac_c" 1>&6 ! echo "configure:2458: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2463 "configure" #include "confdefs.h" *************** *** 2454,2458 **** ; return 0; } EOF ! if { (eval echo configure:2457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes --- 2509,2513 ---- ; return 0; } EOF ! if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes *************** *** 2475,2484 **** echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:2478: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2483 "configure" #include "confdefs.h" #include <sys/types.h> --- 2530,2539 ---- echo $ac_n "checking for mode_t""... $ac_c" 1>&6 ! echo "configure:2533: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2538 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2508,2517 **** echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:2511: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2516 "configure" #include "confdefs.h" #include <sys/types.h> --- 2563,2572 ---- echo $ac_n "checking for pid_t""... $ac_c" 1>&6 ! echo "configure:2566: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2571 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2541,2550 **** echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:2544: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2549 "configure" #include "confdefs.h" #include <sys/types.h> --- 2596,2605 ---- echo $ac_n "checking for size_t""... $ac_c" 1>&6 ! echo "configure:2599: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2604 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2575,2584 **** echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2578: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2583 "configure" #include "confdefs.h" #include <sys/types.h> --- 2630,2639 ---- echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ! echo "configure:2633: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2638 "configure" #include "confdefs.h" #include <sys/types.h> *************** *** 2597,2601 **** ; return 0; } EOF ! if { (eval echo configure:2600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void --- 2652,2656 ---- ; return 0; } EOF ! if { (eval echo configure:2655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void *************** *** 2617,2627 **** for ac_func in getcwd regcmp regcomp strerror vsnprintf snprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2621: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2626 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, --- 2672,2737 ---- for ac_func in getcwd regcmp regcomp strerror vsnprintf snprintf do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:2676: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <<EOF + #line 2681 "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ + #include <assert.h> + /* Override any gcc2 internal prototype to avoid an error. */ + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func(); + + int main() { + + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else + $ac_func(); + #endif + + ; return 0; } + EOF + if { (eval echo configure:2704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" + fi + rm -f conftest* + fi + + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF + #define $ac_tr_func 1 + EOF + + else + echo "$ac_t""no" 1>&6 + fi + done + + for ac_func in fixkeypad + do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ! echo "configure:2731: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF ! #line 2736 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, *************** *** 2646,2650 **** ; return 0; } EOF ! if { (eval echo configure:2649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" --- 2756,2760 ---- ; return 0; } EOF ! if { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" Index: configure.in =================================================================== RCS file: /cvsroot/cscope/cscope/configure.in,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** configure.in 2001/07/03 22:09:50 1.19 --- configure.in 2001/07/05 14:31:00 1.20 *************** *** 477,480 **** --- 477,481 ---- AC_HEADER_DIRENT AC_HEADER_STDC + AC_CHECK_FUNCS(strchr memcpy memset) AC_CHECK_HEADERS(fcntl.h sys/window.h sys/termios.h unistd.h) *************** *** 488,491 **** --- 489,493 ---- AC_TYPE_SIGNAL AC_CHECK_FUNCS(getcwd regcmp regcomp strerror vsnprintf snprintf) + AC_CHECK_FUNCS(fixkeypad) case "$host_os" in |