0
2
1
1 |
#! /usr/bin/env python |
|
2 |
|
|
3 |
import sys |
|
4 |
import os |
|
5 |
|
|
6 |
if len(sys.argv)>1 and sys.argv[1] in ["-h","--help"]: |
|
7 |
print """ |
|
8 |
This utility just prints the length of the longest path |
|
9 |
in the revision graph from revison 0 to the current one. |
|
10 |
""" |
|
11 |
exit(0) |
|
12 |
plist = os.popen("hg parents --template='{rev}\n'").readlines() |
|
13 |
if len(plist)>1: |
|
14 |
print "You are in the process of merging" |
|
15 |
exit(1) |
|
16 |
PAR = int(plist[0]) |
|
17 |
|
|
18 |
f = os.popen("hg log -r 0:tip --template='{rev} {parents}\n'").readlines() |
|
19 |
REV = -1 |
|
20 |
lengths=[] |
|
21 |
for l in f: |
|
22 |
REV+=1 |
|
23 |
s = l.split() |
|
24 |
rev = int(s[0]) |
|
25 |
if REV != rev: |
|
26 |
print "Something is seriously wrong" |
|
27 |
exit(1) |
|
28 |
if len(s) == 1: |
|
29 |
par1 = par2 = rev - 1 |
|
30 |
elif len(s) == 2: |
|
31 |
par1 = par2 = int(s[1].split(":")[0]) |
|
32 |
else: |
|
33 |
par1 = int(s[1].split(":")[0]) |
|
34 |
par2 = int(s[2].split(":")[0]) |
|
35 |
if rev == 0: |
|
36 |
lengths.append(0) |
|
37 |
else: |
|
38 |
lengths.append(max(lengths[par1],lengths[par2])+1) |
|
39 |
print lengths[PAR] |
1 | 1 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
2 | 2 |
|
3 |
#EXECUTE_PROCESS( |
|
4 |
# COMMAND hg id -i |
|
5 |
# OUTPUT_VARIABLE HG_REVISION |
|
6 |
# OUTPUT_STRIP_TRAILING_WHITESPACE) |
|
7 |
|
|
8 | 3 |
SET(PROJECT_NAME "LEMON") |
9 |
SET(PROJECT_VERSION_MAJOR "0") |
|
10 |
SET(PROJECT_VERSION_MINOR "99") |
|
11 |
SET(PROJECT_VERSION_PATCH "0") |
|
12 |
SET(PROJECT_VERSION |
|
13 |
|
|
4 |
SET(PROJECT_VERSION "hg-tip" CACHE STRING "The version string.") |
|
14 | 5 |
|
15 | 6 |
PROJECT(${PROJECT_NAME}) |
16 | 7 |
|
17 | 8 |
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
18 | 9 |
|
19 | 10 |
INCLUDE(FindDoxygen) |
20 | 11 |
INCLUDE(FindGhostscript) |
21 | 12 |
|
22 | 13 |
ENABLE_TESTING() |
23 | 14 |
|
24 | 15 |
ADD_SUBDIRECTORY(lemon) |
25 | 16 |
ADD_SUBDIRECTORY(demo) |
26 | 17 |
ADD_SUBDIRECTORY(doc) |
27 | 18 |
ADD_SUBDIRECTORY(test) |
28 | 19 |
|
29 | 20 |
IF(WIN32) |
30 | 21 |
INSTALL(FILES ${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico |
31 | 22 |
DESTINATION bin) |
32 | 23 |
ENDIF(WIN32) |
33 | 24 |
|
34 | 25 |
IF(WIN32) |
35 | 26 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
36 | 27 |
SET(CPACK_PACKAGE_VENDOR |
37 | 28 |
"EGRES - Egervary Research Group on Combinatorial Optimization") |
38 | 29 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
39 | 30 |
"LEMON - Library of Efficient Models and Optimization in Networks") |
40 | 31 |
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") |
41 | 32 |
|
42 |
SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) |
|
43 |
SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) |
|
44 |
SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) |
|
45 | 33 |
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
46 | 34 |
|
47 | 35 |
SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
48 |
"${PROJECT_NAME} ${ |
|
36 |
"${PROJECT_NAME} ${PROJECT_VERSION}") |
|
49 | 37 |
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY |
50 |
"${PROJECT_NAME} ${ |
|
38 |
"${PROJECT_NAME} ${PROJECT_VERSION}") |
|
51 | 39 |
|
52 | 40 |
# Variables to generate a component-based installer. |
53 | 41 |
#SET(CPACK_COMPONENTS_ALL headers library html_documentation) |
54 | 42 |
|
55 | 43 |
#SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers") |
56 | 44 |
#SET(CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "Static library") |
57 | 45 |
#SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DISPLAY_NAME "HTML documentation") |
58 | 46 |
|
59 | 47 |
#SET(CPACK_COMPONENT_HEADERS_DESCRIPTION |
60 | 48 |
# "C++ header files for use with the LEMON library") |
61 | 49 |
#SET(CPACK_COMPONENT_LIBRARY_DESCRIPTION |
62 | 50 |
# "Static library used to build programs with LEMON") |
63 | 51 |
#SET(CPACK_COMPONENT_HTML_DOCUMENTATION_DESCRIPTION |
64 | 52 |
# "Doxygen generated documentation") |
65 | 53 |
|
66 | 54 |
#SET(CPACK_COMPONENT_HEADERS_DEPENDS library) |
67 | 55 |
|
68 | 56 |
#SET(CPACK_COMPONENT_HEADERS_GROUP "Development") |
69 | 57 |
#SET(CPACK_COMPONENT_LIBRARY_GROUP "Development") |
70 | 58 |
#SET(CPACK_COMPONENT_HTML_DOCUMENTATION_GROUP "Documentation") |
71 | 59 |
|
72 | 60 |
#SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION |
73 | 61 |
# "Components needed to develop software using LEMON") |
74 | 62 |
#SET(CPACK_COMPONENT_GROUP_DOCUMENTATION_DESCRIPTION |
75 | 63 |
# "Documentation of LEMON") |
76 | 64 |
|
77 | 65 |
#SET(CPACK_ALL_INSTALL_TYPES Full Developer) |
78 | 66 |
|
79 | 67 |
#SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) |
80 | 68 |
#SET(CPACK_COMPONENT_LIBRARY_INSTALL_TYPES Developer Full) |
81 | 69 |
#SET(CPACK_COMPONENT_HTML_DOCUMENTATION_INSTALL_TYPES Full) |
82 | 70 |
|
83 | 71 |
SET(CPACK_GENERATOR "NSIS") |
84 | 72 |
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis/lemon.ico") |
85 | 73 |
SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/cmake/nsis/uninstall.ico") |
86 | 74 |
#SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/nsis\\\\installer.bmp") |
87 | 75 |
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\lemon.ico") |
88 | 76 |
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ${PROJECT_NAME}") |
89 | 77 |
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\lemon.cs.elte.hu") |
90 | 78 |
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\lemon.cs.elte.hu") |
91 | 79 |
SET(CPACK_NSIS_CONTACT "lemon-user@lemon.cs.elte.hu") |
92 | 80 |
SET(CPACK_NSIS_CREATE_ICONS_EXTRA " |
93 | 81 |
CreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation.lnk\\\" \\\"$INSTDIR\\\\doc\\\\index.html\\\" |
94 | 82 |
") |
95 | 83 |
SET(CPACK_NSIS_DELETE_ICONS_EXTRA " |
96 | 84 |
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP |
97 | 85 |
Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation.lnk\\\" |
98 | 86 |
") |
99 | 87 |
|
100 | 88 |
INCLUDE(CPack) |
101 | 89 |
ENDIF(WIN32) |
1 | 1 |
dnl Process this file with autoconf to produce a configure script. |
2 | 2 |
|
3 | 3 |
dnl Version information. |
4 |
m4_define([lemon_version_number], |
|
4 |
m4_define([lemon_version_number], |
|
5 |
[m4_normalize(esyscmd([echo ${LEMON_VERSION}]))]) |
|
6 |
dnl m4_define([lemon_version_number], []) |
|
7 |
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))]) |
|
5 | 8 |
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))]) |
6 |
m4_define([lemon_version], [ifelse(lemon_version_number(), |
|
9 |
m4_define([lemon_version], [ifelse(lemon_version_number(), |
|
10 |
[], |
|
11 |
[lemon_hg_path().lemon_hg_revision()], |
|
12 |
[lemon_version_number()])]) |
|
7 | 13 |
|
8 | 14 |
AC_PREREQ([2.59]) |
9 | 15 |
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon]) |
10 | 16 |
AC_CONFIG_AUX_DIR([build-aux]) |
11 | 17 |
AC_CONFIG_MACRO_DIR([m4]) |
12 | 18 |
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc]) |
13 | 19 |
AC_CONFIG_SRCDIR([lemon/list_graph.h]) |
14 | 20 |
AC_CONFIG_HEADERS([config.h lemon/config.h]) |
15 | 21 |
|
16 | 22 |
lx_cmdline_cxxflags_set=${CXXFLAGS+set} |
17 | 23 |
|
18 | 24 |
dnl Checks for programs. |
19 | 25 |
AC_PROG_CXX |
20 | 26 |
AC_PROG_CXXCPP |
21 | 27 |
AC_PROG_INSTALL |
22 | 28 |
AC_DISABLE_SHARED |
23 | 29 |
AC_PROG_LIBTOOL |
24 | 30 |
|
25 | 31 |
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no]) |
26 | 32 |
AC_CHECK_PROG([gs_found],[gs],[yes],[no]) |
27 | 33 |
|
28 | 34 |
dnl Set custom compiler flags when using g++. |
29 | 35 |
if test x"$lx_cmdline_cxxflags_set" != x"set" -a "$GXX" = yes; then |
30 | 36 |
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" |
31 | 37 |
fi |
32 | 38 |
|
33 | 39 |
dnl Checks for libraries. |
34 | 40 |
#LX_CHECK_GLPK |
35 | 41 |
#LX_CHECK_CPLEX |
36 | 42 |
#LX_CHECK_SOPLEX |
37 | 43 |
|
38 | 44 |
dnl Disable/enable building the demo programs. |
39 | 45 |
AC_ARG_ENABLE([demo], |
40 | 46 |
AS_HELP_STRING([--enable-demo], [build the demo programs]) |
41 | 47 |
AS_HELP_STRING([--disable-demo], [do not build the demo programs @<:@default@:>@]), |
42 | 48 |
[], [enable_demo=no]) |
43 | 49 |
AC_MSG_CHECKING([whether to build the demo programs]) |
44 | 50 |
if test x"$enable_demo" != x"no"; then |
45 | 51 |
AC_MSG_RESULT([yes]) |
46 | 52 |
else |
47 | 53 |
AC_MSG_RESULT([no]) |
48 | 54 |
fi |
49 | 55 |
AM_CONDITIONAL([WANT_DEMO], [test x"$enable_demo" != x"no"]) |
50 | 56 |
|
51 | 57 |
dnl Disable/enable building the binary tools. |
52 | 58 |
AC_ARG_ENABLE([tools], |
53 | 59 |
AS_HELP_STRING([--enable-tools], [build additional tools @<:@default@:>@]) |
54 | 60 |
AS_HELP_STRING([--disable-tools], [do not build additional tools]), |
55 | 61 |
[], [enable_tools=yes]) |
56 | 62 |
AC_MSG_CHECKING([whether to build the additional tools]) |
57 | 63 |
if test x"$enable_tools" != x"no"; then |
58 | 64 |
AC_MSG_RESULT([yes]) |
59 | 65 |
else |
60 | 66 |
AC_MSG_RESULT([no]) |
61 | 67 |
fi |
62 | 68 |
AM_CONDITIONAL([WANT_TOOLS], [test x"$enable_tools" != x"no"]) |
63 | 69 |
|
64 | 70 |
dnl Disable/enable building the benchmarks. |
65 | 71 |
AC_ARG_ENABLE([benchmark], |
66 | 72 |
AS_HELP_STRING([--enable-benchmark], [build the benchmarks]) |
67 | 73 |
AS_HELP_STRING([--disable-benchmark], [do not build the benchmarks @<:@default@:>@]), |
68 | 74 |
[], [enable_benchmark=no]) |
69 | 75 |
AC_MSG_CHECKING([whether to build the benchmarks]) |
70 | 76 |
if test x"$enable_benchmark" != x"no"; then |
71 | 77 |
AC_MSG_RESULT([yes]) |
72 | 78 |
else |
73 | 79 |
AC_MSG_RESULT([no]) |
74 | 80 |
fi |
75 | 81 |
AM_CONDITIONAL([WANT_BENCHMARK], [test x"$enable_benchmark" != x"no"]) |
76 | 82 |
|
77 | 83 |
dnl Checks for header files. |
78 | 84 |
AC_CHECK_HEADERS(limits.h sys/time.h sys/times.h unistd.h) |
79 | 85 |
|
80 | 86 |
dnl Checks for typedefs, structures, and compiler characteristics. |
81 | 87 |
AC_C_CONST |
82 | 88 |
AC_C_INLINE |
83 | 89 |
AC_TYPE_SIZE_T |
84 | 90 |
AC_HEADER_TIME |
85 | 91 |
AC_STRUCT_TM |
86 | 92 |
|
87 | 93 |
dnl Checks for library functions. |
88 | 94 |
AC_HEADER_STDC |
89 | 95 |
AC_CHECK_FUNCS(gettimeofday times ctime_r) |
90 | 96 |
|
91 | 97 |
dnl Add dependencies on files generated by configure. |
92 | 98 |
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], |
93 | 99 |
['$(top_srcdir)/doc/Doxyfile.in $(top_srcdir)/lemon/lemon.pc.in']) |
94 | 100 |
|
95 | 101 |
AC_CONFIG_FILES([ |
96 | 102 |
Makefile |
97 | 103 |
doc/Doxyfile |
98 | 104 |
lemon/lemon.pc |
99 | 105 |
]) |
100 | 106 |
|
101 | 107 |
AC_OUTPUT |
102 | 108 |
|
103 | 109 |
echo |
104 | 110 |
echo '****************************** SUMMARY ******************************' |
105 | 111 |
echo |
106 | 112 |
echo Package version............... : $PACKAGE-$VERSION |
107 | 113 |
echo |
108 | 114 |
echo C++ compiler.................. : $CXX |
109 | 115 |
echo C++ compiles flags............ : $CXXFLAGS |
110 | 116 |
echo |
111 | 117 |
#echo GLPK support.................. : $lx_glpk_found |
112 | 118 |
#echo CPLEX support................. : $lx_cplex_found |
113 | 119 |
#echo SOPLEX support................ : $lx_soplex_found |
114 | 120 |
#echo |
115 | 121 |
echo Build benchmarks.............. : $enable_benchmark |
116 | 122 |
echo Build demo programs........... : $enable_demo |
117 | 123 |
echo Build additional tools........ : $enable_tools |
118 | 124 |
echo |
119 | 125 |
echo The packace will be installed in |
120 | 126 |
echo -n ' ' |
121 | 127 |
echo $prefix. |
122 | 128 |
echo |
123 | 129 |
echo '*********************************************************************' |
124 | 130 |
|
125 | 131 |
echo |
126 | 132 |
echo Configure complete, now type \'make\' and then \'make install\'. |
127 | 133 |
echo |
0 comments (0 inline)