Lines Matching +full:sub +full:- +full:system

3 # -----------------------------------------------------------------------------
31 # -----------------------------------------------------------------------------
32 # https://invisible-island.net/ncurses/ncurses-openbsd.html
34 # Update the OpenBSD source-tree given an ncurses tarball or build-tree.
106 sub patchdate() {
110 sub failed($) {
116 sub verbose($) {
121 sub read_file($) {
130 sub read_dir($) {
138 next if ( -l $path . "/" . $data[$d] );
145 sub rename_dir($$) {
148 printf "%% mv %s -> %s\n", $src, $dst if ($opt_v);
152 sub check_sourcedir($) {
154 &failed("not a directory: $path") unless ( -d $path );
157 &failed("not an ncurses source-tree: $path")
158 unless ( -f "NEWS" and -f "dist.mk" );
162 sub unpack($) {
170 $command = "unzip -q %s";
173 &failed("not a gzip'd tarball or zip-file: $path");
176 system( sprintf( $command, $full ) );
178 # there should be exactly one subdirectory -- the source-tree
186 sub remove_dir($) {
188 if ( -d $tree ) {
189 printf "%% rm -rf %s\n", $tree if ($opt_v);
194 sub copy_CVS($) {
199 if ( -d $src and !-d $dst ) {
201 mkdir $mid unless ( -d $mid );
202 mkdir $dst unless ( -d $dst );
203 system("cp -a$verbose $src/* $dst/");
207 sub is_tic_code($) {
223 sub is_ident($$) {
231 # We "could", filter out differences with ident's using the diff -I option,
233 sub munge_ident($) {
238 return unless ( -f $source );
244 my $skipit = -1;
279 system("chmod u+w $target");
285 system("chmod u-w $target");
292 sub munge_docs($) {
333 system("chmod u+w $path");
339 system("chmod u-w $path");
344 sub copy_file($$) {
348 if ( -d $dst ) {
353 system("chmod u+w $dst") if ( -f $dst );
354 system("cp -a$verbose $src $dst");
358 sub copy_code($) {
369 next if ( -d $src_item );
370 next if ( -l $src_item );
373 next if ( $item =~ /^llib-/ );
411 system( sprintf( "cp -a$verbose %s %s/%s", $src_item, $dst, $item ) );
416 # Checking if nroff supports tables is a long-obsolete issue, and is not really
417 # necessary, except to match OpenBSD's source-tree.
418 sub uses_tables($) {
434 sub copy_1doc($$) {
438 $src .= "m" if ( -f "${src}m" );
448 sub copy_docs($) {
491 sub setup_dir($) {
504 elsif ( -d $backup_dir ) {
513 # reuse the shared-library version, assuming ABI=5 would involve at
514 # most a minor-version bump.
524 sub do_build($) {
527 system($command);
530 sub finish_dir() {
532 system("diff -Naurb $target_dir $update_dir | diffstat -n 30")
533 if ( -d $target_dir );
535 &do_build("cd $update_dir && make -n") if ($opt_x);
538 if ( -d $backup_dir ) {
551 sub only_c_files($) {
561 sub makefile_list($$$) {
595 sub manpage_list($) {
606 sub columns_of($) {
609 for my $n ( 0 .. length($string) - 1 ) {
625 sub format_list($$) {
667 sub compare_makefiles($) {
671 ( -d $backup_dir ? $backup_dir : $target_dir ) . "/Makefile";
672 system("diff -u $bakfile $newfile") if ( -f $bakfile );
676 # The curses makefile has to build build-time utilities and generate source.
677 sub gen_1st_makefile() {
695 #CURSESTRACE=-DTRACE
700 # XXX - should be defined elsewhere
718 HOSTCFLAGS+= -I. -I\${.CURDIR} \${CURSESTRACE}
719 CFLAGS+= -I. -I\${.CURDIR} \${CURSESTRACE} -D_XOPEN_SOURCE_EXTENDED -DNDEBUG
738 \@cmp -s \${DESTDIR}/usr/include/ncurses.h \${.CURDIR}/curses.h || \\
739 \${INSTALL} \${INSTALL_COPY} -m 444 -o \$(BINOWN) -g \$(BINGRP) \\
742 cmp -s \$\$i \${DESTDIR}/usr/include/\$\$i || \\
743 \${INSTALL} \${INSTALL_COPY} -m 444 -o \$(BINOWN) -g \$(BINGRP) \$\$i \\
753 sh \${.CURDIR}/base/MKlib_gen.sh "\${CC} -E -P -I\${.CURDIR}" \\
761 -o \${.TARGET} \${.CURDIR}/tinfo/make_keys.c \${LDADD}
769 \${HOSTCC} \${LDSTATIC} \${HOSTCFLAGS} -DMAIN_PROGRAM \${HOSTLDFLAGS} \\
770 -o \${.TARGET} \${.CURDIR}/tinfo/make_hash.c \${LDADD}
778 \${HOSTCC} \${LDSTATIC} \${HOSTCFLAGS} -DMAIN_PROGRAM \${HOSTLDFLAGS} \\
779 -o \${.TARGET} \${.CURDIR}/tinfo/comp_hash.c \${LDADD}
785 CAPLIST += \${.CURDIR}/Caps-ncurses
797 sh \${.CURDIR}/tty/MKexpanded.sh "\${CC} -E -P" \${CPPFLAGS} > \${.TARGET}
804 \${AWK} -f \${.CURDIR}/base/MKkeyname.awk \\
809 \${AWK} -f \${.CURDIR}/tinfo/MKnames.awk \\
813 \${AWK} -f \${.CURDIR}/tinfo/MKcodes.awk \\
818 echo | \${AWK} -f \${.CURDIR}/base/MKunctrl.awk bigstrings=1 > \${.TARGET}
824 -cd \${DESTDIR}\${LIBDIR}; \\
826 ln -f \$\$i `echo \$\$i | sed 's/curses/termlib/'`; \\
827 ln -f \$\$i `echo \$\$i | sed 's/curses/termcap/'`; \\
828 ln -f \$\$i `echo \$\$i | sed 's/curses/ncurses/'`; \\
829 ln -f \$\$i `echo \$\$i | sed 's/curses/ncursesw/'`; \\
838 sub gen_lib_makefile($) {
843 # in ncurses, header-files are quasi-generated, because the original
844 # header file for form/menu/panel lives in the source-directory, but is
845 # copied to the include-directory with "make sources".
860 my $includes = '-I${.CURDIR}/../libcurses';
861 $includes .= ' -I${.CURDIR}/../libmenu' if ( $libname eq "form" );
863 CFLAGS+=$includes -D_XOPEN_SOURCE_EXTENDED -DNDEBUG
871 cmp -s \$\$i \${DESTDIR}/usr/include/\$\$i || \\
872 \${INSTALL} \${INSTALL_COPY} -m 444 -o \$(BINOWN) -g \$(BINGRP) \$\$i \\
878 -cd \${DESTDIR}\${LIBDIR}; \\
880 ln -f \$\$i `echo \$\$i | sed 's/${libname}/${libname}w/'`; \\
889 sub gen_bin_makefile($) {
925 # transform.h also is generated, but OpenBSD checked-in a copy
955 LDADD= -L\${CURSES} -lcurses\t# in-tree link to add _nc_strict_bsd, etc
968 CFLAGS+= -I\${CURSES} -I\${.CURDIR} -I.
975 CFLAGS+= -I\${CURSES} -I\${TIC} -I\${.CURDIR} -I.
1004 sub setup_lib_libcurses() {
1031 system( "sed -i"
1032 . " -e 's,^shift,test \$# != 0 \\&\\& shift,'"
1036 # system version. Just trim it.
1038 system( "sed -i"
1039 . " -e '/__FreeBSD_version/s,|| defined(__OpenBSD__),,'"
1055 &copy_file( "$source_dir/include/Caps-ncurses", $update_dir )
1062 sub setup_lib_libform() {
1070 sub setup_lib_libmenu() {
1078 sub setup_lib_libpanel() {
1086 sub setup_bin_infocmp() {
1094 sub setup_bin_tabs() {
1102 sub setup_bin_tic() {
1128 sub setup_bin_toe() {
1136 sub setup_bin_tput() {
1144 sub setup_bin_tset() {
1152 sub setup_terminfo() {
1158 # build the terminfo database using the in-tree tic.
1165 &verbose(".. changing makefile to use in-tree tic");
1166 system( "sed -i -E "
1167 . "-e 's,(TIC=).*,\\1\t$prog,' "
1168 . "-e 's,(\\\${TIC}),LD_LIBRARY_PATH=$libs \\1,' "
1175 sub configure_tree() {
1176 return if ( -f "ncurses/Makefile" );
1179 $prefix[ ++$#prefix ] = "--with-abi-version=5"
1182 "--with-ospeed=int", #
1183 "--with-shared", #
1184 "--without-normal", #
1185 "--without-debug", #
1186 "--with-terminfo-dirs=" . join( ':', @search ), #
1187 "--without-ada", #
1188 "--disable-hard-tabs", #
1189 "--enable-const", #
1190 "--enable-getcap", #
1191 "--enable-bsdpad", #
1192 "--enable-signed-char", #
1193 "--enable-termcap", #
1194 "--enable-widec", #
1195 "--disable-setuid-environ"
1197 $options[ ++$#options ] = "--with-trace" if ($opt_t);
1198 $options[ ++$#options ] = "--enable-string-hacks"
1200 system( join( ' ', @prefix ) . ' ' . join( ' ', @options ) );
1201 &failed("problem with configuring") unless ( -f "ncurses/Makefile" );
1203 system("make sources");
1207 system( "sed -i" . " -E"
1208 . " -e '/TYPEOF_CHTYPE/s,int,long,'"
1209 . " -e '/USE_TERMCAP/d'"
1210 . " -e '/HAVE_LIB(FORM|MENU|PANEL)/s,^(.*)\$,/* \\1 */,'"
1211 . " -e 's/TERMPATH.*/PURE_TERMINFO 0/'"
1212 . " -e '/SYSTEM_NAME/s,\[0-9.\]+,,'"
1216 sub get_definitions() {
1232 sub setup_all_dirs() {
1233 printf "** %s all build-directories\n", $opt_r ? "removing" : "setting up";
1242 &setup_bin_tabs if ( -f "$source_dir/progs/tabs.c" );
1249 sub usage() {
1254 -6 use ABI 6 rather than 5 if available
1255 -d DST specify destination (default: /usr/src)
1256 -n no-op, do not update destination
1257 -r remove update, restore sources from ".orig"
1258 -t enable ncurses trace
1259 -v verbose
1260 -x build each directory after setting up
1271 if ( -f $ARGV[0] ) {
1285 # move out of temp-directory to allow cleanup.