Fix build-system: install data files (keys, apps, menu ...)

* Correctly build data files when operate outside of the $(srcdir)
* Actually install data files
* Use pkg-config to detect X11, works better on MacOSX. We used pkg-config
  already anyway, double checking for X11 does not yield better results.
* Replace EXEEXT in some files while before installing them
This commit is contained in:
Mathias Gumz 2015-01-05 15:08:32 +01:00 committed by Mathias Gumz
parent 0820bcb640
commit f8d0bd4cb3
5 changed files with 38 additions and 33 deletions

View file

@ -38,6 +38,10 @@ PROGRAM_SUFFIX=@program_suffix@
# Do not rely on configure.ac AC_CONFIG_FILES for install paths. The # Do not rely on configure.ac AC_CONFIG_FILES for install paths. The
# paths should be expanded at make time rather than configure. # paths should be expanded at make time rather than configure.
edit_cmd = sed \ edit_cmd = sed \
-e 's|@default_style[@]|$(DEFAULT_STYLE)|g' \
-e 's|@default_menu[@]|$(DEFAULT_MENU)|g' \
-e 's|@default_keysfile[@]|$(DEFAULT_KEYSFILE)|g' \
-e 's|@default_appsfile[@]|$(DEFAULT_APPSFILE)|g' \
-e 's|@bindir[@]|$(bindir)|g' \ -e 's|@bindir[@]|$(bindir)|g' \
-e 's|@datadir[@]|$(datadir)|g' \ -e 's|@datadir[@]|$(datadir)|g' \
-e 's|@exec_prefix[@]|$(exec_prefix)|g' \ -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
@ -53,6 +57,7 @@ edit_cmd = sed \
-e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \ -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
-e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \ -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
-e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \ -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
-e 's|@EXEEXT[@]|$(EXEEXT)|g' \
-e 's|@VERSION[@]|$(VERSION)|g' -e 's|@VERSION[@]|$(VERSION)|g'
PATHFILES = PATHFILES =
@ -60,6 +65,7 @@ CLEANFILES += $(PATHFILES)
EXTRA_DIST += $(PATHFILES:=.in) EXTRA_DIST += $(PATHFILES:=.in)
$(PATHFILES): Makefile $(PATHFILES): Makefile
$(MKDIR_P) $(dir $@)
@ rm -f $@ $@.tmp @ rm -f $@ $@.tmp
$(AM_V_GEN) srcdir=''; \ $(AM_V_GEN) srcdir=''; \
test -f ./$@.in || srcdir=$(srcdir)/; \ test -f ./$@.in || srcdir=$(srcdir)/; \

View file

@ -194,14 +194,24 @@ dnl Check for networking libraries
AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"]) AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"])
AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket $LIBS"]) AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket $LIBS"])
dnl Check for X headers and libraries #dnl Check for X headers and libraries
AC_PATH_X #AC_PATH_X
AC_PATH_XTRA #AC_PATH_XTRA
AS_IF([test x$no_x = "xyes"], [ #AS_IF([test x$no_x = "xyes"], [
# AC_MSG_ERROR([Fluxbox requires the X Window System libraries and headers.])
#])
dnl Check for X11
PKG_CHECK_MODULES([X11], [ x11 ],
[AC_DEFINE([HAVE_X11], [1], [Define if x11 is available]) have_x11=yes],
[have_x11=no])
AM_CONDITIONAL([X11], [test "$have_x11" = "yes"], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.]))
AS_IF([test x$have_x11 = "xno"], [
AC_MSG_ERROR([Fluxbox requires the X Window System libraries and headers.]) AC_MSG_ERROR([Fluxbox requires the X Window System libraries and headers.])
]) ])
LIBS="$X_LIBS $LIBS" CXXFLAGS="$X11_CFLAGS $CXXFLAGS"
LIBS="$X11_LIBS $LIBS"
dnl Check for xpg4 dnl Check for xpg4
AC_CHECK_LIB([xpg4], [setlocale], [LIBS="-lxpg4 $LIBS"]) AC_CHECK_LIB([xpg4], [setlocale], [LIBS="-lxpg4 $LIBS"])
@ -371,12 +381,6 @@ AS_IF([test "x$enable_imlib2" != "xno"], [
]) ])
AM_CONDITIONAL([IMLIB2], [test "$have_imlib2" = "yes"]) AM_CONDITIONAL([IMLIB2], [test "$have_imlib2" = "yes"])
dnl Check for X11
PKG_CHECK_MODULES([X11], [ x11 ],
[AC_DEFINE([HAVE_X11], [1], [Define if x11 is available]) have_x11=yes],
[have_x11=no])
AM_CONDITIONAL([X11], [test "$have_x11" = "yes"], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.]))
dnl Check for X fonts dnl Check for X fonts
have_xft=no have_xft=no
AC_ARG_ENABLE([xft], AS_HELP_STRING([--disable-xft], [disable xft support])) AC_ARG_ENABLE([xft], AS_HELP_STRING([--disable-xft], [disable xft support]))

