-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
184 lines (149 loc) · 5.9 KB
/
configure.ac
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
AC_PREREQ(2.69)
dnl Use a short version and package name here, or "make dist" will fail
dnl packaging [...]/libgphoto2_port/gphoto2-port-portability.h
dnl because tar only handles 99 chars per file path. Oh, and GNU tar 1.13
dnl even used to fail silently before automake got the filename-length-max=99
dnl parameter.
dnl
dnl If we want to use a package name like "gphoto-suite-2.2.4", then we have to
dnl remove libgphoto2_port from libgphoto2 and give it its own subdirectory:
dnl src/libgphoto2_port/libgphoto2_port/gphoto2/gphoto2-port-portability.h
dnl src/libgphoto2/libgphoto2/...
dnl src/libgphoto2/camlibs/...
dnl src/gphoto2/...
dnl That would change the standard module people check out to "gphoto-suite".
dnl
dnl "/src/libgphoto2/libgphoto2_port/libgphoto2_port/gphoto2/gphoto2-port-portability.h"
dnl is 82 characters, which leaves 17 characters for the distdir name.
dnl "gphoto-suite-2.3.0" whould be 18 characters - one too many: 82+18=100 > 99 :-(
dnl
dnl However, "/src/libgphoto2/libgphoto2_port/gphoto2/gphoto2-port-portability.h"
dnl is 66 characters, which leaves 33 characters for the distdir name.
dnl "gphoto-suite-2.3.0" whould be 18 characters - bingo!
AC_INIT([gphoto suite],
[2.5.23.1],
[https://github.com/gphoto/gphoto-suite/issues],
[gphoto-suite],
[https://github.com/gphoto/gphoto-suite])
AC_CONFIG_SRCDIR([README.md])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([auto-m4])
AC_CONFIG_AUX_DIR([auto-aux])
AM_INIT_AUTOMAKE([
-Wall
-Werror
foreign
1.15
no-dist-gzip
dist-xz
check-news
filename-length-max=99
])
m4_pattern_forbid([^GP_])
GP_CHECK_SHELL_ENVIRONMENT
GP_CONFIG_MSG([Build])
GP_CONFIG_MSG([Source code location],[${srcdir}])
dnl ---------------------------------------------------------------------------
dnl compiler stuff
dnl ---------------------------------------------------------------------------
LT_INIT([
dlopen
win32-dll
disable-static
])
AC_PROG_CC
AC_PROG_CXX
AM_CFLAGS="$CFLAGS"
AM_LDFLAGS="$LDFLAGS"
AM_CPPFLAGS="$CPPFLAGS"
GP_CONFIG_MSG([Compiler],[${CC}])
GP_CONFIG_MSG([Features])
PKG_CHECK_MODULES([PKGMODULECHECK], [pkgmodulecheck], [:], [:])
# ---------------------------------------------------------------------------
# Warnings: If we have GCC, be paranoid.
# ---------------------------------------------------------------------------
AS_VAR_IF([GCC], [yes], [dnl
AM_CPPFLAGS="$AM_CPPFLAGS -Wall -Wextra -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
AM_LDFLAGS="$AM_LDFLAGS -g -Wall"
])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_LDFLAGS])
# Configure subdirs.
dnl Absolute directories work with multiple levels of
dnl AC_CONFIG_SUBDIRS recursion, relative directories do not.
gp_top_builddir="$(pwd)/"
gp_top_srcdir="$(cd "${srcdir}" && pwd)/"
GP_SUBPACKAGE([gphoto2_manual])
AS_IF(["$enable_subpackage_gphoto2_manual" && test -f "${srcdir}/src/gphoto2-manual/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/gphoto2-manual])
# let pkg-config find *-uninstalled.pc
PKG_CONFIG_PATH="${gp_top_builddir}src/gphoto2-manual${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
])
GP_SUBPACKAGE([libexif])
AS_IF(["$enable_subpackage_libexif" && test -f "${srcdir}/src/libexif/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/libexif])
# let pkg-config find *-uninstalled.pc
PKG_CONFIG_PATH="${gp_top_builddir}src/libexif${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
])
GP_SUBPACKAGE([libgphoto2])
AS_IF(["$enable_subpackage_libgphoto2" && test -f "${srcdir}/src/libgphoto2/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/libgphoto2])
# let pkg-config find *-uninstalled.pc
PKG_CONFIG_PATH="${gp_top_builddir}src/libgphoto2/libgphoto2_port${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
PKG_CONFIG_PATH="${gp_top_builddir}src/libgphoto2${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
# PKG_CONFIG_PATH="src/libgphoto2/libgphoto2_port${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
# PKG_CONFIG_PATH="src/libgphoto2${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
])
GP_SUBPACKAGE([gphoto2])
AS_IF(["$enable_subpackage_gphoto2" && test -f "${srcdir}/src/gphoto2/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/gphoto2])
])
dnl GP_SUBPACKAGE([gphotofs])
dnl AS_IF(["$enable_subpackage_gphotofs" && test -f "${srcdir}/src/gphotofs/configure.ac"], [dnl
dnl AC_CONFIG_SUBDIRS([src/gphotofs])
dnl ])
dnl GP_SUBPACKAGE([libgphoto2_sharp])
dnl AS_IF(["$enable_subpackage_libgphoto2_sharp" && test -f "${srcdir}/src/libgphoto2-sharp/configure.ac"], [dnl
dnl AC_CONFIG_SUBDIRS([src/libgphoto2-sharp])
dnl ])
dnl GP_SUBPACKAGE([libgphoto2_python])
dnl AS_IF(["$enable_subpackage_libgphoto2_python" && test -f "${srcdir}/src/libgphoto2-python/configure.ac"], [dnl
dnl AC_CONFIG_SUBDIRS([src/libgphoto2-python])
dnl ])
GP_SUBPACKAGE([exif])
AS_IF(["$enable_subpackage_exif" && test -f "${srcdir}/src/exif/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/exif])
])
GP_SUBPACKAGE([libexif_gtk])
AS_IF(["$enable_subpackage_libexif_gtk" && test -f "${srcdir}/src/libexif-gtk/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/libexif-gtk])
# let pkg-config find *-uninstalled.pc
PKG_CONFIG_PATH="${gp_top_builddir}src/libexif-gtk${PKG_CONFIG_PATH+:}${PKG_CONFIG_PATH}"
export PKG_CONFIG_PATH
])
GP_SUBPACKAGE([gexif])
AS_IF(["$enable_subpackage_gexif" && test -f "${srcdir}/src/gexif/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/gexif])
])
GP_SUBPACKAGE([gtkam])
AS_IF(["$enable_subpackage_gtkam" && test -f "${srcdir}/src/gtkam/configure.ac"], [dnl
AC_CONFIG_SUBDIRS([src/gtkam])
])
GP_CONFIG_MSG([PKG_CONFIG_PATH])
saved_IFS="$IFS"
IFS=":"
for path in ${PKG_CONFIG_PATH}
do
IFS="$saved_IFS"
GP_CONFIG_MSG([path],[${path}])
done
IFS="$saved_IFS"
dnl ---------------------------------------------------------------------------
dnl Output files
dnl ---------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
GP_CONFIG_OUTPUT