X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=sysdeps%2Funix%2Fsysv%2Flinux%2Fconfigure;h=25d3f06d0b265e411313d1eb794d2a6d81a0a491;hb=0eb88fc5281804773e2a0c7a488a4452463535ce;hp=87f91bf5b3dbd25c9b6a404a286ca6505d16c88a;hpb=3a9b6a3bf0269231bef7de74757a910dedd04e0c;p=ncurses.git diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure old mode 100644 new mode 100755 index 87f91bf5..25d3f06d --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -1,55 +1,64 @@ # Local configure fragment for ncurses/sysdeps/unix/sysv/linux. -glibc_nc_srcdir=${srcdir}/ncurses - -NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[ ]*=' $glibc_nc_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" -NCURSES_MINOR="`egrep '^NCURSES_MINOR[ ]*=' $glibc_nc_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" -NCURSES_PATCH="`egrep '^NCURSES_PATCH[ ]*=' $glibc_nc_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" -nc_cv_abi_version=${NCURSES_MAJOR} -nc_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} +nc_given_srcdir=${srcdir}/ncurses + +NCURSES_MAJOR="`egrep '^NCURSES_MAJOR[ ]*=' $nc_given_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +NCURSES_MINOR="`egrep '^NCURSES_MINOR[ ]*=' $nc_given_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +NCURSES_PATCH="`egrep '^NCURSES_PATCH[ ]*=' $nc_given_srcdir/dist.mk | sed -e 's/^[^0-9]*//'`" +cf_cv_abi_version=${NCURSES_MAJOR} +cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} + +# Default to char +if [ x${cf_cv_type_of_bool} = x ] +then + cf_cv_type_of_bool=char +fi -rm -f ncurses/codes.c \ +rm -f ncurses/MKterm.h.awk \ + ncurses/codes.c \ ncurses/comp_captab.c \ + ncurses/confdefs.h \ + ncurses/config.log \ ncurses/curses.h \ - ncurses/edit_man.sed \ - ncurses/edit_man.sh \ - ncurses/eti.h \ ncurses/expanded.c \ ncurses/fallback.c \ - ncurses/form.h \ ncurses/hashsize.h \ - ncurses/keys.tries \ + ncurses/init_keytry.h \ ncurses/lib_gen.c \ ncurses/lib_keyname.c \ - ncurses/menu.h \ - ncurses/mf_common.h \ ncurses/names.c \ ncurses/ncurses_cfg.h \ ncurses/nomacros.h \ - ncurses/panel.h \ ncurses/parametrized.h \ - ncurses/run_tic.sh \ ncurses/term.h \ ncurses/termcap.h \ ncurses/terminfo.5 \ ncurses/termsort.c \ ncurses/unctrl.c \ - ncurses/unctrl.h \ - ncurses/config_h + ncurses/unctrl.h # Protect against being on the right side of a sed subst in config.status. sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <%g +s%@cf_cv_rel_version@%$cf_cv_rel_version%g +s%@cf_cv_abi_version@%$cf_cv_abi_version%g +s%@cf_cv_builtin_bool@%1%g +s%@cf_cv_type_of_bool@%$cf_cv_type_of_bool%g +s%@cf_cv_shift_limit@%32%g +s%@cf_cv_widec_shift@%8%g +s%@cf_cv_typeof_chtype@%long%g +s%@cf_cv_1UL@%1UL%g +s%@cf_cv_cc_bool_type@%0%g EOF @@ -85,13 +94,13 @@ if test -z "$nc_sed_cmds"; then nc_sed_cmds=cat fi -NC_CONFIG_FILES=${NC_CONFIG_FILES-"ncurses/config_h ncurses/MKterm.h.awk ncurses/curses.h ncurses/termcap.h ncurses/unctrl.h"} +NC_CONFIG_FILES=${NC_CONFIG_FILES-"ncurses/MKterm.h.awk ncurses/curses.h ncurses/termcap.h ncurses/unctrl.h"} for nc_file in .. $NC_CONFIG_FILES; do if test "x$nc_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$nc_file" in *:*) nc_file_in=`echo "$nc_file"|sed 's%[^:]*:%%'` nc_file=`echo "$nc_file"|sed 's%:.*%%'` ;; - *) nc_file_in=`echo "${nc_file}"| sed 's%ncurses%include%'`.in ;; + *) nc_file_in=`echo "${nc_file}" | sed 's%ncurses%include%'`.in ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. @@ -108,6 +117,21 @@ for nc_file in .. $NC_CONFIG_FILES; do if test "x$nc_file" != x..; then nc_dir_suffix= nc_dots= fi + case "$nc_given_srcdir" in + .) nc_srcdir=. + if test -z "$nc_dots"; then nc_top_srcdir=. + else nc_top_srcdir=`echo $nc_dots|sed 's%/$%%'`; fi ;; + /*) nc_srcdir="$nc_given_srcdir$nc_dir_suffix"; nc_top_srcdir="$nc_given_srcdir" ;; + *) # Relative path. + nc_srcdir="$nc_dots$nc_given_srcdir$nc_dir_suffix" + nc_top_srcdir="$nc_dots$nc_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) NC_INSTALL="$ac_given_INSTALL" ;; + *) NC_INSTALL="$nc_dots$ac_given_INSTALL" ;; + esac + echo creating "$nc_file" rm -f "$nc_file" configure_input="Generated automatically from `echo $nc_file_in|sed 's%.*/%%'` by configure." @@ -117,35 +141,179 @@ for nc_file in .. $NC_CONFIG_FILES; do if test "x$nc_file" != x..; then *) nc_comsub= ;; esac - nc_file_inputs=`echo $nc_file_in|sed -e "s%^%$glibc_nc_srcdir/%" -e "s%:% $glibc_nc_srcdir/%g"` + nc_file_inputs=`echo $nc_file_in|sed -e "s%^%$nc_given_srcdir/%" -e "s%:% $nc_given_srcdir/%g"` sed -e "$nc_comsub s%@configure_input@%$configure_input%g +s%@nc_srcdir@%$nc_srcdir%g +s%@nc_top_srcdir@%$nc_top_srcdir%g +s%@INSTALL@%$NC_INSTALL%g " $nc_file_inputs | (eval "$nc_sed_cmds") > $nc_file fi; done rm -f conftest.s* +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# nc_d sets the value in "#define NAME VALUE" lines. +nc_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +nc_dB='\([ ][ ]*\)[^ ]*%\1#\2' +nc_dC='\3' +nc_dD='%g' +# nc_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +nc_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +nc_uB='\([ ]\)%\1#\2define\3' +nc_uC=' ' +nc_uD='\4%g' +# nc_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +nc_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +nc_eB='$%\1#\2define\3' +nc_eC=' ' +nc_eD='%g' + +NC_CONFIG_HEADERS="ncurses/ncurses_cfg.h:include/ncurses_cfg.hin" +for nc_file in .. $NC_CONFIG_HEADERS; do if test "x$nc_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$nc_file" in + *:*) nc_file_in=`echo "$nc_file"|sed 's%[^:]*:%%'` + nc_file=`echo "$nc_file"|sed 's%:.*%%'` ;; + *) nc_file_in="${nc_file}.in" ;; + esac + + echo creating $nc_file + + rm -f conftest.frag conftest.in conftest.out + nc_file_inputs=`echo $nc_file_in|sed -e "s%^%$nc_given_srcdir/%" -e "s%:% $nc_given_srcdir/%g"` + cat $nc_file_inputs > conftest.in + + rm -f conftest.frag + cat >> conftest.frag <> conftest.frag <> conftest.frag <> conftest.frag <> conftest.frag <> conftest.frag <> conftest.edit < conftest.out +rm -f conftest.in +mv conftest.out conftest.in +rm -f conftest.edit conftest.frag + + rm -f conftest.frag conftest.h + echo "/* $nc_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $nc_file conftest.h 2>/dev/null; then + echo "$nc_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + nc_dir=`echo $nc_file|sed 's%/[^/][^/]*$%%'` + if test "$nc_dir" != "$nc_file" && test "$nc_dir" != .; then + # The file is in a subdirectory. + test ! -d "$nc_dir" && mkdir "$nc_dir" + fi + rm -f $nc_file + mv conftest.h $nc_file + fi +fi; done + SYS_NAME=`uname -a` if test -z "$SYS_NAME"; then SYS_NAME=unknown;fi -AWK=awk -CC="gcc -I${glibc_nc_srcdir}/ncurses -Incurses -I${glibc_nc_srcdir}/include" -CPP="${CC} -E" -NC_LIST_MODELS="normal" -WITH_ECHO="yes" -WITH_OVERWRITE="yes" +NC_AWK=awk +BUILD_CC=${BUILD_CC-gcc} +NC_CC="${BUILD_CC} -I${nc_given_srcdir}/ncurses -Incurses -I${nc_given_srcdir}/include" +NC_CPP="${NC_CC} -E" +CF_LIST_MODELS="normal" +#WITH_ECHO="yes" +#WITH_OVERWRITE="yes" nc_cxx_library="yes" -nc_cv_systype="Linux" -nc_cv_rel_version="4.1" -nc_cv_abi_version="4" -nc_cv_do_symlinks="yes" -nc_cv_rm_so_locs="no" - - - - - - +cf_cv_systype="Linux" +cf_cv_rel_version="4.2" +cf_cv_abi_version="4" +cf_cv_do_symlinks="yes" +cf_cv_rm_so_locs="no" rm -f headers.sed headers.sh @@ -190,84 +358,51 @@ NC_EOF chmod 0755 headers.sh -### Special editing. We generate ncurses_cfg.h directly to allow all filenames -### to be MSDOS-compatible, as well as to make the list of definitions be -### dynamically determined by the configuration script -- a consideration when -### doing type-clean development testing. - -echo creating ncurses/ncurses_cfg.h -rm -f ncurses/ncurses_cfg.h -echo "/* generated by configure-script - * On host: $SYS_NAME - */ -#ifndef NC_CONFIG_H -#define NC_CONFIG_H" >ncurses/ncurses_cfg.h -sed -e '/^ -D/!d' \ - -e 's/ -D/\ -#define /g' \ - -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1 /g' \ - -e 's/\\//g' \ - ncurses/config_h | sort >>ncurses/ncurses_cfg.h -echo " - /* The C compiler may not treat these properly, but C++ has to */ -#ifdef __cplusplus -#undef const -#undef inline -#else -#if defined(lint) || defined(TRACE) -#undef inline -#define inline /* nothing */ -#endif -#endif - -#endif /* NC_CONFIG_H */" >> ncurses/ncurses_cfg.h -echo removing ncurses/config_h -rm ncurses/config_h - echo creating ncurses/term.h -${AWK} -f ncurses/MKterm.h.awk ${glibc_nc_srcdir}/include/Caps > ncurses/term.h -sh ${glibc_nc_srcdir}/include/edit_cfg.sh ncurses/ncurses_cfg.h ncurses/term.h +${NC_AWK} -f ncurses/MKterm.h.awk ${nc_given_srcdir}/include/Caps > ncurses/term.h +sh ${nc_given_srcdir}/include/edit_cfg.sh ncurses/ncurses_cfg.h ncurses/term.h echo creating ncurses/hashsize.h -sh ${glibc_nc_srcdir}/include/MKhashsize.sh ${glibc_nc_srcdir}/include/Caps > ncurses/hashsize.h +sh ${nc_given_srcdir}/include/MKhashsize.sh ${nc_given_srcdir}/include/Caps > ncurses/hashsize.h echo creating ncurses/parametrized.h -sh ${glibc_nc_srcdir}/include/MKparametrized.sh ${glibc_nc_srcdir}/include/Caps > ncurses/parametrized.h +sh ${nc_given_srcdir}/include/MKparametrized.sh ${nc_given_srcdir}/include/Caps > ncurses/parametrized.h echo creating ncurses/termsort.c -sh ${glibc_nc_srcdir}/progs/MKtermsort.sh "${AWK}" ${glibc_nc_srcdir}/include/Caps > ncurses/termsort.c +sh ${nc_given_srcdir}/progs/MKtermsort.sh "${NC_AWK}" ${nc_given_srcdir}/include/Caps > ncurses/termsort.c echo creating ncurses/fallback.c -sh ${glibc_nc_srcdir}/ncurses/MKfallback.sh > ncurses/fallback.c +sh ${nc_given_srcdir}/ncurses/tinfo/MKfallback.sh > ncurses/fallback.c echo creating ncurses/lib_gen.c -sh ${glibc_nc_srcdir}/ncurses/MKlib_gen.sh "${CPP}" "${AWK}" < ncurses/curses.h > ncurses/lib_gen.c +sh ${nc_given_srcdir}/ncurses/base/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h > ncurses/lib_gen.c echo creating ncurses/nomacros.h -sh ${glibc_nc_srcdir}/ncurses/MKlib_gen.sh "${CPP}" "${AWK}" < ncurses/curses.h | fgrep undef > ncurses/nomacros.h - -echo creating ncurses/keys.tries -${AWK} -f ${glibc_nc_srcdir}/ncurses/MKkeys.awk ${glibc_nc_srcdir}/ncurses/keys.list > ncurses/keys.tries +sh ${nc_given_srcdir}/ncurses/base/MKlib_gen.sh "${NC_CPP}" "${NC_AWK}" < ncurses/curses.h | fgrep undef > ncurses/nomacros.h echo creating ncurses/expanded.c -sh ${glibc_nc_srcdir}/ncurses/MKexpanded.sh "${CPP}" -mv expanded.c ncurses/expanded.c +sh ${nc_given_srcdir}/ncurses/tty/MKexpanded.sh "${NC_CPP}" >ncurses/expanded.c echo creating ncurses/comp_captab.c -${CC} -o make_hash -DMAIN_PROGRAM ${glibc_nc_srcdir}/ncurses/comp_hash.c -sh ${glibc_nc_srcdir}/ncurses/MKcaptab.awk "${AWK}" ${glibc_nc_srcdir}/include/Caps > ncurses/comp_captab.c +${NC_CC} -o make_hash -DMAIN_PROGRAM ${nc_given_srcdir}/ncurses/tinfo/comp_hash.c +sh ${nc_given_srcdir}/ncurses/tinfo/MKcaptab.awk "${NC_AWK}" ${nc_given_srcdir}/include/Caps > ncurses/comp_captab.c rm -f make_hash echo creating ncurses/lib_keyname.c -${AWK} -f ${glibc_nc_srcdir}/ncurses/MKkeyname.awk ${glibc_nc_srcdir}/ncurses/keys.list > ncurses/lib_keyname.c +${NC_AWK} -f ${nc_given_srcdir}/ncurses/base/MKkeyname.awk ${nc_given_srcdir}/ncurses/tinfo/keys.list > ncurses/lib_keyname.c echo creating ncurses/names.c and ncurses/codes.c -${AWK} -f ${glibc_nc_srcdir}/ncurses/MKnames.awk ${glibc_nc_srcdir}/include/Caps +${NC_AWK} -f ${nc_given_srcdir}/ncurses/tinfo/MKnames.awk ${nc_given_srcdir}/include/Caps cat namehdr boolnames boolfnames numnames numfnames strnames strfnames nameftr >ncurses/names.c cat namehdr boolcodes numcodes strcodes codeftr > ncurses/codes.c rm -f namehdr nameftr codeftr boolnames boolfnames boolcodes numnames numfnames numcodes strnames strfnames strcodes +echo creating ncurses/init_keytry.h +${NC_CC} -o make_key ${nc_given_srcdir}/ncurses/tinfo/make_keys.c +./make_key ${nc_given_srcdir}/ncurses/keys.list > ncurses/init_keytry.h +rm -f make_key + echo creating ncurses/unctrl.c -echo | ${AWK} -f ${glibc_nc_srcdir}/ncurses/MKunctrl.awk > ncurses/unctrl.c +echo | ${NC_AWK} -f ${nc_given_srcdir}/ncurses/base/MKunctrl.awk > ncurses/unctrl.c echo creating ncurses/terminfo.5 -sh ${glibc_nc_srcdir}/man/MKterminfo.sh ${glibc_nc_srcdir}/man/terminfo.head ${glibc_nc_srcdir}/include/Caps ${glibc_nc_srcdir}/man/terminfo.tail > ncurses/terminfo.5 +sh ${nc_given_srcdir}/man/MKterminfo.sh ${nc_given_srcdir}/man/terminfo.head ${nc_given_srcdir}/include/Caps ${nc_given_srcdir}/man/terminfo.tail > ncurses/terminfo.5