configure.ac
author alpar
Tue, 31 Oct 2006 08:46:18 +0000
changeset 2280 dc726706ea65
parent 2108 f2c532541730
child 2315 bd09e00b64bb
permissions -rw-r--r--
One more refinement
     1 dnl Process this file with autoconf to produce a configure script.
     2 AC_PREREQ([2.59])
     3 AC_INIT([LEMON], [svnhead], [etik-ol@cs.elte.hu], [lemon])
     4 AC_CONFIG_AUX_DIR([build-aux])
     5 AC_CONFIG_MACRO_DIR([m4])
     6 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
     7 AC_CONFIG_SRCDIR([lemon/list_graph.h])
     8 AC_CONFIG_HEADERS([config.h lemon/config.h])
     9 
    10 lx_cmdline_cxxflags_set=${CXXFLAGS+set}
    11 
    12 dnl Checks for programs.
    13 AC_PROG_CXX
    14 AC_PROG_CXXCPP
    15 AC_PROG_INSTALL
    16 AC_DISABLE_SHARED
    17 AC_PROG_LIBTOOL
    18 
    19 if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes; then
    20   CXXFLAGS="$CXXFLAGS -Wall -W"
    21 fi
    22 
    23 AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
    24 
    25 dnl Checks for libraries.
    26 LX_CHECK_GLPK
    27 LX_CHECK_CPLEX
    28 
    29 dnl Enable/disable installing the documentation
    30 AC_ARG_ENABLE([doc],
    31 AS_HELP_STRING([--enable-doc@<:@=yes|no|full@:>@], [build the documentation (full enables internal documentation too) @<:@default=yes@:>@])
    32 AS_HELP_STRING([--disable-doc], [do not build the documentation]),
    33               [], [enable_doc=yes])
    34 
    35 AC_MSG_CHECKING([whether to build the documention])
    36 case "$enable_doc" in
    37   yes)
    38     DOXYGEN_INTERNAL_DOCS=NO
    39     AC_MSG_RESULT([yes])
    40     ;;
    41   full)
    42     DOXYGEN_INTERNAL_DOCS=YES
    43     AC_MSG_RESULT([full])
    44     ;;
    45   no)
    46     DOXYGEN_INTERNAL_DOCS=NO
    47     AC_MSG_RESULT([no])
    48     ;;
    49   *)
    50     AC_MSG_ERROR([bad value $enable_doc for option --enable-doc])
    51     ;;
    52 esac
    53 AC_SUBST(DOXYGEN_INTERNAL_DOCS)
    54 AM_CONDITIONAL([WANT_DOC], [test x"$enable_doc" != x"no"])
    55 
    56 dnl Disable/enable building the demo programs
    57 AC_ARG_ENABLE([demo],
    58 AS_HELP_STRING([--enable-demo], [build the demo programs])
    59 AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
    60               [], [enable_demo=no])
    61 AC_MSG_CHECKING([whether to build the demo programs])
    62 if test x"$enable_demo" != x"no"; then
    63   AC_MSG_RESULT([yes])
    64 else
    65   AC_MSG_RESULT([no])
    66 fi
    67 AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
    68 
    69 dnl Disable/enable building the benchmarks
    70 AC_ARG_ENABLE([benchmark],
    71 AS_HELP_STRING([--enable-benchmark], [build the benchmarks])
    72 AS_HELP_STRING([--disable-benchmark], [do not build the benchmarks @<:@default@:>@]),
    73               [], [enable_benchmark=no])
    74 AC_MSG_CHECKING([whether to build the benchmarks])
    75 if test x"$enable_benchmark" != x"no"; then
    76   AC_MSG_RESULT([yes])
    77 else
    78   AC_MSG_RESULT([no])
    79 fi
    80 AM_CONDITIONAL([WANT_BENCHMARK], [test x"$enable_benchmark" != x"no"])
    81 
    82 dnl Checks for header files.
    83 AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
    84 
    85 dnl Checks for typedefs, structures, and compiler characteristics.
    86 AC_C_CONST
    87 AC_C_INLINE
    88 AC_TYPE_SIZE_T
    89 AC_HEADER_TIME
    90 AC_STRUCT_TM
    91 
    92 dnl Checks for library functions.
    93 AC_HEADER_STDC
    94 AC_CHECK_FUNCS(gettimeofday times ctime_r)
    95 
    96 AC_CONFIG_FILES([
    97 Makefile
    98 lemon.spec
    99 autopackage/default.apspec
   100 doc/Doxyfile
   101 lemon/lemon.pc
   102 ])
   103 
   104 AC_OUTPUT
   105 
   106 echo
   107 echo '****************************** SUMMARY ******************************'
   108 echo
   109 echo Package version............... : $PACKAGE-$VERSION
   110 echo
   111 echo C++ compiler.................. : $CXX
   112 echo C++ compiles flags............ : $CXXFLAGS
   113 echo
   114 echo GLPK support.................. : $lx_glpk_found
   115 echo CPLEX support................. : $lx_cplex_found
   116 echo
   117 echo build benchmarks.............. : $enable_benchmark
   118 echo build demo programs........... : $enable_demo
   119 echo
   120 echo The packace will be installed in
   121 echo -n '  '
   122 echo $prefix.
   123 echo
   124 echo The documentation will be installed in
   125 echo -n '  '
   126 eval echo ${datadir}/doc/$PACKAGE.
   127 echo
   128 echo '*********************************************************************'
   129 
   130 echo
   131 echo configure complete, now type \'make\' and then \'make install\'.
   132 echo