gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Add long long checking to build systems (#230)
0 5 1
default
6 files changed with 17 insertions and 2 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
1
#cmakedefine HAVE_LONG_LONG 1
... ...
 No newline at end of file
Ignore white space 6 line context
... ...
@@ -9,16 +9,19 @@
9 9

	
10 10
PROJECT(${PROJECT_NAME})
11 11

	
12 12
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
13 13

	
14 14
INCLUDE(FindDoxygen)
15 15
INCLUDE(FindGhostscript)
16 16

	
17
INCLUDE(CheckTypeSize)
18
CHECK_TYPE_SIZE("long long" LONG_LONG)
19

	
17 20
ENABLE_TESTING()
18 21

	
19 22
ADD_SUBDIRECTORY(lemon)
20 23
ADD_SUBDIRECTORY(demo)
21 24
ADD_SUBDIRECTORY(doc)
22 25
ADD_SUBDIRECTORY(test)
23 26

	
24 27
IF(WIN32)
Ignore white space 6 line context
... ...
@@ -19,16 +19,22 @@
19 19
AC_CONFIG_SRCDIR([lemon/list_graph.h])
20 20
AC_CONFIG_HEADERS([config.h lemon/config.h])
21 21

	
22 22
lx_cmdline_cxxflags_set=${CXXFLAGS+set}
23 23

	
24 24
dnl Do compilation tests using the C++ compiler.
25 25
AC_LANG([C++])
26 26

	
27
dnl Check the existence of long long type.
28
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no])
29
if test x"$long_long_found" = x"yes"; then
30
  AC_DEFINE([HAVE_LONG_LONG], [1], [Define to 1 if you have long long.])
31
fi
32

	
27 33
dnl Checks for programs.
28 34
AC_PROG_CXX
29 35
AC_PROG_CXXCPP
30 36
AC_PROG_INSTALL
31 37
AC_DISABLE_SHARED
32 38
AC_PROG_LIBTOOL
33 39

	
34 40
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no])
... ...
@@ -111,16 +117,18 @@
111 117
echo
112 118
echo '****************************** SUMMARY ******************************'
113 119
echo
114 120
echo Package version............... : $PACKAGE-$VERSION
115 121
echo
116 122
echo C++ compiler.................. : $CXX
117 123
echo C++ compiles flags............ : $CXXFLAGS
118 124
echo
125
echo Compiler supports long long... : $long_long_found
126
echo
119 127
#echo GLPK support.................. : $lx_glpk_found
120 128
#echo CPLEX support................. : $lx_cplex_found
121 129
#echo SOPLEX support................ : $lx_soplex_found
122 130
#echo
123 131
echo Build demo programs........... : $enable_demo
124 132
echo Build additional tools........ : $enable_tools
125 133
echo
126 134
echo The packace will be installed in
Ignore white space 6 line context
... ...
@@ -91,17 +91,17 @@
91 91
  };
92 92

	
93 93
  template <typename _Graph, typename _Item>
94 94
  struct DefaultMapSelector<_Graph, _Item, unsigned long> {
95 95
    typedef VectorMap<_Graph, _Item, unsigned long> Map;
96 96
  };
97 97

	
98 98

	
99
#if defined __GNUC__ && !defined __STRICT_ANSI__
99
#if defined HAVE_LONG_LONG
100 100

	
101 101
  // long long
102 102
  template <typename _Graph, typename _Item>
103 103
  struct DefaultMapSelector<_Graph, _Item, signed long long> {
104 104
    typedef VectorMap<_Graph, _Item, signed long long> Map;
105 105
  };
106 106

	
107 107
  template <typename _Graph, typename _Item>
Ignore white space 6 line context
1 1
/* Define to 1 if you have CPLEX. */
2 2
#undef HAVE_CPLEX
3 3

	
4 4
/* Define to 1 if you have GLPK. */
5 5
#undef HAVE_GLPK
6

	
7
/* Define to 1 if you have long long */
8
#undef HAVE_LONG_LONG
Ignore white space 16 line context
... ...
@@ -366,17 +366,17 @@
366 366
    static bool nonZero(Value a) { return a!=0;}
367 367

	
368 368
    ///@}
369 369

	
370 370
    ///Returns zero
371 371
    static Value zero() {return 0;}
372 372
  };
373 373

	
374
#if defined __GNUC__ && !defined __STRICT_ANSI__
374
#if HAVE_LONG_LONG 
375 375

	
376 376
  ///Long long integer specialization of Tolerance.
377 377

	
378 378
  ///Long long integer specialization of Tolerance.
379 379
  ///\warning This class (more exactly, type <tt>long long</tt>)
380 380
  ///is not ansi compatible.
381 381
  ///\sa Tolerance
382 382
  template<>
0 comments (0 inline)