Skip to content

Commit 38f7f11

Browse files
committed
build: add option to install (private) header files
1 parent cd11bf8 commit 38f7f11

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Makefile.am

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,16 @@ tzd_files += data/Saratov.tzd data/Singapore.tzd data/South_Africa.tzd data/Sout
352352
tzd_files += data/windowsZones.xml
353353
header_files = include/gromox/ab_tree.hpp include/gromox/arcfour.hpp include/gromox/archive.hpp include/gromox/atomic.hpp include/gromox/authmgr.hpp include/gromox/bounce_gen.hpp include/gromox/clock.hpp include/gromox/common_types.hpp include/gromox/config_file.hpp include/gromox/contexts_pool.hpp include/gromox/cookie_parser.hpp include/gromox/cryptoutil.hpp include/gromox/database.h include/gromox/database_mysql.hpp include/gromox/dbop.h include/gromox/dcerpc.hpp include/gromox/defs.h include/gromox/double_list.hpp include/gromox/dsn.hpp include/gromox/eid_array.hpp include/gromox/element_data.hpp include/gromox/exmdb_client.hpp include/gromox/exmdb_common_util.hpp include/gromox/exmdb_ext.hpp include/gromox/exmdb_idef.hpp include/gromox/exmdb_provider_client.hpp include/gromox/exmdb_rpc.hpp include/gromox/exmdb_server.hpp include/gromox/ext_buffer.hpp
354354
header_files += include/gromox/fileio.h include/gromox/flusher_common.h include/gromox/freebusy.hpp include/gromox/gab.hpp include/gromox/generic_connection.hpp include/gromox/hook_common.h include/gromox/hpm_common.h include/gromox/http.hpp include/gromox/ical.hpp include/gromox/icase.hpp include/gromox/json.hpp include/gromox/list_file.hpp include/gromox/lzxpress.hpp include/gromox/mail.hpp include/gromox/mail_func.hpp include/gromox/mapi_types.hpp include/gromox/mapidefs.h include/gromox/mapierr.hpp include/gromox/mapitags.hpp include/gromox/midb.hpp include/gromox/midb_agent.hpp include/gromox/mime.hpp include/gromox/mjson.hpp include/gromox/msgchg_grouping.hpp include/gromox/mysql_adaptor.hpp include/gromox/ndr.hpp include/gromox/ntlmssp.hpp include/gromox/oxcmail.hpp include/gromox/oxoabkt.hpp
355-
header_files += include/gromox/paths.h.in include/gromox/pcl.hpp include/gromox/plugin.hpp include/gromox/proc_common.h include/gromox/process.hpp include/gromox/proptag_array.hpp include/gromox/propval.hpp include/gromox/range_set.hpp include/gromox/resource_pool.hpp include/gromox/restriction.hpp include/gromox/rop_util.hpp include/gromox/rpc_types.hpp include/gromox/rule_actions.hpp include/gromox/safeint.hpp include/gromox/simple_tree.hpp include/gromox/sortorder_set.hpp include/gromox/stream.hpp include/gromox/svc_common.h include/gromox/svc_loader.hpp include/gromox/textmaps.hpp include/gromox/threads_pool.hpp include/gromox/tie.hpp include/gromox/tnef.hpp include/gromox/usercvt.hpp include/gromox/util.hpp include/gromox/vcard.hpp include/gromox/xarray2.hpp include/gromox/zcore_client.hpp include/gromox/zcore_rpc.hpp include/gromox/zz_ndr_stack.hpp
356-
header_files += lib/mapi/oxcmail_int.hpp
355+
header_files += include/gromox/paths.h include/gromox/pcl.hpp include/gromox/plugin.hpp include/gromox/proc_common.h include/gromox/process.hpp include/gromox/proptag_array.hpp include/gromox/propval.hpp include/gromox/range_set.hpp include/gromox/resource_pool.hpp include/gromox/restriction.hpp include/gromox/rop_util.hpp include/gromox/rpc_types.hpp include/gromox/rule_actions.hpp include/gromox/safeint.hpp include/gromox/simple_tree.hpp include/gromox/sortorder_set.hpp include/gromox/stream.hpp include/gromox/svc_common.h include/gromox/svc_loader.hpp include/gromox/textmaps.hpp include/gromox/threads_pool.hpp include/gromox/tie.hpp include/gromox/tnef.hpp include/gromox/usercvt.hpp include/gromox/util.hpp include/gromox/vcard.hpp include/gromox/xarray2.hpp include/gromox/zcore_client.hpp include/gromox/zcore_rpc.hpp include/gromox/zz_ndr_stack.hpp
356+
if ENABLE_PRIVATE_HEADERS
357+
pkginclude_HEADERS = ${header_files}
358+
endif
359+
EXTRA_HEADERS = include/gromox/paths.h.in lib/mapi/oxcmail_int.hpp
357360
list_files = data/cpid.txt data/exmdb_list.txt data/folder_names.txt data/lang_charset.txt data/lcid.txt data/mime_extension.txt data/propnames.txt
358361
pkgdata_DATA = data/abkt.pak data/timezone.pak
359362
dist_pkgdata_DATA = ${list_files} data/gdbinit data/fpm-gromox.conf.sample data/gromox.ldif data/sqliterc
360363
toolprogs = tools/defs2php.pl tools/defs2php.sh tools/duplogid tools/enumsort tools/exmidl.pl tools/exmidl.sh tools/includesort tools/mpak.pl tools/mpak.sh tools/proptagsort tools/stackusage tools/warncount tools/zcidl.pl tools/zcidl.sh
361-
EXTRA_DIST = ${abkt_files} ${tzd_files} ${header_files} ${toolprogs} LICENSE.txt README.rst default.sym exch/bounce_exch.cpp exch/php/ews/thumbnail.php exch/php/lib/conf.php exch/php/lib/db.php lib/haproxy.cpp tools/genmails tools/staticnpmap.cpp
364+
EXTRA_DIST = ${abkt_files} ${tzd_files} ${header_files} ${EXTRA_HEADERS} ${toolprogs} LICENSE.txt README.rst default.sym exch/bounce_exch.cpp exch/php/ews/thumbnail.php exch/php/lib/conf.php exch/php/lib/db.php lib/haproxy.cpp tools/genmails tools/staticnpmap.cpp
362365

