dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.58]) AC_INIT(jpilot, 0.99.9) AM_INIT_AUTOMAKE([1.8]) AC_CANONICAL_HOST dnl create a config.h file (Automake will add -DHAVE_CONFIG_H) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE AC_SUBST(VERSION) AC_SUBST(CFLAGS) AC_PROG_CC AC_ISC_POSIX AC_DISABLE_STATIC AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL AC_PROG_INSTALL AC_PATH_PROG([SED], [sed], [ AC_MSG_ERROR([sed is required]) ]) if test "x$prefix" = "xNONE"; then AC_DEFINE_UNQUOTED(BASE_DIR, "$ac_default_prefix", [ BASE_DIR ]) else AC_DEFINE_UNQUOTED(BASE_DIR, "$prefix", [ BASE_DIR ]) fi dnl ****************************** dnl * dialer conditional dnl ****************************** dnl check operating system for jpilot-dialer case "${build_os}" in linux-gnu) dialer=yes ;; *) AC_MSG_WARN([Operating system ${build_os} not supported by jpilot-dialer]) ; dialer=no ;; esac AM_CONDITIONAL(JPILOT_DIALER, test x$dialer = xyes) dnl ****************************** dnl * start gettext dnl ****************************** AC_PROG_INTLTOOL() dnl Set of available languages ALL_LINGUAS="ca cs da de es fr it ja ko nl no ru rw sv tr uk vi zh_CN zh_TW" dnl AM_GNU_GETTEXT([]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.14.5]) if test "x$MSGFMT" = "xno"; then if test "x$GMSGFMT" = "xno"; then AC_MSG_RESULT(I can't find gettext) AC_MSG_ERROR(Either install gettext or use 'configure --disable-nls') fi fi AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(INTLOBJS) AC_SUBST(GLIBC21) AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) AC_SUBST(INTLBISON) dnl ****************************** dnl * end gettext dnl ****************************** dnl ****************************** dnl * pilot-link libs dnl ****************************** dnl Check for pilot-link libs pilot_prefix="" AC_ARG_WITH(pilot_prefix, AC_HELP_STRING([--with-pilot-prefix=PFX],[Prefix to top level of pilot-link files (e.g., = /usr/local if the pilot-link includes are in /usr/local/include and libs are in /usr/local/lib)])) if test "x$with_pilot_prefix" != "x"; then pilot_prefix=$with_pilot_prefix fi dnl Make sure that the pilot-link stuff actually exists AC_MSG_CHECKING(for pilot-link header files) pilotinclude=${FORCE_PILOT_INCLUDES:-no} if test $pilotinclude = no ; then for pilot_incl in $pilot_prefix/include /usr/include /usr/local/include \ /usr/extra/pilot/include /usr/include/libpisock; do if test -r "$pilot_incl/pi-version.h" ; then pilotinclude=yes PILOT_FLAGS="$PILOT_FLAGS -I$pilot_incl" break fi done fi if test $pilotinclude = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not find the pilot-link header files) else AC_MSG_RESULT(found at $pilot_incl) fi dnl pilot-link maybe installed at this point AC_MSG_CHECKING(for pilot library files) pilotlibs=${FORCE_PILOT_LIBS:-no} PILOT_LIBS="-lpisock" if test $pilotlibs = no ; then for pilot_libs in $pilot_prefix/lib /usr/lib /usr/local/lib/ \ /usr/extra/pilot/lib ; do if test -r $pilot_libs/libpisock.so >/dev/null 2>&1 ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi if test -r "$pilot_libs/libpisock.a" ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi if test -r "$pilot_libs/libpisock.sl" ; then pilotlibs=yes PILOT_LIBS="-L$pilot_libs $PILOT_LIBS" break fi done fi if test $pilotlibs = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not find the pilot-link libraries) else AC_MSG_RESULT(found at $pilot_libs) fi dnl Solaris needs the socket library dnl AC_CHECK_LIB(socket, main, PILOT_LIBS=$PILOT_LIBS" -lsocket", , ) AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) AC_ARG_ENABLE(pl-test, AC_HELP_STRING([--disable-pl-test],[Do not try to compile a test pilot-link program]), enable_pl_test=$enableval, enable_pl_test=yes) if test "x$enable_pl_test" = "xyes"; then dnl Check to make sure pilot-link library can be linked pilotcompile=no dnl ************************* dnl * Link a tiny program to make sure we have the environment right dnl ************************* AC_MSG_CHECKING(to see if I can compile a pilot link program) save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PILOT_FLAGS" save_LIBS="$LIBS" LIBS="$LIBS $PILOT_LIBS" AC_TRY_LINK([#include "pi-version.h" #include "pi-socket.h"], [pi_close (0);] , pilotcompile=yes, , ) if test $pilotcompile = no ; then AC_MSG_RESULT(no) AC_MSG_ERROR(Could not compile a test pilot-link program) else AC_MSG_RESULT(ok) AC_SUBST(PILOT_FLAGS) AC_SUBST(PILOT_LIBS) fi dnl ****************************** dnl * Try to run a pilot-link program (tests dynamic linking) dnl ****************************** AC_MSG_CHECKING(running a pilot-link program ) AC_TRY_RUN([ #include int main() { return 0; } ], AC_MSG_RESULT([ok]), AC_MSG_ERROR([ * Can not run a pilot-link test program * Make sure libpisock can be found by ld * Check /etc/ld.so.conf and run ldconfig * This test can be disabled by the --disable-pl-test option]) , [ error ]) fi dnl ************************* dnl * Check pilot-link pi-version.h dnl ************************* AC_MSG_CHECKING(pilot-link version ) dnl ** save CFLAGS save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PILOT_FLAGS" save_LIBS="$LIBS" LIBS="$LIBS $PILOT_LIBS" dnl *** check for pi-version.h AC_TRY_COMPILE([#include ], [ exit(0); ], , AC_MSG_ERROR([pilot-link header pi-version.h not found]) ) dnl ***** dnl * Pilot-link version variations, USB support, 12.0, etc. dnl ***** usb=no; pl12=no; pl_version_check_done=no; pl_version=`grep "define PILOT_LINK_VERSION" "$pilot_incl/pi-version.h" | \ cut -d " " -f 3` pl_major=`grep "define PILOT_LINK_MAJOR" "$pilot_incl/pi-version.h" | \ cut -d " " -f 3` pl_minor=`grep "define PILOT_LINK_MINOR" "$pilot_incl/pi-version.h" | \ cut -d " " -f 3` pl_patch=`grep "define PILOT_LINK_PATCH" "$pilot_incl/pi-version.h" | \ cut -d " " -f 3 | sed -e 's/"//g'` AC_MSG_RESULT([pi-version indicates $pl_version.$pl_major.$pl_minor]) dnl *** check for pilot-link 0.12 and up if test $pl_version -eq 0 ; then if test $pl_major -ge 12 ; then pl12=yes usb=yes pl_version_check_done=yes; AC_MSG_RESULT([pilot-link has USB]) AC_MSG_RESULT([pilot-link has card support (>12.0)]) fi fi dnl *** check for pilot-link 0.11 dnl *** check for broken pilot-link versions if test "x$pl_version_check_done" = "xno"; then if test $pl_version -eq 0 ; then if test $pl_major -eq 11 ; then if test $pl_minor -eq 0 ; then AC_MSG_ERROR([pilot-link versions 0.11.0 - 0.11.2 are not compatible with J-Pilot]) fi if test $pl_minor -eq 1 ; then AC_MSG_ERROR([pilot-link versions 0.11.0 - 0.11.2 are not compatible with J-Pilot]) fi if test $pl_minor -eq 2 ; then AC_MSG_ERROR([pilot-link versions 0.11.0 - 0.11.2 are not compatible with J-Pilot]) fi usb=yes pl_version_check_done=yes; AC_MSG_RESULT([pilot-link has USB]) fi fi fi dnl *** check for pilot-link 0.10 dnl *** check for broken pilot-link versions if test "x$pl_version_check_done" = "xno"; then if test $pl_version -eq 0 ; then if test $pl_major -eq 10 ; then usb=yes pl_version_check_done=yes; AC_MSG_RESULT([pilot-link has USB]) AC_MSG_RESULT([pilot-link 0.10.x is not recommended]) fi fi fi dnl *** Check for pilot-link 0.9.0 or older if test "x$pl_version_check_done" = "xno"; then if test $pl_version -eq 0 ; then if test $pl_major -lt 10 ; then AC_MSG_RESULT([older than 0.10.0 ... USB will NOT be enabled]) AC_MSG_RESULT([This should be ok for old USB visors]) pl_version_check_done=yes; fi fi fi dnl *** dnl *** check for broken pilot-links dnl *** if test $pl_version -eq 0 ; then if test $pl_major -eq 12 ; then if test $pl_minor -eq 0 ; then if test $pl_patch = "-pre2" ; then AC_MSG_RESULT([pilot-link 0.12.0-pre2 was found]) AC_MSG_ERROR([pilot-link 0.12.0-pre2 is not recommended, \ it has some bugs with not fetching the category app info]) fi fi fi fi if test "x$usb" = "xyes"; then AC_DEFINE(USB_PILOT_LINK, 1, [ usb support ]) fi if test "x$pl12" = "xyes"; then AC_DEFINE(PILOT_LINK_0_12, 1, [ pl-0.12 support ]) fi CFLAGS="$save_CFLAGS" LIBS="$save_LIBS" dnl ****************************** dnl * End pilot-links tests dnl ****************************** dnl ****************************** dnl * Enable/Disable features dnl ****************************** AC_ARG_ENABLE(plugins, AC_HELP_STRING([--disable-plugins],[Do not compile plugin support]), enable_plugins=$enableval, enable_plugins=yes) plugin_support=no if test "x$enable_plugins" = "xyes"; then # dnl Check for shared library calls # AC_MSG_CHECKING(for dlopen) # save_LIBS="$LIBS" # LIBS="$LIBS -ldl" # AC_TRY_LINK([#include ], [dlopen("huh",0);] , have_dlopen=yes, , ) # LIBS="$save_LIBS" AC_CHECK_FUNCS(dlopen) if test "x$ac_cv_func_dlopen" = "xyes"; then have_dlopen=yes else for lib in dl; do AC_CHECK_LIB($lib, dlopen, [LIBS="$LIBS -ldl"; have_dlopen=yes; break]) done fi if test "x$have_dlopen" = "xyes"; then AC_DEFINE(ENABLE_PLUGINS, 1, [ plugin support ]) plugin_support="yes" AC_SUBST(plugin_support) else AC_MSG_RESULT(Could not find dlopen - not using plugin support) fi else AC_MSG_RESULT(Plugin support disabled by configure options) fi AC_ARG_ENABLE(private, AC_HELP_STRING([--disable-private],[Do not use private records feature (password not needed to see private records)]), enable_private=$enableval, enable_private=yes; AC_DEFINE(ENABLE_PRIVATE, 1, [ Private record support ])) if test $enable_private = no; then AC_MSG_RESULT(Private record support disabled by configure options) fi AC_ARG_ENABLE(datebk, AC_HELP_STRING([--disable-datebk],[Disable Datebk support]), enable_datebk=$enableval, enable_datebk=yes; AC_DEFINE(ENABLE_DATEBK, 1, [ DateBk support ]) ) if test $enable_datebk = no; then AC_MSG_RESULT(Datebk support disabled by configure options) fi AC_ARG_ENABLE(manana, AC_HELP_STRING([--disable-manana],[Disable Maņana support]), enable_manana=$enableval, enable_manana=yes; AC_DEFINE(ENABLE_MANANA, 1, [ Manana support ]) ) if test $enable_manana = no; then AC_MSG_RESULT(Maņana support disabled by configure options) fi AC_ARG_ENABLE(prometheon, AC_HELP_STRING([--enable-prometheon],[For use with Prometheon: http://www.prometheon.net]), enable_prometheon=$enableval; AC_DEFINE(ENABLE_PROMETHEON, 1, [ Prometheon support ]) AC_DEFINE_UNQUOTED(PROGNAME, "copilot", [ program name ]) , enable_prometheon=no; AC_DEFINE_UNQUOTED(PROGNAME, "jpilot", [ program name ]) ) if test $enable_prometheon = yes; then AC_MSG_RESULT(Prometheon support enabled) fi AC_SUBST(PROGNAME) AC_ARG_ENABLE(alarm-shell-danger, AC_HELP_STRING([--enable-alarm-shell-danger],[Allow alarm descriptions and notes to be used in alarm shell commands]), enable_alarm_shell_danger=$enableval; AC_DEFINE(ENABLE_ALARM_SHELL_DANGER, 1, [ Datebook description and note allowed in shell commands ]) , enable_alarm_shell_danger=no; ) dnl ************************* dnl * GTK 2 dnl ************************* AC_ARG_ENABLE(gtk2, AC_HELP_STRING([--disable-gtk2],[Disable GTK2 support and compile with GTK1]), enable_gtk2=$enableval, enable_gtk2=yes; AC_DEFINE(ENABLE_GTK2, 1, [ GTK-2 support ]) ) if test $enable_gtk2 = no; then AC_MSG_RESULT(GTK2 support disabled by configure options) fi dnl Checking for GTK version dnl Check for GTK2 have_gtk2=no; if test "x$enable_gtk2" = "xyes"; then AM_PATH_GTK_2_0(2.0.3, have_gtk2=yes, AC_MSG_ERROR([*** GTK >= 2.0.3 not found ***])) fi if test "x$have_gtk2" = "xno"; then AM_PATH_GTK(1.2.0,, AC_MSG_ERROR([*** GTK >= 1.2.0 not found ***])) fi dnl ************************* dnl * Stock buttons dnl ************************* AC_ARG_ENABLE(stock_buttons, AC_HELP_STRING([--enable-stock-buttons],[Enable stock buttons]), AC_MSG_RESULT(stock buttons enabled by configure options), ) if test "x$enable_stock_buttons" = "xyes"; then if test "x$have_gtk2" = "xyes"; then AC_DEFINE(ENABLE_STOCK_BUTTONS, 1, [ Use GTK2 stock buttons ]) else AC_MSG_ERROR([GTK2 required for stock buttons]) fi fi dnl ************************* dnl * End Stock buttons dnl ************************* dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HAVE_HEADERS(fcntl.h sys/file.h sys/time.h unistd.h string.h locale.h langinfo.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_FUNC_UTIME_NULL #AC_CHECK_FUNCS(mkdir mktime select strdup strstr setenv) AC_CHECK_FUNCS(memmove strchr memcpy strdup setenv \ getcwd strerror) AC_CHECK_FUNCS(setenv) AC_CHECK_HEADERS([openssl/md5.h], OPEN_SSL_MD5=1, OPEN_SSL_MD5=0) AC_CHECK_HEADERS([openssl/des.h], OPEN_SSL_DES=1, OPEN_SSL_DES=0) if test "$OPEN_SSL_MD5" = "1"; then if test "$OPEN_SSL_DES" = "1"; then make_keyring=yes fi fi if test "x$make_keyring" != "xyes"; then AC_MSG_WARN([Open SSL headers not found, Keyring will not be built]) fi AC_ARG_WITH(with_flock, AC_HELP_STRING([--with-flock],[Substitute flock instead of fnctl (for NFS)])) if test "x$with_flock" != "x"; then AC_DEFINE(USE_FLOCK, 1, [ Using flock instead of fnctl ]) AC_MSG_RESULT(Using flock instead of fnctl) fi dnl For Irix abilib=$ABILIB if test "x$abilib" = "x"; then AC_DEFINE_UNQUOTED(ABILIB, "lib", [ ABILIB ]) else AC_DEFINE_UNQUOTED(ABILIB, "$abilib", [ ABILIB ]) fi AC_SUBST(ABILIB) dnl ****************************** dnl * what plugins to make dnl ****************************** keyring_plugin=no; if test x$make_keyring = xyes -a x$plugin_support = xyes; then keyring_plugin=yes; fi AM_CONDITIONAL(MAKE_KEYRING, test x$keyring_plugin = xyes) AM_CONDITIONAL(MAKE_EXPENSE, test x$plugin_support = xyes) AM_CONDITIONAL(MAKE_SYNCTIME, test x$plugin_support = xyes) AC_OUTPUT(Makefile docs/Makefile Expense/Makefile KeyRing/Makefile dialer/Makefile po/Makefile.in SyncTime/Makefile jpilot.spec SlackBuild m4/Makefile empty/Makefile icons/Makefile) chmod +x SlackBuild # # Configuration messages # AC_MSG_RESULT() AC_MSG_RESULT(This package is configured for the following features:) AC_MSG_RESULT(------------------------------------------------------) echo "Compiling Expense plugin............... $plugin_support" echo "Compiling SyncTime plugin.............. $plugin_support" echo "Compiling KeyRing plugin............... $keyring_plugin" echo "Compiling with private record support.. $enable_private" echo "Compiling with Datebk support.......... $enable_datebk" echo "Compiling with plugin support.......... $enable_plugins" echo "Compiling with Maņana support.......... $enable_manana" echo "Compiling with Prometheon support...... $enable_prometheon" echo "GTK-2 support.......................... $have_gtk2" echo "Compiler Options....................... $CFLAGS" echo "Prefix directory....................... $prefix" echo "pilot-link headers..................... $pilot_incl" echo "NLS support (foreign languages)........ $USE_NLS" echo "USB support enabled.................... $usb" echo "dialer support......................... $dialer" echo "pilot-link 0.12 support................ $pl12" echo "Pilot-link version found............... $pl_version.$pl_major.$pl_minor$pl_patch" echo echo "Now type make to compile"