Skip to content

Commit

Permalink
xspec module: better to run code generator once at configure time
Browse files Browse the repository at this point in the history
  • Loading branch information
John C. Houck committed Feb 3, 2012
1 parent fc2afa9 commit 370bb30
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
13 changes: 11 additions & 2 deletions autoconf/configure.ac
Expand Up @@ -246,6 +246,15 @@ JH_CREATE_FC_MODULE_ORULES(src)
JH_APPEND_FC_RULES(src/Makefile)
JH_APPEND_FC_ELFRULES(src/Makefile)

dnl
dnl Run xspec module code generator, but don't
dnl assume that slsh is on the path.
dnl
if test "x$HEADAS_DIR" != "x" ; then
( cd modules/xspec/src;
$SLANG_LIBDIR/../bin/slsh code_gen.sl 12 $HEADAS_DIR )
fi

echo ""
echo "You are compiling with this compiler configuration:"
echo " CC =" "$CC"
Expand All @@ -263,10 +272,10 @@ if test "x$HEADAS_DIR" != "x" ; then
headas_arg="headas"
fi
echo " --with-${headas_arg} = $HEADAS_DIR"
./autoconf/compiler_check.sh "$CC" "$FC" "$HEADAS_DIR"
autoconf/compiler_check.sh "$CC" "$FC" "$HEADAS_DIR"
else
echo "The XSPEC module will not be compiled."
./autoconf/compiler_check.sh "$CC" "$FC"
autoconf/compiler_check.sh "$CC" "$FC"
fi
echo ""
echo "isis will be installed in" "$prefix"
Expand Down
9 changes: 7 additions & 2 deletions configure
Expand Up @@ -11524,6 +11524,11 @@ PROGRAM_FC_ELF_ORULES="$PROGRAM_FC_ELF_ORULES
PROGRAM_FC_ELF_ORULES=""
if test "x$HEADAS_DIR" != "x" ; then
( cd modules/xspec/src;
$SLANG_LIBDIR/../bin/slsh code_gen.sl 12 $HEADAS_DIR )
fi
echo ""
echo "You are compiling with this compiler configuration:"
echo " CC =" "$CC"
Expand All @@ -11541,10 +11546,10 @@ if test "x$HEADAS_DIR" != "x" ; then
headas_arg="headas"
fi
echo " --with-${headas_arg} = $HEADAS_DIR"
./autoconf/compiler_check.sh "$CC" "$FC" "$HEADAS_DIR"
autoconf/compiler_check.sh "$CC" "$FC" "$HEADAS_DIR"
else
echo "The XSPEC module will not be compiled."
./autoconf/compiler_check.sh "$CC" "$FC"
autoconf/compiler_check.sh "$CC" "$FC"
fi
echo ""
echo "isis will be installed in" "$prefix"
Expand Down
8 changes: 5 additions & 3 deletions modules/xspec/src/Makefile.in
Expand Up @@ -151,8 +151,8 @@ xspec_O_DEP = $(SRCDIR)/xspec-compat.inc
#---------------------------------------------------------------------------
# Rules
#---------------------------------------------------------------------------
all: new-xspec12-code $(ELFDIR_ELF_LIB)
static: new-xspec12-code $(OBJDIR_NORMAL_LIB)
all: $(ELFDIR_ELF_LIB)
static: $(OBJDIR_NORMAL_LIB)

$(OBJDIR_NORMAL_LIB): $(SRCDIR)/config-xspec-version $(OBJDIR) $(CONFIG_H) $(OBJS)
-$(RM) $(OBJDIR_NORMAL_LIB)
Expand All @@ -177,7 +177,9 @@ $(SRCDIR)/config-xspec-version:
HEADAS=$(HEA); export HEADAS; /bin/sh xspec_libs

new-xspec11-code:
./code_gen.sl 11 $(HEA)/..
@echo '*** WARNING: The xspec 11 interface is no longer maintained'
@echo '*** Use xspec 12 instead.'
@#./code_gen.sl 11 $(HEA)/..

new-xspec12-code:
./code_gen.sl 12 $(HEA)/..
Expand Down
2 changes: 1 addition & 1 deletion modules/xspec/src/parse_model_dat.sl
Expand Up @@ -313,7 +313,7 @@ define find_model_dat_file (dir, xspec_version) %{{{
variable path = path_concat (dir, x);
if (NULL != stat_file (path))
return path;
path = path_concat (dir + "/..", x);
path = path_concat (path_concat (dir, ".."), x);
if (NULL != stat_file (path))
return path;
}
Expand Down

0 comments on commit 370bb30

Please sign in to comment.