-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
executable file
·154 lines (119 loc) · 4.06 KB
/
configure.ac
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
AC_INIT(Sort Demo, 1.1, bobf-at-mrp3-dot-com, sortdemo)
AC_PREREQ(2.59)
AC_CONFIG_SRCDIR(sortdemo.cpp)
AM_INIT_AUTOMAKE
# use system default 'cc' when available; else, gcc
AC_PROG_CC([cc gcc])
AC_PATH_XTRA
AM_OPTIONS_WXCONFIG
AM_PATH_WXCONFIG([3.0.0], wxWin=1)
if test "$wxWin" != 1; then
AC_MSG_ERROR([
wxWindows must be installed on your system, but the wx-config
script couldn't be located. Please check that wx-config is in
the path, the directory where wxWidgets libraries are installed
(returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or
an equivalent variable, and wxWindows version is 2.6.0 or above.
If the wx-config location is NOT in the path, or the application
name is NOT 'wx-config', you can specify the correct (fully-
qualified) path name using the --with-wx-config option.]) ;
fi
# recommended by autoscan
AC_CHECK_HEADERS([stdio.h])
AC_CHECK_HEADERS([sys/timeb.h])
AC_HEADER_STDBOOL
AC_C_INLINE
# use system default 'c++' when available; else, g++
AC_PROG_CXX([c++ g++])
AC_TYPE_SIZE_T
AC_CHECK_FUNCS([printf sprintf ftime memset sqrt])
AC_SEARCH_LIBS([ftime],[compat],,[AC_MSG_ERROR(["missing library for 'ftime'"])])
AC_C_CONST
AC_HEADER_STDC
AC_CANONICAL_HOST
# optional things for Interix vs the rest of the world
case $host in
i*86-pc-interix*)
MAN_PAGES="sortdemo.interix"
CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
;;
*)
MAN_PAGES="sortdemo.1"
;;
esac
AC_SUBST([MAN_PAGES])
# locating the 'xrc' library
xrc_exist="N"
xrc_lib=`wx-config --basename`"_xrc-"`wx-config --release`
echo "temporary: ${AWK}" >&5
echo "$as_me:$LINENO: checking for lib${xrc_lib}" >&5
echo $ECHO_N "checking $xrc_path for lib${xrc_lib} ... $ECHO_C" >&6
# it's difficult expanding this any other way - awk had trouble with the '$0', so
# I couldn't use split to create an array and filter uniques. Instead I do this
for xrcp0 in `wx-config --libs` ; do
if echo "${xrcp0}" | grep -vq -- "-L" ; then
continue
fi
# remove the '-L' using pattern substitution
xrcp=${xrcp0##"-L"}
xrc1="${xrcp}/lib${xrc_lib}.a"
xrc2="${xrcp}/lib${xrc_lib}.so"
if test -e "$xrc1" ; then
echo "$as_me:$LINENO: $xrc1 exists (static)" >&5
echo "yes (static)" >&6
xrc_exist="Y"
WX_LIBS="$WX_LIBS -l$xrc_lib"
break
elif test -e "$xrc2" ; then
echo "$as_me:$LINENO: $xrc1 does not exist" >&5
echo "$as_me:$LINENO: $xrc2 exists (shared)" >&5
echo "yes (shared)" >&6
xrc_exist="Y"
WX_LIBS="$WX_LIBS -l$xrc_lib"
break
fi
done
if test $xrc_exist == "N" ; then
echo "$as_me:$LINENO: ${xrc1} and ${xrc2} do not exist!!! ** ERROR **" >&5
echo "no (error)" >&6
AC_MSG_ERROR([
wxWidgets contributed software must be installed
on your system, specifically the 'xrc' library.
The 'wxrc' application should also be installed
if you need to re-build the resources. Please
check the wxWidgets installation to make sure
that you have built the 'xrc' library.
]) ;
fi
echo "$as_me:$LINENO: checking for wxrc" >&5
echo $ECHO_N "checking for wxrc ... $ECHO_C" >&6
# here is where I differ from the standard scripts and
# check for installations like is used on FreeBSD
WXRC_PATH="" ;
for xpath in `echo "$PATH" | sed 's/:/ /g'` ;
do
for xp2 in ${xpath}/wxrc* ; do
if ( test -x "${xp2}" ) ; then
xp3=`basename ${xp2}`
WXRC_PATH=`${WX_CONFIG_NAME} --utility=${xp3}`
if ( test "x" != x"$WXRC_PATH" ) ; then
break ;
fi ;
fi;
done ;
done
if ( test "$WXRC_PATH" = "" ) ; then
echo "$as_me:$LINENO: no suitable wxrc has been located in the path" >&5 ;
echo "no" >&6 ;
else
echo "$as_me:$LINENO: wxrc has been located at $WXRC_PATH" >&5 ;
echo "yes ( $WXRC_PATH )" >&6 ;
fi
AC_SUBST([WXRC_PATH])
CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
LDFLAGS="$LDFLAGS $WX_LIBS"
# the end
AC_CONFIG_FILES([Makefile])
AC_OUTPUT