AC_INIT(src/YSM_Main.c) # give welcome echo "" echo "" echo "ysmICQ client. [http://ysmv7.sourceforge.net]" echo "raddy at gmx dot net" echo "" # do we have what we need? AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET # check missing posix types CHECK_POSIX_TYPES # enable command line options. ac_arg_threads="no" ac_arg_readline="no" AC_ARG_ENABLE([threads], AC_HELP_STRING([--disable-threads], [disable threads support]), ac_arg_threads=$enableval, ac_arg_threads=yes) AC_ARG_ENABLE([readline], AC_HELP_STRING([--disable-readline], [do not try to use the readline library]), ac_arg_readline=$enableval, ac_arg_readline=yes) ##### fribidi ##### AC_ARG_WITH(fribidi, [ --with-fribidi=[DIR] enable the fribidi library in [DIR] to enable Hebrew and Arabic support], [with_fribidi=$withval], [with_fribidi=no]) if test "$with_fribidi" = "yes"; then for ac_dir in /usr/local /usr; do if test -f "$ac_dir/include/fribidi/fribidi.h"; then with_fribidi=$ac_dir break; fi done fi if test -n "$with_fribidi" -a "$with_fribidi" != "no"; then if test "$with_fribidi" = "yes"; then with_fribidi="/usr"; fi if test -r $with_fribidi/include/fribidi/fribidi.h; then LIBS="$LIBS `$with_fribidi/bin/fribidi-config --libs`" AC_DEFINE(USE_FRIBIDI, 1, [use fribidi]) fi fi ##### fribidi ##### AC_CACHE_CHECK([whether to enable threads support], ac_arg_threads, ac_arg_threads) AC_CACHE_CHECK([whether to use the readline library], ac_arg_readline, ac_arg_readline) # only check for readline if we have threads support if test "x$ac_arg_threads" = "xyes"; then CHECK_POSIX_THREADS # check for readline if we have threads only if test "$pthread_libs" != "no" && test "x$ac_arg_readline" = "xyes"; then CHECK_READLINE else vl_cv_lib_readline="no" fi else vl_cv_lib_readline="no" fi # check for iconv CHECK_ICONV # check for setenv CHECK_SETENV # check for sparc required libraries AC_CHECK_LIB([socket], [connect], LIBS="-lsocket $LIBS") AC_CHECK_LIB([nsl], [gethostbyname], LIBS="-lnsl $LIBS") # final checks if test "$vl_cv_lib_readline" == "no"; then # are we using getline instead? do we have threads? if test "$pthread_libs"; then CMDOBJS="cmdline/getline.o $CMDOBJS" else # no threads, use ysmreadline!. CMDOBJS="cmdline/ysmline.o $CMDOBJS" fi fi AC_SUBST(pthread_libs) AC_SUBST(CMDOBJS) AC_STDC_HEADERS AC_OUTPUT([Makefile src/Makefile src/man/Makefile])