363366
data/abkt.pak: ${abkt_files}
364367
${AM_V_GEN}${MKDIR_P} data
@@ -429,7 +432,13 @@ dldcheck.stamp: dldcheck ${dldcheck_files}
429432
.tps.service:
430433
${AM_V_GEN}${MKDIR_P} system; ${SED} -e 's|@''libexecdir''@|${libexecdir}|g' <$< >$@
431434

432-
.PHONY: tarball
435+
.PHONY: header-presence tarball
436+
437+
header-presence:
438+
@echo ${header_files} | sed -e 's/ /\n/g' | sort -u >hdrinstalled.o
439+
@echo include/gromox/*.h include/gromox/*.hpp | sed -e 's/ /\n/g' | sort -u >hdrpresent.o
440+
${AM_V_GEN}diff -dpru hdrinstalled.o hdrpresent.o
441+
433442
tarball:
434443
tmpdir=$$(mktemp -dtu); \
435444
mkdir $$tmpdir && \

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ AS_IF([test "$cxxmode" = error], [
5353
])
5454
my_CXXFLAGS="$my_CXXFLAGS${cxxmode}"
5555

56+
AC_ARG_ENABLE([private-headers],
57+
[AS_HELP_STRING([--enable-private-headers], [Do copy header files during \`make install\`])],
58+
[install_headers="$enableval"], [install_headers=no])
59+
AM_CONDITIONAL([ENABLE_PRIVATE_HEADERS], [test "$install_headers" = yes])
5660
AC_ARG_WITH([asan], AS_HELP_STRING([--with-asan], [Activate Address Sanitizer]),
5761
[
5862
my_CFLAGS="$my_CFLAGS -fsanitize=address"
@@ -277,3 +281,4 @@ AS_IF([test -z "$cxxmode"], [AC_MSG_RESULT([*** No usable -std= argument was det
277281
AC_LANG_POP([C++])
278282
AC_CONFIG_FILES([Makefile])
279283
AC_OUTPUT
284+
echo "Install private headers: $install_headers"

qconf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ case "$(uname -s)" in
1313
OpenBSD)
1414
set -x
1515
"$topdir/configure" --sysconfdir=/etc --prefix=/usr/local --localstatedir=/var \
16+
--enable-private-headers \
1617
CFLAGS="-O0 -g" CXXFLAGS="-O0 -g" "$@"
1718
set +x
1819
ncpus=$(sysctl hw.ncpuonline 2>/dev/zero | cut -b15-)
@@ -29,6 +30,7 @@ OpenBSD)
2930
fi
3031
set -x
3132
"$topdir/configure" --sysconfdir=/etc --localstatedir=/var $libdir \
33+
--enable-private-headers \
3234
CFLAGS="-O0 -g" CXXFLAGS="-O0 -g" "$@"
3335
set +x
3436
ncpus=$(nproc)

0 commit comments

Comments
 (0)