File: configure.ac

package info (click to toggle)
twpsk 4.3-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 1,296 kB
  • ctags: 900
  • sloc: cpp: 8,443; sh: 1,952; makefile: 44
file content (135 lines) | stat: -rw-r--r-- 4,093 bytes parent folder | download
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

# Copyright (C) 1999-2014 Ted Williams (wa0eir) <wa0eir@wa0eir.bcts.info>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AC_INIT([twpsk],[4.3],[wa0eir@wa0eir.bcts.info])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE(subdir-objects)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC

AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h], [],
                 [AC_MSG_ERROR(This header file is missing)])

AC_CHECK_HEADERS([sys/socket.h unistd.h pulse/simple.h], [],
                 [AC_MSG_ERROR(This header file is missing)])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset mkdir select socket strdup])
AC_CHECK_FUNCS([pow sqrt strncasecmp atexit bzero])

# Checks for libraries.
AC_CHECK_LIB([m], [sqrt], [],
             [AC_MSG_ERROR("ERROR: libm was not found")])

AC_CHECK_LIB([pthread], [pthread_create], [],
             [AC_MSG_ERROR("ERROR: libpthread was not found")])

AC_CHECK_LIB([pulse-simple], [pa_simple_new], [],
             [AC_MSG_ERROR("ERROR: pulseaudio library was not found")])

AC_CHECK_LIB([pulse], [pa_strerror], [],
             [AC_MSG_ERROR("pulselibrary was not found")])

#
# Find headers and libraries for X11, Xpm and Xm
#
AC_DEFINE([HAVE_LIBXPM], [0], ["got xpm"])
AC_DEFINE([HAVE_LIB_XP], [0], ["got xp"])
AC_DEFINE([HAVE_MOTIF], [0], ["got 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/LessTif on your system")
fi

AC_CHECK_HEADERS([X11/xpm.h],
   [tw_XPM_header="yes"],
   [AC_MSG_WARN("Can't find the Xpm header file on your system")
    AC_MSG_WARN("The window icon will not be created")])

# Look for the Xpm header file. If found, look for the Xpm libraryin
tw_XPM_lib="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_header" = "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_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 -lpulse"
###########################################################################
echo "######################################################################"
echo CFLAGS $CFLAGS
echo LIBS $LIBS
echo LDFLAGS $LDFLAGS
echo APP DEFAULTS DIR = "$appdefaultdir"
echo "######################################################################"

USER_NAME=$USER
AC_SUBST(USER_NAME)
HOME_DIR=$HOME
AC_SUBST(HOME_DIR)

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