File: configure.ac

package info (click to toggle)
gummi 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,940 kB
  • sloc: ansic: 8,894; sh: 145; makefile: 77; python: 38
file content (108 lines) | stat: -rw-r--r-- 3,169 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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.65)
AC_INIT([Gummi], [0.8.1], [alexander@localhost], [gummi], [https://alexandervdm.github.io/gummi])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])

GETTEXT_PACKAGE=gummi
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
AC_SUBST(GETTEXT_PACKAGE)

# ls po/*.po | sort | sed 's/po\///g;s/.po//g'| sed ':a;N;s/\n/ /g;ta'
ALL_LINGUAS="ar ca cs da de el es fr hu it nl pl pt pt_BR ro ru sv zh_CN zh_TW"

AC_CONFIG_SRCDIR([src/environment.h])
AC_CONFIG_HEADERS([config.h])
AH_VERBATIM([USE_SYNCTEX1], [#undef USE_SYNCTEX1])

# Checks for programs.
AC_PROG_CC
AC_PROG_CC_C_O
IT_PROG_INTLTOOL
AM_PROG_CC_C_O

# Checks for libraries.
AM_PATH_GLIB_2_0([2.20.0], [
	 GUI_CFLAGS="$GUI_CFLAGS $GLIB_CFLAGS"
	 GUI_LIBS="$GUI_LIBS $GLIB_LIBS"
	], [AC_MSG_ERROR([You need Glib >= 2.20.0 to build $PACKAGE])])

PKG_CHECK_MODULES(gthread, [gthread-2.0],,
	[AC_MSG_ERROR([You need ghread-2.0 to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $gthread_CFLAGS"
GUI_LIBS="$GUI_LIBS $gthread_LIBS"

AM_PATH_GTK_3_0([3.20.0], [
	 GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS"
	 GUI_LIBS="$GUI_LIBS $GTK_LIBS"
	], [AC_MSG_ERROR([You need Gtk+ >= 3.20.0 to build $PACKAGE])])

PKG_CHECK_MODULES(gtksourceview, [gtksourceview-3.0 >= 3.4.0],,
	[AC_MSG_ERROR([You need gtksourceview3 >= 3.4.0 to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $gtksourceview_CFLAGS"
GUI_LIBS="$GUI_LIBS $gtksourceview_LIBS"

PKG_CHECK_MODULES(poppler, [poppler-glib],,
	[AC_MSG_ERROR([You need Poppler to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $poppler_CFLAGS"
GUI_LIBS="$GUI_LIBS $poppler_LIBS"


PKG_CHECK_MODULES(gtkspell3, [gtkspell3-3.0],,
    [AC_MSG_ERROR([You need GtkSpell3 to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $gtkspell3_CFLAGS"
GUI_LIBS="$GUI_LIBS $gtkspell3_LIBS"

PKG_CHECK_MODULES(synctex, [synctex >= 1.16],,
	[AC_MSG_ERROR([You need synctex to build $PACKAGE])])
GUI_CFLAGS="$GUI_CFLAGS $synctex_CFLAGS"
GUI_LIBS="$GUI_LIBS $synctex_LIBS"

# Set USE_SYNCTEX1 for synctex (< 2.00) compatibility
if $PKG_CONFIG --max-version 1.99 synctex; then
  AC_DEFINE(USE_SYNCTEX1)
fi
AC_SUBST(USE_SYNCTEX1)

# Add explicit linking flags
GUI_LIBS="$GUI_LIBS -pthread -lm -lz"
AC_CHECK_LIB(rt, clock_gettime, [
    GUI_LIBS="$GUI_LIBS -lrt"
])

# Checks for header files.
AC_CHECK_HEADERS([libintl.h locale.h netdb.h stdlib.h string.h sys/socket.h sys/time.h unistd.h fcntl.h])

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

# Checks for library functions.
AC_CHECK_FUNCS([gethostbyname memset setlocale socket strstr])

AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_CFLAGS)
AC_CONFIG_FILES([Makefile
		 src/Makefile
		 data/Makefile
		 data/ui/Makefile
		 data/icons/Makefile
		 data/snippets/Makefile
		 data/misc/Makefile
		 lib/Makefile
		 po/Makefile.in
		 data/misc/$PACKAGE.desktop
		 ])
AC_OUTPUT

echo
echo gummi...................................... : Version $VERSION
echo
echo The binary will be installed in $prefix/bin
echo 

echo configure complete, now type \'make\'.
echo