File: configure.ac

package info (click to toggle)
twclock 3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 896 kB
  • sloc: ansic: 2,375; sh: 1,233; makefile: 27
file content (116 lines) | stat: -rw-r--r-- 3,388 bytes parent folder | download | duplicates (2)
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
#
# configure.ac for twclock
#

AC_INIT([TWCLOCK], [3.5], [wa0eir@wa0eir.bcts.info])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE()

# Checks for programs.
AC_PROG_CC

# Checks for header files.
AC_CHECK_HEADERS([time.h stdio.h fcntl.h stdlib.h string.h],
   [], [AC_MSG_ERROR(This header file is missing)])
AC_CHECK_HEADERS([sys/ioctl.h time.h math.h ],
   [], [AC_MSG_ERROR(This header file is missing)])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM

# Checks for libraries functions
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_STRFTIME
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([putenv])
AC_CHECK_LIB([m], [sin], [],
             [AC_MSG_ERROR("math library was not found")])

AC_CHECK_LIB([pthread], [pthread_create], [],
             [AC_MSG_ERROR("pthread library was not found")])
#
# check for pulseaudio headers and libs
#
AC_CHECK_HEADERS(pulse/simple.h pulse/error.h, [],
                 [AC_MSG_ERROR("This header file is missing")])
AC_CHECK_LIB([pulse-simple], [pa_simple_new], [],
            [AC_MSG_ERROR("pulseaudio library was not found")])

AC_CHECK_LIB([pulse], [pa_strerror], [],
            [AC_MSG_ERROR("pulse library was not found")])
#
# Find headers and libraries for X11, Xpm and Xm
#
AC_DEFINE([HAVE_LIBXPM], [0], ["for xpm"])
AC_DEFINE([HAVE_LIB_XP], [0], ["for xp"])
AC_DEFINE([HAVE_MOTIF], [0], ["for motif/lessTif"])

AC_CHECK_HEADERS([X11/Intrinsic.h],[],
   [AC_MSG_ERROR("Can't find the X11/Intrinsic.h header file.")
    AC_MSG_ERROR("Please install the libXt development package.")])

# Check Motif/LessTif
AC_FIND_MOTIF
if test "$with_motif" = "no"
then
   AC_MSG_ERROR("Can't find Motif or LessTif on your system")
fi

#
# Look for the the Xpm header file. If found, look for the Xpm library.
#
tw_XPM_header="no"
tw_XPM_lib="no"

AC_CHECK_HEADERS([X11/xpm.h],
   [
      tw_XPM_header="yes"
      AC_CHECK_LIB([Xpm], [XpmCreatePixmapFromData])
      tw_XPM_lib="yes"
   ])

if test "$tw_XPM_headers" = "no"
then
   AC_MSG_WARN("Can't find the Xpm header file on your system.")
   AC_MSG_WARN("The window icon will not be created.")
fi

if test "$tw_XPM_lib" = "no"
then
   AC_MSG_WARN("Can't find the Xpm library on your system.")
   AC_MSG_WARN("The window icon will not be created.")
fi

#
# Find the system app-defaults directory
#
PKG_CHECK_MODULES(APPDEFS, xt)
xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
AC_SUBST(appdefaultdir)

AC_ARG_WITH(appdefaultdir,
   AC_HELP_STRING([--with-appdefaultdir=<pathname>],
   [specify directory for app-defaults files (default is autodetected)]),
   [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"])
AC_SUBST(appdefaultdir)

###########################################################################
CFLAGS="$CFLAGS $X_CFLAGS $MOTIF_CFLAGS"
LIBS="$X_LIBS $MOTIF_LIBS -lXt -lX11 $X_PRE_LIBS $X_EXTRA_LIBS $LIBS"
###########################################################################

echo "######################################################################"
echo CFLAGS = $CFLAGS
echo LIBS = $LIBS
echo LDFLAGS = $LDFLAGS
echo APP DEFAULTS DIR = "$appdefaultdir"
echo "######################################################################"

AC_CONFIG_FILES([Makefile src/Makefile src/icons/Makefile
                 man/Makefile man/en/Makefile])
AC_OUTPUT