File: configure.in

package info (click to toggle)
graphthing 1.3.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 848 kB
  • ctags: 699
  • sloc: cpp: 7,716; yacc: 209; sh: 206; lex: 188; makefile: 10
file content (189 lines) | stat: -rw-r--r-- 4,779 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# script for autoconf

AC_INIT([GraphThing],[1.3.2])
AC_PREREQ(2.53)
AC_CONFIG_SRCDIR(src/graph.h)
AC_CONFIG_HEADER(src/config.h)

AC_DEFINE_UNQUOTED(GT_VERSION, "$PACKAGE_VERSION")
AC_SUBST(GT_VERSION)

# Check out C++ compiler
AC_PROG_CC
AC_PROG_CXX
AC_CXX_NAMESPACES
AC_C_PROTOTYPES
# TODO: Check for PROTOTYPES being defined
AC_C_STRINGIZE
if test $ac_cv_c_stringize != yes; then
	AC_MSG_ERROR([no ANSI stringizing operator])
fi
AC_CXX_BOOL
AC_CXX_EXCEPTIONS
AC_CXX_HAVE_SSTREAM
AC_CXX_HAVE_STD
AC_CXX_HAVE_STL
AC_CXX_MEMBER_CONSTANTS

# Other programs
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
	AC_MSG_ERROR([I'd much prefer to use GNU bison])
fi
AC_PROG_LEX
if test "$LEX" != "flex"; then
	AC_MSG_ERROR([I'd much prefer to use GNU flex])
fi
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S



AC_PATH_PROG(unamepath, uname)
if test "x$unamepath" = "x"; then
	system="unknown"
else
	AC_MSG_CHECKING(system type)
	system=`$unamepath -s`
	AC_MSG_RESULT($system)
	if test "$system" = "Linux"; then
		AC_DEFINE(USING_LINUX)
	fi
	if test "$system" = "FreeBSD"; then
		AC_DEFINE(USING_FREEBSD)
	fi
	if test "$system" = "Darwin"; then
		AC_DEFINE(USING_OSX)
	fi
fi


# Check for needed headers
AC_CHECK_HEADERS([math.h stdio.h stdlib.h string.h time.h unistd.h],
		 [],
		 [exit])

# Check for maths library
AC_CHECK_LIB(m, atan2, , AC_MSG_ERROR([Missing maths library (-lm)]))

# Check for GNU make
CHECK_GNU_MAKE
if test "x$_cv_gnu_make_command" = "x"; then
	echo "#############################################"
	echo "# Sorry, GNU Make is required to build.     #"
	echo "#############################################"
	exit 1
fi

# Check for wxWidgets
AM_PATH_WXWIDGETS(2.6.1, , exit)

# Using '--disable-nls' removes the compilation of translation stuff
turn_on_nls="yes"
AC_ARG_ENABLE(nls,
	AS_HELP_STRING([--disable-nls], [Do not use Native Language Support]),
	[ turn_on_nls="$enableval" ],
	[ turn_on_nls="yes" ])
if test "$turn_on_nls" = "yes"; then
	AC_DEFINE(ENABLE_NLS)
	NLS_OBJS="lang.o"
	AC_SUBST(NLS_OBJS)
	NLS_PARSERS="lang."
	AC_SUBST(NLS_PARSERS)
fi

# Using '--enable-langdialog' turns on the LangDialog
use_langdialog="no"
AC_ARG_ENABLE(langdialog,
	AS_HELP_STRING([--enable-langdialog], [Use the language selection dialog (needs NLS)]),
	[ use_langdialog="$enableval" ],
	[ use_langdialog="no" ])
if test "$use_langdialog" = "yes"; then
	if test "$turn_on_nls" = "yes"; then
		NLS_OBJS="$NLS_OBJS langdialog.o"
		AC_SUBST(NLS_OBJS)
	else
		echo "###"
		echo "### ERROR: The language selection dialog (LangDialog)"
		echo "###        requires NLS. Please don't use --disable-nls."
		echo "###"
		exit 1
	fi
else
	AC_DEFINE(LANG_DIALOG_IS_DISABLED)
fi

# Using '--with-dev' changes compile-time flags to be more strict
turn_on_dev="no"
AC_ARG_WITH(dev, [  --with-dev              Enable developer flags],
[
	turn_on_dev="yes"
	EXTRA_CFLAGS='-Wall \
	 -Wpointer-arith -Werror -ggdb';
	AC_SUBST(EXTRA_CFLAGS)

	EXTRA_PROGS='unit_test chrom'
	AC_SUBST(EXTRA_PROGS)

	AC_DEFINE(GT_WITH_DEV)
])

# Using '--with-prof' enables profiling
turn_on_prof="no"
AC_ARG_WITH(prof, [  --with-prof             Enable profiling],
[
	turn_on_prof="yes"
	EXTRA_CFLAGS="$EXTRA_CFLAGS -g -pg"
	EXTRA_LDFLAGS="-g -pg"
	AC_SUBST(EXTRA_CFLAGS)
	AC_SUBST(EXTRA_LDFLAGS)
])

# Write stuff to Makefiles
AC_CONFIG_FILES([GNUmakefile
	src/GNUmakefile
	graphthing.1])
AC_OUTPUT
#ln -sf src/config.h config.h

# Tell them about the options they have selected
echo "###"
if test "$turn_on_nls" = "yes"; then
	echo "### * Native Language Support enabled."
	if test "$use_langdialog" = "yes"; then
		echo "###     (with LangDialog enabled)."
	else
		echo "###     (but no LangDialog)."
	fi
else
	echo "### * Native Language Support disabled."
fi
echo "###"

# If they've turned on Developer Flags, give a warning
if test "$turn_on_dev" = "yes"; then
	echo "###"
	echo "### WARNING: You have enabled Developer flags. Unless you"
	echo "###          are a developer, you are strongly advised to"
	echo "###          leave developer flags turned off, or you may"
	echo "###          have problems compiling GraphThing."
	echo "###"
fi

# If they've turned on Profiling, give a warning
if test "$turn_on_prof" = "yes"; then
	echo "###"
	echo "### WARNING: You have enabled Profiling. Unless you are a"
	echo "###          developer, you are strongly advised to leave"
	echo "###          profiling turned off, or you may have problems"
	echo "###          compiling or running GraphThing."
	echo "###"
fi	


echo "##################################################"
echo "   GraphThing is now configured. Simply type...  "
echo "           $_cv_gnu_make_command                 "
echo "   ... and GraphThing will be compiled.          "
echo "##################################################"