File: configure.ac

package info (click to toggle)
fityk 0.4.4-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,472 kB
  • ctags: 2,617
  • sloc: cpp: 19,705; sh: 5,965; xml: 2,325; yacc: 356; makefile: 183; lex: 178
file content (168 lines) | stat: -rw-r--r-- 4,800 bytes parent folder | download
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
dnl $Id: configure.ac,v 1.8 2005/03/04 14:28:46 wojdyr Exp $
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([src/fzgbase.h])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET([])
AM_INIT_AUTOMAKE(fityk, 0.4.4)
AM_MAINTAINER_MODE

dnl What versions of program are to be made 
AC_ARG_ENABLE(GUI, 
[  --disable-GUI           do not build GUI version of program])
test -z "$enable_GUI" && enable_GUI="yes"  
AC_ARG_ENABLE(CLI, 
[  --disable-CLI           do not build CLI version of program])
test -z "$enable_CLI" && enable_CLI="yes"  

dnl normal/debug/optimize flags
AC_ARG_ENABLE(debug, 
[  --enable-debug          debug flags, no optimization       ])
AC_ARG_ENABLE(optimization, 
[  --enable-optimization   all optimizations, no debug info])

dnl Checks for -enable-debug/optimization options
if test "$enable_debug" = "yes"; then 
	CXXFLAGS="-g -O0 -fno-inline -W $CXXFLAGS"
fi
if test "$enable_optimization" = "yes"; then 
	CPPFLAGS="-DNDEBUG $CPPFLAGS"
	CXXFLAGS="-O3 $CXXFLAGS"
	LDFLAGS="-s $LDFLAGS"
fi


dnl use static/dynamic wxWin library
AC_ARG_ENABLE(sharedwx, 
[  --disable-shared-wx     link with static version of wxWindows library])
test -z "$enable_sharedwx" && enable_sharedwx="yes"  

dnl The GNU readline library
AC_ARG_WITH(readline, 
[  --without-readline      do not use the GNU readline library for cfityk 
  --with-readline=PATH    Specify the location of readline])
test -z "$with_readline" && with_readline="yes"  

dnl don't run make in docs/
AC_ARG_WITH(doc,
	    [  --without-doc           do not build and install documentation]) 
test -z "$with_doc" && with_doc="yes"  

AM_OPTIONS_WXCONFIG

dnl both CLI and GUI can't be disabled.
if test "$enable_CLI" = "no" -a "$enable_GUI" = "no"; then 
	AC_MSG_ERROR([Disabling both GUI and CLI versions makes no sense.])
fi


PROGRAM_EXT=
#################################
# MS Windows specific macros 

AC_MSG_CHECKING([for native Win32 - MinGW])
case "${host}" in
    *-*-mingw*)
        os_win32=yes
	PROGRAM_EXT=".exe"
	;;
    *)
        os_win32=no
	;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")

if test "$os_win32" = "yes"; then
    AC_CHECK_TOOL(RC, windres)
    if test "${RC}" = "" ; then
        AC_MSG_ERROR([Required resource tool 'windres' not found on PATH.])
    fi
fi
#################################


dnl Checks for programs.
AC_PROG_CXX

dnl Checks for common header files.
AC_HEADER_STDC
if test "$ac_cv_header_stdc" != yes; then 
	AC_MSG_ERROR([ANSI C header files not found :-(])
fi
dnl use c++ for testing <sstream>
 
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(sstream, [], [AC_MSG_ERROR(
 [You don't have a <sstream> header. It is a part of standard C++ library.
  Either you have too old compiler, or standard C++ library can't be found.])])
AC_LANG_POP([C++]) dnl C is faster than C++

dnl Checks for version specific libraries and headers.
if test "$enable_GUI" != "no" ; then 
    FITYK=fityk$PROGRAM_EXT 
    AM_PATH_WXCONFIG(2.4.2, wxWin=1)
    if test "$wxWin" != 1; then
    	AC_MSG_ERROR([
    	      wxWindows must be installed on your system
    	      but wx-config script couldn't be found.
    
    	      Please check that wx-config is in path, the directory
    	      where wxWindows libraries are installed (returned by
    	      'wx-config --libs' command) is in LD_LIBRARY_PATH or
    	      equivalent variable and wxWindows version is 2.4.2 or above.
            ])
    fi

    if test "$enable_sharedwx" != "no"; then
	    WX_LIBS_DS="$WX_LIBS"
	    dnl AC_MSG_RESULT([Chosen shared version of wxWindows library.])
    else
	    WX_LIBS_DS="$WX_LIBS_STATIC"
	    AC_MSG_RESULT([Chosen static version of wxWindows library.])
    fi

fi

if test "$enable_CLI" != "no"; then 
    CFITYK=cfityk$PROGRAM_EXT 
    READLINE_STUFF

    AC_CHECK_PROG(gnuplot_in_path, gnuplot, yes)
    if test "$gnuplot_in_path" != "yes" ; then
	    AC_MSG_RESULT(
	  [ gnuplot is used by cfityk (command line version) for drawing plots, 
		       but it is not necessery])
    fi

    AC_CHECK_HEADER(unistd.h, [], [AC_MSG_ERROR(
      [You don't have an unistd.h header, that is required to build cfityk.])])
fi

if test "$with_doc" != "no"; then
    DOC=doc
else
    DOC=
fi

AC_SUBST(FITYK)
AC_SUBST(CFITYK)
AC_SUBST(WX_LIBS_DS) 
AC_SUBST(DOC)


dnl Checks for typedefs, structures, and compiler characteristics.
dnl AC_TYPE_PID_T

dnl Checks for library functions.
dnl AC_TYPE_SIGNAL
dnl AC_CHECK_FUNCS(putenv strtod)

dnl in generated configure script, this line is too late
test "x$prefix" = xNONE && prefix=$ac_default_prefix

AC_CONFIG_FILES([Makefile fityk.spec fityk.iss src/Makefile src/img/Makefile doc/Makefile doc/fitykhelp_img/Makefile samples/Makefile config/Makefile])
AC_OUTPUT