configure.ac
author Peter Kovacs <kpeter@inf.elte.hu>
Thu, 09 Oct 2008 10:09:44 +0200
changeset 313 64f8f7cc6168
parent 273 5d12d5c80ac9
child 310 a9e8f310507f
permissions -rw-r--r--
Fix several doxygen warnings
ladanyi@1
     1
dnl Process this file with autoconf to produce a configure script.
ladanyi@1
     2
ladanyi@1
     3
dnl Version information.
alpar@273
     4
m4_define([lemon_version_number],
alpar@273
     5
	[m4_normalize(esyscmd([echo ${LEMON_VERSION}]))])
alpar@273
     6
dnl m4_define([lemon_version_number], [])
alpar@273
     7
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))])
alpar@19
     8
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))])
alpar@273
     9
m4_define([lemon_version], [ifelse(lemon_version_number(),
alpar@273
    10
			   [],
alpar@273
    11
			   [lemon_hg_path().lemon_hg_revision()],
alpar@273
    12
			   [lemon_version_number()])])
ladanyi@1
    13
ladanyi@1
    14
AC_PREREQ([2.59])
ladanyi@236
    15
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])
ladanyi@1
    16
AC_CONFIG_AUX_DIR([build-aux])
ladanyi@1
    17
AC_CONFIG_MACRO_DIR([m4])
ladanyi@64
    18
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc])
ladanyi@1
    19
AC_CONFIG_SRCDIR([lemon/list_graph.h])
ladanyi@1
    20
AC_CONFIG_HEADERS([config.h lemon/config.h])
ladanyi@1
    21
ladanyi@1
    22
lx_cmdline_cxxflags_set=${CXXFLAGS+set}
ladanyi@1
    23
ladanyi@296
    24
dnl Do compilation tests using the C++ compiler.
ladanyi@296
    25
AC_LANG([C++])
ladanyi@296
    26
ladanyi@1
    27
dnl Checks for programs.
ladanyi@1
    28
AC_PROG_CXX
ladanyi@1
    29
AC_PROG_CXXCPP
ladanyi@1
    30
AC_PROG_INSTALL
ladanyi@1
    31
AC_DISABLE_SHARED
ladanyi@1
    32
AC_PROG_LIBTOOL
ladanyi@1
    33
ladanyi@60
    34
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
ladanyi@153
    35
AC_CHECK_PROG([gs_found],[gs],[yes],[no])
ladanyi@60
    36
ladanyi@296
    37
dnl Detect Intel compiler.
ladanyi@296
    38
AC_MSG_CHECKING([whether we are using the Intel C++ compiler])
ladanyi@296
    39
AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER
ladanyi@296
    40
choke me
ladanyi@296
    41
#endif], [ICC=[yes]], [ICC=[no]])
ladanyi@296
    42
if test x"$ICC" = x"yes"; then
ladanyi@296
    43
  AC_MSG_RESULT([yes])
ladanyi@296
    44
else
ladanyi@296
    45
  AC_MSG_RESULT([no])
ladanyi@296
    46
fi
ladanyi@296
    47
alpar@225
    48
dnl Set custom compiler flags when using g++.
ladanyi@296
    49
if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes -a "$ICC" = no; then
ladanyi@1
    50
  CXXFLAGS="$CXXFLAGS -Wall -W -Wall -W -Wunused -Wformat=2 -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-char-subscripts -Wwrite-strings -Wno-char-subscripts -Wreturn-type -Wcast-qual -Wcast-align -Wsign-promo -Woverloaded-virtual -Woverloaded-virtual -ansi -fno-strict-aliasing -Wold-style-cast -Wno-unknown-pragmas"
ladanyi@1
    51
fi
ladanyi@1
    52
ladanyi@1
    53
dnl Checks for libraries.
ladanyi@259
    54
#LX_CHECK_GLPK
ladanyi@259
    55
#LX_CHECK_CPLEX
ladanyi@259
    56
#LX_CHECK_SOPLEX
ladanyi@1
    57
alpar@225
    58
dnl Disable/enable building the demo programs.
ladanyi@1
    59
AC_ARG_ENABLE([demo],
ladanyi@1
    60
AS_HELP_STRING([--enable-demo], [build the demo programs])
ladanyi@1
    61
AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]),
ladanyi@1
    62
              [], [enable_demo=no])
ladanyi@1
    63
AC_MSG_CHECKING([whether to build the demo programs])
ladanyi@1
    64
if test x"$enable_demo" != x"no"; then
ladanyi@1
    65
  AC_MSG_RESULT([yes])
ladanyi@1
    66