View file

@ -28,30 +28,32 @@ include data/styles/bora_black/Makemodule.am
include data/styles/arch/pixmaps/Makemodule.am include data/styles/arch/pixmaps/Makemodule.am
include data/styles/arch/Makemodule.am include data/styles/arch/Makemodule.am
install-pkgdataDATA: pkgdata_FILES = data/init data/keys data/apps data/overlay data/menu
install-data-local: $(pkgdata_FILES)
@echo "Installing menu file in $(DESTDIR)$(DEFAULT_MENU)" @echo "Installing menu file in $(DESTDIR)$(DEFAULT_MENU)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_MENU)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_MENU))
$(INSTALL_DATA) ./menu $(DESTDIR)$(DEFAULT_MENU) $(INSTALL_DATA) ./data/menu $(DESTDIR)$(DEFAULT_MENU)
@echo "Installing keys file in $(DESTDIR)$(DEFAULT_KEYS)" @echo "Installing keys file in $(DESTDIR)$(DEFAULT_KEYS)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_KEYS)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_KEYS))
$(INSTALL_DATA) $(srcdir)/keys $(DESTDIR)$(DEFAULT_KEYS) $(INSTALL_DATA) $(srcdir)/data/keys $(DESTDIR)$(DEFAULT_KEYS)
@echo "Installing apps file in $(DESTDIR)$(DEFAULT_APPS)" @echo "Installing apps file in $(DESTDIR)$(DEFAULT_APPS)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_APPS)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_APPS))
$(INSTALL_DATA) ./apps $(DESTDIR)$(DEFAULT_APPS) $(INSTALL_DATA) ./data/apps $(DESTDIR)$(DEFAULT_APPS)
@echo "Installing overlay file in $(DESTDIR)$(DEFAULT_OVERLAY)" @echo "Installing overlay file in $(DESTDIR)$(DEFAULT_OVERLAY)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_OVERLAY)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_OVERLAY))
$(INSTALL_DATA) $(srcdir)/overlay $(DESTDIR)$(DEFAULT_OVERLAY) $(INSTALL_DATA) $(srcdir)/data/overlay $(DESTDIR)$(DEFAULT_OVERLAY)
@echo "Installing init file in $(DESTDIR)$(DEFAULT_INIT)" @echo "Installing init file in $(DESTDIR)$(DEFAULT_INIT)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_INIT)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_INIT))
$(INSTALL_DATA) ./init $(DESTDIR)$(DEFAULT_INIT) $(INSTALL_DATA) ./data/init $(DESTDIR)$(DEFAULT_INIT)
@echo "Installing windowmenu file in $(DESTDIR)$(DEFAULT_WINDOWMENU)" @echo "Installing windowmenu file in $(DESTDIR)$(DEFAULT_WINDOWMENU)"
$(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_WINDOWMENU)) $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_WINDOWMENU))
$(INSTALL_DATA) $(srcdir)/windowmenu $(DESTDIR)$(DEFAULT_WINDOWMENU) $(INSTALL_DATA) $(srcdir)/data/windowmenu $(DESTDIR)$(DEFAULT_WINDOWMENU)
menu: data/menu:
env MENUFILENAME=menu \ env MENUFILENAME=$@ \
PREFIX="${prefix}" \ PREFIX="${prefix}" \
MENUTITLE="Fluxbox-${VERSION}" \ MENUTITLE="Fluxbox-${VERSION}" \
INSTALL=Yes \ INSTALL=Yes \
PATH="${PATH}:../util:../util/fbrun" \ PATH="${PATH}:../util:../util/fbrun" \
util/fluxbox-generate_menu sh util/fluxbox-generate_menu

