Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rc08a725 r4097723  
    11dnl $Id$
    22dnl Process this file with autoconf to produce a configure script.
    3 AC_INIT([BarnOwl],[1.1.2],[bug-barnowl@mit.edu])
    4 AM_INIT_AUTOMAKE([-Wall foreign])
     3AC_INIT(owl.c)
    54
    6 AC_CONFIG_HEADER([config.h])
     5AC_CONFIG_HEADER(config.h)
    76
    87AC_PROG_CC
     8
     9dnl If we're using GCC, enable all warnings
     10if test "$GCC" = yes; then
     11     CFLAGS="$CFLAGS -Wall -g";
     12fi
    913
    1014dnl Check for Athena
     
    4246        AC_MSG_RESULT(no)
    4347fi
    44 PROTECT_CFLAGS=${PROTECT_CFLAGS-"-fstack-protector"}
    45 SAVE_CFLAGS=$CFLAGS
    46 CFLAGS="$CFLAGS $PROTECT_CFLAGS"
    47 AC_MSG_CHECKING(whether protection cflags work)
    48 AC_COMPILE_IFELSE(int i;,
    49     [AC_MSG_RESULT(yes)],
    50     [AC_MSG_RESULT(no)
    51     CFLAGS=$SAVE_CFLAGS])
    5248
     49AC_ARG_WITH([stack-protector],
     50  [AS_HELP_STRING([--with-stack-protector],
     51    [Enable gcc -fstack-protector])],
     52  [],
     53  [with_stack_protector=check])
    5354
    54 AC_CHECK_LIB(ssp, __stack_chk_guard)
     55AS_IF([test "x$with_stack_protector" != xno],
     56  [
     57    SAVE_CFLAGS=$CFLAGS
     58    CFLAGS="$CFLAGS -fstack-protector"
     59    AC_MSG_CHECKING(whether protection cflags work)
     60    AC_COMPILE_IFELSE(int i;,
     61        [AC_MSG_RESULT(yes)],
     62        [AC_MSG_RESULT(no)
     63        CFLAGS=$SAVE_CFLAGS
     64        if test "x$with_stack_protector" != xcheck; then
     65          AC_MSG_FAILURE([--with-stack-protector selected, but gcc does support it.])
     66        fi])
     67    AC_CHECK_LIB(ssp, __stack_chk_guard)
     68  ])
     69
    5570AC_CHECK_LIB(ncursesw, initscr,, AC_MSG_ERROR(No libncursesw found.))
    5671AC_CHECK_LIB(com_err, com_err)
     
    6075AC_CHECK_LIB(des425, des_cbc_encrypt,,AC_CHECK_LIB(crypto,DES_cbc_encrypt))
    6176AC_CHECK_LIB(resolv, res_search)
    62 dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
    63 AC_CHECK_LIB(zephyr, ZGetSender)
    64 AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
     77
     78AC_ARG_WITH([zephyr],
     79  [AS_HELP_STRING([--with-libzephyr],
     80    [Disable Zephyr support])],
     81  [],
     82  [with_zephyr=check])
     83
     84AS_IF([test "x$with_zephyr" != xno],
     85  [AC_CHECK_LIB([zephyr], [ZGetSender],
     86   [LIBS="$LIBS -lzephyr"
     87    AC_DEFINE([HAVE_LIBZEPHYR], [1],
     88                [Define if you have libzephyr])
     89    AC_CHECK_LIB([zephyr], [ZInitLocationInfo],
     90      AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [1],
     91                [Have ZInitLocationInfo]),)
     92   ],
     93   [if test "x$with_zephyr" != xcheck; then
     94      AC_MSG_FAILURE(
     95        [--with-libzephyr was given, but libzephyr does not seem to be available.])
     96    fi
     97   ])])
     98
     99AC_ARG_ENABLE([athstatic], AS_HELP_STRING([--enable-athstatic],
     100                                          [Statically link libraries in /usr/athena/lib]),
     101                                          [ATHSTATIC=./athstatic],
     102                                          [ATHSTATIC=])
    65103
    66104AC_CHECK_FUNCS(use_default_colors resizeterm des_string_to_key des_key_sched des_ecb_encrypt)
     
    105143dnl Add LDFLAGS for embedded perl
    106144FOO=`perl -MExtUtils::Embed -e ldopts`
    107 AC_MSG_NOTICE([Adding perl LIBS ${FOO}])
    108 LIBS=${LIBS}\ ${FOO}
     145AC_MSG_NOTICE([Adding perl LDFLAGS ${FOO}])
     146LDFLAGS=${LDFLAGS}\ ${FOO}
    109147
    110148dnl Add CFLAGS and LDFLAGS for glib-2.0
     
    116154LDFLAGS="${GLIB_LIBS} ${LDFLAGS}"
    117155
    118 if test "x${prefix}" = "xNONE"; then
    119    prefix="${ac_default_prefix}"
    120 fi
     156dnl Checks for typedefs, structures, and compiler characteristics.
    121157
    122 AC_DEFINE_UNQUOTED([DATADIR],["${prefix}/share/${PACKAGE}"],
    123                    [Package data directory])
    124 
    125 dnl Checks for typedefs, structures, and compiler characteristics.
     158dnl Support --program-{prefix,suffix,transform}
     159AC_ARG_PROGRAM
    126160
    127161AC_SUBST(XSUBPPDIR)
    128162AC_SUBST(XSUBPPFLAGS)
     163AC_SUBST(ATHSTATIC)
    129164
    130165AC_PROG_INSTALL
    131 AC_PROG_RANLIB
    132166
    133 AC_CONFIG_FILES([Makefile libfaim/Makefile])
    134 AC_OUTPUT([perl/modules/Makefile])
     167AC_CONFIG_SUBDIRS(libfaim)
     168
     169AC_OUTPUT(Makefile)
Note: See TracChangeset for help on using the changeset viewer.