-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfigure.in
More file actions
154 lines (127 loc) · 4.19 KB
/
configure.in
File metadata and controls
154 lines (127 loc) · 4.19 KB
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
dnl this files has to be processed by autoconf
AC_PREREQ(2.61)
AC_INIT([sqface],[0.0.1])
AC_CONFIG_SRCDIR([README])
AC_CONFIG_SRCDIR(src/sqface.h)
AC_CONFIG_HEADERS(src/sqface_config.h)
AM_INIT_AUTOMAKE([no-define])
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LD
AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
dnl Checks for header files.
AC_CHECK_HEADERS(string.h stdlib.h stdio.h time.h math.h)
MAJOR_VERSION=0
MINOR_VERSION=0
BUGFIX_VERSION=1
EXTRA_VERSION="-dev"
SQFACE_VERSION_TEXT="${MAJOR_VERSION}.${MINOR_VERSION}.${BUGFIX_VERSION}${EXTRA_VERSION}"
SQFACE_VERSION_ID=`expr [$]MAJOR_VERSION \* 10000 + [$]MINOR_VERSION \* 100 + [$]BUGFIX_VERSION`
dnl generate sqface_version.h {{{
echo "/* automatically generated by configure */" > sqface_version.h.new
echo "/* edit configure.in to change the version number */" >> sqface_version.h.new
echo "#define SQFACE_MAJOR_VERSION $MAJOR_VERSION" >> sqface_version.h.new
echo "#define SQFACE_MINOR_VERSION $MINOR_VERSION" >> sqface_version.h.new
echo "#define SQFACE_BUGFIX_VERSION $BUGFIX_VERSION" >> sqface_version.h.new
echo "#define SQFACE_EXTRA_VERSION \"$EXTRA_VERSION\"" >> sqface_version.h.new
echo "#define SQFACE_VERSION_TEXT \"$SQFACE_VERSION_TEXT\"" >> sqface_version.h.new
echo "#define SQFACE_VERSION_ID $SQFACE_VERSION_ID" >> sqface_version.h.new
cmp sqface_version.h.new $srcdir/src/sqface_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f $srcdir/src/sqface_version.h && mv sqface_version.h.new $srcdir/src/sqface_version.h && \
echo 'Updated src/sqface_version.h'
else
rm -f sqface_version.h.new
fi
dnl }}}
DEFAULT_INSTALL_PREFIX="/usr/local"
STANDARD_PREFIXES="/usr /usr/local /opt /local"
dnl {{{ --with-libdir
AC_ARG_WITH(libdir,
[AS_HELP_STRING([--with-libdir],[look for libraries in .../NAME rather than .../lib])
],
[LIBDIR=$with_libdir],
[LIBDIR=lib]
)
dnl }}}
dnl {{{ --with-freeimage
AC_ARG_WITH(freeimage,
[AS_HELP_STRING([--with-freeimage],[specify FreeImage install prefix])
],
[ ],
[with_freeimage=yes]
)
if test "x$with_freeimage" = "xno"; then
AC_MSG_ERROR([FreeImage library and headers are required to build sqface]);
else
AC_MSG_CHECKING([FreeImage install prefix])
if test "x$with_freeimage" = "xyes"; then
for i in `echo "$STANDARD_PREFIXES"`; do
if test -f "$i/include/FreeImage.h"; then
FREEIMAGE_DIR="$i"
break;
fi
done
else
if test -f "$with_freeimage/include/FreeImage.h"; then
FREEIMAGE_DIR="$with_freeimage"
break;
else
AC_MSG_ERROR([Can't find FreeImage headers under $with_freeimage directory]);
fi
fi
if test "x$FREEIMAGE_DIR" = "x"; then
AC_MSG_ERROR([Unable to locate FreeImage headers, please use --with-freeimage=<DIR>]);
fi
AC_MSG_RESULT([$FREEIMAGE_DIR])
LDFLAGS="$LDFLAGS -L$FREEIMAGE_DIR/$LIBDIR"
CFLAGS="$CFLAGS -I$FREEIMAGE_DIR/include"
CXXFLAGS="$CXXFLAGS -I$FREEIMAGE_DIR/include"
LIBS="$LIBS -lfreeimage"
AC_CHECK_LIB([freeimage], [FreeImage_Load], [], [
AC_MSG_ERROR([FreeImage_Load() is missing, check config.log for more details])
])
HAVE_FREEIMAGE=yes
fi
dnl }}}
dnl {{{ --enable-debug
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[enable debugging symbols and compile flags])
],
[
if test x"$enableval" = xyes ; then
debug="yes"
else
debug="no"
fi
]
)
if test x"$debug" = xyes ; then
AC_DEFINE([SQFACE_DEBUG], [], [debug build])
if test x"$GCC" = xyes; then
dnl Remove any optimization flags from CFLAGS and CXXFLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9s]*//g'`
CFLAGS=`echo "$CFLAGS" | sed -e 's/-g[0-2]\? //g'`
CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/-O[0-9s]*//g'`
CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/-g[0-2]\? //g'`
changequote([,])
CFLAGS="$CFLAGS -g3 -Wall -O0"
CXXFLAGS="$CXXFLAGS -g3 -Wall -O0"
fi
dnl Do not strip symbols from developer object files.
INSTALL_STRIP_FLAG=""
else
dnl Make sure to strip symbols from non-developer object files.
INSTALL_STRIP_FLAG="-s"
fi
dnl }}}
LIBS="$LIBS -lm"
AC_SUBST(INSTALL_STRIP_FLAG)
AC_CONFIG_FILES([Makefile src/Makefile examples/Makefile])
AC_OUTPUT