Skip to content

Commit

Permalink
Simplified, standardized and extended quoting so that it should work …
Browse files Browse the repository at this point in the history
…on netbsd as well

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@25763 72102866-910b-0410-8b05-ffd578937521
  • Loading branch information
nicola committed Dec 20, 2007
1 parent 2b10456 commit 931648b
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 95 deletions.
14 changes: 14 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2007-12-20 Nicola Pero <[email protected]>

* configure.ac (GNUSTEP_PREFIX): Removed double-quoting around
`...` expression on the right-hand of assignment. It is
unnecessary and seems to be adding additional unwanted quotes on
netbsd.
* openapp.in: Similar changes.
* opentool.in: Similar changes.
* GNUstep.sh.in: Similar changes.
* configure: Regenerated.

* GNUmakefile.in: Quote most paths in shell expressions.
* openapp.in: Similar changes.

2007-12-17 Adam Fedor <[email protected]>

* nsi-app.template, Master/nsis.make, Documenation/make.texi,
Expand Down
152 changes: 76 additions & 76 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -121,85 +121,85 @@ all: generated-files

install: generated-files
$(EC)(echo "Creating system tools directory: $(tooldir)"; \
$(srcdir)/mkinstalldirs $(tooldir); \
"$(srcdir)/mkinstalldirs" "$(tooldir)"; \
echo "Creating makefile directories in: $(makedir)"; \
$(srcdir)/mkinstalldirs \
$(makedir) \
$(makedir)/$(GNUSTEP_TARGET_CPU) \
$(makedir)/$(GNUSTEP_TARGET_DIR) \
$(makedir)/$(GNUSTEP_TARGET_LDIR) \
$(makedir)/Additional \
$(makedir)/Auxiliary \
$(makedir)/Master \
$(makedir)/Instance \
$(makedir)/Instance/Shared \
$(makedir)/Instance/Documentation)
"$(srcdir)/mkinstalldirs" \
"$(makedir)" \
"$(makedir)/$(GNUSTEP_TARGET_CPU)" \
"$(makedir)/$(GNUSTEP_TARGET_DIR)" \
"$(makedir)/$(GNUSTEP_TARGET_LDIR)" \
"$(makedir)/Additional" \
"$(makedir)/Auxiliary" \
"$(makedir)/Master" \
"$(makedir)/Instance" \
"$(makedir)/Instance/Shared" \
"$(makedir)/Instance/Documentation")
$(EC)(echo "Installing GNUstep configuration file in $(GNUSTEP_CONFIG_FILE)"; \
$(srcdir)/mkinstalldirs "$(GNUSTEP_CONFIG_FILE_DIR)"; \
"$(srcdir)/mkinstalldirs" "$(GNUSTEP_CONFIG_FILE_DIR)"; \
$(INSTALL_DATA) GNUstep.conf "$(GNUSTEP_CONFIG_FILE)")
$(EC)(echo "Installing gnustep-make support software")
$(EC)(for f in config.guess config.sub install-sh mkinstalldirs \
clean_cpu.sh clean_os.sh \
clean_vendor.sh cpu.sh os.sh vendor.sh \
print_unique_pathlist.sh \
relative_path.sh strip_makefiles.sh; do \
$(INSTALL_PROGRAM) -m 755 $(srcdir)/$$f $(makedir); \
$(INSTALL_PROGRAM) -m 755 "$(srcdir)/$$f" "$(makedir)"; \
done)
$(EC)($(INSTALL_DATA) GNUstep.sh $(makedir); \
$(INSTALL_DATA) GNUstep.csh $(makedir); \
$(INSTALL_DATA) filesystem.sh $(makedir); \
$(INSTALL_DATA) filesystem.csh $(makedir); \
$(INSTALL_DATA) $(srcdir)/ld_lib_path.sh $(makedir); \
$(INSTALL_DATA) $(srcdir)/ld_lib_path.csh $(makedir); \
$(INSTALL_DATA) $(srcdir)/GNUstep-reset.sh $(makedir); \
$(INSTALL_PROGRAM) -m 755 fixpath.sh $(makedir); \
$(INSTALL_PROGRAM) -m 755 openapp $(tooldir); \
$(INSTALL_PROGRAM) -m 755 $(srcdir)/debugapp $(tooldir); \
$(INSTALL_PROGRAM) -m 755 opentool $(tooldir); \
$(INSTALL_PROGRAM) -m 755 gnustep-config $(tooldir))
$(EC)($(INSTALL_DATA) GNUstep.sh "$(makedir)"; \
$(INSTALL_DATA) GNUstep.csh "$(makedir)"; \
$(INSTALL_DATA) filesystem.sh "$(makedir)"; \
$(INSTALL_DATA) filesystem.csh "$(makedir)"; \
$(INSTALL_DATA) "$(srcdir)/ld_lib_path.sh" "$(makedir)"; \
$(INSTALL_DATA) "$(srcdir)/ld_lib_path.csh" "$(makedir)"; \
$(INSTALL_DATA) "$(srcdir)/GNUstep-reset.sh" "$(makedir)"; \
$(INSTALL_PROGRAM) -m 755 fixpath.sh "$(makedir)"; \
$(INSTALL_PROGRAM) -m 755 openapp "$(tooldir)"; \
$(INSTALL_PROGRAM) -m 755 "$(srcdir)/debugapp" "$(tooldir)"; \
$(INSTALL_PROGRAM) -m 755 opentool "$(tooldir)"; \
$(INSTALL_PROGRAM) -m 755 gnustep-config "$(tooldir)")
$(EC)(echo "Installing makefiles"; \
for f in $(MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/$$f $(makedir); \
$(INSTALL_DATA) "$(srcdir)/$$f" "$(makedir)"; \
done; \
for f in $(MASTER_MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/Master/$$f $(makedir)/Master; \
$(INSTALL_DATA) "$(srcdir)/Master/$$f" "$(makedir)/Master"; \
done; \
for f in $(INSTANCE_MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/Instance/$$f $(makedir)/Instance; \
$(INSTALL_DATA) "$(srcdir)/Instance/$$f" "$(makedir)/Instance"; \
done; \
for f in $(INSTANCE_SHARED_MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/Instance/Shared/$$f \
$(makedir)/Instance/Shared; \
$(INSTALL_DATA) "$(srcdir)/Instance/Shared/$$f" \
"$(makedir)/Instance/Shared"; \
done; \
for f in $(INSTANCE_DOC_MAKE_FILES); do \
$(INSTALL_DATA) $(srcdir)/Instance/Documentation/$$f \
$(makedir)/Instance/Documentation; \
$(INSTALL_DATA) "$(srcdir)/Instance/Documentation/$$f" \
"$(makedir)/Instance/Documentation"; \
done; \
$(INSTALL_DATA) $(srcdir)/app-wrapper.template $(makedir); \
$(INSTALL_DATA) $(srcdir)/nsi-app.template $(makedir); \
$(INSTALL_DATA) executable.template $(makedir); \
$(INSTALL_DATA) config-noarch.make $(makedir); \
$(INSTALL_DATA) filesystem.make $(makedir); \
$(INSTALL_DATA) config.make $(makedir)/$(GNUSTEP_TARGET_LDIR))
$(INSTALL_DATA) "$(srcdir)/app-wrapper.template" "$(makedir)"; \
$(INSTALL_DATA) "$(srcdir)/nsi-app.template" "$(makedir)"; \
$(INSTALL_DATA) executable.template "$(makedir)"; \
$(INSTALL_DATA) config-noarch.make "$(makedir)"; \
$(INSTALL_DATA) filesystem.make "$(makedir)"; \
$(INSTALL_DATA) config.make "$(makedir)/$(GNUSTEP_TARGET_LDIR)")
$(EC)(echo "Installing manpages"; \
$(srcdir)/mkinstalldirs $(mandir)/man1 \
$(mandir)/man7; \
$(INSTALL_DATA) $(srcdir)/Documentation/openapp.1 $(mandir)/man1; \
which gzip > /dev/null 2>&1 && rm -f $(mandir)/man1/openapp.1.gz && gzip -9 $(mandir)/man1/openapp.1; \
$(INSTALL_DATA) $(srcdir)/Documentation/GNUstep.7 $(mandir)/man7; \
which gzip > /dev/null 2>&1 && rm -f $(mandir)/man7/GNUstep.7.gz && gzip -9 $(mandir)/man7/GNUstep.7)
"$(srcdir)/mkinstalldirs" "$(mandir)/man1" \
"$(mandir)/man7"; \
$(INSTALL_DATA) "$(srcdir)/Documentation/openapp.1" "$(mandir)/man1"; \
which gzip > /dev/null 2>&1 && rm -f "$(mandir)/man1/openapp.1.gz" && gzip -9 "$(mandir)/man1/openapp.1"; \
$(INSTALL_DATA) "$(srcdir)/Documentation/GNUstep.7" "$(mandir)/man7"; \
which gzip > /dev/null 2>&1 && rm -f "$(mandir)/man7/GNUstep.7.gz" && gzip -9 "$(mandir)/man7/GNUstep.7")
$(EC)(if [ "@GNUSTEP_STRIP_MAKEFILES@" = "strip" ]; then \
echo "Stripping makefiles and shell scripts..."; \
cd $(makedir); ./strip_makefiles.sh; \
cd "$(makedir)"; ./strip_makefiles.sh; \
fi)

# FIXME - review the issue of this config.site. What is it used for ?
# $(EC)($(srcdir)/mkinstalldirs $(GNUSTEP_SYSTEM_ROOT)/share; \
# $(INSTALL_DATA) $(srcdir)/config.site $(GNUSTEP_SYSTEM_ROOT)/share)

uninstall:
rm -f $(mandir)/man1/openapp.1 $(mandir)/man1/openapp.1.gz; \
rm -f $(mandir)/man7/GNUstep.7 $(mandir)/man7/GNUstep.7.gz; \
rm -f "$(mandir)/man1/openapp.1" "$(mandir)/man1/openapp.1.gz"; \
rm -f "$(mandir)/man7/GNUstep.7" "$(mandir)/man7/GNUstep.7.gz"; \
for f in config.guess config.sub install-sh mkinstalldirs \
clean_cpu.sh clean_os.sh \
clean_vendor.sh cpu.sh ld_lib_path.sh os.sh \
Expand All @@ -209,46 +209,46 @@ uninstall:
filesystem.sh filesystem.csh \
GNUstep.sh GNUstep.csh GNUstep-reset.sh \
relative_path.sh strip_makefiles.sh; do \
rm -f $(makedir)/$$f; \
rm -f "$(makedir)/$$f"; \
done
rm -f $(tooldir)/openapp; \
rm -f $(tooldir)/debugapp; \
rm -f $(tooldir)/opentool; \
rm -f $(tooldir)/gnustep-config; \
rm -f "$(tooldir)/openapp"; \
rm -f "$(tooldir)/debugapp"; \
rm -f "$(tooldir)/opentool"; \
rm -f "$(tooldir)/gnustep-config"; \
for f in $(MAKE_FILES); do \
rm -f $(makedir)/$$f; \
rm -f "$(makedir)/$$f"; \
done
for f in $(MASTER_MAKE_FILES); do \
rm -f $(makedir)/Master/$$f; \
rm -f "$(makedir)/Master/$$f"; \
done
for f in $(INSTANCE_MAKE_FILES); do \
rm -f $(makedir)/Instance/$$f; \
rm -f "$(makedir)/Instance/$$f"; \
done
for f in $(INSTANCE_SHARED_MAKE_FILES); do \
rm -f $(makedir)/Instance/Shared/$$f; \
rm -f "$(makedir)/Instance/Shared/$$f"; \
done
for f in $(INSTANCE_DOC_MAKE_FILES); do \
rm -f $(makedir)/Instance/Documentation/$$f; \
rm -f "$(makedir)/Instance/Documentation/$$f"; \
done
rm -f $(makedir)/executable.template
rm -f $(makedir)/app-wrapper.template
rm -f $(makedir)/nsi-app.template
rm -f $(GNUSTEP_SYSTEM_ROOT)/share/config.site
rm -f $(makedir)/config-noarch.make
rm -f $(makedir)/filesystem.make
rm -f $(makedir)/$(GNUSTEP_TARGET_LDIR)/config.make
rm -f "$(makedir)/executable.template"
rm -f "$(makedir)/app-wrapper.template"
rm -f "$(makedir)/nsi-app.template"
rm -f "$(GNUSTEP_SYSTEM_ROOT)/share/config.site"
rm -f "$(makedir)/config-noarch.make"
rm -f "$(makedir)/filesystem.make"
rm -f "$(makedir)/$(GNUSTEP_TARGET_LDIR)/config.make"
rm -f "$(GNUSTEP_CONFIG_FILE)"
-for f in $(makedir)/Instance/Documentation \
$(makedir)/Instance/Shared \
$(makedir)/Instance \
$(makedir)/Master \
$(makedir)/Auxiliary \
$(makedir)/Additional \
$(makedir)/$(GNUSTEP_TARGET_LDIR) \
$(makedir)/$(GNUSTEP_TARGET_DIR) \
$(makedir)/$(GNUSTEP_TARGET_CPU) \
$(makedir); do \
test -d $$f && rmdir $$f; \
-for f in "$(makedir)/Instance/Documentation" \
"$(makedir)/Instance/Shared" \
"$(makedir)/Instance" \
"$(makedir)/Master" \
"$(makedir)/Auxiliary" \
"$(makedir)/Additional" \
"$(makedir)/$(GNUSTEP_TARGET_LDIR)" \
"$(makedir)/$(GNUSTEP_TARGET_DIR)" \
"$(makedir)/$(GNUSTEP_TARGET_CPU)" \
"$(makedir)"; do \
test -d "$$f" && rmdir "$$f"; \
done

clean:
Expand Down
8 changes: 7 additions & 1 deletion GNUstep.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,15 @@ unset GNUSTEP_HOME

# Determine if the paths look like Windows paths that need fixing
fixup_paths=no
if [ -z "`echo $GNUSTEP_MAKEFILES | sed 's|^[a-zA-Z]:/.*$||'`" ]; then
# Here we want to use `...` but the only portable way to use it when
# there are "..." inside the expression (ie, it's actually
# `..."..."...`) seems to be to use it in variable assignments. So we
# use a temporary variable and assign the result of `...` to it
path_check=`echo "$GNUSTEP_MAKEFILES" | sed 's|^[a-zA-Z]:/.*$||'`
if [ -z "$path_check" ]; then
fixup_paths=yes
fi
unset path_check

# GNUSTEP_PATHLIST is deprecated and will be removed.
#
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3957,7 +3957,7 @@ fi
# PATH (on some systems at least) and so comparing them won't find a
# match and the check will fail even if GNUSTEP_SYSTEM_TOOLS is in
# PATH and a spurious warning will be produced.
GNUSTEP_PREFIX="`echo \"$GNUSTEP_PREFIX\" | sed 's%/*$%%'`"
GNUSTEP_PREFIX=`echo "$GNUSTEP_PREFIX" | sed 's%/*$%%'`
{ echo "$as_me:$LINENO: result: $GNUSTEP_PREFIX" >&5
echo "${ECHO_T}$GNUSTEP_PREFIX" >&6; }
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fi
# PATH (on some systems at least) and so comparing them won't find a
# match and the check will fail even if GNUSTEP_SYSTEM_TOOLS is in
# PATH and a spurious warning will be produced.
GNUSTEP_PREFIX="`echo \"$GNUSTEP_PREFIX\" | sed 's%/*$%%'`"
GNUSTEP_PREFIX=`echo "$GNUSTEP_PREFIX" | sed 's%/*$%%'`

AC_MSG_RESULT($GNUSTEP_PREFIX)

Expand Down
26 changes: 13 additions & 13 deletions openapp.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
# (originally we had a separate script, called debugapp, for that).

if [ -z "$1" ]; then
echo "usage: `basename "$0"` [--find] [--debug] application [arguments...]"
echo "`basename "$0"` --help for more help"
echo usage: `basename "$0"` [--find] [--debug] application [arguments...]
echo `basename "$0"` --help for more help
exit 1
fi

Expand All @@ -45,12 +45,12 @@ fi
while [ x"$1" != x ]; do
case "$1" in
--help)
echo "usage: `basename "$0"` [--find] [--debug] application [arguments...]"
echo usage: `basename "$0"` [--find] [--debug] application [arguments...]
echo
echo "application is the complete or relative name of the application"
echo "program with or without the .app extension, like Ink.app."
echo
echo "[arguments...] are the arguments to the application."
echo "[arguments...] are the arguments to the application."
echo
echo "If --find is used, openapp prints out the full path of the application "
echo "executable which would be executed, without actually executing it. It"
Expand Down Expand Up @@ -139,7 +139,7 @@ if [ -n "$GNUSTEP_USER_CONFIG_FILE" ]; then
fi

if [ -z "$GNUSTEP_MAKEFILES" ]; then
GNUSTEP_MAKEFILES=@GNUSTEP_MAKEFILES@
GNUSTEP_MAKEFILES="@GNUSTEP_MAKEFILES@"
fi
# OK, we now have GNUSTEP_MAKEFILES, source GNUstep.sh

Expand All @@ -150,7 +150,7 @@ fi
# Also, we'd like to get the GNUSTEP_*_APPS directories so we can
# search them, so tell GNUstep.sh to export all variabes.
GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes
. $GNUSTEP_MAKEFILES/GNUstep.sh
. "$GNUSTEP_MAKEFILES/GNUstep.sh"
unset GNUSTEP_SH_EXPORT_ALL_VARIABLES

if [ -z "$GNUSTEP_IS_FLATTENED" ]; then
Expand All @@ -162,7 +162,7 @@ if [ -z "$GDB" ]; then
fi

# Remove leading slashes at the end of the application name
openapp_app="`echo \"$openapp_app\" | sed 's%/*$%%'`"
openapp_app=`echo "$openapp_app" | sed 's%/*$%%'`

# Check if the user has provided the .app suffix; if not, add it.
# Save the appname (without the .app suffix) if we have it, so
Expand All @@ -186,7 +186,7 @@ case "$openapp_app" in
echo "Trying $openapp_app..."
fi
if [ -d "$openapp_app" ]; then
openapp_full_appname="`(cd \"$openapp_app\"; pwd)`"
openapp_full_appname=`(cd "$openapp_app"; pwd)`
fi
;;
*)
Expand All @@ -197,7 +197,7 @@ case "$openapp_app" in
echo "Trying $openapp_dir/$openapp_app..."
fi
if [ -d "$openapp_dir/$openapp_app" ]; then
openapp_full_appname="`(cd \"$openapp_dir/$openapp_app\"; pwd)`"
openapp_full_appname=`(cd "$openapp_dir/$openapp_app"; pwd)`
break
fi
done
Expand All @@ -220,7 +220,7 @@ case "$openapp_app" in
echo "Trying $openapp_dir/$openapp_app..."
fi
if [ -d "$openapp_dir/$openapp_app" ]; then
openapp_full_appname="`(cd \"$openapp_dir/$openapp_app\"; pwd)`"
openapp_full_appname=`(cd "$openapp_dir/$openapp_app"; pwd)`
break
fi
fi
Expand All @@ -234,7 +234,7 @@ case "$openapp_app" in
echo "Trying $openapp_dir/$openapp_app..."
fi
if [ -d "$openapp_dir/$openapp_app" ]; then
openapp_full_appname="`(cd \"$openapp_dir/$openapp_app\"; pwd)`"
openapp_full_appname=`(cd "$openapp_dir/$openapp_app"; pwd)`
break
fi
done
Expand All @@ -253,9 +253,9 @@ fi

# get base app name
if [ -z "$openapp_appname" ]; then
openapp_appname="`echo \"$openapp_app\" | sed 's/\.app$//'`"
openapp_appname=`echo "$openapp_app" | sed 's/\.app$//'`
fi
openapp_appname="`basename \"$openapp_appname\"`"
openapp_appname=`basename "$openapp_appname"`

if [ -z "$EXEEXT" ]; then
EXEEXT=@EXEEXT@
Expand Down
6 changes: 3 additions & 3 deletions opentool.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ case "$tool" in
/*) # An absolute path.
full_toolname="$tool";;
*/*) # A relative path
tool_dir="`dirname \"$tool\"`";
tool_dir="`(cd \"$tool_dir\"; pwd)`";
tool_name="`basename \"$tool\"`";
tool_dir=`dirname "$tool"`;
tool_dir=`(cd "$tool_dir"; pwd)`;
tool_name=`basename "$tool"`;
full_toolname="${tool_dir}/${tool_name}";;
*) # A path that should be searched into GNUstep tool paths

Expand Down

0 comments on commit 931648b

Please sign in to comment.