# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.5) AC_INIT([serdisplib], [2.00], [mrwastl@users.sf.net]) # extra version postfix (may be used for adding info for patched versions but will NOT be evaluated) PACKAGE_VERSION_EXTRA="" #AC_CONFIG_SRCDIR([src/serdisp_control.c]) AC_CONFIG_HEADER([config.h]) AC_CANONICAL_SYSTEM # Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_CHECK_TOOLS(AR,[gar ar], [/usr/local/bin:/usr/bin:/usr/sfw/bin:${PATH}]) AC_CHECK_TOOLS(MAKE,[gmake make], [/usr/local/bin:/usr/bin:/usr/sfw/bin:${PATH}]) AC_PROG_MAKE_SET AC_CHECK_TYPES([uint32_t]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) # split version information PACKAGE_VERSION_MAJOR=`echo "${PACKAGE_VERSION}" | sed 's/\..*//'` PACKAGE_VERSION_MINOR=`echo "${PACKAGE_VERSION}" | sed 's/^.*\.//'` AC_SUBST([PACKAGE_VERSION]) AC_SUBST([PACKAGE_VERSION_MAJOR]) AC_SUBST([PACKAGE_VERSION_MINOR]) AC_SUBST([PACKAGE_VERSION_EXTRA]) # configure options AC_DEFUN(MY_ARG_ENABLE, [AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [enable support for $1 (default is $2)]), , [enable_$1=$2])]) AC_DEFUN(MY_ARG_WITH, [AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1], [include support for $1 (default is $2)]), , [ac_cv_use_$1=$withval], [ac_cv_use_$1=$2])]) AC_DEFUN(MY_ARG_ENABLE_CUSTOMHELP, [AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3 (default is $2)]), , [enable_$1=$2])]) AC_DEFUN(MY_ARG_WITH_LIST, [AC_ARG_WITH([$1], AC_HELP_STRING([--with-$1=], [$3 (default is '$2')]), , [ac_cv_use_$1=$withval], [ac_cv_use_$1=$2])]) # os-specific stuff # ugly hack for determination whether to build w/ or w/o soname, will be enhanced later # for now: soname only together with linux # ditto: framebuffer case $build in *-*-linux*) use_soname="true" may_support_fb="true" ;; *) use_soname="false" may_support_fb="false" ;; esac AC_SUBST(use_soname) # enable/disable experimental code MY_ARG_ENABLE_CUSTOMHELP([experimental], no, [enable experimental code]) if test "$enable_experimental" = "yes"; then AC_DEFINE(WITH_EXPERIMENTAL, 1, [whether to enable experimental code]) fi # enabling/disabling dynamic loading of libraries MY_ARG_ENABLE_CUSTOMHELP([dynloading], auto, [enable dynamic loading of external libraries (libpthread, libusb, ...)]) MY_ARG_ENABLE_CUSTOMHELP([statictools], yes, [link tools (eg. testserdisp) to static version of serdisplib]) MY_ARG_ENABLE_CUSTOMHELP([cypress_paranoia], auto, [deactivate libusb-support for certain cypress-based display modules]) MY_ARG_ENABLE_CUSTOMHELP([libusb], auto, [(only if --disable-dynloading): enable support for libusb, required by driver 'acoolsdcm' and USB-based output devices]) MY_ARG_ENABLE_CUSTOMHELP([libSDL], auto, [(only if --disable-dynloading): enable support for libSDL, required by driver 'directgfx']) MY_ARG_ENABLE_CUSTOMHELP([libdlo], auto, [(only if --disable-dynloading): enable support for libdlo, required by driver 'displaylink']) MY_ARG_ENABLE_CUSTOMHELP([pthread], auto, [(only if --disable-dynloading): enable multithreading support, required by events and GPIs)]) # deactivate libusb-support for certain cypress-based display modules (l4m132c, l4me5i) on linux systems # auto: disable libusb-support for linux-systems only (exceptions: arm- und mips-based systems) cypress_paranoia="true" if test "$enable_cypress_paranoia" = "no"; then cypress_paranoia="false" elif test "$enable_cypress_paranoia" = "yes"; then cypress_paranoia="true" else case $build in *-*-linux*) case $build in arm*-*-* | mips*-*-*) cypress_paranoia="false" ;; *) cypress_paranoia="true" ;; esac ;; *) cypress_paranoia="false" ;; esac fi AC_SUBST(cypress_paranoia) # link testserdisp, multidisplay using either the static or shared version of serdisplib # static: in-place testing + being sure that not using wrong version; needs more space # shared: for cross-compiling and space-considerations (embedded systems) if test "$enable_statictools" = "yes"; then use_sharedlib="false" else use_sharedlib="true" fi AC_SUBST(use_sharedlib) # Checks for libraries. AC_CHECK_HEADERS([gd/gd.h gd.h /opt/sfw/include/gd.h /usr/local/include/gd.h gd2/gd.h], [has_libgd_headers="true";break], [has_libgd_headers="false"]) AC_SUBST(has_libgd_headers) # special case sun solaris AC_CHECK_HEADERS([/opt/sfw/include/gd.h], [has_libgd_opt_sfw_headers="true";break], [has_libgd_opt_sfw_headers="false"]) AC_SUBST(has_libgd_opt_sfw_headers) # true colour supported since libgd v.2 => all versions of libgd < 2 are excluded here AC_CHECK_LIB([gd], [gdImageCreateTrueColor]) AC_CHECK_FUNCS([gdImageCreateTrueColor], [has_libgd_lib="true";break], [has_libgd_lib="false"]) AC_SUBST(has_libgd_lib) AC_CHECK_FUNCS([gdImageCreateFromGif]) # check for dyn. loading of libraries support # defines the following in config.h: # HAVE_DLFCN_H # WITH_DYNLOADING if defined: additional libraries are loaded dynamically via dlopen/dlsym AC_CHECK_HEADERS([dlfcn.h], [has_dynloading_headers="true";break], [has_dynloading_headers="false"]) has_dynloading="false" # pre-init if test "$has_dynloading_headers" = "true"; then if test "$enable_dynloading" != "no"; then # support for which kind of dynamic linking? AC_CHECK_LIB(dl, dlopen, [needs_libdl="true";break], [needs_libdl="false"]) AC_CHECK_FUNCS([dlsym], [has_dynloading="true";break], [has_dynloading="false"]) if test "$has_dynloading" = "false" ; then AC_CHECK_LIB(dl, dlsym, [has_dynloading="true";break], [has_dynloading="false"]) fi AC_SUBST(needs_libdl) if test "$has_dynloading" = "true" ; then AC_DEFINE(WITH_DYNLOADING, 1, [whether to use dynamic loading of libraries]) fi EXTRA_LIBS_STATIC="" if test "$needs_libdl" = "true" ; then EXTRA_LIBS_STATIC="-ldl" fi AC_SUBST(EXTRA_LIBS_STATIC) else has_dynloading="false" fi fi AC_SUBST(has_dynloading) # check for pthread header and library # defines the following in config.h: # HAVE_PTHREAD_H # HAVE_LIBTHREAD (only applicable if --enable-experimental) AC_CHECK_HEADERS([pthread.h], [has_pthread_headers="true";break], [has_pthread_headers="false"]) if test "$has_pthread_headers" = "true"; then if test "$has_dynloading" = "false"; then if test "$enable_pthread" != "no"; then AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_FUNCS([pthread_exit], [has_pthread_lib="true";break], [has_pthread_lib="false"]) AC_SUBST(has_pthread_lib) AC_DEFINE(HAVE_LIBPTHREAD, 0, [whether libpthread is available and usable (header files and, if no dynamic linking, library files available)]) if test "$has_pthread_lib" = "true"; then AC_DEFINE(HAVE_LIBPTHREAD, 1, [whether libpthread is available and usable (header files and, if no dynamic linking, library files available)]) LDFLAGS="${LDFLAGS} -lpthread" fi fi else # has_dynloading = true has_pthread_lib="true" AC_DEFINE(HAVE_LIBPTHREAD, 1, [whether libpthread is available and usable (header files and, if no dynamic linking, library files available)]) fi fi AC_SUBST(HAVE_LIBPTHREAD) # check for libusb header and library # defines the following in config.h: # HAVE_USB_H # HAVE_LIBUSB AC_PATH_PROG(LIBUSB_CONFIG, libusb-config) has_libusb="false" # pre-init if test ! -z "${LIBUSB_CONFIG}"; then LIBUSB_CFLAGS=`${LIBUSB_CONFIG} --cflags` CFLAGS="${CFLAGS} ${LIBUSB_CFLAGS}" #defines HAVE_USB_H if available AC_CHECK_HEADERS([usb.h], [has_libusb_headers="true";break], [has_libusb_headers="false"]) if test "$has_libusb_headers" = "true"; then LIBUSB_LIBS=`${LIBUSB_CONFIG} --libs` # save current LDFLAGS (to be restored after usb-detection) TEMP_LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS} ${LIBUSB_LIBS}" if test "$has_dynloading" = "true"; then AC_CHECK_LIB([usb], [usb_get_string_simple]) # if usb_get_string_simple() unavailable -> libusb too old (<= 0.1.7) AC_CHECK_FUNCS([usb_get_string_simple], [has_libusb="true";break], [has_libusb="false"]) AC_CHECK_FUNCS([usb_detach_kernel_driver_np], [has_libusb_detach_kdriver="true";break], [has_libusb_detach_kdriver="false"]) AC_DEFINE(HAVE_LIBUSB, 1, [whether libusb is available and usable (header files and, if no dynamic linking, library files available)]) # restore LDFLAGS LDFLAGS="${TEMP_LDFLAGS}" else # has_dynloading = false if test "$enable_libusb" != "no"; then AC_CHECK_LIB([usb], [usb_get_string_simple]) # if usb_get_string_simple() unavailable -> libusb too old (<= 0.1.7) AC_CHECK_FUNCS([usb_get_string_simple], [has_libusb="true";break], [has_libusb="false"]) AC_CHECK_FUNCS([usb_detach_kernel_driver_np], [has_libusb_detach_kdriver="true";break], [has_libusb_detach_kdriver="false"]) # restore LDFLAGS LDFLAGS="${TEMP_LDFLAGS}" if test "$has_libusb" = "true"; then AC_DEFINE(HAVE_LIBUSB, 1, [whether libusb is available and usable (header files and, if no dynamic linking, library files available)]) if test -z "$LIBUSB_LIBS"; then has_libusb="false" AC_DEFINE(HAVE_LIBSDL, 0, [whether libusb is available and usable (header files and, if no dynamic linking, library files available)]) else LDFLAGS="${LDFLAGS} ${LIBUSB_LIBS}" fi fi fi fi fi fi AC_SUBST(has_libusb) AC_SUBST(has_libusb_detach_kdriver) AC_SUBST(HAVE_LIBUSB) # libsdl # check for libSDL header and library # defines the following in config.h: # one of # HAVE_SDL_H # HAVE_SDL_SDL_H # HAVE_LIBSDL AC_PATH_PROG(LIBSDL_CONFIG, sdl-config) has_libSDL="false" # pre-init if test ! -z "${LIBSDL_CONFIG}"; then LIBSDL_CFLAGS=`${LIBSDL_CONFIG} --cflags` CFLAGS="${CFLAGS} ${LIBSDL_CFLAGS}" #defines either HAVE_SDL_SDL_H or HAVE_SDL_H AC_CHECK_HEADERS([SDL/SDL.h SDL.h], [has_libSDL_headers="true";break], [has_libSDL_headers="false"]) if test "$has_libSDL_headers" = "true"; then if test "$has_dynloading" = "true"; then has_libSDL="true" AC_DEFINE(HAVE_LIBSDL, 1, [whether libSDL is available and usable (header files and, if no dynamic linking, library files available)]) else # has_dynloading = false if test "$enable_libSDL" != "no"; then LIBSDL_LIBS=`${LIBSDL_CONFIG} --libs` # we don't want configure to auto-add libsdl because it will not be linked but included using libdl / dlopen() instead # so LDFLAGS will be restored after libsdl-detection TEMP_LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS} ${LIBSDL_LIBS}" # AC_CHECK_LIB([SDL], [SDL_SetVideoMode]) AC_CHECK_FUNCS([SDL_SetVideoMode], [has_libSDL="true";break], [has_libSDL="false"]) # restore LDFLAGS LDFLAGS="${TEMP_LDFLAGS}" if test "$has_libSDL" = "true"; then AC_DEFINE(HAVE_LIBSDL, 1, [whether libSDL is available and usable (header files and, if no dynamic linking, library files available)]) #CFLAGS="${CFLAGS} ${LIBSDL_CFLAGS}" if test -z "$LIBSDL_LIBS"; then has_libSDL="false" AC_DEFINE(HAVE_LIBSDL, 0, [whether libSDL is available and usable (header files and, if no dynamic linking, library files available)]) else LDFLAGS="${LDFLAGS} ${LIBSDL_LIBS}" fi fi fi fi fi fi AC_SUBST(has_libSDL) AC_SUBST(HAVE_LIBSDL) # libdlo # check for libdlo header and library # defines the following in config.h: # HAVE_DLO_H # HAVE_LIBDLO #AC_PATH_PROG(LIBDLO_CONFIG, libdlo-config) has_libdlo="false" # pre-init #if test ! -z "${LIBDLO_CONFIG}"; then # LIBDLO_CFLAGS=`${LIBDLO_CONFIG} --cflags` # CFLAGS="${CFLAGS} ${LIBDLO_CFLAGS}" #defines HAVE_DLO_H if available AC_CHECK_HEADERS([libdlo.h], [has_libdlo_headers="true";break], [has_libdlo_headers="false"]) if test "$has_libdlo_headers" = "true"; then if test "$has_dynloading" = "true"; then has_libdlo="true" AC_DEFINE(HAVE_LIBDLO, 1, [whether libdlo is available and usable (header files and, if no dynamic linking, library files available)]) else # has_dynloading = false if test "$enable_libdlo" != "no"; then LIBDLO_LIBS="-ldlo -lusb" # we don't want configure to auto-add libdlo because it will not be linked but included using libdl / dlopen() instead # so LDFLAGS will be restored after libdlo-detection TEMP_LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS} ${LIBDLO_LIBS}" # AC_CHECK_LIB([dlo], [dlo_init]) AC_CHECK_FUNCS([dlo_final], [has_libdlo="true";break], [has_libdlo="false"]) # restore LDFLAGS LDFLAGS="${TEMP_LDFLAGS}" if test "$has_libdlo" = "true"; then AC_DEFINE(HAVE_LIBDLO, 1, [whether libdlo is available and usable (header files and, if no dynamic linking, library files available)]) if test -z "$LIBDLO_LIBS"; then has_libdlo="false" AC_DEFINE(HAVE_LIBDLO, 0, [whether libdlo is available and usable (header files and, if no dynamic linking, library files available)]) else LDFLAGS="${LDFLAGS} ${LIBDLO_LIBS}" fi fi fi fi fi #fi AC_SUBST(has_libdlo) AC_SUBST(HAVE_LIBDLO) # socket, nsl # check for socket and nsl-based functions # defines the following in config.h: # one of # HAVE_SYS_SOCKET_H # HAVE_NETDB_H # HAVE_NETSOCK_LIBS (only applicable if --enable-experimental) AC_CHECK_HEADERS([sys/socket.h], [has_netsock_headers="true";break], [has_netsock_headers="false"]) if test "$has_netsock_headers" = "true" ; then AC_CHECK_HEADERS([netdb.h], [has_netsock_headers="true";break], [has_netsock_headers="false"]) fi if test "$has_netsock_headers" = "true"; then if test "$has_dynloading" = "false"; then # some systems require additional libs for socket and endhostent & co TEMP_LIBS="${LIBS}" LIBS="" AC_SEARCH_LIBS([socket], [socket nsl]) AC_SEARCH_LIBS([endhostent], [socket nsl]) LDFLAGS="${LIBS} ${LDFLAGS}" LIBS="${LIBS} ${TEMP_LIBS}" AC_CHECK_FUNCS([socket], [has_netsock_libs="true";break], [has_netsock_libs="false"]) if test "$has_netsock_libs" = "true" ; then AC_CHECK_FUNCS([endhostent], [has_netsock_libs="true";break], [has_netsock_libs="false"]) fi AC_DEFINE(HAVE_NETSOCK_LIBS, 0, [whether support for socket and nsl-based functions is available and usable (header files and, if no dynamic linking, library files available)]) if test "$has_netsock_libs" = "true"; then AC_DEFINE(HAVE_NETSOCK_LIBS, 1, [whether support for socket and nsl-based functions is available and usable (header files and, if no dynamic linking, library files available)]) fi else # has_dynloading = true AC_DEFINE(HAVE_NETSOCK_LIBS, 1, [whether support for socket and nsl-based functions is available and usable (header files and, if no dynamic linking, library files available)]) has_netsock_libs="true" fi fi AC_SUBST(has_netsock_libs) AC_SUBST(HAVE_NETSOCK_LIBS) # check for fb.h for framebuffer (only on linux systems) # defines the following in config.h: # HAVE_LINUX_FB_H # HAVE_SYS_MMAN_H if test "${may_support_fb}" = "true" ; then AC_CHECK_HEADERS([linux/fb.h], [has_fb_headers="true";break], [has_fb_headers="false"]) # check for sys/mman.h too if test "${has_fb_headers}" = "true"; then AC_CHECK_HEADERS([sys/mman.h], [has_fb_headers="true";break], [has_fb_headers="false"]) fi else has_fb_headers="false" fi AC_SUBST(has_fb_headers) ### enable/disable drivers enabled_drivers="" # which drivers to enable # not beautiful at the moment but it works AC_DEFUN(MY_WITH_DRIVER, [AC_DEFINE(WITH_DRIVER_$1, $2, driver support for $3) if test "$2" = "1"; then WITH_DRIVER_$1=true enabled_drivers="${enabled_drivers}, $3" else WITH_DRIVER_$1=false fi AC_SUBST(WITH_DRIVER_$1)]) # some ideas taken from lcd4linux AC_ARG_WITH( drivers, [ --with-drivers= compile drivers given in ,] [ drivers may be separated with commas,] [ 'all' (default) compiles all available drivers,] [ drivers may be excluded with 'all,-' or ] [ 'all,!' (eg.: 'all,-i2c,-sed133x').] [ (try 'all,\!' if your shell complains...)] [ ] [ possible drivers are:] [ acoolsdcm, ddusbt, directgfx, goldelox, i2c,] [ ks0108, l4m, lc7981, lh155, nokcol, pcd8544, rs232,] [ sed133x, sed153x, sed156x, ssdoled, stv8105, t6963] [ only if --with-experimental is enabled: ] [ displaylink, remote ] [ only with linux systems: ] [ framebuffer ], drivers=${withval}, drivers=all ) drivers=`echo ${drivers} | sed -e 's/,/ /g'` all_drivers="undef" for driver in ${drivers} ; do case $driver in !*|-*) val="no" driver=`echo $driver|cut -c 2-` ;; *) val="yes" ;; esac if test "${driver}" = "all" ; then if test "${all_drivers}" = "undef" ; then all_drivers="yes" else AC_MSG_ERROR(['all' must be first element in driver list]) fi else # 'all' may only occur as first element in the list if test "${all_drivers}" = "undef" ; then all_drivers="no" fi case "$driver" in sed153x) if test "${val}" = "yes" ; then MY_WITH_DRIVER(SED153X, 1, [sed153x]) else MY_WITH_DRIVER(SED153X, 0, [sed153x]) fi ;; pcd8544) if test "${val}" = "yes" ; then MY_WITH_DRIVER(PCD8544, 1, [pcd8544]) else MY_WITH_DRIVER(PCD8544, 0, [pcd8544]) fi ;; sed156x) if test "${val}" = "yes" ; then MY_WITH_DRIVER(SED156X, 1, [sed156x]) else MY_WITH_DRIVER(SED156X, 0, [sed156x]) fi ;; i2c) if test "${val}" = "yes" ; then MY_WITH_DRIVER(I2C, 1, [i2c]) else MY_WITH_DRIVER(I2C, 0, [i2c]) fi ;; t6963) if test "${val}" = "yes" ; then MY_WITH_DRIVER(T6963, 1, [t6963]) else MY_WITH_DRIVER(T6963, 0, [t6963]) fi ;; sed133x) if test "${val}" = "yes" ; then MY_WITH_DRIVER(SED133X, 1, [sed133x]) else MY_WITH_DRIVER(SED133X, 0, [sed133x]) fi ;; nokcol) if test "${val}" = "yes" ; then MY_WITH_DRIVER(NOKCOL, 1, [nokcol]) else MY_WITH_DRIVER(NOKCOL, 0, [nokcol]) fi ;; ks0108) if test "${val}" = "yes" ; then MY_WITH_DRIVER(KS0108, 1, [ks0108]) else MY_WITH_DRIVER(KS0108, 0, [ks0108]) fi ;; lh155) if test "${val}" = "yes" ; then MY_WITH_DRIVER(LH155, 1, [lh155]) else MY_WITH_DRIVER(LH155, 0, [lh155]) fi ;; ssdoled) if test "${val}" = "yes" ; then MY_WITH_DRIVER(SSDOLED, 1, [ssdoled]) else MY_WITH_DRIVER(SSDOLED, 0, [ssdoled]) fi ;; l4m) if test "${val}" = "yes" ; then MY_WITH_DRIVER(L4M, 1, [l4m]) else MY_WITH_DRIVER(L4M, 0, [l4m]) fi ;; goldelox) if test "${val}" = "yes" ; then MY_WITH_DRIVER(GOLDELOX, 1, [goldelox]) else MY_WITH_DRIVER(GOLDELOX, 0, [goldelox]) fi ;; stv8105) if test "${val}" = "yes" ; then MY_WITH_DRIVER(STV8105, 1, [stv8105]) else MY_WITH_DRIVER(STV8105, 0, [stv8105]) fi ;; acoolsdcm|alphacool) if test "${val}" = "yes" ; then if test "$has_libusb" = "true" ; then MY_WITH_DRIVER(ACOOLSDCM, 1, [acoolsdcm]) else MY_WITH_DRIVER(ACOOLSDCM, 0, [acoolsdcm]) fi else MY_WITH_DRIVER(ACOOLSDCM, 0, [acoolsdcm]) fi ;; rs232) if test "${val}" = "yes" ; then MY_WITH_DRIVER(RS232, 1, [rs232]) else MY_WITH_DRIVER(RS232, 0, [rs232]) fi ;; lc7981) if test "${val}" = "yes" ; then MY_WITH_DRIVER(LC7981, 1, [lc7981]) else MY_WITH_DRIVER(LC7981, 0, [lc7981]) fi ;; ddusbt) if test "${val}" = "yes" ; then MY_WITH_DRIVER(DDUSBT, 1, [ddusbt]) else MY_WITH_DRIVER(DDUSBT, 0, [ddusbt]) fi ;; directgfx) if test "${val}" = "yes" ; then if test "$has_libSDL" = "true" ; then MY_WITH_DRIVER(DIRECTGFX, 1, [directgfx]) else MY_WITH_DRIVER(DIRECTGFX, 0, [directgfx]) fi else MY_WITH_DRIVER(DIRECTGFX, 0, [directgfx]) fi ;; displaylink) if test "${enable_experimental}" = "yes" ; then if test "${val}" = "yes" ; then if test "$has_libdlo" = "true" ; then MY_WITH_DRIVER(DISPLAYLINK, 1, [displaylink]) else MY_WITH_DRIVER(DISPLAYLINK, 0, [displaylink]) fi else MY_WITH_DRIVER(DISPLAYLINK, 0, [displaylink]) fi else # hide from enabled/disabled drivers list experimental_hide_displaylink="1" fi ;; framebuffer) if test "${may_support_fb}" = "true" ; then if test "${val}" = "yes" ; then if test "$has_fb_headers" = "true" ; then MY_WITH_DRIVER(FRAMEBUFFER, 1, [framebuffer]) else MY_WITH_DRIVER(FRAMEBUFFER, 0, [framebuffer]) fi else MY_WITH_DRIVER(FRAMEBUFFER, 0, [framebuffer]) fi else # hide from enabled/disabled drivers list experimental_hide_framebuffer="1" fi ;; remote) if test "${enable_experimental}" = "yes" ; then if test "${val}" = "yes" ; then if test "${has_netsock_libs}" = "true" ; then MY_WITH_DRIVER(REMOTE, 1, [remote]) else MY_WITH_DRIVER(REMOTE, 0, [remote]) fi else MY_WITH_DRIVER(REMOTE, 0, [remote]) fi else # hide from enabled/disabled drivers list experimental_hide_remote="1" fi ;; *) AC_MSG_ERROR([Unknown driver '$driver']) ;; esac fi done # 'all driver'-step # if some driver has already been undefined before it will NOT be overruled here if test "${all_drivers}" = "yes" ; then if test -z "${WITH_DRIVER_SED153X}" ; then MY_WITH_DRIVER(SED153X, 1, [sed153x]) fi if test -z "${WITH_DRIVER_PCD8544}" ; then MY_WITH_DRIVER(PCD8544, 1, [pcd8544]) fi if test -z "${WITH_DRIVER_SED156X}" ; then MY_WITH_DRIVER(SED156X, 1, [sed156x]) fi if test -z "${WITH_DRIVER_I2C}" ; then MY_WITH_DRIVER(I2C, 1, [i2c]) fi if test -z "${WITH_DRIVER_T6963}" ; then MY_WITH_DRIVER(T6963, 1, [t6963]) fi if test -z "${WITH_DRIVER_SED133X}" ; then MY_WITH_DRIVER(SED133X, 1, [sed133x]) fi if test -z "${WITH_DRIVER_NOKCOL}" ; then MY_WITH_DRIVER(NOKCOL, 1, [nokcol]) fi if test -z "${WITH_DRIVER_KS0108}" ; then MY_WITH_DRIVER(KS0108, 1, [ks0108]) fi if test -z "${WITH_DRIVER_LH155}" ; then MY_WITH_DRIVER(LH155, 1, [lh155]) fi if test -z "${WITH_DRIVER_SSDOLED}" ; then MY_WITH_DRIVER(SSDOLED, 1, [ssdoled]) fi if test -z "${WITH_DRIVER_L4M}" ; then MY_WITH_DRIVER(L4M, 1, [l4m]) fi if test -z "${WITH_DRIVER_GOLDELOX}" ; then MY_WITH_DRIVER(GOLDELOX, 1, [goldelox]) fi if test -z "${WITH_DRIVER_STV8105}" ; then MY_WITH_DRIVER(STV8105, 1, [stv8105]) fi if test -z "${WITH_DRIVER_ACOOLSDCM}" ; then if test "$has_libusb" = "true" ; then MY_WITH_DRIVER(ACOOLSDCM, 1, [acoolsdcm]) fi fi if test -z "${WITH_DRIVER_DIRECTGFX}" ; then if test "$has_libSDL" = "true" ; then MY_WITH_DRIVER(DIRECTGFX, 1, [directgfx]) fi fi if test -z "${WITH_DRIVER_RS232}" ; then MY_WITH_DRIVER(RS232, 1, [rs232]) fi if test -z "${WITH_DRIVER_LC7981}" ; then MY_WITH_DRIVER(LC7981, 1, [lc7981]) fi if test -z "${WITH_DRIVER_DDUSBT}" ; then MY_WITH_DRIVER(DDUSBT, 1, [ddusbt]) fi if test "${enable_experimental}" = "yes" ; then if test -z "${WITH_DRIVER_DISPLAYLINK}" ; then if test "$has_libdlo" = "true" ; then MY_WITH_DRIVER(DISPLAYLINK, 1, [displaylink]) fi fi else # hide from enabled/disabled drivers list experimental_hide_displaylink="1" fi if test "${may_support_fb}" = "true" ; then if test -z "${WITH_DRIVER_FRAMEBUFFER}" ; then if test "$has_fb_headers" = "true" ; then MY_WITH_DRIVER(FRAMEBUFFER, 1, [framebuffer]) fi fi else # hide from enabled/disabled drivers list experimental_hide_framebuffer="1" fi if test "${enable_experimental}" = "yes" ; then if test -z "${WITH_DRIVER_REMOTE}" ; then if test "${has_netsock_libs}" = "true" ; then MY_WITH_DRIVER(REMOTE, 1, [remote]) fi fi else # hide from enabled/disabled drivers list experimental_hide_remote="1" fi fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h stdlib.h string.h strings.h sys/ioctl.h sys/time.h sys/resource.h syslog.h termios.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_C_VOLATILE # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_CHECK_FUNCS([gettimeofday memset strcasecmp strchr strerror strncasecmp strrchr strtol]) # generate serdisplib.spec using serdisplib.spec.in (does not work with older autoconf) AC_CONFIG_FILES([serdisplib.spec]) # version number in serdisp_control.h is generated automatically AC_CONFIG_FILES([include/serdisplib/serdisp_control.h]) # generate makefiles AC_CONFIG_FILES([src/Makefile tools/Makefile Makefile]) # generate DOCS/Doxyfile using DOCS/Doxyfile.in AC_CONFIG_FILES([DOCS/Doxyfile]) # generate pkg-config file AC_CONFIG_FILES([serdisplib.pc]) if test "$WITH_DRIVER_REMOTE" = "true"; then AC_CONFIG_FILES([server/Makefile]) fi # generate timestamp to test if configure.in was changed AC_OUTPUT(,echo timestamp > stamp-h) # copy bitbake file (template-filename to version-based filename) rm -f buildfiles/serdisplib_*.bb cp buildfiles/templates/serdisplib_TEMPLATE.bb buildfiles/serdisplib_$PACKAGE_VERSION.bb echo "" if test "$PACKAGE_VERSION_EXTRA" = ""; then echo "serdisplib version: $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR" else echo "serdisplib version: $PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_EXTRA" fi echo "" lib_linkingtype="dynamically added via dlopen()" echo "" echo "" echo "features" echo "========" if test "$enable_experimental" = "yes"; then echo " * experimental code ... enabled" else echo " * experimental code ... disabled" fi if test "$enable_dynloading" = "no"; then echo " * dyn. loading of libraries ... disabled" lib_linkingtype="statically linked" elif test "$enable_dynloading" = "auto" -a "$has_dynloading" = "false"; then echo " * dyn. loading of libraries ... disabled (support not found)" lib_linkingtype="statically linked" else if test "$has_dynloading" = "true" ; then echo " * dyn. loading of libraries ... yes" if test "$needs_libdl" = "true" ; then echo "" echo " NOTE: " echo " All binaries that are linking the static version of libserdisp also require to link libdl!" echo " (eg.: gcc -o app app.o libserdisp.a -ldl)" echo "" echo " This is NOT necessary if linking the dynamic version (eg.: gcc -o app app.o -lserdisp)" fi else echo " * dynamic linking ... no (dlopen(), dlsym(), ... not found)" lib_linkingtype="statically linked" fi fi echo "" echo "" echo "supported extra libraries" echo "=========================" if test "$has_libusb" = "true"; then if test "$has_libusb_detach_kdriver" = "true"; then echo " * libusb support ... yes (${lib_linkingtype})" else echo " * libusb support ... yes, but without usb_detach_kernel_driver_np()" fi else if test "$enable_libusb" = "no"; then echo " * libusb support ... disabled" elif test "$has_libusb_headers" = "false"; then echo " * libusb support ... header file (usb.h) not found" else echo " * libusb support ... no, or too old (at least headers for libusb 0.1.7 are needed)" fi fi if test "$has_libSDL" = "true"; then echo " * libSDL support ... yes (${lib_linkingtype})" else if test "$enable_libSDL" = "no"; then echo " * libSDL support ... disabled" else echo " * libSDL support ... no (header files and/or library not found)" fi fi if test "$has_pthread_lib" = "true"; then echo " * libpthread support ... yes (${lib_linkingtype})" else if test "$enable_pthread" = "no"; then echo " * libpthread support ... disabled" else echo " * libpthread support ... no (header files and/or library not found)" fi fi if test "${enable_experimental}" = "yes" ; then if test "$has_libdlo" = "true"; then echo " * libdlo support ... yes (${lib_linkingtype})" else if test "$enable_libdlo" = "no"; then echo " * libdlo support ... disabled" else echo " * libdlo support ... no (header files and/or library not found)" fi fi fi if test "$enable_dynlinking" = "no"; then if test "$has_pthread_lib" = "true"; then echo " * pthread support ... yes (statically linked)" else echo " * pthread support ... disabled" fi fi if test "$has_libgd_lib" = "true"; then if test "$has_libgd_headers" = "true"; then echo " * libgd >= 2 support ... yes" else echo " * libgd >= 2 support ... yes, but header files are missing" fi else echo " * libgd >= 2 support ... no " fi disabled_drivers="" for possible_driver in `echo $ac_subst_vars ` ; do if test "`echo ${possible_driver} | grep 'WITH_DRIVER_' 2> /dev/null`" != "" ; then if test "$(eval echo \${$possible_driver})" != "true" ; then driver_lc=`echo "${possible_driver}" | sed -e 's/WITH_DRIVER_//' | tr 'A-Z' 'a-z'` experimental_hide_driver="experimental_hide_${driver_lc}" if test "$(eval echo \${$experimental_hide_driver})" != "1" ; then disabled_drivers="${disabled_drivers}, ${driver_lc}" fi fi fi done enabled_drivers=`echo ${enabled_drivers} | cut -c 3-` disabled_drivers=`echo ${disabled_drivers} | cut -c 3-` echo "" echo "" echo "enabled(+) / disabled(-) drivers" echo "================================" echo " + ${enabled_drivers}" echo " - ${disabled_drivers}" echo "" echo "" echo "tools" echo "=====" if test "$has_libgd_headers" = "true" -a "$has_libgd_lib" = "true"; then echo " * multidisplay ... yes" if test "$ac_cv_func_gdImageCreateFromGif" = "yes" ; then echo " - with GIF support ... yes" else echo " - with GIF support ... no (recent libgd needed for GIF support)" fi else if test "$has_libgd_lib" = "false"; then echo " * multidisplay ... no (because of missing libgd)" else echo " * multidisplay ... no (because of missing header files for libgd)" fi fi echo "" echo "--- Now type \"$MAKE\" to build $PACKAGE_NAME" echo "--- (on linux systems, 'make' and 'gmake' usually are the same)" echo "---" echo "--- For testing $PACKAGE_NAME use \"src/testserdisp\"" echo ""