Commit ad51c4dd authored by Karl Wette's avatar Karl Wette Committed by Adam Mercer
Browse files

Generate user environment scripts using AWK script

- Write a .shell file containing generic commands for setting and
  prepending/appending to (path) environment variables
- AWK script generate_user_env.awk generates .csh and .sh user
  environment scripts from .shell file
Original: fb259c866f2c5c7c2a5e7d1be2e5f8b159d157dc
parent 15d0f126
# Environment script generation
# Author: Karl Wette, 2011
# before processing any file
BEGIN {
prompt = "user_env.awk:"
# check that required variables were set on command line
if (package == "") {
print prompt, "no value for 'package' given on command line" >"/dev/stderr"
exit 1
}
if (output == "") {
print prompt, "no value for 'output' given on command line" >"/dev/stderr"
exit 1
}
sourcecount = 0
}
# source another environment setup file
# syntax: source FILE
$1 == "source" {
++sourcecount
sourcefiles[sourcecount] = $2
}
# set a environment variable to a given value or path
# syntax: set NAME value
# set NAME /dir1 /dir2
$1 == "set" {
name = $2
if (name == "") {
print prompt, "no name given to prepend" > "/dev/stderr"
exit 1
}
setvars[name] = ""
value = ""
for (i = 3; i <= NF; ++i) {
found = index(":" setvars[name] ":", ":" $i ":") > 0 ||
index(":" value ":", ":" $i ":") > 0
if (!found) {
value = value ":" $i
}
}
setvars[name] = substr(value, 2)
delete pathvars[name]
}
# prepend a value to a path environment variable
# syntax: prepend PATH /dir1 /dir2 /dir3 ...
$1 == "prepend" {
name = $2
if (name == "") {
print prompt, "no name given to prepend" > "/dev/stderr"
exit 1
}
if (pathvars[name] == "") {
pathvars[name] = sprintf("${%s}", name)
}
value = ""
for (i = 3; i <= NF; ++i) {
found = index(":" pathvars[name] ":", ":" $i ":") > 0 ||
index(":" value ":", ":" $i ":") > 0
if (!found) {
value = value $i ":"
}
}
pathvars[name] = value pathvars[name]
delete setvars[name]
}
# append a value to a path environment variable
# syntax: append PATH /dir1 /dir2 /dir3 ...
$1 == "append" {
name = $2
if (name == "") {
print prompt, "no name given to prepend" > "/dev/stderr"
exit 1
}
if (pathvars[name] == "") {
pathvars[name] = sprintf("${%s}", name)
}
value = ""
for (i = 3; i <= NF; ++i) {
found = index(":" pathvars[name] ":", ":" $i ":") > 0 ||
index(":" value ":", ":" $i ":") > 0
if (!found) {
value = value ":" $i
}
}
pathvars[name] = pathvars[name] value
delete setvars[name]
}
# output environment variables
END {
# if output file ends in 'csh', use C shell syntax, otherwise Bourne shell syntax
csh = (output ~ /\.csh$/)
# print usage
printf "# source this file to access '%s'\n", package >output
printf "# usage:\n" >>output
printf "# source %s\n", output >>output
# output source files
for (i = 1; i <= sourcecount; ++i) {
if (csh) {
printf "if ( -f %s.csh ) then\n", sourcefiles[i] >>output
printf " source %s.csh $argv:q\n", sourcefiles[i] >>output
printf "endif\n" >>output
}
else {
printf "if [ -f %s.sh ]; then\n", sourcefiles[i] >>output
printf " source %s.sh \"$@\"\n", sourcefiles[i] >>output
printf "fi\n" >>output
}
}
# output set variables
for (name in setvars) {
if (csh) {
printf "setenv %s \"%s\"\n", name, setvars[name] >>output
}
else {
printf "%s=\"%s\"\n", name, setvars[name] >>output
printf "export %s\n", name >>output
}
}
# output prepend/append variables
# - use sed, if available, to first remove path
# elements from path variable if already present
for (name in pathvars) {
if (csh) {
printf "if ( ! ${?%s} ) setenv %s\n", name, name >>output
printf "which sed >&/dev/null\n" >>output
printf "if ( ! $status ) then\n" >>output
}
else {
printf "type -p sed >/dev/null\n" >>output
printf "if [ $? -eq 0 ]; then\n" >>output
}
split(pathvars[name], pathvar, ":")
for (i in pathvar) {
if (substr(pathvar[i], 1, 1) != "$") {
if (csh) {
printf " setenv %s `echo \":${%s}:\" | sed 's|:%s:||;s|^:||;s|:$||'`\n", name, name, pathvar[i] >>output
}
else {
printf " %s=`echo \":${%s}:\" | sed 's|:%s:||;s|^:||;s|:$||'`\n", name, name, pathvar[i] >>output
}
}
}
if (csh) {
printf " setenv %s `echo \"%s\" | sed 's|^:||;s|:$||'`\n", name, pathvars[name] >>output
printf "else\n" >>output
printf " setenv %s \"%s\"\n", name, pathvars[name] >>output
printf "endif\n" >>output
}
else {
printf " %s=`echo \"%s\" | sed 's|^:||;s|:$||'`\n", name, pathvars[name] >>output
printf "else\n" >>output
printf " %s=\"%s\"\n", name, pathvars[name] >>output
printf "fi\n" >>output
printf "export %s\n", name >>output
}
}
}
......@@ -48,7 +48,9 @@ lib/git_info.sed
lib/git_version
lib/lal-version
libtool
misc/lal-user-env.*sh
misc/lal-user-env.shell
misc/lal-user-env.csh
misc/lal-user-env.sh
misc/uninstall-lal.sh
packages/*/doc/main.pdf
packages/*/include/*.tex
......
......@@ -202,6 +202,7 @@ AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4], m4)
......
......@@ -19,51 +19,35 @@ EXTRA_DIST = \
lt~obsolete.m4 \
main.tex.in \
missing \
mkinstalldirs
mkinstalldirs \
generate_user_env.awk
CLEANFILES = lal-user-env.sh lal-user-env.csh
CLEANFILES = \
lal-user-env.shell \
lal-user-env.sh \
lal-user-env.csh
sysconf_DATA = lal-user-env.sh lal-user-env.csh
BUILT_SOURCES = lal-user-env.sh lal-user-env.csh
sysconf_DATA = \
lal-user-env.sh \
lal-user-env.csh
BUILT_SOURCES = \
lal-user-env.sh \
lal-user-env.csh
all-local: include-link
lal-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL" >$@ ;\
echo "LAL_PREFIX=\"$(prefix)\"" >>$@ ;\
echo "export LAL_PREFIX" >>$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "DYLD_LIBRARY_PATH=\"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "PKG_CONFIG_PATH=\"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "export PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH PKG_CONFIG_PATH" >>$@
lal-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "# generic user environment script" >$@
@echo "set LAL_PREFIX $(prefix)" >>$@
@echo "prepend PATH $(bindir)" >>$@
@echo "prepend MANPATH $(mandir)" >>$@
@echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
@echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
lal-user-env.csh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL" >$@ ;\
echo "setenv LAL_PREFIX \"$(prefix)\"" >>$@ ;\
echo "setenv PATH \"$(bindir):\$${PATH}\"" >>$@ ;\
echo "if ( \$$?MANPATH ) then" >>$@ ;\
echo " setenv MANPATH \"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv MANPATH \"$(mandir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?LD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?DYLD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?PKG_CONFIG_PATH ) then" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig\"" >>$@ ;\
echo "endif" >>$@
lal-user-env.csh lal-user-env.sh: lal-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@"
@$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
@INCLUDEMKFILE@
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
......@@ -26,7 +26,9 @@ doc/lalapps.toc
lalapps-*.tar.gz
lalapps.spec
libtool
misc/lalapps-user-env.*sh
misc/lalapps-user-env.shell
misc/lalapps-user-env.csh
misc/lalapps-user-env.sh
src/*/python_config.sed
src/calibration/lalapps_ComputeFactors
src/calibration/lalapps_ComputeStrainDriver
......
......@@ -146,6 +146,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
# check for condor_compile
AC_ENABLE_SHARED
......
......@@ -18,60 +18,35 @@ EXTRA_DIST = \
missing \
mkinstalldirs \
py-compile \
generate_user_env.awk \
vcsID.common
sysconf_DATA = lalapps-user-env.sh lalapps-user-env.csh
BUILT_SOURCES = lalapps-user-env.sh lalapps-user-env.csh
CLEANFILES = lalapps-user-env.sh lalapps-user-env.csh
CLEANFILES = \
lalapps-user-env.shell \
lalapps-user-env.sh \
lalapps-user-env.csh
sysconf_DATA = \
lalapps-user-env.sh \
lalapps-user-env.csh
BUILT_SOURCES = \
lalapps-user-env.sh \
lalapps-user-env.csh
if HAVE_PYTHON
lalapps-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LALApps" >$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
if test "$(pyexecdir)" != "$(pythondir)" ; then \
echo "PYTHONPATH=\"$(pyexecdir):$(pythondir):\$${PYTHONPATH}\"" >>$@ ;\
else \
echo "PYTHONPATH=\"$(pythondir):\$${PYTHONPATH}\"" >>$@ ;\
fi ;\
echo "export PATH MANPATH PYTHONPATH" >>$@
lalapps-user-env.csh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LALApps" >$@ ;\
echo "setenv PATH \"$(bindir):\$${PATH}\"" >>$@ ;\
echo "if ( \$$?MANPATH ) then" >>$@ ;\
echo " setenv MANPATH \"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv MANPATH \"$(mandir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?PYTHONPATH ) then" >>$@ ;\
if test "$(pyexecdir)" != "$(pythondir)" ; then \
echo " setenv PYTHONPATH \"$(pyexecdir):$(pythondir):\$${PYTHONPATH}\"" >>$@ ;\
else \
echo " setenv PYTHONPATH \"$(pythondir):\$${PYTHONPATH}\"" >>$@ ;\
fi ;\
echo "else" >>$@ ;\
if test "$(pyexecdir)" != "$(pythondir)" ; then \
echo " setenv PYTHONPATH \"$(pyexecdir):$(pythondir)\"" >>$@ ;\
else \
echo " setenv PYTHONPATH \"$(pythondir)\"" >>$@ ;\
fi ;\
echo "endif" >>$@
lalapps_pythonpath = $(pyexecdir) $(pythondir)
else
lalapps-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LALApps" >$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "export PATH MANPATH" >>$@
lalapps-user-env.csh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LALApps" >$@ ;\
echo "setenv PATH \"$(bindir):\$${PATH}\"" >>$@ ;\
echo "if ( \$$?MANPATH ) then" >>$@ ;\
echo " setenv MANPATH \"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv MANPATH \"$(mandir)\"" >>$@ ;\
echo "endif" >>$@
lalapps_pythonpath =
endif
lalapps-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "# generic user environment script" >$@
@echo "prepend PATH $(bindir)" >>$@
@echo "prepend MANPATH $(mandir)" >>$@
@echo "prepend PYTHONPATH $(lalapps_pythonpath)" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
lalapps-user-env.csh lalapps-user-env.sh: lalapps-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@"
@$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
......@@ -22,6 +22,7 @@ libtool
src/LALBurstConfig.h
src/LALBurstVCSInfo.h
src/git_version
src/lalburst-user-env.shell
src/lalburst-user-env.csh
src/lalburst-user-env.sh
src/stamp-h2
......
......@@ -84,6 +84,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
......
......@@ -48,6 +48,7 @@ liblalburst_la_SOURCES = \
liblalburst_la_LDFLAGS = -version-info $(LIBVERSION)
CLEANFILES = \
lalburst-user-env.shell \
lalburst-user-env.sh \
lalburst-user-env.csh
......@@ -61,47 +62,23 @@ BUILT_SOURCES = \
lalburst-user-env.sh \
lalburst-user-env.csh
lalburst-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL Burst" >$@ ;\
echo "LALBURST_PREFIX=\"$(prefix)\"" >>$@ ;\
echo "export LALBURST_PREFIX" >>$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "DYLD_LIBRARY_PATH=\"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "PKG_CONFIG_PATH=\"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "export PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH PKG_CONFIG_PATH" >>$@
lalburst-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "# generic user environment script" >$@
@echo "set LALBURST_PREFIX $(prefix)" >>$@
@echo "prepend PATH $(bindir)" >>$@
@echo "prepend MANPATH $(mandir)" >>$@
@echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
@echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
lalburst-user-env.csh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL Burst" >$@ ;\
echo "setenv LALBURST_PREFIX \"$(prefix)\"" >>$@ ;\
echo "setenv PATH \"$(bindir):\$${PATH}\"" >>$@ ;\
echo "if ( \$$?MANPATH ) then" >>$@ ;\
echo " setenv MANPATH \"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv MANPATH \"$(mandir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?LD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?DYLD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?PKG_CONFIG_PATH ) then" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig\"" >>$@ ;\
echo "endif" >>$@
lalburst-user-env.csh lalburst-user-env.sh: lalburst-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@"
@$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
EXTRA_DIST = \
LALBurstConfig.h.in \
LALBurstVCSInfo.h.in \
generate_user_env.awk \
generate_vcs_info.py
LALBurstVCSInfo.h: ._vcsinfo
......
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
......@@ -21,6 +21,7 @@ lalframe.spec
libtool
src/LALFrameConfig.h
src/LALFrameVCSInfo.h
src/lalframe-user-env.shell
src/lalframe-user-env.csh
src/lalframe-user-env.sh
src/stamp-h2
......
......@@ -90,6 +90,7 @@ AC_PROG_CXX
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4],[m4])
......
......@@ -30,6 +30,7 @@ noinst_HEADERS = \
liblalframe_la_LDFLAGS = -version-info $(LIBVERSION)
CLEANFILES = \
lalframe-user-env.shell \
lalframe-user-env.sh \
lalframe-user-env.csh
......@@ -43,45 +44,21 @@ BUILT_SOURCES = \
lalframe-user-env.sh \
lalframe-user-env.csh
lalframe-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL Frame" >$@ ;\
echo "LALFRAME_PREFIX=\"$(prefix)\"" >>$@ ;\
echo "export LALFRAME_PREFIX" >>$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "DYLD_LIBRARY_PATH=\"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "PKG_CONFIG_PATH=\"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "export PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH PKG_CONFIG_PATH" >>$@
lalframe-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "# generic user environment script" >$@
@echo "set LALFRAME_PREFIX $(prefix)" >>$@
@echo "prepend PATH $(bindir)" >>$@
@echo "prepend MANPATH $(mandir)" >>$@
@echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
@echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
lalframe-user-env.csh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL Frame" >$@ ;\
echo "setenv LALFRAME_PREFIX \"$(prefix)\"" >>$@ ;\
echo "setenv PATH \"$(bindir):\$${PATH}\"" >>$@ ;\
echo "if ( \$$?MANPATH ) then" >>$@ ;\
echo " setenv MANPATH \"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv MANPATH \"$(mandir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?LD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv LD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?DYLD_LIBRARY_PATH ) then" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv DYLD_LIBRARY_PATH \"$(libdir)\"" >>$@ ;\
echo "endif" >>$@ ;\
echo "if ( \$$?PKG_CONFIG_PATH ) then" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "else" >>$@ ;\
echo " setenv PKG_CONFIG_PATH \"$(libdir)/pkgconfig\"" >>$@ ;\
echo "endif" >>$@
lalframe-user-env.csh lalframe-user-env.sh: lalframe-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@"
@$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
EXTRA_DIST = \
generate_user_env.awk \
generate_vcs_info.py \
LALFrameConfig.h.in \
LALFrameVCSInfo.h.in
......
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
......@@ -22,6 +22,7 @@ libtool
src/LALInferenceConfig.h
src/LALInferenceVCSInfo.h
src/git_version
src/lalinference-user-env.shell
src/lalinference-user-env.csh
src/lalinference-user-env.sh
src/stamp-h2
......
......@@ -91,6 +91,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
......
......@@ -33,6 +33,7 @@ liblalinference_la_SOURCES = \
liblalinference_la_LDFLAGS = -version-info $(LIBVERSION)
CLEANFILES = \
lalinference-user-env.shell \
lalinference-user-env.sh \
lalinference-user-env.csh
......@@ -46,49 +47,25 @@ BUILT_SOURCES = \
lalinference-user-env.sh \
lalinference-user-env.csh
lalinference-user-env.sh: Makefile
@echo "creating $@" ;\
echo "# Source this file to access LAL Inference" >$@ ;\
echo "LALINFERENCE_PREFIX=\"$(prefix)\"" >>$@ ;\
echo "export LALINFERENCE_PREFIX" >>$@ ;\
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\
echo "DYLD_LIBRARY_PATH=\"$(libdir):\$${DYLD_LIBRARY_PATH}\"" >>$@ ;\
echo "PKG_CONFIG_PATH=\"$(libdir)/pkgconfig:\$${PKG_CONFIG_PATH}\"" >>$@ ;\
echo "export PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH PKG_CONFIG_PATH" >>$@
lalinference-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "# generic user environment script" >$@
@echo "set LALINFERENCE_PREFIX $(prefix)" >>$@
@echo "prepend PATH $(bindir)" >>$@
@echo "prepend MANPATH $(mandir)" >>$@
@echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
@echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
@echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
<