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 ...@@ -48,7 +48,9 @@ lib/git_info.sed
lib/git_version lib/git_version
lib/lal-version lib/lal-version
libtool 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 misc/uninstall-lal.sh
packages/*/doc/main.pdf packages/*/doc/main.pdf
packages/*/include/*.tex packages/*/include/*.tex
......
...@@ -202,6 +202,7 @@ AC_PROG_CXX ...@@ -202,6 +202,7 @@ AC_PROG_CXX
AC_PROG_CPP AC_PROG_CPP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_AWK
LT_INIT LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])]) AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4], m4) AC_CHECK_PROGS([M4],[gm4 m4], m4)
......
...@@ -19,51 +19,35 @@ EXTRA_DIST = \ ...@@ -19,51 +19,35 @@ EXTRA_DIST = \
lt~obsolete.m4 \ lt~obsolete.m4 \
main.tex.in \ main.tex.in \
missing \ 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 sysconf_DATA = \
BUILT_SOURCES = lal-user-env.sh lal-user-env.csh lal-user-env.sh \
lal-user-env.csh
BUILT_SOURCES = \
lal-user-env.sh \
lal-user-env.csh
all-local: include-link all-local: include-link
lal-user-env.sh: Makefile lal-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "# generic user environment script" >$@
echo "# Source this file to access LAL" >$@ ;\ @echo "set LAL_PREFIX $(prefix)" >>$@
echo "LAL_PREFIX=\"$(prefix)\"" >>$@ ;\ @echo "prepend PATH $(bindir)" >>$@
echo "export LAL_PREFIX" >>$@ ;\ @echo "prepend MANPATH $(mandir)" >>$@
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\ @echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\ @echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\ @echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
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.csh: Makefile lal-user-env.csh lal-user-env.sh: lal-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "creating $@"
echo "# Source this file to access LAL" >$@ ;\ @$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
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" >>$@
@INCLUDEMKFILE@ @INCLUDEMKFILE@
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
...@@ -26,7 +26,9 @@ doc/lalapps.toc ...@@ -26,7 +26,9 @@ doc/lalapps.toc
lalapps-*.tar.gz lalapps-*.tar.gz
lalapps.spec lalapps.spec
libtool 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/*/python_config.sed
src/calibration/lalapps_ComputeFactors src/calibration/lalapps_ComputeFactors
src/calibration/lalapps_ComputeStrainDriver src/calibration/lalapps_ComputeStrainDriver
......
...@@ -146,6 +146,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) ...@@ -146,6 +146,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_PROG_CPP AC_PROG_CPP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_AWK
# check for condor_compile # check for condor_compile
AC_ENABLE_SHARED AC_ENABLE_SHARED
......
...@@ -18,60 +18,35 @@ EXTRA_DIST = \ ...@@ -18,60 +18,35 @@ EXTRA_DIST = \
missing \ missing \
mkinstalldirs \ mkinstalldirs \
py-compile \ py-compile \
generate_user_env.awk \
vcsID.common vcsID.common
sysconf_DATA = lalapps-user-env.sh lalapps-user-env.csh CLEANFILES = \
BUILT_SOURCES = lalapps-user-env.sh lalapps-user-env.csh lalapps-user-env.shell \
CLEANFILES = lalapps-user-env.sh lalapps-user-env.csh 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 if HAVE_PYTHON
lalapps-user-env.sh: Makefile lalapps_pythonpath = $(pyexecdir) $(pythondir)
@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" >>$@
else else
lalapps-user-env.sh: Makefile lalapps_pythonpath =
@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" >>$@
endif 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 ...@@ -22,6 +22,7 @@ libtool
src/LALBurstConfig.h src/LALBurstConfig.h
src/LALBurstVCSInfo.h src/LALBurstVCSInfo.h
src/git_version src/git_version
src/lalburst-user-env.shell
src/lalburst-user-env.csh src/lalburst-user-env.csh
src/lalburst-user-env.sh src/lalburst-user-env.sh
src/stamp-h2 src/stamp-h2
......
...@@ -84,6 +84,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],) ...@@ -84,6 +84,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
AC_PROG_CPP AC_PROG_CPP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_AWK
LT_INIT LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])]) AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
......
...@@ -48,6 +48,7 @@ liblalburst_la_SOURCES = \ ...@@ -48,6 +48,7 @@ liblalburst_la_SOURCES = \
liblalburst_la_LDFLAGS = -version-info $(LIBVERSION) liblalburst_la_LDFLAGS = -version-info $(LIBVERSION)
CLEANFILES = \ CLEANFILES = \
lalburst-user-env.shell \
lalburst-user-env.sh \ lalburst-user-env.sh \
lalburst-user-env.csh lalburst-user-env.csh
...@@ -61,47 +62,23 @@ BUILT_SOURCES = \ ...@@ -61,47 +62,23 @@ BUILT_SOURCES = \
lalburst-user-env.sh \ lalburst-user-env.sh \
lalburst-user-env.csh lalburst-user-env.csh
lalburst-user-env.sh: Makefile lalburst-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "# generic user environment script" >$@
echo "# Source this file to access LAL Burst" >$@ ;\ @echo "set LALBURST_PREFIX $(prefix)" >>$@
echo "LALBURST_PREFIX=\"$(prefix)\"" >>$@ ;\ @echo "prepend PATH $(bindir)" >>$@
echo "export LALBURST_PREFIX" >>$@ ;\ @echo "prepend MANPATH $(mandir)" >>$@
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\ @echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\ @echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\ @echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
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.csh: Makefile lalburst-user-env.csh lalburst-user-env.sh: lalburst-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "creating $@"
echo "# Source this file to access LAL Burst" >$@ ;\ @$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
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" >>$@
EXTRA_DIST = \ EXTRA_DIST = \
LALBurstConfig.h.in \ LALBurstConfig.h.in \
LALBurstVCSInfo.h.in \ LALBurstVCSInfo.h.in \
generate_user_env.awk \
generate_vcs_info.py generate_vcs_info.py
LALBurstVCSInfo.h: ._vcsinfo LALBurstVCSInfo.h: ._vcsinfo
......
../../gnuscripts/generate_user_env.awk
\ No newline at end of file
...@@ -21,6 +21,7 @@ lalframe.spec ...@@ -21,6 +21,7 @@ lalframe.spec
libtool libtool
src/LALFrameConfig.h src/LALFrameConfig.h
src/LALFrameVCSInfo.h src/LALFrameVCSInfo.h
src/lalframe-user-env.shell
src/lalframe-user-env.csh src/lalframe-user-env.csh
src/lalframe-user-env.sh src/lalframe-user-env.sh
src/stamp-h2 src/stamp-h2
......
...@@ -90,6 +90,7 @@ AC_PROG_CXX ...@@ -90,6 +90,7 @@ AC_PROG_CXX
AC_PROG_CPP AC_PROG_CPP
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LN_S AC_PROG_LN_S
AC_PROG_AWK
LT_INIT LT_INIT
AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])]) AM_PATH_PYTHON([2.4],,[AC_MSG_ERROR([Python-2.4, or higher, is required])])
AC_CHECK_PROGS([M4],[gm4 m4],[m4]) AC_CHECK_PROGS([M4],[gm4 m4],[m4])
......
...@@ -30,6 +30,7 @@ noinst_HEADERS = \ ...@@ -30,6 +30,7 @@ noinst_HEADERS = \
liblalframe_la_LDFLAGS = -version-info $(LIBVERSION) liblalframe_la_LDFLAGS = -version-info $(LIBVERSION)
CLEANFILES = \ CLEANFILES = \
lalframe-user-env.shell \
lalframe-user-env.sh \ lalframe-user-env.sh \
lalframe-user-env.csh lalframe-user-env.csh
...@@ -43,45 +44,21 @@ BUILT_SOURCES = \ ...@@ -43,45 +44,21 @@ BUILT_SOURCES = \
lalframe-user-env.sh \ lalframe-user-env.sh \
lalframe-user-env.csh lalframe-user-env.csh
lalframe-user-env.sh: Makefile lalframe-user-env.shell: Makefile $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "# generic user environment script" >$@
echo "# Source this file to access LAL Frame" >$@ ;\ @echo "set LALFRAME_PREFIX $(prefix)" >>$@
echo "LALFRAME_PREFIX=\"$(prefix)\"" >>$@ ;\ @echo "prepend PATH $(bindir)" >>$@
echo "export LALFRAME_PREFIX" >>$@ ;\ @echo "prepend MANPATH $(mandir)" >>$@
echo "PATH=\"$(bindir):\$${PATH}\"" >>$@ ;\ @echo "prepend LD_LIBRARY_PATH $(libdir)" >>$@
echo "MANPATH=\"$(mandir):\$${MANPATH}\"" >>$@ ;\ @echo "prepend PKG_CONFIG_PATH $(libdir)/pkgconfig" >>$@
echo "LD_LIBRARY_PATH=\"$(libdir):\$${LD_LIBRARY_PATH}\"" >>$@ ;\ @echo "prepend LAL_DATA_PATH $(pkgdatadir)" >>$@
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.csh: Makefile lalframe-user-env.csh lalframe-user-env.sh: lalframe-user-env.shell $(srcdir)/generate_user_env.awk
@echo "creating $@" ;\ @echo "creating $@"
echo "# Source this file to access LAL Frame" >$@ ;\ @$(AWK) -f $(srcdir)/generate_user_env.awk -v package=$(PACKAGE_NAME) -v output=$@ $<
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" >>$@ ;\