else
ladanyi@1
    67
  AC_MSG_RESULT([no])
ladanyi@1
    68
fi
ladanyi@1
    69
AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"])
ladanyi@1
    70
alpar@225
    71
dnl Disable/enable building the binary tools.
ladanyi@1
    72
AC_ARG_ENABLE([tools],
ladanyi@1
    73
AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@])
ladanyi@1
    74
AS_HELP_STRING([--disable-tools], [do not build additional tools]),
ladanyi@1
    75
              [], [enable_tools=yes])
ladanyi@1
    76
AC_MSG_CHECKING([whether to build the additional tools])
ladanyi@1
    77
if test x"$enable_tools" != x"no"; then
ladanyi@1
    78
  AC_MSG_RESULT([yes])
ladanyi@1
    79
else
ladanyi@1
    80
  AC_MSG_RESULT([no])
ladanyi@1
    81
fi
ladanyi@1
    82
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"])
ladanyi@1
    83
alpar@225
    84
dnl Disable/enable building the benchmarks.
ladanyi@1
    85
AC_ARG_ENABLE([benchmark],
ladanyi@1
    86
AS_HELP_STRING([--enable-benchmark], [build the benchmarks])
ladanyi@1
    87
AS_HELP_STRING([--disable-benchmark], [do not build the benchmarks @<:@default@:>@]),
ladanyi@1
    88
              [], [enable_benchmark=no])
ladanyi@1
    89
AC_MSG_CHECKING([whether to build the benchmarks])
ladanyi@1
    90
if test x"$enable_benchmark" != x"no"; then
ladanyi@1
    91
  AC_MSG_RESULT([yes])
ladanyi@1
    92
else
ladanyi@1
    93
  AC_MSG_RESULT([no])
ladanyi@1
    94
fi
ladanyi@1
    95
AM_CONDITIONAL([WANT_BENCHMARK], [test x"$enable_benchmark" != x"no"])
ladanyi@1
    96
ladanyi@1
    97
dnl Checks for header files.
ladanyi@1
    98
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h)
ladanyi@1
    99
ladanyi@1
   100
dnl Checks for typedefs, structures, and compiler characteristics.
ladanyi@1
   101
AC_C_CONST
ladanyi@1
   102
AC_C_INLINE
ladanyi@1
   103
AC_TYPE_SIZE_T
ladanyi@1
   104
AC_HEADER_TIME
ladanyi@1
   105
AC_STRUCT_TM
ladanyi@1
   106
ladanyi@1
   107
dnl Checks for library functions.
ladanyi@1
   108
AC_HEADER_STDC
ladanyi@1
   109
AC_CHECK_FUNCS(gettimeofday times ctime_r)
ladanyi@1
   110
alpar@219
   111
dnl Add dependencies on files generated by configure.
alpar@219
   112
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],
alpar@219
   113
  ['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in'])
alpar@219
   114
ladanyi@1
   115
AC_CONFIG_FILES([
ladanyi@1
   116
Makefile
ladanyi@1
   117
doc/Doxyfile
ladanyi@1
   118
lemon/lemon.pc
ladanyi@1
   119
])
ladanyi@1
   120
ladanyi@1
   121
AC_OUTPUT
ladanyi@1
   122
ladanyi@1
   123
echo
ladanyi@1
   124
echo '****************************** SUMMARY ******************************'
ladanyi@1
   125
echo
ladanyi@1
   126
echo Package version............... : $PACKAGE-$VERSION
ladanyi@1
   127
echo
ladanyi@1
   128
echo C++ compiler.................. : $CXX
ladanyi@1
   129
echo C++ compiles flags............ : $CXXFLAGS
ladanyi@1
   130
echo
ladanyi@259
   131
#echo GLPK support.................. : $lx_glpk_found
ladanyi@259
   132
#echo CPLEX support................. : $lx_cplex_found
ladanyi@259
   133
#echo SOPLEX support................ : $lx_soplex_found
ladanyi@259
   134
#echo
alpar@55
   135
echo Build benchmarks.............. : $enable_benchmark
alpar@55
   136
echo Build demo programs........... : $enable_demo
alpar@55
   137
echo Build additional tools........ : $enable_tools
ladanyi@1
   138
echo
ladanyi@1
   139
echo The packace will be installed in
ladanyi@1
   140
echo -n '  '
ladanyi@1
   141
echo $prefix.
ladanyi@1
   142
echo
ladanyi@1
   143
echo '*********************************************************************'
ladanyi@1
   144
ladanyi@1
   145
echo
alpar@55
   146
echo Configure complete, now type \'make\' and then \'make install\'.
ladanyi@1
   147
echo