Skip to content

Commit

Permalink
configure: Add --with-pkg{data,sysconf,libexec}dir options
Browse files Browse the repository at this point in the history
Quick hack for discussion.
  • Loading branch information
p-montanus committed Sep 27, 2015
1 parent a5803dc commit cb2ab83
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 15 deletions.
31 changes: 16 additions & 15 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ srcdir = @srcdir@
libdir = @libdir@
incdir = @includedir@
mandir = @mandir@
datadir = @datarootdir@/@PACKAGE_NAME@
sysconfdir=@sysconfdir@
pkgconfdir=@sysconfdir@/@PACKAGE_NAME@
libexecdir=@libexecdir@
pkglibexecdir=@libexecdir@/@PACKAGE_NAME@
datadir = @datadir@
pkgdatadir = @pkgdatadir@
sysconfdir = @sysconfdir@
pkgsysconfdir = @pkgsysconfdir@
libexecdir = @libexecdir@
pkglibexecdir = @pkglibexecdir@
SLINK = @LN_S@
STRIP = @STRIP@
ifdef SPARSE
Expand Down Expand Up @@ -68,8 +69,8 @@ ALL_CFLAGS = $(CFLAGS) --std=gnu99 -Wall $(COVERAGE_CFLAGS)
DEBUG_CPPFLAGS ?= -DDEBUG
ALL_CPPFLAGS = $(CPPFLAGS) \
$(DEBUG_CPPFLAGS) \
-DDATADIR=\"$(datadir)\" \
-DPKGCONFDIR=\"$(pkgconfdir)\" \
-DDATADIR=\"$(pkgdatadir)\" \
-DPKGCONFDIR=\"$(pkgsysconfdir)\" \
-DPKGLIBEXECDIR=\"$(pkglibexecdir)\"

include $(srcdir)/source.mak
Expand Down Expand Up @@ -107,15 +108,15 @@ EMAN = $(ETAGS_PROG).$(manext)
#
# corpora files
#
corporadir = $(datadir)/corpora
pkgconf_corporadir = $(pkgconfdir)/corpora
corporadir = $(pkgdatadir)/corpora
pkgconf_corporadir = $(pkgsysconfdir)/corpora
CORPORA = ctags.ctags RFC1213-MIB.txt

#
# preload
#
preloaddir = $(datadir)/preload
pkgconf_preloaddir = $(pkgconfdir)/preload
preloaddir = $(pkgdatadir)/preload
pkgconf_preloaddir = $(pkgsysconfdir)/preload
PRELOAD_OPTLIB = \
\
coffee.ctags \
Expand All @@ -130,8 +131,8 @@ DEFAULT_PRELOAD_FILE=default.ctags
#
# config files
#
optlibdir = $(datadir)/optlib
pkgconf_optlibdir = $(pkgconfdir)/optlib
optlibdir = $(pkgdatadir)/optlib
pkgconf_optlibdir = $(pkgsysconfdir)/optlib
OPTLIB = $(PRELOAD_OPTLIB)

#
Expand Down Expand Up @@ -317,8 +318,8 @@ uninstall-etags:
- rm -f $(DEST_ETAGS) $(DEST_EMAN)

uninstall-data: uninstall-corpora uninstall-optlib uninstall-preload
- rmdir $(datadir)
- rmdir $(pkgconfdir)
- rmdir $(pkgdatadir)
- rmdir $(pkgsysconfdir)

uninstall-corpora:
- rm -f $(addprefix $(corporadir)/,$(CORPORA))
Expand Down
36 changes: 36 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ AC_ARG_ENABLE(tmpdir,
[default directory for temporary files [ARG=/tmp]])],
tmpdir_specified=yes)

AC_ARG_WITH([pkgdatadir],
[AS_HELP_STRING([--with-pkgdatadir=DIR],
[ctags read-only architecture-independent data [DATADIR/ctags]])])

AC_ARG_WITH([pkgsysconfdir],
[AS_HELP_STRING([--with-pkgsysconfdir=DIR],
[ctags read-only single-machine data [SYSCONFDIR/ctags]])])

AC_ARG_WITH([pkglibexecdir],
[AS_HELP_STRING([--with-pkglibexecdir=DIR],
[ctags program executables [LIBEXECDIR/ctags]])])

AC_ARG_PROGRAM

# Process configuration options
Expand All @@ -213,6 +225,30 @@ if test "$enable_maintainer_mode" = yes ; then
AC_MSG_NOTICE(enabling maintainer mode)
fi


case "${with_pkgdatadir+set}"-"$with_pkgdatadir" in #(
"set"-"yes" | "set"-"no") pkgdatadir="${datadir}/ctags" ;; #(
"set"-*) pkgdatadir="${with_pkgdatadir}" ;; #(
*) pkgdatadir="${datadir}/ctags" ;;
esac

case "${with_pkgsysconfdir+set}"-"$with_pkgsysconfdir" in #(
"set"-"yes" | "set"-"no") pkgsysconfdir="${sysconfdir}/ctags" ;; #(
"set"-*) pkgsysconfdir="${with_pkgsysconfdir}" ;; #(
*) pkgsysconfdir="${sysconfdir}/ctags" ;;
esac

case "${with_pkglibexecdir+set}"-"$with_pkglibexecdir" in #(
"set"-"yes" | "set"-"no") pkglibexecdir="${libexecdir}/ctags" ;; #(
"set"-*) pkglibexecdir="${with_pkglibexecdir}" ;; #(
*) pkglibexecdir="${libexecdir}/ctags" ;;
esac

AC_SUBST([pkgdatadir])
AC_SUBST([pkgsysconfdir])
AC_SUBST([pkglibexecdir])


install_targets="install-ctags install-data install-libexec"
AC_MSG_CHECKING(whether to install link to etags)
if test yes = "$enable_etags"; then
Expand Down

0 comments on commit cb2ab83

Please sign in to comment.