summaryrefslogtreecommitdiff
path: root/configure.in
blob: 5f30f204c556f017fdf208fcd3f5c7cc33f7b5cb (plain)
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
AC_INIT(configure.in)

E_PKG_VERSION=0.10
#E_PKG_REVISION=0.01
if test "x$E_PKG_REVISION" != "x"; then
  E_PKG_VER_REV=$E_PKG_VERSION-$E_PKG_REVISION
  E_RPM_REVISION=$E_PKG_REVISION
else
  E_PKG_VER_REV=$E_PKG_VERSION
  E_RPM_REVISION=1
fi

AM_INIT_AUTOMAKE(epplets, $E_PKG_VER_REV)

AC_DEFINE_UNQUOTED(E_PKG_VERSION, "$E_PKG_VERSION", [Version])
AC_SUBST(E_PKG_VERSION)
AC_DEFINE_UNQUOTED(E_PKG_REVISION, "$E_PKG_REVISION", [Revision])
AC_SUBST(E_PKG_REVISION)
AC_SUBST(E_RPM_REVISION)

# reasonable guesses for where stuff is installed
if test "x$prefix" = "xNONE"; then
  prefix=$ac_default_prefix
fi
if test "x$exec_prefix" = "xNONE"; then
  exec_prefix=$prefix
fi

AC_PROG_CC
AC_PROG_CPP

dnl# These must be run after AC_PROG_CC but before any other macros that use
dnl# the C compiler
AC_AIX
AC_ISC_POSIX
AC_MINIX

dnl# At least make the attempt to support CygWin32
AC_CYGWIN

AM_PROG_LIBTOOL

AC_GCC_TRADITIONAL

AC_PROG_INSTALL

dnl# Check the sanity of what we've done so far
AM_SANITY_CHECK

dnl# Most people don't want the developer-only clutter
AM_MAINTAINER_MODE

dnl# If it's there, what the hell?
AM_WITH_DMALLOC

dnl# Look for needed programs
AC_CHECK_PROG(RM, rm, rm, true)
AC_CHECK_PROG(CP, cp, cp, false)
AC_CHECK_PROG(CHMOD, chmod, chmod, true)
AC_CHECK_PROG(TAR, tar, tar, tar)
AC_CHECK_PROG(MKDIR, mkdir, mkdir, false)
AC_CHECK_PROG(AR, ar, ar, false)
AC_CHECK_PROG(MV, mv, mv, true)
AC_LN_S

AC_C_CONST
AC_C_INLINE
AC_PATH_XTRA

if test "$ac_cv_lib_socket_connect" = "yes" ; then
  SUBLIBS="-lsocket"
fi
if test "$ac_cv_lib_nsl_gethostbyname" = "yes" ; then
  SUBLIBS="$SUBLIBS -lnsl"
fi

dnl# Checks for header files.
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(unistd.h time.h math.h pwd.h sys/types.h varargs.h stdarg.h)
AC_HEADER_TIME

dnl# Missing typedefs and replacements
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_UID_T

dnl# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(snprintf, x=1, x=0)
AC_SUBST(HAVE_SNPRINTF, $x)
AM_CONDITIONAL(BUILD_SNPRINTF, test "x$x" = "x0")

# ok enlightenment d00ds want to ignore civilization and install
# everything in one place. The rest of use prefer sanity.
#
AC_ARG_ENABLE(fsstd,
  [  --enable-fsstd          install files following FSSTD @<:@default=yes@:>@],,
  enable_fsstd=yes)
if test "x$enable_fsstd" = "xyes"; then
  ENLIGHTENMENT_ROOT=${datadir}/e16
  ENLIGHTENMENT_BIN=${bindir}
  USE_FSSTD=yes
else
  ENLIGHTENMENT_ROOT=${prefix}/e16
  ENLIGHTENMENT_BIN=${prefix}/e16/bin
  USE_FSSTD=no
fi
EROOT=`eval echo $ENLIGHTENMENT_ROOT`
AC_SUBST(EROOT)

