Commit a24eb9ee by Maarten L. Hekkelman

configure to work without an installation of mrc

parent 0b3e922e
......@@ -16,3 +16,6 @@ config.log
aclocal.m4
dssp
*.dssp
src/config.hpp
src/config.hpp.in~
src/revision.hpp
......@@ -55,7 +55,7 @@ endif
# main build variables
CXXFLAGS += -Wall -Wno-multichar
DATADIR = $(datadir)/libcifpp
DATADIR = $(datadir)/dssp
DEFINES += DATADIR='"$(DATADIR)"'
......@@ -94,10 +94,29 @@ $(OBJDIR)/%.o: %.cpp | $(OBJDIR)
COMMON_OBJECTS = pr-main.o
REVISION = $(shell git log --pretty=format:%h --max-count=1)
REVISION_FILE = version-info-$(REVISION).txt
$(REVISION_FILE):
rm -f version-info-*.txt
git describe --match=build --dirty > $@
@ git log --pretty=medium --date=iso8601 -1 >> $@
src/revision.hpp: $(REVISION_FILE)
@ echo 'const char kRevision[] = R"(' > $@
@ cat $? >> $@
@ echo ')";' >> $@
$(OBJDIR)/pr-main.o: src/revision.hpp
ifneq "$(USE_RSRC)" "0"
COMMON_RSRC = $(DATADIR)/dictionaries
rsrc:
@ mkdir -p $@
rsrc/version.txt: $(REVISION_FILE) | rsrc
cp $? $@
endif
# The program rules
......@@ -105,6 +124,8 @@ endif
# disabled for now: centrifuge map-maker
PROGRAMS = dssp
dssp_RSRC = rsrc/
define PROGRAM_template =
$(1)_OBJECTS += $(1).o $(COMMON_OBJECTS)
......@@ -112,7 +133,7 @@ $(1)_OBJECTS += $(1).o $(COMMON_OBJECTS)
ifneq "$(USE_RSRC)" "0"
$(1)_OBJECTS += $(1).o $(1)_rsrc.o
$$(OBJDIR)/$(1)_rsrc.o: $$($(1)_RSRC) $$(COMMON_RSRC)
$$(OBJDIR)/$(1)_rsrc.o: $$($(1)_RSRC)
$(MRC) -o $$@ $$^
endif
......@@ -138,29 +159,14 @@ clean:
all: $(PROGRAMS)
REVISION = $(shell git log --pretty=format:%h --max-count=1)
REVISION_FILE = version-info-$(REVISION).txt
$(REVISION_FILE): $(OBJDIR) src
rm -f version-info-*.txt
git describe --match=build --dirty > $@
@ git log --pretty=medium --date=iso8601 -1 >> $@
src/revision.hpp: $(REVISION_FILE)
@ echo 'const char kRevision[] = R"(' > $@
@ cat $? >> $@
@ echo ')";' >> $@
rsrc:
@ mkdir -p $@
rsrc/version.txt: $(REVISION_FILE) | rsrc
cp $? $@
.PHONY: install
install: $(PROGRAMS)
install -d $(bindir)
for p in $(PROGRAMS); do install $$p $(bindir)/$$p; done
ifeq "$(USE_RSRC)" "0"
install -d $(DATADIR)/dictionaries
install -m644 rsrc/mmcif_pdbx.dic $(DATADIR)/dictionaries/mmcif_pdbx.dic
endif
.PHONY: FORCE
FORCE:
......
......@@ -5412,6 +5412,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
USE_RSRC=0
if test "x$MRC" = "x"; then
# Extract the first word of "mrc", so it can be a program name with args.
set dummy mrc; ac_word=$2
......@@ -5458,20 +5460,20 @@ fi
if test "x$MRC" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The mrc application was not found, not using resources." >&5
$as_echo "$as_me: WARNING: The mrc application was not found, not using resources." >&2;}
fi
# Check whether --enable-resources was given.
else
# Check whether --enable-resources was given.
if test "${enable_resources+set}" = set; then :
enableval=$enable_resources;
fi
USE_RSRC=0
if test "x$enable_resources" != "xno"; then :
if test "x$enable_resources" != "xno" ; then :
USE_RSRC=1
USE_RSRC=1
fi
fi
USE_RSRC=$USE_RSRC
......
......@@ -23,23 +23,24 @@ AC_ARG_VAR([DEBUG], [Build a debug version of the application])
AC_ARG_VAR([MRC], [Specify a location for the mrc executable])
dnl We really want to use mrc
USE_RSRC=0
if test "x$MRC" = "x"; then
AC_PATH_PROG([MRC], [mrc])
fi
if test "x$MRC" = "x"; then
AC_MSG_WARN([The mrc application was not found, not using resources.])
else
AC_ARG_ENABLE(
resources,
[AS_HELP_STRING([--disable-resources], [Do not use mrc to store data in resources])])
AS_IF([test "x$enable_resources" != "xno" ], [
USE_RSRC=1
])
fi
AC_ARG_ENABLE(
resources,
[AS_HELP_STRING([--disable-resources], [Do not use mrc to store data in resources])])
USE_RSRC=0
AS_IF([test "x$enable_resources" != "xno"], [
USE_RSRC=1
])
AC_SUBST([USE_RSRC], [$USE_RSRC])
AC_DEFINE_UNQUOTED([USE_RSRC], [$USE_RSRC], [Use mrc to store resources])
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment