Skip to content

Commit

Permalink
[loc] use a single rufus.loc as translator base
Browse files Browse the repository at this point in the history
* Remove the need to maintain a new_translation.loc
* Add a sed invocation to remove comments and unwanted stuff
  to generate a final embedded.loc
* Note: sed is only invoked for MinGW.
  MS compilers still embed the unmodified rufus.loc.
* Also fix a small bug when parsing the version.
  • Loading branch information
pbatard committed Nov 1, 2013
1 parent c44fa39 commit c544429
Show file tree
Hide file tree
Showing 25 changed files with 602 additions and 438 deletions.
1 change: 1 addition & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RM = @RM@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
Expand Down
1 change: 0 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh
aclocal || exit 1
#autoheader || exit 1
automake -a -c || exit 1
autoconf || exit 1
rm -rf autom4te.cache
76 changes: 75 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ test x\$exitcode = x0 || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
Expand Down Expand Up @@ -574,6 +575,7 @@ AM_CFLAGS
VISIBILITY_CFLAGS
WINDRES
RM
SED
RANLIB
OBJEXT
EXEEXT
Expand Down Expand Up @@ -3165,6 +3167,75 @@ else
RANLIB="$ac_cv_prog_RANLIB"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
{ ac_script=; unset ac_script;}
if test -z "$SED"; then
ac_path_SED_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_SED_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_SED="$ac_path_SED"
ac_path_SED_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_SED_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_SED"; then
as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
else
ac_cv_path_SED=$SED
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
# Extract the first word of "rm", so it can be a program name with args.
set dummy rm; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down Expand Up @@ -3505,6 +3576,8 @@ ac_config_files="$ac_config_files src/libcdio/udf/Makefile"
ac_config_files="$ac_config_files src/libcdio/driver/Makefile"
ac_config_files="$ac_config_files res/localization/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
Expand Down Expand Up @@ -4242,6 +4315,7 @@ do
"src/libcdio/iso9660/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcdio/iso9660/Makefile" ;;
"src/libcdio/udf/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcdio/udf/Makefile" ;;
"src/libcdio/driver/Makefile") CONFIG_FILES="$CONFIG_FILES src/libcdio/driver/Makefile" ;;
"res/localization/Makefile") CONFIG_FILES="$CONFIG_FILES res/localization/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
esac
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
AC_PREREQ([2.50])
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_SED
AC_PATH_PROG(RM, rm, rm)
AC_CHECK_TOOL(STRIP, strip, strip)
AC_CHECK_TOOL(WINDRES, windres, windres)
Expand Down Expand Up @@ -58,4 +59,5 @@ AC_CONFIG_FILES([src/syslinux/libinstaller/Makefile])
AC_CONFIG_FILES([src/libcdio/iso9660/Makefile])
AC_CONFIG_FILES([src/libcdio/udf/Makefile])
AC_CONFIG_FILES([src/libcdio/driver/Makefile])
AC_CONFIG_FILES([res/localization/Makefile])
AC_OUTPUT
15 changes: 15 additions & 0 deletions res/localization/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
all-local: embedded.loc

BUILT_SOURCES = embedded.loc
noinst_PROGRAMS =
noinst_EXES =

pkg_v_sed = $(pkg_v_sed_$(V))
pkg_v_sed_ = $(pkg_v_sed_$(AM_DEFAULT_VERBOSITY))
pkg_v_sed_0 = @echo " SED $<";

embedded.loc: rufus.loc
$(pkg_v_sed)$(SED) -f embedded.sed $< > $@

clean-local:
-rm -rf embedded.loc
Loading

0 comments on commit c544429

Please sign in to comment.