summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 829b63c86f01e7b4ecb0630befdb2e5f00e9a173 (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
m4_define([pkg_version],  [0.15])
#m4_define([pkg_revision], [000])
m4_define([pkg_version],  m4_ifdef([pkg_revision], [pkg_version.pkg_revision], [pkg_version]))
m4_define([rpm_revision], m4_ifdef([pkg_revision], ["0.%(date '+%y%m%d')"], [1]))

AC_INIT([e16-epplets],[pkg_version],[enlightenment-devel@lists.sourceforge.net])
AM_INIT_AUTOMAKE([foreign dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_MACRO_DIR([m4])

AC_SUBST(E_RPM_REVISION, [rpm_revision])

dnl 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

define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])dnl
AC_ENABLE_SHARED
LT_INIT

AC_PROG_INSTALL

PKG_PROG_PKG_CONFIG

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_C_CONST
AC_C_INLINE
EC_C___ATTRIBUTE__
EC_C___FUNC__

AC_PATH_XTRA

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_CHECK_FUNCS(snprintf, x=1, x=0)
AC_SUBST(HAVE_SNPRINTF, $x)
AM_CONDITIONAL(BUILD_SNPRINTF, test "x$x" = "x0")

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/glx.h,, enable_glx=no)
  AC_CHECK_LIB(GL, glXChooseVisual, enable_glx=yes, enable_glx=no)
fi
if test "x$enable_glx" = "xyes"; then
  GLX_LIBS="-lGL"
  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)
AM_CONDITIONAL(BUILD_GLX, test "x$enable_glx" = "xyes")

PKG_CHECK_MODULES(IMLIB2, imlib2 >= 1.2.0)

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

# Build with libgtop?
AC_ARG_WITH(libgtop,
  [  --with-libgtop          use libgtop if available @<:@default=no@:>@])
if test "x$with_libgtop" = "xyes"; then
  PKG_CHECK_MODULES(LIBGTOP, libgtop-2.0,
    AC_DEFINE(HAVE_LIBGTOP, 1, [Using libgtop]) )
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

EC_C_WARNINGS()

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
api/Makefile
epplets/Makefile
api/epplet.h
e16-epplets.spec
])
AC_OUTPUT

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"