View file

@ -65,9 +65,9 @@ src/defaults.cc: force
echo ''; \ echo ''; \
echo 'const char* gitrevision() {'; \ echo 'const char* gitrevision() {'; \
if test -r $$GITDIR/HEAD; then \ if test -r $$GITDIR/HEAD; then \
echo ' return "'`cat $$GITDIR/$$(cat $$GITDIR/HEAD | cut -f 2 -d ' ')`'";'; \ echo ' return "'`cd $$GITDIR && git rev-parse HEAD`'";'; \
else \ else \
echo ' return "this_is_tar_ball_build";'; \ echo ' return "unknown";'; \
fi; \ fi; \
echo '}' ) > $(top_builddir)/src/defaults_tmp.cc echo '}' ) > $(top_builddir)/src/defaults_tmp.cc
@if ! cmp $(top_builddir)/src/defaults_tmp.cc $(top_builddir)/src/defaults.cc ; then cp $(top_builddir)/src/defaults_tmp.cc $(top_builddir)/src/defaults.cc; fi @if ! cmp $(top_builddir)/src/defaults_tmp.cc $(top_builddir)/src/defaults.cc ; then cp $(top_builddir)/src/defaults_tmp.cc $(top_builddir)/src/defaults.cc; fi
@ -151,11 +151,7 @@ fluxbox_LDADD = \
$(XFT_LIBS) \ $(XFT_LIBS) \
$(XINERAMA_LIBS) \ $(XINERAMA_LIBS) \
$(XPM_LIBS) \ $(XPM_LIBS) \
$(XRENDER_LIBS) \ $(XRENDER_LIBS)
$(X_EXTRA_LIBS) \
$(X_LIBS) \
$(X_PRE_LIBS) \
$(X11_LIBS)
fluxbox_SOURCES = \ fluxbox_SOURCES = \
src/AlphaMenu.cc \ src/AlphaMenu.cc \

View file

@ -24,7 +24,6 @@ fbsetroot_LDADD = \
libFbTk.a \ libFbTk.a \
$(FONTCONFIG_LIBS) \ $(FONTCONFIG_LIBS) \
$(FRIBIDI_LIBS) \ $(FRIBIDI_LIBS) \
$(X11_LIBS) \
$(XFT_LIBS) \ $(XFT_LIBS) \
$(XRENDER_LIBS) $(XRENDER_LIBS)
@ -45,13 +44,11 @@ fluxbox_update_configs_CPPFLAGS = \
-I$(nls_incdir) -I$(nls_incdir)
fluxbox_update_configs_LDADD = \ fluxbox_update_configs_LDADD = \
libFbTk.a \ libFbTk.a \
$(FRIBIDI_LIBS) \ $(FRIBIDI_LIBS)
$(X11_LIBS)
fluxbox_remote_SOURCES = \ fluxbox_remote_SOURCES = \
util/fluxbox-remote.cc util/fluxbox-remote.cc
fluxbox_remote_CPPFLAGS = \ fluxbox_remote_CPPFLAGS = \
$(AM_CPPFLAGS) \ $(AM_CPPFLAGS) \
-I$(fbtk_incdir) -I$(fbtk_incdir)
fluxbox_remote_LDADD = \
$(X11_LIBS)