dnl#
dnl# X LIBRARIES
dnl#
AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="$X_LIBS -lX11", [
echo "ERROR:  You need libX11 to build Epplets.  Verify that you have libX11.a or";
echo "        libX11.so installed and that it is located in the X libraries";
echo "        directory shown above.  If it is in a different directory, try using";
echo "        the --x-libraries parameter to configure.";
             AC_MSG_ERROR([Fatal:  libX11 not found.])], $X_LIBS $SUBLIBS)
AC_CHECK_LIB(Xext, XextAddDisplay, X_LIBS="-lXext $X_LIBS", [
echo "ERROR:  You need libXext to build Epplets.  Verify that you have libXext.a or";
echo "        libXext.so installed and that it is located in the X libraries";
echo "        directory shown above.  If it is in a different directory, try using";
echo "        the --x-libraries parameter to configure.";
             AC_MSG_ERROR([Fatal:  libXext not found.])], $X_LIBS $SUBLIBS)

AC_ARG_ENABLE(glx,
  [  --enable-glx            build with GLX support @<:@default=yes@:>@],,
  enable_glx=yes)
if test "x$enable_glx" = "xyes"; then
  AC_CHECK_HEADERS(GL/gl.h GL/glu.h GL/glx.h,, enable_glx=no)
  AC_CHECK_LIB(GL, glXChooseVisual,, enable_glx=no)
dnl# AC_CHECK_LIB(GLU, main, , GLX_LIBS="", $X_LIBS)
fi
if test "x$enable_glx" = "xyes"; then
  GLX_LIBS="-lGL -lGLU"
  GLX_PROGS="E-OpenGL-Demo.epplet"
  AC_DEFINE(HAVE_GLX, 1, [GLX support])
else
  AC_MSG_WARN([*** GL epplets will not be built ***])
fi
AC_SUBST(GLX_LIBS)
AC_SUBST(GLX_PROGS)

PKG_CHECK_MODULES(IMLIB2, imlib2 >= 1.2.0)

AC_CHECK_LIB(kstat, kstat_open, KSTAT_LIBS="-lkstat")
AC_SUBST(KSTAT_LIBS)

AC_MSG_CHECKING(for Linux)
if test "`uname -s`" != "Linux"; then
  AC_MSG_RESULT(no)
  AC_CHECK_PROG(LIBGTOP_CONFIG, libgtop-config, libgtop-config, no)
else
  AC_MSG_RESULT(yes)
  LIBGTOP_CONFIG=no
fi

if test "$LIBGTOP_CONFIG" != "no"; then
  
  LIBGTOP_CONF_SH="`$LIBGTOP_CONFIG --config`"
  if test ! -z "$LIBGTOP_CONF_SH"; then
    . $LIBGTOP_CONF_SH

    AC_MSG_CHECKING(libgtop-config for the value of CFLAGS)
    CFLAGS="$CFLAGS $LIBGTOP_INCS"
    AC_DEFINE(HAVE_LIBGTOP, 1, [Have libgtop])
    AC_MSG_RESULT($CFLAGS)

    AC_MSG_CHECKING(libgtop-config for the value of LIBS)
    GTLIBS="$GTLIBS $LIBGTOP_LIBS $LIBGTOP_EXTRA_LIBS"
    AC_MSG_RESULT($GTLIBS)

    SAVE_LIBS="$LIBS"
    LIBS="$GTLIBS"

    AC_MSG_CHECKING(the sanity of new compile/link flags)
    AC_TRY_LINK(, , echo "yes", echo "no" ; LIBGTOP_CONFIG="no" ; 
                AC_WARN(Compile/link failed.)
    )

    LIBS="$SAVE_LIBS"
  fi
else
  GTLIBS=""
fi
AC_SUBST(GTLIBS)


