-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathconfigure.ac
231 lines (182 loc) · 6.35 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
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#-------------------------------------------------------------------
#
# Process this file with autoconf to produce a configure script.
#
#-------------------------------------------------------------------
AC_INIT
AC_PREREQ([2.69])
AC_CONFIG_AUX_DIR([build-aux])
SRCDIR="$(cd "$srcdir" && pwd -P)"
AC_SUBST([SRCDIR])
AC_CANONICAL_HOST
AC_DEFUN([PROG_ABSPATH], [
case "$$1" in
.*) $1="$(cd "$(dirname "$$1")" && pwd -P)/$(basename "$$1")" ;;
esac
])
test "x$CFLAGS" = "x" && CFLAGS='-g -O2 -pipe'
AC_CONFIG_HEADERS([include/FVWMconfig.h])
AC_PROG_MAKE_SET
#-------------------------------------------------------------------
#
# Checks for programs.
#
#-------------------------------------------------------------------
AC_LANG([C])
AC_PROG_CC
PROG_ABSPATH([CC])
AC_CHECK_PROG([RM], [rm], [rm -f], [rm -f])
PROG_ABSPATH([RM])
AC_CHECK_PROG([AR], [ar], [ar cr], [ar cr])
PROG_ABSPATH([AR])
AC_PROG_RANLIB
PROG_ABSPATH([RANLIB])
PKG_PROG_PKG_CONFIG
#-------------------------------------------------------------------
#
# Check for OS specific
#
#-------------------------------------------------------------------
AC_USE_SYSTEM_EXTENSIONS
#-------------------------------------------------------------------
#
# Checks for standard programs.
#
#-------------------------------------------------------------------
AC_PROG_INSTALL
PROG_ABSPATH([INSTALL])
AC_PROG_LN_S
PROG_ABSPATH([LN_S])
#-------------------------------------------------------------------
#
# Check for the existence of various libraries. The order here
# is important, so that then end up in the right order in the
# command line generated by make. The -lsocket and -lnsl libraries
# require a couple of special tricks:
#
# 1. Use "connect" and "accept" to check for -lsocket, and
# "gethostbyname" to check for -lnsl.
# 2. Use each function name only once: can't redo a check because
# autoconf caches the results of the last check and won't redo it.
# 3. Use -lnsl and -lsocket only if they supply procedures that
# aren't already present in the normal libraries. This is because
# IRIX 5.2 has libraries, but they aren't needed and they're
# bogus: they goof up name resolution if used.
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
# To get around this problem, check for both libraries together
# if -lsocket doesn't work by itself.
#
# Need to check for Xpm and rplay
#
#-------------------------------------------------------------------
AC_CHECK_LIB([Xbsd], [main], [LIBS="$LIBS -lXbsd"])
fvwm95_checkBoth=0
AC_CHECK_FUNC([connect], [fvwm95_checkSocket=0], [fvwm95_checkSocket=1])
if test "$fvwm95_checkSocket" = 1; then
AC_CHECK_LIB([socket], [main], [LIBS="$LIBS -lsocket"], [fvwm95_checkBoth=1])
fi
if test "$fvwm95_checkBoth" = 1; then
fvwm95_oldLibs=$LIBS
LIBS="$LIBS -lsocket -lnsl"
AC_CHECK_FUNC([accept], [fvwm95_checkNsl=0], [LIBS=$fvwm95_oldLibs])
fi
AC_CHECK_FUNC([gethostbyname], [], [AC_CHECK_LIB([nsl], [main], [LIBS="$LIBS -lnsl"])])
# For FvwmConsole
READLINE_LIBRARIES="$($PKG_CONFIG --libs readline 2>/dev/null)"
if ! test -z "$READLINE_LIBRARIES"; then
AC_DEFINE([HAVE_READLINE], [1], [readline library presence])
fi
AC_SUBST([READLINE_LIBRARIES])
#-------------------------------------------------------------------
#
# Checks for typedefs, structures, and compiler characteristics.
#
#-------------------------------------------------------------------
AC_C_CONST
AC_C_INLINE
#-------------------------------------------------------------------
#
# Checks for library functions.
#
#-------------------------------------------------------------------
# AC_CHECK_FUNCS(select)
AC_CHECK_FUNCS([gethostname waitpid sysconf uname])
AC_CHECK_FUNCS([strerror strcasecmp strncasecmp strtoul])
#===================================================================
#-------------------------------------------------------------------
#
# Check for X11
#
#-------------------------------------------------------------------
AC_PATH_X
#-------------------------------------------------------------------
#
# Hard coded fvwm config stuff
#
#-------------------------------------------------------------------
fvwm_name="fvwm95"
fvwm_rc=".fvwm95rc"
fvwm_icons="$x_includes/X11/bitmaps:$x_includes/X11/pixmaps:$prefix/icons"
if test "x$x_libraries" != x ; then
x_libraries="-L$x_libraries"
fi
if test "x$x_includes" != x ; then
x_includes="-I$x_includes"
fi
#-------------------------------------------------------------------
#
# export variables
#
#-------------------------------------------------------------------
AC_SUBST([x_libraries])
AC_SUBST([x_includes])
AC_SUBST([fvwm_icons])
AC_SUBST([fvwm_name])
AC_SUBST([fvwm_rc])
#-------------------------------------------------------------------
#
# always build Makefiles in examples subdir
# so user can manually build programs when needed.
#
#-------------------------------------------------------------------
AC_CONFIG_FILES([Makefile \
fvwm/Makefile \
icons/Makefile \
libs/Makefile \
mini-icons/Makefile \
utils/Makefile \
xpmroot/Makefile \
sample.fvwmrc/Makefile \
sample.fvwmrc/system.fvwm95rc \
modules/Makefile \
modules/FvwmAudio/Makefile \
modules/FvwmAuto/Makefile \
modules/FvwmBacker/Makefile \
modules/FvwmBanner/Makefile \
modules/FvwmButtons/Makefile \
modules/FvwmConsole/Makefile \
modules/FvwmCpp/Makefile \
modules/FvwmDebug/Makefile \
modules/FvwmForm/Makefile \
modules/FvwmIconBox/Makefile \
modules/FvwmIconMan/Makefile \
modules/FvwmIdent/Makefile \
modules/FvwmM4/Makefile \
modules/FvwmPager/Makefile \
modules/FvwmSave/Makefile \
modules/FvwmSaveDesk/Makefile \
modules/FvwmScript/Makefile \
modules/FvwmScript/Widgets/Makefile \
modules/FvwmScript/Scripts/Makefile \
modules/FvwmScript/Scripts/some_nice_icons/Makefile \
modules/FvwmScroll/Makefile \
modules/FvwmTalk/Makefile \
modules/FvwmTaskBar/Makefile \
modules/FvwmWharf/Makefile \
modules/FvwmWinList/Makefile])
AC_OUTPUT
#-------------------------------------------------------------------
#
# Hasta la vista!
#
#-------------------------------------------------------------------