From f8d0bd4cb303caad68c121a77974a3a0daa0c40e Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Mon, 5 Jan 2015 15:08:32 +0100 Subject: 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 --- Makefile.am | 6 ++++++ configure.ac | 26 +++++++++++++++----------- data/Makemodule.am | 22 ++++++++++++---------- src/Makemodule.am | 10 +++------- util/Makemodule.am | 7 ++----- 5 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1b09b39..f208e73 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,6 +38,10 @@ PROGRAM_SUFFIX=@program_suffix@ # Do not rely on configure.ac AC_CONFIG_FILES for install paths. The # paths should be expanded at make time rather than configure. 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|@datadir[@]|$(datadir)|g' \ -e 's|@exec_prefix[@]|$(exec_prefix)|g' \ @@ -53,6 +57,7 @@ edit_cmd = sed \ -e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \ -e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \ -e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \ + -e 's|@EXEEXT[@]|$(EXEEXT)|g' \ -e 's|@VERSION[@]|$(VERSION)|g' PATHFILES = @@ -60,6 +65,7 @@ CLEANFILES += $(PATHFILES) EXTRA_DIST += $(PATHFILES:=.in) $(PATHFILES): Makefile + $(MKDIR_P) $(dir $@) @ rm -f $@ $@.tmp $(AM_V_GEN) srcdir=''; \ test -f ./$@.in || srcdir=$(srcdir)/; \ diff --git a/configure.ac b/configure.ac index 33217ad..d6d5612 100644 --- a/configure.ac +++ b/configure.ac @@ -194,14 +194,24 @@ dnl Check for networking libraries AC_CHECK_LIB([nsl], [t_open], [LIBS="-lnsl $LIBS"]) AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket $LIBS"]) -dnl Check for X headers and libraries -AC_PATH_X -AC_PATH_XTRA -AS_IF([test x$no_x = "xyes"], [ +#dnl Check for X headers and libraries +#AC_PATH_X +#AC_PATH_XTRA +#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.]) ]) -LIBS="$X_LIBS $LIBS" +CXXFLAGS="$X11_CFLAGS $CXXFLAGS" +LIBS="$X11_LIBS $LIBS" dnl Check for xpg4 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"]) -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 have_xft=no AC_ARG_ENABLE([xft], AS_HELP_STRING([--disable-xft], [disable xft support])) diff --git a/data/Makemodule.am b/data/Makemodule.am index 437c54d..a1c15e4 100644 --- a/data/Makemodule.am +++ b/data/Makemodule.am @@ -28,30 +28,32 @@ include data/styles/bora_black/Makemodule.am include data/styles/arch/pixmaps/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)" $(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)" $(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)" $(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)" $(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)" $(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)" $(mkinstalldirs) $(DESTDIR)$(dir $(DEFAULT_WINDOWMENU)) - $(INSTALL_DATA) $(srcdir)/windowmenu $(DESTDIR)$(DEFAULT_WINDOWMENU) + $(INSTALL_DATA) $(srcdir)/data/windowmenu $(DESTDIR)$(DEFAULT_WINDOWMENU) -menu: - env MENUFILENAME=menu \ +data/menu: + env MENUFILENAME=$@ \ PREFIX="${prefix}" \ MENUTITLE="Fluxbox-${VERSION}" \ INSTALL=Yes \ PATH="${PATH}:../util:../util/fbrun" \ - util/fluxbox-generate_menu + sh util/fluxbox-generate_menu diff --git a/src/Makemodule.am b/src/Makemodule.am index 2fd5891..3f1fa06 100644 --- a/src/Makemodule.am +++ b/src/Makemodule.am @@ -65,9 +65,9 @@ src/defaults.cc: force echo ''; \ echo 'const char* gitrevision() {'; \ 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 \ - echo ' return "this_is_tar_ball_build";'; \ + echo ' return "unknown";'; \ fi; \ 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 @@ -151,11 +151,7 @@ fluxbox_LDADD = \ $(XFT_LIBS) \ $(XINERAMA_LIBS) \ $(XPM_LIBS) \ - $(XRENDER_LIBS) \ - $(X_EXTRA_LIBS) \ - $(X_LIBS) \ - $(X_PRE_LIBS) \ - $(X11_LIBS) + $(XRENDER_LIBS) fluxbox_SOURCES = \ src/AlphaMenu.cc \ diff --git a/util/Makemodule.am b/util/Makemodule.am index b022f10..c985d0d 100644 --- a/util/Makemodule.am +++ b/util/Makemodule.am @@ -24,7 +24,6 @@ fbsetroot_LDADD = \ libFbTk.a \ $(FONTCONFIG_LIBS) \ $(FRIBIDI_LIBS) \ - $(X11_LIBS) \ $(XFT_LIBS) \ $(XRENDER_LIBS) @@ -45,13 +44,11 @@ fluxbox_update_configs_CPPFLAGS = \ -I$(nls_incdir) fluxbox_update_configs_LDADD = \ libFbTk.a \ - $(FRIBIDI_LIBS) \ - $(X11_LIBS) + $(FRIBIDI_LIBS) fluxbox_remote_SOURCES = \ util/fluxbox-remote.cc fluxbox_remote_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(fbtk_incdir) -fluxbox_remote_LDADD = \ - $(X11_LIBS) + -- cgit v0.11.2