# -*- mode:sh; sh-basic-offset:2; tab-width:2; indent-tabs-mode:t -*- AC_INIT() AC_CONFIG_HEADER(common/c_config.h) AC_CONFIG_AUX_DIR(script) AC_CANONICAL_HOST AC_CANONICAL_BUILD # for CFLAGS="..." ./configure ... AC_SUBST(CFLAGS) if test -d ${top_srcdir-$srcdir}/encodefilter -a -d ${top_srcdir-$srcdir}/baselib ; then SUBDIRS="baselib encodefilter" MEF_CFLAGS='-I${top_builddir}/encodefilter/include' POBL_CFLAGS='-I${top_builddir}/baselib/include' LMEF='${top_builddir}/encodefilter/src/libmef.la' LPOBL='${top_builddir}/baselib/src/libpobl.la' elif test -d ${top_srcdir-$srcdir}/../../encodefilter -a -d ${top_srcdir-$srcdir}/../../baselib ; then # --with-gui=xlib,fb => cd fb ; --with-gui=fb MEF_CFLAGS='-I${top_builddir}/../../encodefilter/include' POBL_CFLAGS='-I${top_builddir}/../../baselib/include' LMEF='${top_builddir}/../../encodefilter/src/libmef.la' LPOBL='${top_builddir}/../../baselib/src/libpobl.la' else LMEF="-lmef" LPOBL="-lpobl" fi AC_SUBST(LMEF) AC_SUBST(MEF_CFLAGS) AC_SUBST(LPOBL) AC_SUBST(POBL_CFLAGS) AC_CHECK_TOOL(PKG_CONFIG, pkg-config) AC_ARG_WITH(ios-sdk, [ --with-ios-sdk@<:@=ARG@:>@ iOS SDK (e.g. iphoneos4.3 iphonesimulator4.3) ], ios_sdk=$with_ios_sdk) if test "$ios_sdk" != ""; then AC_CHECK_PROG(XCRUN, xcrun, xcrun) if test "$XCRUN" != ""; then if test "$SDKROOT" = ""; then SDKROOT=`$XCRUN --sdk $ios_sdk --show-sdk-path` fi if test "$CC" = ""; then # Do 'export' for baselib/configure and encodefilter/configure. export CC="`$XCRUN --sdk $ios_sdk -f cc` -isysroot $SDKROOT" simver=`echo $ios_sdk|sed -n 's/^iphonesimulator\(@<:@0-9.@:>@*\)$/\1/p'` if test "$simver" != ""; then case "$simver" in @<:@0-4@:>@.*) # -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 or something like that # should be defined as the value of CFLAGS environmental variable # before ./configure. ;; *) CC="$CC -mios-simulator-version-min=$simver" ;; esac fi fi AC_ARG_WITH(ios-arch, [ --with-ios-arch@<:@=ARG@:>@ iOS architectures (e.g. arm7v x86_64,i686) ], ios_arch=$with_ios_arch) if test "$ios_arch" != ""; then ios_arch=`echo ${ios_arch} | sed 's/,/ /g'` for arch in $ios_arch; do CC="$CC -arch $arch" done fi if test "$CPP" = ""; then export CPP="$CC -E" fi if test "$RANLIB" = ""; then export RANLIB=`$XCRUN --sdk $ios_sdk -f ranlib` fi if test "$LIBTOOL" = ""; then export LIBTOOL=`$XCRUN --sdk $ios_sdk -f libtool` fi if test "$AR" = ""; then export AR=`$XCRUN --sdk $ios_sdk -f ar` fi fi XCRUN= fi AC_PROG_CC # mlimgloader (gdiplus.cpp) and SCIM AC_PROG_CXX AC_PROG_INSTALL AC_C_INLINE AC_LIBTOOL_WIN32_DLL AC_LIBTOOL_DLOPEN AC_ARG_WITH(libtool, [ --with-libtool@<:@=ARG@:>@ libtool path @<:@default=without@:>@], libtool=$with_libtool) if test "${libtool}" != "" ; then LIBTOOL=${libtool} else AM_PROG_LIBTOOL LIBTOOL='${top_builddir}/libtool' fi AC_SUBST(LIBTOOL) AC_CHECK_LIB(socket,connect,SOCK_LIBS=-lsocket) AC_SUBST(SOCK_LIBS) AC_PATH_XTRA if test "$have_x" = "yes"; then X_CFLAGS_AUX="-DHAVE_XLIB" X_LIBS="$X_LIBS -lX11" AC_SUBST(X_CFLAGS_AUX) fi AC_ARG_ENABLE(debug, [ --enable-debug debug @<:@default=disabled@:>@], debug=$enable_debug) if test "$debug" = "yes" ; then DEB_CFLAGS="-DDEBUG -DBL_DEBUG" fi AC_SUBST(DEB_CFLAGS) AC_SUBST(OPT_CFLAGS) MLTERM_FB="mlterm-fb" AC_ARG_WITH(gui, [ --with-gui@<:@=ARG@:>@ gui library (xlib|win32|fb|quartz|console|wayland|sdl2|beos)], gui=$with_gui) if test `echo $gui | grep ,`; then gui_list=`echo $gui | sed 's/,/ /g'` is_first=t mkdir -p ${top_srcdir-$srcdir}/gui for g in $gui_list; do if test $is_first; then gui=$g is_first= else SUBDIRS="${SUBDIRS} gui/$g" MAKE_DIRS="${MAKE_DIRS} gui/$g" if test -d ${top_srcdir-$srcdir}/gui/$g ; then echo "" echo "** WARNING **" echo "${top_srcdir-$srcdir}/gui/$g exists, so copy no files for $g." echo "If there are files which should be copied, copy them manually." echo "" else mkdir -p ${top_srcdir-$srcdir}/gui/$g # clone source tree to build both mlterm, mlterm-wl, mlterm-fb, mlterm-con and mlterm-sdl2. for file in ChangeLog Makefile.in common configure etc gtk inputmethod java \ main man vtemu script scrollbar uitoolkit doc libvterm; do cp -R ${top_srcdir-$srcdir}/$file ${top_srcdir-$srcdir}/gui/$g/ done mkdir -p ${top_srcdir-$srcdir}/gui/$g/contrib cp -R ${top_srcdir-$srcdir}/contrib/scrollbar ${top_srcdir-$srcdir}/gui/$g/contrib/ fi fi done elif test "$gui" = "subdir"; then gui=`basename $PWD` if test "$gui" = "wscons"; then MLTERM_FB="mlterm-wscons" elif test "$gui" = "x68kgrf"; then MLTERM_FB="mlterm-x68kgrf" elif test "$gui" = "scpc98"; then MLTERM_FB="mlterm-scpc98" fi fi AC_SUBST(MLTERM_FB) if test "$gui" = "wscons"; then gui="fb" fbtype="wscons" elif test "$gui" = "x68kgrf"; then gui="fb" fbtype="x68kgrf" elif test "$gui" = "scpc98"; then gui="fb" fbtype="pc98" fi if test "$gui" = "fb" ; then MAKE_DIRS="doc/kbd ${MAKE_DIRS}" OUTPUT_FILES="doc/kbd/Makefile ${OUTPUT_FILES}" fi ml_cv_is_posix="yes" case "${host_os}" in mingw*) CYGPATHW=echo WIN32TAG=_win32 if test ! -f "/lib/libmsys-1.0.dll.a" ; then case "${lt_cv_path_LD}" in *-msys*) ;; *) ml_cv_is_posix="no" ;; esac fi if test "$gui" != "sdl2" -a "$gui" != "win32" ; then echo "$gui is not supported in ${host_os}. Use win32." gui="win32" fi ;; msys*) # msys2 AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo) WIN32TAG=_win32 # $have_x is defined in AC_PATH_XTRA. if test "$have_x" = "yes" ; then if test "$gui" = "" ; then gui="xlib" elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then echo "$gui is not supported in ${host_os}. Use win32." gui="win32" fi else if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then echo "$gui is not supported in ${host_os}. Use win32." gui="win32" fi fi ;; cygwin*) AC_CHECK_PROG(CYGPATHW,cygpath,cygpath -w,echo) WIN32TAG=_win32 case "${CC} ${CFLAGS}" in *mno-cygwin* | *-mingw*) ml_cv_is_posix="no" ;; *) ;; esac # $have_x is defined in AC_PATH_XTRA. if test "$have_x" = "yes" ; then if test "$gui" = "" ; then gui="xlib" elif test "$gui" != "xlib" -a "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then echo "$gui is not supported in ${host_os}. Use win32." gui="win32" fi else if test "$gui" != "win32" -a "$gui" != "console" -a "$gui" != "sdl2"; then echo "$gui is not supported in ${host_os}. Use win32." gui="win32" fi fi ;; *) CYGPATHW=echo if test "$gui" != "xlib" -a "$gui" != "fb" -a "$gui" != "console" -a "$gui" != "quartz" -a "$gui" != "wayland" -a "$gui" != "sdl2" -a "$gui" != "beos"; then if test "$gui" != "" ; then echo "$gui is not supported in ${host_os}. xlib is used instead." fi gui="xlib" fi # $have_x is defined in AC_PATH_XTRA. if test "$gui" = "xlib" -a "$have_x" != "yes" ; then echo "" echo "** ERROR **" echo "Could not find xlib." echo "" exit 1 fi ;; esac # for java/Makefile.in AC_SUBST(WIN32TAG) AC_SUBST(CYGPATHW) if test "$ml_cv_is_posix" = "yes" -o "$debug" = "yes" ; then SUBSYSTEM="-Wl,--subsystem,console" fi AC_SUBST(SUBSYSTEM) if test "$with_gnu_ld" = "yes" ; then DEXPORT="-Wl,--version-script=\$(VPATH)/dexport.map" elif test "`$LD --version 2>&1 | $GREP Solaris`" != "" ; then # This option is for SunOS 5.x (Solaris) or later. DEXPORT="-Wl,-M -Wl,\$(VPATH)/dexport-sun.map -Wl,-z -Wl,nodefs" fi AC_SUBST(DEXPORT) AC_ARG_WITH(gtk, [ --with-gtk@<:@=ARG@:>@ gtk+ version (2.0|3.0)], gtk_version=$with_gtk) if test "$gtk_version" = "" ; then gtk_version=3.0 fi PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no) if test "$have_gtk" != "yes"; then if test "$gtk_version" = "3.0"; then gtk_version=2.0 else gtk_version=3.0 fi PKG_CHECK_MODULES(GTK, gtk+-$gtk_version, have_gtk=yes, have_gtk=no) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0, have_gdk_pixbuf2=yes, have_gdk_pixbuf2=no) # try to link libgio-2.0 explicitly. (SF topic #6234829) PKG_CHECK_EXISTS(gdk-pixbuf-2.0 >= 2.14, [ PKG_CHECK_MODULES(GIO, gio-2.0) ]) GDK_PIXBUF_CFLAGS="$GDK_PIXBUF_CFLAGS $GIO_CFLAGS" GDK_PIXBUF_LIBS="$GDK_PIXBUF_LIBS $GIO_LIBS" AC_CHECK_PROG(have_gdk_pixbuf1,gdk-pixbuf-config,yes) if test "$gui" = "xlib" ; then AC_ARG_WITH(imagelib, [ --with-imagelib@<:@=ARG@:>@ image library (gdk-pixbuf) @<:@default=no@:>@], imagelib=$with_imagelib) else # Don't link an external image library on win32gdi or framebuffer. with_imagelib="" fi case ${imagelib} in imlib) AC_CHECK_PROG(imlib_config,imlib-config,yes,no) if test "x$imlib_config" = "xno" ; then echo "" echo "** ERROR **" echo "Could not find imlib-config." echo "" exit 1 fi echo "" echo "** WARNING **" echo " imlib is no longer supported." echo "" IMAGELIB_CFLAGS="`imlib-config --cflags` -DBUILTIN_IMAGELIB" IMAGELIB_LIBS="`imlib-config --libs`" ;; imlib2) AC_CHECK_PROG(imlib2_config,imlib2-config,yes,no) if test "x$imlib2_config" = "xno" ; then echo "" echo "** ERROR **" echo "Could not find imlib2-config." echo "" exit 1 fi echo "" echo "** WARNING **" echo " imlib2 is no longer supported." echo "" IMAGELIB_CFLAGS="`imlib2-config --cflags` -DBUILTIN_IMAGELIB" IMAGELIB_LIBS="`imlib2-config --libs`" ;; gdk-pixbuf) if test "$have_gdk_pixbuf2" = "yes" ; then gdk_pixbuf_version=2 elif test "$have_gdk_pixbuf1" = "yes" ; then gdk_pixbuf_version=1 else echo "" echo "** ERROR **" echo "Could not find gdk-pixbuf" echo "" exit 1 fi ;; gdk-pixbuf2) if test "$have_gdk_pixbuf2" = "yes" ; then gdk_pixbuf_version=2 else echo "" echo "** ERROR **" echo "Could not find gdk-pixbuf2" echo "" exit 1 fi ;; gdk-pixbuf1) if test "$have_gdk_pixbuf1" = "yes" ; then gdk_pixbuf_version=1 else echo "" echo "** ERROR **" echo "Could not find gdk-pixbuf1" echo "" exit 1 fi ;; *) if test "${imagelib}" != "" ; then echo "" echo "** ERROR **" echo "${imagelib} library is NOT supported." echo "" exit 1 fi ;; esac PKG_CHECK_MODULES(FT, freetype2, have_ft=yes, have_ft=no) if test "$have_ft" = "no" ; then PKG_CHECK_MODULES(FT, freetype, have_ft=yes, have_ft=no) fi # -DUSE_FREETYPE can be added to FT_CFLAGS later. FT_CFLAGS_ORIGINAL=$FT_CFLAGS if test "$gdk_pixbuf_version" != "" ; then if test "$gdk_pixbuf_version" = "1" ; then # Override GDK_PIXBUF_XXX variables. GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`" GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`" echo "" echo "** WARNING **" echo " gdk-pixbuf1 is no longer supported." echo "" fi IMAGELIB_CFLAGS="${GDK_PIXBUF_CFLAGS} -DBUILTIN_IMAGELIB" IMAGELIB_LIBS="${GDK_PIXBUF_LIBS}" if test "$have_ft" = "yes"; then IMAGELIB_CFLAGS="$IMAGELIB_CFLAGS -DUSE_FREETYPE_EMOJI $FT_CFLAGS_ORIGINAL" IMAGELIB_LIBS="$IMAGELIB_LIBS $FT_LIBS" fi elif test "$have_gdk_pixbuf2" != "yes" -a "$have_gdk_pixbuf1" = "yes" ; then GDK_PIXBUF_CFLAGS="`gdk-pixbuf-config --cflags`" GDK_PIXBUF_LIBS="`gdk-pixbuf-config --libs`" fi # Used by mlimgloader. AC_SUBST(GDK_PIXBUF_CFLAGS) AC_SUBST(GDK_PIXBUF_LIBS) AC_SUBST(IMAGELIB_CFLAGS) AC_SUBST(IMAGELIB_LIBS) # XXX For pow in libm.so which is used in ui_imagelib.c # /lib/* ... e.g.) /lib/i386-linux-gnu in ubuntu. for ml_cv_lib_path in /lib /usr/lib /lib/* `echo $LIBRARY_PATH | tr ":" " "` ; do libm_files=`ls $ml_cv_lib_path/libm\\.so* $ml_cv_lib_path/libm\\.sl* 2> /dev/null` for libm_file in $libm_files ; do if test -z "$ml_cv_libm_dir" -a -n "`$NM -D $libm_file | $GREP pow`" ; then ml_cv_libm_dir=`dirname $libm_file` fi done done if test -z "$IMAGELIB_LIBS" ; then if test -n "$ml_cv_libm_dir" ; then MATH_CFLAGS="-DDLOPEN_LIBM -DLIBMDIR=\\\"$ml_cv_libm_dir\\\"" else AC_CHECK_LIB(m, pow, MATH_LIBS=-lm) fi else AC_CHECK_LIB(m, pow, MATH_LIBS=-lm) fi AC_SUBST(MATH_LIBS) AC_SUBST(MATH_CFLAGS) AC_ARG_ENABLE(image, [ --disable-image show image @<:@default=enabled@:>@], image=$enable_image, image="yes") if test "$image" != "yes" ; then # If sixel.h is not found on gui=console, set IMAGE_CFLAGS="-DNO_IMAGE" forcibly below. IMAGE_CFLAGS="-DNO_IMAGE" fi AC_SUBST(IMAGE_CFLAGS) if test "$gui" = "win32" ; then GUI="win32" GUI_CFLAGS="-DUSE_WIN32GUI" X_CFLAGS="" elif test "$gui" = "xlib" ; then GUI="xlib" # Li18nux Xlib-I18N defines X_HAVE_UTF8_STRING but has no Xutf8LookupString. ldflags="$LDFLAGS" cflags="$CFLAGS" LDFLAGS="$LDFLAGS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS" CFLAGS="$X_CFLAGS $CFLAGS" AC_CHECK_LIB(X11,Xutf8LookupString,XUTF8_CFLAGS="-DHAVE_XUTF8_LOOKUP_STRING") LDFLAGS="$ldflags" CFLAGS="$cflags" AC_SUBST(XUTF8_CFLAGS) elif test "$gui" = "quartz" ; then GUI="quartz" GUI_CFLAGS="-DUSE_QUARTZ" if test "$ios_sdk" != ""; then GUI_CFLAGS="$GUI_CFLAGS -DCOCOA_TOUCH" COCOAOBJ=cocoatouch.o COCOA_LIBS="-framework Foundation -framework UIKit -framework CoreGraphics" else COCOAOBJ=cocoa.o COCOA_LIBS="-framework Foundation -framework Cocoa" fi AC_SUBST(COCOAOBJ) AC_SUBST(COCOA_LIBS) X_CFLAGS="" VT_NORM_OBJ="vt_normalize.o" VT_NORM_CFLAGS="-DUSE_NORMALIZE" AC_SUBST(VT_NORM_OBJ) AC_SUBST(VT_NORM_CFLAGS) elif test "$gui" = "console" ; then GUI="console" GUI_CFLAGS="-DUSE_CONSOLE" AC_CHECK_HEADER(sixel.h, SIXEL_CFLAGS="-DUSE_LIBSIXEL") if test "$SIXEL_CFLAGS" = "-DUSE_LIBSIXEL" ; then SIXEL_LIBS="-lsixel" else IMAGE_CFLAGS="-DNO_IMAGE" IMAGELIB_CFLAGS="" IMAGELIB_LIBS="" fi AC_SUBST(SIXEL_CFLAGS) AC_SUBST(SIXEL_LIBS) elif test "$gui" = "beos" ; then GUI="beos" GUI_CFLAGS="-DUSE_BEOS" elif test "$gui" = "wayland" ; then GUI="wayland" GUI_CFLAGS="-DUSE_WAYLAND" elif test "$gui" = "sdl2" ; then PKG_CHECK_MODULES(SDL2, sdl2, have_sdl2=yes, have_sdl2=no) if test "$have_sdl2" != "yes" ; then AC_CHECK_PROG(sdl2_config, sdl2-config, yes) if test "$sdl2_config" = "yes"; then SDL2_CFLAGS="`sdl2-config --cflags`" SDL2_LIBS="`sdl2-config --libs`" else echo "sdl2 is not available." exit 1 fi fi if test "$ml_cv_is_posix" != "yes"; then SDL2GUI="win32" AC_SUBST(SDL2GUI) fi GUI="sdl2" GUI_CFLAGS="-DUSE_SDL2" AC_SUBST(SDL2_CFLAGS) AC_SUBST(SDL2_LIBS) else GUI="fb" if test "$fbtype" = ""; then if test "`sysctl machdep.ispc98`" = "machdep.ispc98: 1"; then fbtype="pc98" else # for NetBSD/x68k # is also checked not to enable USE_GRF on NetBSD/macppc. AC_CHECK_HEADER(machine/grfioctl.h, AC_CHECK_HEADER(machine/vuid_event.h, [ fbtype="x68kgrf" GUI_CFLAGS="-DHAVE_GRFIOCTL_H" ])) fi fi if test "$fbtype" = "x68kgrf"; then GUI_CFLAGS="${GUI_CFLAGS} -DUSE_GRF" elif test "$fbtype" = "pc98"; then GUI_CFLAGS="${GUI_CFLAGS} -DPC98" fi GUI_CFLAGS="${GUI_CFLAGS} -DUSE_FRAMEBUFFER" fi AC_SUBST(GUI) AC_SUBST(GUI_CFLAGS) AC_CHECK_HEADER(regex.h,REGEX_CFLAGS="-DHAVE_REGEX") AC_SUBST(REGEX_CFLAGS) AC_ARG_ENABLE(dl-ctl, [ --disable-dl-ctl dynamic loading ctl library @<:@default=enable@:>@], dl_ctl=$enable_dl_ctl, dl_ctl="yes") if test "$enable_shared" = "no" ; then dl_ctl="no" fi if test "$dl_ctl" = "yes" ; then LMLTERM_CORE=libmlterm_core.la CTL_LOADER_OBJ=vt_ctl_loader.o else LMLTERM_CORE=libmlterm_core.a CTL_CFLAGS="-DNO_DYNAMIC_LOAD_CTL" CTL_LIBS_FOR_VTE="../vtemu/libctl/*.lo" fi AC_SUBST(LMLTERM_CORE) AC_SUBST(CTL_LOADER_OBJ) AC_ARG_ENABLE(fribidi, [ --disable-fribidi bidi @<:@default=enabled@:>@], fribidi=$enable_fribidi, fribidi="yes") if test "$fribidi" = "yes" ; then PKG_CHECK_MODULES(FRIBIDI, fribidi, have_fribidi=yes, have_fribidi=no) if test "$have_fribidi" != "yes" ; then AC_CHECK_PROG(fribidi_config,fribidi-config,yes,fribidi="no") if test "$fribidi_config" = "yes" ; then FRIBIDI_CFLAGS="`fribidi-config --cflags`" FRIBIDI_LIBS="`fribidi-config --libs`" have_fribidi="yes" fi fi else have_fribidi="no" fi if test "$have_fribidi" = "yes" ; then if test "$dl_ctl" = "yes" ; then CTL_LIBS="libctl_bidi.la ${CTL_LIBS}" else CTL_CFLAGS="-DUSE_FRIBIDI ${CTL_CFLAGS}" CTL_LIBS="libctl_bidi.a ${CTL_LIBS}" CTL_LIBS_FOR_PROG="../vtemu/libctl/libctl_bidi.a ${FRIBIDI_LIBS} ${CTL_LIBS_FOR_PROG}" CTL_LIBS_FOR_VTE="${FRIBIDI_LIBS} ${CTL_LIBS_FOR_VTE}" fi fi AC_SUBST(FRIBIDI_CFLAGS) AC_SUBST(FRIBIDI_LIBS) AC_SUBST(CTL_CFLAGS) AC_SUBST(CTL_LIBS_FOR_VTE) AC_ARG_WITH(pthread, [ --without-pthread don't use pthread @<:@default=with@:>@]) AC_ARG_ENABLE(dl-type, [ --disable-dl-type dynamic loading type engine library @<:@default=enable@:>@], dl_type=$enable_dl_type, dl_type="yes") if test "$enable_shared" = "no" ; then dl_type="no" fi if test "$dl_type" = "yes" ; then TYPE_LOADER_OBJ=ui_type_loader.o if test "$gui" != "xlib" ; then TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE" fi else TYPE_CFLAGS="-DNO_DYNAMIC_LOAD_TYPE" TYPE_LIBS_FOR_VTE="../uitoolkit/libtype/*.lo" fi AC_SUBST(TYPE_LOADER_OBJ) if test "$gui" != "win32" -a "$gui" != "quartz"; then PKG_CHECK_MODULES(FONTCONFIG, fontconfig, have_fc=yes, have_fc=no) if test "$have_fc" = "yes"; then FONTCONFIG_CFLAGS="$FONTCONFIG_CFLAGS -DUSE_FONTCONFIG" AC_SUBST(FONTCONFIG_CFLAGS) AC_SUBST(FONTCONFIG_LIBS) fi fi AC_ARG_ENABLE(anti_alias, [ --disable-anti-alias same as --with-type-engines=xcore on xlib @<:@default=enabled@:>@ do not use truetype fonts on framebuffer @<:@default=enabled@:>@ ], anti_alias=$enable_anti_alias, anti_alias="auto") if test "$anti_alias" != "no"; then if test "$gui" = "fb" -o "$gui" = "wayland" -o "$gui" = "sdl2"; then if test "$have_ft" = "yes" ; then FT_CFLAGS="$FT_CFLAGS -DUSE_FREETYPE " AC_ARG_ENABLE(fontconfig, [ --disable-fontconfig use fontconfig with freetype on framebuffer or wayland @<:@default=enabled@:>@ ], fontconfig=$enable_fontconfig, fontconfig="yes") if test "$fontconfig" != "no" -a "$have_fc" = "yes"; then FT_CFLAGS="$FT_CFLAGS $FONTCONFIG_CFLAGS" FT_LIBS="$FT_LIBS $FONTCONFIG_LIBS" else fontconfig="no" fi AC_SUBST(FT_CFLAGS) AC_SUBST(FT_LIBS) fi fi fi AC_ARG_WITH(type_engines, [ --with-type-engines@<:@=ARG@:>@ type engines (xcore, xft, cairo) @<:@default=xcore,xft,cairo@:>@], type_engines=$with_type_engines) if test "$gui" != "xlib" ; then type_engines="xcore" elif test "$type_engines" = "" ; then if test "$anti_alias" = "no" ; then type_engines="xcore" else type_engines="xcore,xft,cairo" fi fi type_engines=`echo ${type_engines} | sed 's/,/ /g'` for type_engine in ${type_engines} ; do case ${type_engine} in xft) PKG_CHECK_MODULES(XFT, xft, have_xft=yes, have_xft=no) if test "$have_xft" != "yes" ; then AC_CHECK_PROG(xft_config,xft-config,yes) if test "$xft_config" = "yes" ; then XFT_CFLAGS="`xft-config --cflags`" XFT_LIBS="`xft-config --libs`" have_xft=yes else AC_CHECK_LIB(Xft,XftDrawCreate, [ have_xft=yes # -lfontconfig is necessary because ui_font.c refers FcXXX # functions directly. XFT_LIBS="-lXft -lfontconfig" ]) fi elif test "$gui" = "xlib" -a "$enable_shared" = "no" ; then # In case --disable-shared is specified on some platforms # (e.g. ubuntu 14.04) where dependency_libs="" in libXft.la. XFT_LIBS="$XFT_LIBS -lfontconfig -lfreetype" fi if test "$have_xft" = "yes" ; then if test "$dl_type" = "yes" ; then TYPE_LIBS="libtype_xft.la ${TYPE_LIBS}" else NODL_OBJ="ui_window_xft.o ${NODL_OBJ}" TYPE_LIBS_FOR_VTE="${XFT_LIBS} ${TYPE_LIBS_FOR_VTE}" fi TYPE_CFLAGS="-DUSE_TYPE_XFT ${TYPE_CFLAGS}" type_engines_result="$type_engines_result xft" fi ;; cairo) PKG_CHECK_MODULES(CAIRO, cairo, have_cairo=yes, have_cairo=no) if test "$have_cairo" != "yes" ; then AC_CHECK_LIB(cairo,cairo_create, [ have_cairo=yes # -lfontconfig is necessary because ui_font.c refers FcXXX # functions directly. CAIRO_LIBS="-lcairo -lfontconfig" ]) elif test "$gui" = "xlib" -a "$enable_shared" = "no" ; then # In case --disable-shared is specified on some platforms # (e.g. ubuntu 14.04) where dependency_libs="" in libcairo.la. CAIRO_LIBS="$CAIRO_LIBS -lfontconfig -lfreetype" fi if test "$have_cairo" = "yes" ; then if test "$dl_type" = "yes" ; then TYPE_LIBS="libtype_cairo.la ${TYPE_LIBS}" if test "$with_pthread" != "no" ; then # NetBSD doesn't allow shared libraries to link # libpthread without linking it to executables. case "${host_os}" in netbsd*) PTHREAD_LIB="-lpthread" ;; esac fi else NODL_OBJ="ui_window_cairo.o ${NODL_OBJ}" TYPE_LIBS_FOR_VTE="${CAIRO_LIBS} ${TYPE_LIBS_FOR_VTE}" fi TYPE_CFLAGS="-DUSE_TYPE_CAIRO ${TYPE_CFLAGS}" type_engines_result="$type_engines_result cairo" fi ;; xcore) TYPE_CFLAGS="-DUSE_TYPE_XCORE ${TYPE_CFLAGS}" type_engines_result="$type_engines_result xcore" ;; *) echo "${type_engine} is unknown type engine." ;; esac done AC_ARG_ENABLE(otl, [ --disable-otl Open Type layout with the use of harfbuzz or libotf @<:@default=enabled@:>@], otl=$enable_otl, otl="yes") if test "$otl" != "yes" ; then echo "Open Type layout is disabled" elif test "$gui" = "xlib" -a "$dl_type" = "no" -a "$type_engines_result" = " xcore"; then echo "libotf/libharfbuzz is not available." elif test "$gui" = "fb" -a "$have_ft" != "yes" ; then echo "libotf/libharfbuzz is not available." elif test "$gui" = "wayland" -a "$have_ft" != "yes" ; then echo "libotf/libharfbuzz is not available." elif test "$gui" = "sdl2" -a "$have_ft" != "yes" ; then echo "libotf/libharfbuzz is not available." elif test "$gui" = "console" ; then echo "libotf/libharfbuzz is not available." else PKG_CHECK_MODULES(HB, harfbuzz, have_hb=yes, have_hb=no) if test "$have_hb" = "yes" ; then if test "$gui" = "quartz" ; then CFLAGS_orig=$CFLAGS CPPFLAGS_orig=$CPPFLAGS CFLAGS="$CFLAGS $HB_CFLAGS" CPPFLAGS="$CPPFLAGS $HB_CFLAGS" AC_CHECK_HEADER(hb-coretext.h, have_hb_coretext_h=yes, have_hb_coretext_h=no) CFLAGS=$CFLAGS_orig CPPFLAGS=$CPPFLAGS_orig if test "$have_hb_coretext_h" != "yes" ; then echo "" echo "** ERROR **" echo "harfbuzz/hb-coretext.h is not found." echo "Install harfbuzz with --with-coretext=yes in advance." echo "" have_hb=no fi elif test "$have_ft" = "yes" ; then CFLAGS_orig=$CFLAGS CPPFLAGS_orig=$CPPFLAGS CFLAGS="$CFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL" CPPFLAGS="$CPPFLAGS $HB_CFLAGS $FT_CFLAGS_ORIGINAL" AC_CHECK_HEADER(hb-ft.h, have_hb_ft_h=yes, have_hb_ft_h=no) CFLAGS=$CFLAGS_orig CPPFLAGS=$CPPFLAGS_orig if test "$have_hb_ft_h" != "yes" ; then echo "" echo "** ERROR **" echo "harfbuzz/hb-ft.h is not found." echo "Install harfbuzz with --with-freetype=yes in advance." echo "" have_hb=no fi fi fi if test "$have_hb" = "yes"; then OT_LAYOUT_CFLAGS="$HB_CFLAGS -DUSE_HARFBUZZ -DUSE_OT_LAYOUT" OT_LAYOUT_LIBS="$HB_LIBS" OT_LAYOUT_OBJ=hb.o if test "$gui" = "win32"; then OT_LAYOUT_LIBS="$OT_LAYOUT_LIBS -lfreetype" elif test "$gui" != "quartz" -a "$have_ft" = "yes"; then OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS $FT_CFLAGS_ORIGINAL" fi elif test "$gui" = "win32" ; then OT_LAYOUT_CFLAGS="-DUSE_OT_LAYOUT -DUSE_UNISCRIBE" OT_LAYOUT_OBJ=uniscribe.o OT_LAYOUT_LIBS="-lusp10" else AC_CHECK_PROG(libotf_config,libotf-config,yes) if test "$libotf_config" = "yes" ; then OT_LAYOUT_CFLAGS="`libotf-config --cflags` -DUSE_OT_LAYOUT" OT_LAYOUT_LIBS="`libotf-config --libs`" OT_LAYOUT_OBJ=otf.o fi fi if test "$OT_LAYOUT_OBJ" != "" -a "$enable_shared" = "no" ; then OT_LAYOUT_CFLAGS="$OT_LAYOUT_CFLAGS -DNO_DYNAMIC_LOAD_OTL" OT_LAYOUT_LIBS_FOR_PROG="$OT_LAYOUT_LIBS" fi if test "$OT_LAYOUT_OBJ" != "" -a "$LMLTERM_CORE" = "libmlterm_core.la" ; then LMLTERM_CORE="libmlterm_coreotl.la" fi fi AC_SUBST(OT_LAYOUT_LIBS) AC_SUBST(OT_LAYOUT_LIBS_FOR_PROG) AC_SUBST(OT_LAYOUT_CFLAGS) AC_SUBST(OT_LAYOUT_OBJ) if test "$OT_LAYOUT_OBJ" != "" ; then MAKE_DIRS="uitoolkit/libotl ${MAKE_DIRS}" OUTPUT_FILES="uitoolkit/libotl/Makefile ${OUTPUT_FILES}" fi if test "${NODL_OBJ}" != "" ; then TYPE_LIBS=libtype.a TYPE_LIBS_FOR_PROG="../uitoolkit/libtype/libtype.a ${CAIRO_LIBS} ${XFT_LIBS} ${OT_LAYOUT_LIBS}" fi if test "${TYPE_CFLAGS}" = "" ; then echo "No type engine is specified." exit 1 fi AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) AC_SUBST(CAIRO_LIBS) AC_SUBST(CAIRO_LIBS) AC_SUBST(TYPE_CFLAGS) AC_SUBST(TYPE_LIBS) AC_SUBST(TYPE_LIBS_FOR_PROG) AC_SUBST(TYPE_LIBS_FOR_VTE) AC_SUBST(NODL_OBJ) AC_SUBST(PROG) AC_ARG_ENABLE(ssh2, [ --disable-ssh2 libssh2 @<:@default=enabled@:>@], ssh2=$enable_ssh2, ssh2="yes") if test "$ssh2" = "yes" ; then PKG_CHECK_MODULES(SSH2, libssh2, [ SSH2_CFLAGS="$SSH2_CFLAGS -DUSE_LIBSSH2" if test "x$allow_undefined_flag" = "xunsupported" ; then # vt_pty_ssh.c uses CRYPTO_xxx functions. SSH2_LIBS="-lcrypto $SSH2_LIBS" fi ], ssh2="no") fi if test "$enable_shared" != "no" ; then AC_ARG_WITH(mosh, [ --with-mosh@<:@=ARG@:>@ The directory where mosh is built]) if test -d "$with_mosh"; then PKG_CHECK_MODULES(PROTOBUF, protobuf, MOSH_DIR=$with_mosh, with_mosh="") fi fi if test "$ml_cv_is_posix" = "no" ; then if test "$ssh2" = "yes" ; then VT_PTY_OBJ="vt_pty_ssh.o vt_pty_mosh.o" if test -d "$with_mosh"; then MOSH_DIR=$with_mosh MAKE_DIRS="${MAKE_DIRS} vtemu/libptyssh vtemu/libptymosh" OUTPUT_FILES="${OUTPUT_FILES} vtemu/libptyssh/Makefile vtemu/libptymosh/Makefile" SSH2_LIBS_FOR_PROG="-lwsock32" # XXX Hack for wcwidth() PROTOBUF_LIBS="$PROTOBUF_LIBS \${top_builddir}/encodefilter/src/libmef.la" else # Not dlopen SSH2_CFLAGS="$SSH2_CFLAGS -DNO_DYNAMIC_LOAD_SSH" SSH2_LIBS_FOR_PROG="$SSH2_LIBS -lwsock32 -lws2_32" SSH2_LIBS= fi else VT_PTY_OBJ="vt_pty_pipewin32.o" fi else VT_PTY_OBJ="vt_pty_unix.o" if test "$ssh2" = "yes" ; then if test "$with_pthread" != "no" ; then AC_CHECK_HEADER(pthread.h, [ SSH2_CFLAGS="$SSH2_CFLAGS -DHAVE_PTHREAD" SSH2_LIBS="$SSH2_LIBS -lpthread" ]) # NetBSD doesn't allow shared libraries to link libpthread # without linking it to executables. case "${host_os}" in netbsd*) PTHREAD_LIB="-lpthread" ;; esac fi VT_PTY_OBJ="vt_pty_ssh.o vt_pty_mosh.o ${VT_PTY_OBJ}" if test "$enable_shared" = "no" ; then SSH2_CFLAGS="$SSH2_CFLAGS -DNO_DYNAMIC_LOAD_SSH" SSH2_LIBS_FOR_PROG="$SSH2_LIBS" SSH2_LIBS= else # dlopen libptyssh MAKE_DIRS="vtemu/libptyssh ${MAKE_DIRS}" OUTPUT_FILES="vtemu/libptyssh/Makefile ${OUTPUT_FILES}" if test -d "$with_mosh"; then MAKE_DIRS="${MAKE_DIRS} vtemu/libptymosh" OUTPUT_FILES="${OUTPUT_FILES} vtemu/libptymosh/Makefile" fi fi fi fi AC_SUBST(SSH2_LIBS) AC_SUBST(SSH2_LIBS_FOR_PROG) AC_SUBST(SSH2_CFLAGS) AC_SUBST(VT_PTY_OBJ) AC_SUBST(MOSH_DIR) AC_SUBST(PROTOBUF_CFLAGS) AC_SUBST(PROTOBUF_LIBS) if test "${have_gtk}" = "yes" ; then if test "${gtk_version}" = "3.0" ; then PKG_CHECK_MODULES(VTE, vte-2.91, have_vte=yes, have_vte=no) if test "$have_vte" = "yes" ; then VTE_ABI=2.91 else PKG_CHECK_MODULES(VTE, vte-2.90, have_vte=yes, have_vte=no) if test "$have_vte" = "yes"; then VTE_ABI=2.90 fi fi else PKG_CHECK_MODULES(VTE, vte, have_vte=yes, have_vte=no) fi if test "$have_vte" = "yes" ; then OUTPUT_FILES="gtk/Makefile ${OUTPUT_FILES}" AC_SUBST(VTE_ABI) fi else have_vte=no fi tools="mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc" AC_ARG_WITH(tools, [ --with-tools@<:@=ARG@:>@ external tools @<:@default=mlclient,mlconfig,mlcc,mlterm-menu,mlimgloader,registobmp,mlfc@:>@], [ # if given --without-tools if test "${with_tools}" = "no" ; then tools="" else if test "${with_tools}" != "yes" ; then tools=${with_tools} fi if test -z "$IMAGELIB_CFLAGS" -a "`echo ${tools}|$GREP mlimgloader`" = "" ; then # If --with-imagelib option is not specified, mlimgloader is always built. tools=${tools},mlimgloader fi fi ]) tools=`echo ${tools} | sed 's/,/ /g'` AC_ARG_ENABLE(use-tools, [ --disable-use-tools don't build and use external tools @<:@default=enabled@:>@]) if test "$enable_use_tools" = "no" ; then TOOLS_CFLAGS="-DNO_TOOLS" tools= fi AC_SUBST(TOOLS_CFLAGS) AM_INIT_AUTOMAKE(mlterm,3.9.1) for tool in ${tools} ; do case ${tool} in mlconfig) if test "${have_gtk}" = "yes" -a "$gui" != "fb" -a "$gui" != "console" ; then AM_GLIB_GNU_GETTEXT MAKE_DIRS="tool/mlconfig ${MAKE_DIRS}" OUTPUT_FILES="tool/mlconfig/Makefile tool/mlconfig/po/Makefile.in ${OUTPUT_FILES}" tools_result="$tools_result $tool" else echo "" echo "** WARNING **" echo " couldn't compile mlconfig since headers/libraries of GTK+-2 are missing." echo "" fi ;; mlterm-menu) if test "${have_gtk}" = "yes" -a "$gui" != "fb" -a "$gui" != "console" ; then MAKE_DIRS="contrib/tool/mlterm-menu ${MAKE_DIRS}" OUTPUT_FILES="contrib/tool/mlterm-menu/Makefile ${OUTPUT_FILES}" tools_result="$tools_result $tool" else echo "" echo "** WARNING **" echo " couldn't compile mlterm-menu since headers/libraries of GTK+-2 are missing." echo "" fi ;; mlclient) if test "$ml_cv_is_posix" = "yes" -a "$gui" != "console" ; then MAKE_DIRS="tool/mlclient ${MAKE_DIRS}" OUTPUT_FILES="tool/mlclient/Makefile ${OUTPUT_FILES}" tools_result="$tools_result $tool" fi ;; w3mmlconfig) AC_PATH_PROG(PERL,perl,$PATH) if test "x$PERL" = x ; then echo "" echo "** WARNING **" echo " couldn't find perl in PATH environment variable." echo "" PERL="/usr/local/bin/perl" # should be "/usr/bin/env perl"? fi MAKE_DIRS="tool/w3mmlconfig ${MAKE_DIRS}" OUTPUT_FILES="tool/w3mmlconfig/Makefile tool/w3mmlconfig/mlconfig.cgi tool/w3mmlconfig/w3mmlconfig ${OUTPUT_FILES}" tools_result="$tools_result $tool" ;; mlcc) if test "$ml_cv_is_posix" = "yes" ; then MAKE_DIRS="contrib/tool/mlcc ${MAKE_DIRS}" OUTPUT_FILES="contrib/tool/mlcc/Makefile ${OUTPUT_FILES}" tools_result="$tools_result $tool" fi ;; mlmenu) if test "$gui" = "xlib" ; then MAKE_DIRS="tool/mlmenu ${MAKE_DIRS}" OUTPUT_FILES="tool/mlmenu/Makefile ${OUTPUT_FILES}" tools_result="$tools_result $tool" fi ;; mlterm-zoom) if test "$gui" = "xlib" ; then MAKE_DIRS="contrib/tool/mlterm-zoom ${MAKE_DIRS}" OUTPUT_FILES="contrib/tool/mlterm-zoom/Makefile ${OUTPUT_FILES}" tools_result="$tools_result $tool" fi ;; mlimgloader) if test "$gui" != "quartz" ; then OUTPUT_FILES="tool/mlimgloader/Makefile ${OUTPUT_FILES}" MAKE_DIRS="tool/mlimgloader ${MAKE_DIRS}" tools_result="$tools_result $tool" AC_TRY_COMPILE([ #include #include ],, have_gdiplus=yes,have_gdiplus=no) if test "$have_gdiplus" = "yes" ; then MLIMGLOADER_LIB=gdiplus elif test "$have_gdk_pixbuf2" = "yes" -o "$have_gdk_pixbuf1" = "yes" ; then MLIMGLOADER_LIB=gdk-pixbuf else MLIMGLOADER_LIB=none fi AC_SUBST(MLIMGLOADER_LIB) if test "$have_ft" = "yes"; then EMOJI_CFLAGS="-DUSE_FREETYPE_EMOJI $FT_CFLAGS_ORIGINAL" EMOJI_LIBS="$FT_LIBS" AC_SUBST(EMOJI_CFLAGS) AC_SUBST(EMOJI_LIBS) fi fi ;; registobmp) if test "$have_sdl2" = "yes"; then SDL_CFLAGS=$SDL2_CFLAGS SDL_LIBS=$SDL2_LIBS else PKG_CHECK_MODULES(SDL, sdl2, have_sdl2=yes, have_sdl2=no) if test "$have_sdl2" != "yes" ; then PKG_CHECK_MODULES(SDL, sdl, have_sdl=yes, have_sdl=no) fi fi if test "$have_sdl2" = "yes"; then PKG_CHECK_MODULES(SDLTTF, SDL2_ttf, have_sdlttf=yes, have_sdlttf=no) elif test "$have_sdl" = "yes"; then PKG_CHECK_MODULES(SDLTTF, SDL_ttf, have_sdlttf=yes, have_sdlttf=no) else continue fi if test "$have_sdlttf" = "yes"; then SDLTTF_CFLAGS="$SDLTTF_CFLAGS -DUSE_SDLTTF" fi SDL_CFLAGS="$SDL_CFLAGS $SDLTTF_CFLAGS" SDL_LIBS="$SDL_LIBS $SDLTTF_LIBS" AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) OUTPUT_FILES="tool/registobmp/Makefile ${OUTPUT_FILES}" MAKE_DIRS="tool/registobmp ${MAKE_DIRS}" tools_result="$tools_result $tool" ;; mlfc) if test "$gui" != "win32" -a "$gui" != "quartz" ; then if test "$have_fc" = "yes" ; then OUTPUT_FILES="tool/mlfc/Makefile ${OUTPUT_FILES}" MAKE_DIRS="tool/mlfc ${MAKE_DIRS}" tools_result="$tools_result $tool" fi fi ;; *) echo "${tool} is unknown tool." ;; esac done if test "$gui" = "win32"; then OUTPUT_FILES="tool/servman/Makefile ${OUTPUT_FILES}" MAKE_DIRS="tool/servman ${MAKE_DIRS}" tools_result="$tools_result servman" fi # # --- libltdl --- # AC_ARG_WITH(libltdl, [ --with-libltdl@<:@=PREFIX@:>@ load modules with libltdl @<:@default=without@:>@],, [with_libltdl=no]) # We don't check here wheter libltdl is installed. (See pobl/src/configure.in) # # --- Xdnd --- # AC_ARG_ENABLE(dnd, [ --disable-dnd dnd @<:@default=enabled@:>@], dnd=$enable_dnd, dnd="yes") if test "$dnd" = "no" ; then DND_CFLAGS="-DDISABLE_XDND" fi AC_SUBST(DND_CFLAGS) DL_LIBS_IM="" # # --- kbd --- # AC_ARG_ENABLE(kbd, [ --disable-kbd input method for Arabic and Indic @<:@default=enabled@:>@], kbd=$enable_kbd) if test "$enable_shared" = "no" ; then kbd="no" fi if test "$kbd" != "no" ; then MAKE_DIRS="inputmethod/kbd ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/kbd/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != "xno" ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/kbd/libim-kbd.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result kbd" fi # # --- uim --- # AC_ARG_ENABLE(uim, [ --disable-uim uim @<:@default=enabled@:>@], uim=$enable_uim) if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then uim="no" fi if test "x$uim" != xno ; then PKG_CHECK_MODULES(UIM, uim >= 1.0.0, have_uim=yes, have_uim=no) if test "x$have_uim" = xyes ; then MAKE_DIRS="inputmethod/uim ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/uim/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/uim/libim-uim.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result uim" fi fi AC_SUBST(UIM_CFLAGS) AC_SUBST(UIM_LIBS) # # --- IIIMF --- # AC_ARG_ENABLE(iiimf, [ --disable-iiimf IIIMF (Experimental) @<:@default=enabled@:>@], iiimf=$enable_iiimf) if test "x$iiimf" != xno ; then PKG_CHECK_MODULES(IIIMCF, iiimf-lib-client, have_iiimcf=yes, have_iiimcf=no) if test "x$have_iiimcf" = xyes ; then found_iiimcf=yes elif test -d /usr/lib/im/lib ; then LIBS="$LIBS -L/usr/lib/im/lib" AC_CHECK_LIB(iiimcf, iiimcf_create_context, [ found_iiimcf=yes IIIMCF_CFLAGS="-I/usr/lib/im/include" IIIMCF_LIBS="-L/usr/lib/im/lib -liiimcf" ]) else AC_CHECK_LIB(iiimcf, iiimcf_create_context, [ found_iiimcf=yes IIIMCF_CFLAGS="-I/usr/include/iiim" IIIMCF_LIBS="-liiimcf" ]) fi if test "x$found_iiimcf" = xyes ; then IM_CFLAGS="$IM_CFLAGS -DUSE_IIIMF" MAKE_DIRS="inputmethod/iiimf ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/iiimf/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then echo "" echo "** ERROR **" echo " IIIMF plugin couldn't be used with libltdl." echo "" exit 1 else input_methods_result="$input_methods_result IIIMF" fi AC_CHECK_LIB(iiimcf, iiimcf_create_hotkey_notify_event, [ IIIMCF_CFLAGS="$IIIMCF_CFLAGS -DHAVE_HOTKEY_NOTFY_EVENT" ]) AC_CHECK_LIB(iiimcf, iiimcf_create_aux_getvalues_event, [ IIIMCF_CFLAGS="$IIIMCF_CFLAGS -DHAVE_AUX_GETVALUES_EVENT" ]) fi fi AC_SUBST(IIIMCF_CFLAGS) AC_SUBST(IIIMCF_LIBS) # # --- m17n library --- # AC_ARG_ENABLE(m17nlib, [ --disable-m17nlib m17n library @<:@default=enabled@:>@], m17nlib=$enable_m17nlib) if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then m17nlib="no" fi if test "x$m17nlib" != xno ; then AC_CHECK_PROG(m17n_config, m17n-config, yes, no) if test "$m17n_config" = "yes"; then M17NLIB_LIBS=`m17n-config --libs` M18NLIB_CFLAGS=`m17n-config --cflags` m17nlib=yes else PKG_CHECK_MODULES(M17NLIB, m17n-shell, m17nlib=yes, m17nlib=no) fi if test "$m17nlib" = "yes"; then m17n_saved_libs="$LIBS" LIBS="$LIBS $M17NLIB_LIBS" AC_CHECK_LIB(m17n, minput_open_im, [ MAKE_DIRS="inputmethod/m17nlib ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/m17nlib/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/m17nlib/libim-m17nlib.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result m17nlib" ]) LIBS="$m17n_saved_libs" fi fi AC_SUBST(M17NLIB_CFLAGS) AC_SUBST(M17NLIB_LIBS) # # --- IBUS --- # AC_ARG_ENABLE(ibus, [ --disable-ibus IBUS @<:@default=enabled@:>@], ibus=$enable_ibus) if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then ibus="no" fi if test "x$ibus" != "xno" ; then PKG_CHECK_MODULES(IBUS, ibus-1.0 >= 1.3.0, has_ibus=yes, has_ibus=no) if test "x$has_ibus" = xyes ; then MAKE_DIRS="inputmethod/ibus ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/ibus/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/ibus/libim-ibus.la ${DL_LIBS_IM}" fi if test "$with_pthread" != "no" ; then # NetBSD doesn't allow shared libraries to link libpthread # without linking it to executables. case "${host_os}" in netbsd*) PTHREAD_LIB="-lpthread" ;; esac fi input_methods_result="$input_methods_result iBus" fi fi AC_SUBST(IBUS_CFLAGS) AC_SUBST(IBUS_LIBS) # # --- FCITX --- # AC_ARG_ENABLE(fcitx, [ --disable-fcitx FCITX @<:@default=enabled@:>@], fcitx=$enable_fcitx) if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then fcitx="no" fi if test "x$fcitx" != "xno" ; then PKG_CHECK_MODULES(FCITX, fcitx-gclient, has_fcitx=yes, has_fcitx=no) if test "x$has_fcitx" = xyes ; then MAKE_DIRS="inputmethod/fcitx ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/fcitx/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/fcitx/libim-fcitx.la ${DL_LIBS_IM}" fi if test "$with_pthread" != "no" ; then # NetBSD doesn't allow shared libraries to link libpthread # without linking it to executables. case "${host_os}" in netbsd*) PTHREAD_LIB="-lpthread" ;; esac fi input_methods_result="$input_methods_result fcitx" fi fi AC_SUBST(FCITX_CFLAGS) AC_SUBST(FCITX_LIBS) # # --- SCIM --- # AC_ARG_ENABLE(scim, [ --disable-scim SCIM @<:@default=enabled@:>@], scim=$enable_scim) if test "$enable_shared" = "no" -o "$gui" = "quartz" ; then scim="no" fi if test "x$scim" != "xno" -a "$gui" != "fb" -a "$gui" != "console" ; then PKG_CHECK_MODULES(SCIM, scim >= 1.4.0, has_scim=yes , has_scim=no) if test "x$has_scim" = xyes ; then MAKE_DIRS="inputmethod/scim ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/scim/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/scim/libim-scim.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result SCIM" fi fi AC_SUBST(SCIM_CFLAGS) AC_SUBST(SCIM_LIBS) # # --- CANNA --- # AC_ARG_ENABLE(canna, [ --disable-canna CANNA @<:@default=enabled@:>@], canna=$enable_canna) if test "$enable_shared" = "no" -o "$ml_cv_is_posix" = "no" ; then canna="no" fi if test "x$canna" != "xno" ; then AC_CHECK_HEADER(canna/jrkanji.h, has_canna=yes, has_canna=no) if test "x$has_canna" = xyes ; then CANNA_LIBS="-lcanna" MAKE_DIRS="inputmethod/canna ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/canna/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/canna/libim-canna.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result canna" fi fi AC_SUBST(CANNA_CFLAGS) AC_SUBST(CANNA_LIBS) # # --- WNN --- # AC_ARG_ENABLE(wnn, [ --disable-wnn WNN @<:@default=enabled@:>@], wnn=$enable_wnn) if test "$enable_shared" = "no" -o "$ml_cv_is_posix" = "no" ; then wnn="no" fi if test "x$wnn" != "xno" ; then AC_CHECK_HEADER(wnn/jllib.h, has_wnn=yes, has_wnn=no) if test "x$has_wnn" = xyes ; then WNN_LIBS="-ljd" if test -d /usr/pkg/share/wnn ; then WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/pkg/share\\\"" elif test -d /usr/local/share/wnn ; then WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/local/share\\\"" elif test -d /usr/local/lib/wnn ; then WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/local/lib\\\"" elif test -d /usr/share/wnn ; then WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/share\\\"" else WNN_CFLAGS="-DWNNLIBDIR=\\\"/usr/lib\\\"" fi MAKE_DIRS="inputmethod/wnn ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/wnn/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/wnn/libim-wnn.la ${DL_LIBS_IM}" fi input_methods_result="$input_methods_result wnn" fi fi AC_SUBST(WNN_CFLAGS) AC_SUBST(WNN_LIBS) # # --- SKK --- # AC_ARG_ENABLE(skk, [ --disable-skk SKK @<:@default=enabled@:>@], skk=$enable_skk) if test "$enable_shared" != "no" -a "$skk" != "no"; then MAKE_DIRS="inputmethod/skk ${MAKE_DIRS}" OUTPUT_FILES="inputmethod/skk/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != xno ; then DL_LIBS_IM="-dlopen \$(top_builddir)/inputmethod/skk/libim-skk.la ${DL_LIBS_IM}" fi if test "$ml_cv_is_posix" = "no" ; then SKK_LIBS="-lwsock32 -lws2_32" fi input_methods_result="$input_methods_result skk" fi AC_SUBST(SKK_LIBS) if test "x$input_methods_result" != x ; then IM_CFLAGS="-DUSE_IM_PLUGIN" fi AC_SUBST(IM_CFLAGS) AC_SUBST(DL_LIBS_IM) # # --- scrollbar plugins --- # DL_LIBS_SB="" SB_CFLAGS="" scrollbars="sample,extra,pixmap_engine" AC_ARG_WITH(scrollbars, [ --with-scrollbars@<:@=ARG@:>@ scrollbar plugins (sample, extra, pixmap_engine) @<:@default=sample,extra,pixmap_engine@:>@], [ # If given --without-scrollbars or --with-scrollbars with no args. if test "${with_scrollbars}" = "no" ; then scrollbars="" elif test "${with_scrollbars}" != "yes" ; then scrollbars=${with_scrollbars} fi ]) if test "$enable_shared" != "no" ; then scrollbars=`echo ${scrollbars} | sed 's/,/ /g'` else scrollbars= fi for scrollbar in ${scrollbars} ; do case ${scrollbar} in sample) if test "$gui" = "xlib" -o "$gui" = "win32"; then MAKE_DIRS="scrollbar/sample ${MAKE_DIRS}" OUTPUT_FILES="scrollbar/sample/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != "xno" ; then DL_LIBS_SB="-dlopen \$(top_builddir)/scrollbar/sample/libsample.la ${DL_LIBS_SB}" fi scrollbars_result="$scrollbars_result $scrollbar" fi ;; extra) if test "$gui" = "xlib" ; then MAKE_DIRS="contrib/scrollbar/extra ${MAKE_DIRS}" OUTPUT_FILES="contrib/scrollbar/extra/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != "xno" ; then for name in athena next motif mozmodern ; do DL_LIBS_SB="-dlopen \$(top_builddir)/contrib/scrollbar/extra/lib$name.la ${DL_LIBS_SB}" done fi scrollbars_result="$scrollbars_result $scrollbar" fi ;; pixmap_engine) if test "x$allow_undefined_flag" = "xunsupported" ; then echo "" echo "** ERROR **" echo "pixmap_engine has undefined symbols. $host_os does NOT allow it." echo "" elif test "$gui" = "xlib" -a "$image" != "no"; then if test "$have_gdk_pixbuf1" = "yes" -o "$have_gdk_pixbuf2" = "yes" ; then MAKE_DIRS="contrib/scrollbar/pixmap_engine ${MAKE_DIRS}" OUTPUT_FILES="contrib/scrollbar/pixmap_engine/Makefile contrib/scrollbar/pixmap_engine/sample3/Makefile ${OUTPUT_FILES}" if test "x$with_libltdl" != "xno" ; then DL_LIBS_SB="-dlopen \$(top_builddir)/contrib/scrollbar/pixmap_engine/libpixmap_engine.la ${DL_LIBS_SB}" fi SB_CFLAGS="-DSUPPORT_PIXMAP_ENGINE" scrollbars_result="$scrollbars_result $scrollbar" else echo "" echo "** ERROR **" echo "To use pixmap_engine for scrollbar, you need gdk-pixbuf library." echo "" fi fi ;; *) echo "${scrollbar} is unknown scrollbar." ;; esac done # for scrollbar in ${scrollbars} AC_SUBST(SB_CFLAGS) AC_SUBST(DL_LIBS_SB) # # --- module related stuffs --- # # undefined symbol AC_MSG_CHECKING([for undefined symbol]) if test "x$allow_undefined_flag" = "xunsupported" ; then AC_MSG_RESULT([not supported]) NO_UNDEFINED_FLAG="-no-undefined" else AC_MSG_RESULT(supported) NO_UNDEFINED_FLAG="" fi AC_SUBST(NO_UNDEFINED_FLAG) if test "x$with_libltdl" != "xno" ; then DL_SELF="-dlopen self" fi AC_SUBST(DL_SELF) AC_ARG_ENABLE(vt52, [ --enable-vt52 enable VT52 emulation @<:@default=disabled@:>@], vt52=$enable_vt52, vt52="no") if test "$vt52" = "yes" ; then VT52_CFLAGS="-DUSE_VT52" fi AC_SUBST(VT52_CFLAGS) AC_ARG_ENABLE(optimize_redrawing, [ --enable-optimize-redrawing optimize redrawing a line @<:@default=disabled@:>@], optimize_redrawing=$enable_optimize_redrawing, optimize_redrawing="no") if test "$optimize_redrawing" = "yes" ; then CFLAGS="$CFLAGS -DOPTIMIZE_REDRAWING" fi # XXX(maybe not portable) if test "${USE_NLS}" = "yes" ; then AC_CHECK_LIB(intl,gettext, [ INTL_LIBS="-lintl" ]) fi AC_SUBST(INTL_LIBS) # Because pic object files are fat, non-pic ones are linked unless --disable-static # option is specified. if test "$enable_static" = "no" ; then MAIN_OBJ_SUFFIX=":.o=.lo" fi AC_SUBST(MAIN_OBJ_SUFFIX) CHANGE_DATE=`head -n 1 ${top_srcdir-$srcdir}/ChangeLog | sed -n 's/^\(@<:@0-9@:>@*-@<:@0-9@:>@*-@<:@0-9@:>@*\).*$/\1/p'` AC_SUBST(CHANGE_DATE) OUTPUT_FILES="main/version.h ${OUTPUT_FILES}" if test "${SUBDIRS}" != "" ; then # for baselib and encodefilter ac_configure_args="${ac_configure_args} --without-funcs-mlterm-unuse" if test "$enable_shared" = "no" ; then ac_configure_args="${ac_configure_args} --disable-dl-table" fi # for gui ac_configure_args=`echo ${ac_configure_args} | sed 's/--with-gui=@<:@A-Za-z0-9,@:>@*/--with-gui=subdir/g'` if test "$dl_ctl" != "no"; then ac_configure_args="${ac_configure_args} --disable-ind --disable-fribidi" fi ac_configure_args="${ac_configure_args} --without-tools" AC_CONFIG_SUBDIRS(${SUBDIRS}) fi MAKE_DIRS="vtemu vtemu/libctl uitoolkit/libtype uitoolkit main man etc ${MAKE_DIRS}" OUTPUT_FILES="Makefile vtemu/Makefile vtemu/libctl/Makefile uitoolkit/libtype/Makefile uitoolkit/Makefile main/Makefile man/Makefile etc/Makefile java/Makefile libvterm/Makefile ${OUTPUT_FILES}" AC_ARG_ENABLE(ind, [ --disable-ind libind @<:@default=enabled@:>@], ind=$enable_ind, ind="yes") if test "$gui" = "quartz" -o "$gui" = "console"; then IND_CFLAGS="-DNOT_CONVERT_TO_ISCII" ind="no" fi if test "$ind" = "yes" ; then IND_CFLAGS='-I${top_builddir}/libind' IND_LIBS='${top_builddir}/libind/libind.a' MAKE_DIRS="libind ${MAKE_DIRS}" OUTPUT_FILES="libind/Makefile ${OUTPUT_FILES}" if test "$dl_ctl" = "yes" ; then CTL_LIBS="libctl_iscii.la ${CTL_LIBS}" else CTL_CFLAGS="-DUSE_IND ${CTL_CFLAGS}" CTL_LIBS="libctl_iscii.a ${CTL_LIBS}" CTL_LIBS_FOR_PROG="../vtemu/libctl/libctl_iscii.a ${CTL_LIBS_FOR_PROG}" fi fi AC_SUBST(IND_LIBS) AC_SUBST(IND_CFLAGS) AC_SUBST(CTL_LIBS) AC_SUBST(CTL_LIBS_FOR_PROG) AC_ARG_ENABLE(brlapi, [ --enable-brlapi libbrlapi @<:@default=disabled@:>@], brlapi=$enable_brlapi, brlapi="no") if test "$brlapi" = "yes" ; then BRLAPI_CFLAGS='-DUSE_BRLAPI' BRLAPI_LIBS='-lbrlapi' if test "$host_os" != "haiku"; then INSTALL_OPT="-m 4755 -o root" fi fi AC_SUBST(BRLAPI_LIBS) AC_SUBST(BRLAPI_CFLAGS) AC_SUBST(PTHREAD_LIB) AC_SUBST(MAKE_DIRS) if test "${MAKE_DIRS}" != "" ; then mkdir -p ${MAKE_DIRS} fi AC_OUTPUT(${OUTPUT_FILES}) # ./configure at subdirs finished. if test -d baselib; then utmp_none_obj=`grep bl_utmp_none.o baselib/src/Makefile` elif test -d ../../baselib; then utmp_none_obj=`grep bl_utmp_none.o ../../baselib/src/Makefile` fi if test "$utmp_none_obj" = ""; then UTMP_CFLAGS="-DUSE_UTMP" fi AC_ARG_ENABLE(utmp-suid, [ --enable-utmp-suid install mlterm with SUID or SGID for utmp @<:@default=disabled@:>@], utmp_suid=$enable_utmp_suid) if test "$INSTALL_OPT" = ""; then # SUID is not set to mlterm on MacOSX/Quartz. if test "$utmp_suid" = "yes" -a "$utmp_none_obj" = "" -a "$gui" != "quartz"; then has_utmp=`grep utmp /etc/group 2>/dev/null` if test "$has_utmp" ; then INSTALL_OPT="-m 2755 -g utmp" else INSTALL_OPT="-m 4755 -o root" fi else INSTALL_OPT="-m 755" fi if test "$gui" = "fb" ; then INSTALL_OPT="-m 4755 -o root" fi fi cat main/Makefile | sed "s/@INSTALL_OPT@/$INSTALL_OPT/" | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > main/Makefile.new mv main/Makefile.new main/Makefile cat vtemu/Makefile | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > vtemu/Makefile.new mv vtemu/Makefile.new vtemu/Makefile # Remove 'as_fn_exit 0' sed '$d' ${CONFIG_STATUS} > ${CONFIG_STATUS}.new mv ${CONFIG_STATUS}.new ${CONFIG_STATUS} chmod 755 ${CONFIG_STATUS} cat >>$CONFIG_STATUS < main/Makefile.new mv main/Makefile.new main/Makefile cat vtemu/Makefile | sed "s/@UTMP_CFLAGS@/$UTMP_CFLAGS/" > vtemu/Makefile.new mv vtemu/Makefile.new vtemu/Makefile as_fn_exit 0 EOF # dummy declarations. AC_ARG_ENABLE(pty_helper, [ --enable-pty-helper use pty helper @<:@default=disabled@:>@]) AC_ARG_WITH(map-table, [ --without-map-table mapping table @<:@default=with@:>@]) AC_ARG_WITH(prop-table, [ --without-prop-table property table @<:@default=with@:>@]) AC_ARG_ENABLE(dl-table, [ --disable-dl-table dynamic loading table @<:@default=enable@:>@]) AC_ARG_WITH(utmp, [ --with-utmp@<:@=ARG@:>@ utmp (utempter,sysv,login,bsd,none)]) # configuration result echo echo echo "Mlterm was configured as follows" echo echo "Installation path prefix : $prefix" dnl echo "Character mapping table : " dnl echo "Character property table : " echo "Build shared libraries : $enable_shared" echo "Build static libraries : $enable_static" dnl echo "Optimization for redrawing a line : $optimize_redrawing" if test "$fbtype" = ""; then echo "GUI toolkit : $gui" else echo "GUI toolkit : $gui ($fbtype)" fi echo "BiDi rendering (Fribidi) : $have_fribidi" echo "Indic rendering : $ind" if test "$OT_LAYOUT_OBJ" = "hb.o"; then echo "OpenType Layout : yes (harfbuzz)" elif test "$OT_LAYOUT_OBJ" = "otf.o"; then echo "OpenType Layout : yes (libotf)" elif test "$OT_LAYOUT_OBJ" = "uniscribe.o"; then echo "OpenType Layout : yes (uniscribe)" else echo "OpenType Layout : no" fi echo "External tools :$tools_result" echo "Image processing : $image" echo "Built-in image library : $with_imagelib" echo "utmp support : $utmp" if test "$gui" = "fb" -o "$gui" = "wayland" -o "$gui" = "sdl2"; then if test "$have_ft" = "yes"; then if test "$fontconfig" = "yes"; then echo "Supported font formats : pcf ttf(+fontconfig)" else echo "Supported font formats : pcf ttf" fi else echo "Supported font formats : pcf" fi elif test "$gui" = "xlib"; then echo "Type engines :$type_engines_result" fi echo "DnD : $dnd" echo "Input Methods : XIM$input_methods_result" echo "Scrollbars : simple${scrollbars_result}" echo "libssh2 : $ssh2" echo "mosh directory : $MOSH_DIR" if test "$have_gtk" = "yes"; then echo "GTK+ : yes ($gtk_version)" else echo "GTK+ : no" fi if test "$VTE_ABI" = ""; then vte_version="" else vte_version=" (${VTE_ABI})" fi echo "libvte : $have_vte$vte_version" echo "brlapi : $brlapi" echo "VT52 : $vt52" echo "Permission of mlterm binary : $INSTALL_OPT" echo # This should be called at the end of configure. # If --with-gui=quartz,console is specified, copy uitoolkit/* to gui/console/uitoolkit # before removing following files. if test "$gui" = "quartz" ; then # ui_event_source.c, ui_sb_view_factory.c, ui_scrollbar.c and ui_simple_sb_view.c # exist in uitoolkit/ and uitoolkit/quartz/. # Those in uitoolkit/ must be removed to build those in uitoolkit/quartz/. (cd uitoolkit/quartz/ && \ for file in `ls *.c` ; do if test -f ../$file ; then mv ../$file ../xlib/ ; fi ; done) fi