AC_ARG_ENABLE(auto-respawn,
  [  --disable-auto-respawn  don't respawn epplets through e by default @<:@default=no@:>@],
          no_respawn=yes,)
if test ! -z "$no_respawn"; then
  AC_DEFINE(NO_AUTO_RESPAWN, 1, [Disable auto-respawning])
fi

AC_ARG_ENABLE(old-remember,
  [  --enable-old-remember   use if you have a version of enlightenment < 0.16.8 @<:@default=no@:>@],
  enable_old_remember=no)
if test "x$enable_old_remember" = "xno"; then
  AC_DEFINE(USE_OLD_REMEMBER, 1, [Use old remember mode (e16 < 0.16.8)])
fi


# Build test programs?
AC_ARG_WITH(test-programs,
  [  --with-test-programs    builds the test programs @<:@default=no@:>@],
  TEST_PROGS="EppletTest.epplet EppletConfigTest.epplet", TEST_PROGS="")
AC_SUBST(TEST_PROGS)

# Should we install E-Mixer?
# Probably not ;-) But we may as well check!
P_MIXER=
AC_CHECK_HEADERS(linux/soundcard.h,[P_MIXER=mixer],[
   AC_CHECK_HEADERS(machine/soundcard.h, [P_MIXER=mixer],[
     AC_CHECK_HEADERS(dmedia/audio.h, [P_MIXER=mixer],[
      AC_CHECK_HEADERS(sys/soundcard.h, [P_MIXER=mixer]) ]) ]) ])
if test "$P_MIXER" = "mixer"; then
  MIXER_PROGS="E-Mixer.epplet Emix.epplet"
else
  AC_MSG_WARN([*** Mixer epplets will not be built ***])
  MIXER_PROGS=""
fi
AC_SUBST(MIXER_PROGS)

SGI=
AC_CHECK_HEADERS(dmedia/audio.h,[SGI=sgi])
if test "$SGI" = "sgi"; then
  SGI_LIBS="-laudio"
  SGI_DEFINES="-DSGI_AUDIO"
else
  SGI_LIBS=""
  SGI_DEFINES=""
fi
AC_SUBST(SGI_LIBS)
AC_SUBST(SGI_DEFINES)


AC_ARG_ENABLE(cdaudio,
  [  --enable-cdaudio        build epplets using libcdaudio @<:@default=yes@:>@],,
  enable_cdaudio=yes)
if test "x$enable_cdaudio" = "xyes"; then
  AC_CHECK_LIB(cdaudio, cd_advance, PLAYCD_PROGS=E-PlayCD.epplet, PLAYCD_PROGS="")
fi
AC_SUBST(PLAYCD_PROGS)

AC_ARG_ENABLE(esd,
  [  --enable-esd            build epplets using libesd @<:@default=yes@:>@],,
  enable_esd=yes)
if test "x$enable_esd" = "xyes"; then
  AC_CHECK_LIB(esd, esd_open_sound, ESD_PROGS=E-SD.epplet, ESD_PROGS="")
fi
AC_SUBST(ESD_PROGS)

# Stuff for E-Mountbox
AC_PATH_PROG(MOUNT, mount)
AC_PATH_PROG(UMOUNT, umount)
AC_PATH_PROG(EJECT, eject)
AC_DEFINE_UNQUOTED(MOUNT, "$MOUNT", [Location of mount])
AC_DEFINE_UNQUOTED(UMOUNT, "$UMOUNT", [Location of umount])
AC_DEFINE_UNQUOTED(EJECT, "$EJECT", [Location of eject])
if test -n "$EJECT"; then
    AC_DEFINE(HAVE_EJECT, 1, [Have eject])
fi

AM_CONFIG_HEADER(config.h)

AC_OUTPUT([
Makefile
api/Makefile
epplets/Makefile
debian/Makefile
api/epplet.h
epplets.spec
])

echo
echo "Now type 'make' to build $PACKAGE $VERSION."
echo "Then type 'make install' to install."
echo
echo "If you are installing epplets for the first time, don't forget"
echo "to regenerate e16 menus to build your epplets menu"