From 0a11c4b5a5e3d5c0a375b1d14ed1771e5b4f12bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Sun, 28 Nov 2021 00:24:36 +0200 Subject: [PATCH] Add sortix.c to the build system --- Makefile.am | 2 +- Makefile.in | 6 ++- acconfig.h | 3 ++ config.h.in | 15 ++++++++ configure | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 13 +++++++ drivers.c | 7 ++++ sortix.c | 9 +++++ 8 files changed, 159 insertions(+), 3 deletions(-) create mode 100644 sortix.c diff --git a/Makefile.am b/Makefile.am index 9e0bd83..85f0f58 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,7 +24,7 @@ if JAVASCRIPT links_LDADD=builtin.o context.o ipret.o javascr.o javascript.o md5.o md5hl.o ns.o pomocny.o regexp.o endif -links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c fontconf.c font_inc.c framebuf.c freetype.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc +links_SOURCES=af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c fontconf.c font_inc.c framebuf.c freetype.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c sortix.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc # builtin.c context.c ipret.c javascr.c javascript.c md5.c md5hl.c ns.c pomocny.c regexp.c md5.h ns.h struct.h tree.h typy.h ipret.h javascript.h builtin.h builtin_keys.h dist-hook: diff --git a/Makefile.in b/Makefile.in index 6316782..3884e60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,7 +76,7 @@ bin_PROGRAMS = links @HAIKU_GR_TRUE@links_LDADD = haiku.o @JAVASCRIPT_TRUE@links_LDADD = builtin.o context.o ipret.o javascr.o javascript.o md5.o md5hl.o ns.o pomocny.o regexp.o -links_SOURCES = af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c fontconf.c font_inc.c framebuf.c freetype.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc +links_SOURCES = af_unix.c auth.c beos.c bfu.c block.c bookmark.c cache.c charsets.c compress.c connect.c cookies.c data.c default.c dip.c directfb.c dither.c dns.c dos.c drivers.c error.c file.c finger.c fn_impl.c fontconf.c font_inc.c framebuf.c freetype.c ftp.c gif.c grx.c hpux.c html.c html_gr.c html_r.c html_tbl.c http.c https.c img.c imgcache.c jpeg.c jsint.c kbd.c language.c listedit.c lru.c mailto.c main.c memory.c menu.c objreq.c os_dep.c pmshell.c png.c sched.c select.c session.c smb.c sortix.c string.c suffix.c svg.c svgalib.c terminal.c tiff.c types.c url.c view.c view_gr.c vms.c x.c xbm.c beos.h bits.h cfg.h codepage.h com-defs.h config-vms.h dfb_cur.h hpux.h language.h links.h os_dep.h os_depx.h setup.h arrow.inc certs.inc codepage.inc entity.inc fbcommon.inc language.inc links_ic.inc locase.inc suffix.inc suffix_x.inc uni_7b.inc upcase.inc vpipe.inc CXXFLAGS = @CXXFLAGS@ @@ -99,7 +99,7 @@ fn_impl.o fontconf.o font_inc.o framebuf.o freetype.o ftp.o gif.o grx.o \ hpux.o html.o html_gr.o html_r.o html_tbl.o http.o https.o img.o \ imgcache.o jpeg.o jsint.o kbd.o language.o listedit.o lru.o mailto.o \ main.o memory.o menu.o objreq.o os_dep.o pmshell.o png.o sched.o \ -select.o session.o smb.o string.o suffix.o svg.o svgalib.o terminal.o \ +select.o session.o smb.o sortix.o string.o suffix.o svg.o svgalib.o terminal.o \ tiff.o types.o url.o view.o view_gr.o vms.o x.o xbm.o @ATHEOS_GR_TRUE@links_DEPENDENCIES = atheos.o @JAVASCRIPT_TRUE@links_DEPENDENCIES = builtin.o context.o ipret.o \ @@ -457,6 +457,8 @@ session.o: session.c links.h cfg.h config.h com-defs.h os_dep.h \ os_depx.h setup.h language.h codepage.h smb.o: smb.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ setup.h language.h codepage.h +sortix.o: sortix.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ + setup.h language.h codepage.h string.o: string.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ setup.h language.h codepage.h suffix.o: suffix.c links.h cfg.h config.h com-defs.h os_dep.h os_depx.h \ diff --git a/acconfig.h b/acconfig.h index be88567..87a7609 100644 --- a/acconfig.h +++ b/acconfig.h @@ -229,6 +229,9 @@ /* */ #undef GRDRV_GRX +/* */ +#undef GRDRV_SORTIX + /* Have freetype */ #undef HAVE_FREETYPE diff --git a/config.h.in b/config.h.in index 19d7cd8..a742cd8 100644 --- a/config.h.in +++ b/config.h.in @@ -215,6 +215,9 @@ /* Define if you have the dirfd function. */ #undef HAVE_DIRFD +/* Define if you have the header file. */ +#undef HAVE_DISPLAY_H + /* Define if you have the event_base_free function. */ #undef HAVE_EVENT_BASE_FREE @@ -596,6 +599,9 @@ /* Define if you have the header file. */ #undef HAVE_FONTCONFIG_FONTCONFIG_H +/* Define if you have the header file. */ +#undef HAVE_FRAMEBUFFER_H + /* Define if you have the header file. */ #undef HAVE_FT2BUILD_H @@ -764,6 +770,9 @@ /* Define if you have the header file. */ #undef HAVE_SYS_IOCTL_H +/* Define if you have the header file. */ +#undef HAVE_SYS_KEYCODES_H + /* Define if you have the header file. */ #undef HAVE_SYS_MMAN_H @@ -848,6 +857,9 @@ /* Define if you have the bz2 library (-lbz2). */ #undef HAVE_LIBBZ2 +/* Define if you have the display library (-ldisplay). */ +#undef HAVE_LIBDISPLAY + /* Define if you have the dl library (-ldl). */ #undef HAVE_LIBDL @@ -1173,6 +1185,9 @@ /* */ #undef GRDRV_GRX +/* */ +#undef GRDRV_SORTIX + /* Have freetype */ #undef HAVE_FREETYPE diff --git a/configure b/configure index 76331bf..12dc13d 100755 --- a/configure +++ b/configure @@ -69,6 +69,8 @@ ac_help="$ac_help --without-haiku compile without Haiku graphics driver" ac_help="$ac_help --without-grx compile without DOS GRX graphics driver" +ac_help="$ac_help + --without-sortix compile without Sortix display(1) graphics driver" ac_help="$ac_help --with-x use the X Window System" ac_help="$ac_help @@ -8392,6 +8394,12 @@ if test "${with_grx+set}" = set; then if test "$withval" = no; then disable_grx=yes; else disable_grx=no; fi fi +# Check whether --with-sortix or --without-sortix was given. +if test "${with_sortix+set}" = set; then + withval="$with_sortix" + if test "$withval" = no; then disable_sortix=yes; else disable_sortix=no; fi +fi + drivers="" @@ -10416,6 +10424,105 @@ EOF fi fi +if test "$disable_sortix" != yes; then + for ac_hdr in display.h framebuffer.h sys/keycodes.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:10432: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:10442: \"$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 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + echo $ac_n "checking for display_connect_default in -ldisplay""... $ac_c" 1>&6 +echo "configure:10469: checking for display_connect_default in -ldisplay" >&5 +ac_lib_var=`echo display'_'display_connect_default | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldisplay $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo display | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + if test "$ac_cv_header_display_h" = yes && + test "$ac_cv_header_framebuffer_h" = yes && + test "$ac_cv_header_sys_keycodes_h" = yes && + test "$ac_cv_lib_display_display_connect_default" = yes; then + cat >> confdefs.h <<\EOF +#define GRDRV_SORTIX 1 +EOF + + drivers="$drivers sortix" + fi +fi # Check whether --with-freetype or --without-freetype was given. if test "${with_freetype+set}" = set; then diff --git a/configure.in b/configure.in index 5832504..2eeed7b 100644 --- a/configure.in +++ b/configure.in @@ -1049,6 +1049,7 @@ AC_ARG_WITH(windows, [ --without-windows compile without Windows graphics AC_ARG_WITH(atheos, [ --without-atheos compile without Atheos graphics driver],[if test "$withval" = no; then disable_atheos=yes; else disable_atheos=no; fi]) AC_ARG_WITH(haiku, [ --without-haiku compile without Haiku graphics driver],[if test "$withval" = no; then disable_haiku=yes; else disable_haiku=no; fi]) AC_ARG_WITH(grx, [ --without-grx compile without DOS GRX graphics driver],[if test "$withval" = no; then disable_grx=yes; else disable_grx=no; fi]) +AC_ARG_WITH(sortix, [ --without-sortix compile without Sortix display(1) graphics driver],[if test "$withval" = no; then disable_sortix=yes; else disable_sortix=no; fi]) drivers="" @@ -1311,6 +1312,18 @@ if test "$disable_grx" != yes -a "$ac_cv_have_djgpp" = yes; then fi fi +if test "$disable_sortix" != yes; then + AC_CHECK_HEADERS(display.h framebuffer.h sys/keycodes.h) + AC_CHECK_LIB(display, display_connect_default) + if test "$ac_cv_header_display_h" = yes && + test "$ac_cv_header_framebuffer_h" = yes && + test "$ac_cv_header_sys_keycodes_h" = yes && + test "$ac_cv_lib_display_display_connect_default" = yes; then + AC_DEFINE(GRDRV_SORTIX) + drivers="$drivers sortix" + fi +fi + AC_ARG_WITH(freetype, [ --without-freetype compile without freetype support],[if test "$withval" = no; then disable_freetype=yes; else disable_freetype=no; fi]) font_rendering=INTERNAL diff --git a/drivers.c b/drivers.c index ee86df1..2b1cc10 100644 --- a/drivers.c +++ b/drivers.c @@ -40,6 +40,10 @@ extern struct graphics_driver grx_driver; #ifdef GRDRV_SDL extern struct graphics_driver sdl_driver; #endif +#ifdef GRDRV_SORTIX +extern struct graphics_driver sortix_driver; +#endif + /* * On SPAD you must test first svgalib and then X (because X test is slow). @@ -82,6 +86,9 @@ static struct graphics_driver *graphics_drivers[] = { #endif #ifdef GRDRV_SDL &sdl_driver, +#endif +#ifdef GRDRV_SORTIX + &sortix_driver, #endif NULL }; diff --git a/sortix.c b/sortix.c new file mode 100644 index 0000000..5441706 --- /dev/null +++ b/sortix.c @@ -0,0 +1,9 @@ +#include "cfg.h" + +#ifdef GRDRV_SORTIX + +#include "links.h" + +struct graphics_driver sortix_driver; + +#endif /* GRDRV_SORTIX */