[Libaps-general] Patch for configure.in
Brought to you by:
brianpirie,
tranter
From: Waldo B. <ba...@kd...> - 2000-07-25 22:27:48
|
Hiya, Some portability patches by Michael Matz <ma...@if...> from KDE cvs. Split into two seperate patches. Cheers, Waldo revision 1.4 date: 2000/07/19 00:49:13; author: matz; state: Exp; lines: +7 -4 trying to substitute corels (is that the author?) abominations of advanced shell substitutions with sed calls (like ${value%%:*} with sed -e 's/:.*$//' ) ---------------------------- revision 1.3 date: 2000/06/26 17:45:58; author: matz; state: Exp; lines: +46 -46 Arg. How good, that I have a strong stomach. This was full of bla=`expr BLA ...` where BLA was supposed to be an environment var. ---------------------------- Index: configure.in =================================================================== RCS file: /home/kde/kdesupport/libaps/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- configure.in 2000/06/19 09:49:24 1.2 +++ configure.in 2000/06/26 17:45:58 1.3 @@ -91,7 +91,7 @@ no = : key [default|all][class[,...]]: [default][channel{+-}class[,...]]], - [if test $APSCFG_DEBUG -ne 0; then + [if test "$APSCFG_DEBUG" -ne 0; then if test "$enableval" = "no"; then value=":" else @@ -103,7 +103,7 @@ ) APSCFG_DEBUG_TRACE=0 APSCFG_DEBUG_DEF_CHANNELS="" -if test $APSCFG_DEBUG -eq 0; then +if test "$APSCFG_DEBUG" -eq 0; then AC_MSG_RESULT(no: debugging disabled) else channels=${value#*:} @@ -112,12 +112,12 @@ for class in $classes; do case $class in all) APSCFG_DEBUG_TRACE=31;; - default) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 15 `;; - msg) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 1 `;; - warn) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 2 `;; - error) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 4 `;; - fixme) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 8 `;; - trace) APSCFG_DEBUG_TRACE=`expr APSCFG_DEBUG_TRACE | 16 `;; + default) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 15 `;; + msg) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 1 `;; + warn) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 2 `;; + error) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 4 `;; + fixme) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 8 `;; + trace) APSCFG_DEBUG_TRACE=`expr $APSCFG_DEBUG_TRACE | 16 `;; # *) AC_MSG_WARN("Unrecognized trace class: $class");; esac done @@ -127,17 +127,17 @@ APSCFG_DEBUG_DEF_CHANNELS="$channels" classes="" - if test `expr APSCFG_DEBUG_TRACE & 1 ` -ne 0; then + if test `expr $APSCFG_DEBUG_TRACE & 1 ` -ne 0; then classes="${classes}msg,"; fi - if test `expr APSCFG_DEBUG_TRACE & 2 ` -ne 0; then + if test `expr $APSCFG_DEBUG_TRACE & 2 ` -ne 0; then classes="${classes}warn,"; fi - if test `expr APSCFG_DEBUG_TRACE & 4 ` -ne 0; then + if test `expr $APSCFG_DEBUG_TRACE & 4 ` -ne 0; then classes="${classes}error,"; fi - if test `expr APSCFG_DEBUG_TRACE & 8 ` -ne 0; then + if test `expr $APSCFG_DEBUG_TRACE & 8 ` -ne 0; then classes="${classes}fixme,"; fi - if test `expr APSCFG_DEBUG_TRACE & 16 ` -ne 0; then + if test `expr $APSCFG_DEBUG_TRACE & 16 ` -ne 0; then classes="${classes}trace,"; fi - if test $APSCFG_DEBUG_TRACE -eq 0; then + if test "$APSCFG_DEBUG_TRACE" -eq 0; then classes="no" else classes=${classes%,} @@ -153,7 +153,7 @@ [if test "$enableval" != "no"; then APSCFG_PROFILE=1; else APSCFG_PROFILE=0; fi] ) -if test $APSCFG_PROFILE -eq 0; then +if test "$APSCFG_PROFILE" -eq 0; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) @@ -192,7 +192,7 @@ [if test "$enableval" = "no"; then APSCFG_INLINE=0; else APSCFG_INLINE=1; fi] ) -if test $APSCFG_INLINE -eq 0; then +if test "$APSCFG_INLINE" -eq 0; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) @@ -201,14 +201,14 @@ dnl Create Settings dnl -- make sure we only export true/false values to avoid regenerating dnl config.h for nothing -AC_DEFINE_UNQUOTED(APSCFG_DEBUG, `expr APSCFG_DEBUG != 0 `) +AC_DEFINE_UNQUOTED(APSCFG_DEBUG, `expr $APSCFG_DEBUG != 0 `) AC_DEFINE_UNQUOTED(APSCFG_DEBUG_TRACE, $APSCFG_DEBUG_TRACE) -AC_DEFINE_UNQUOTED(APSCFG_DEBUG_PARANOID, `expr APSCFG_DEBUG_PARANOID != 0 `) +AC_DEFINE_UNQUOTED(APSCFG_DEBUG_PARANOID, `expr $APSCFG_DEBUG_PARANOID != 0 `) AC_DEFINE_UNQUOTED(APSCFG_DEBUG_DEF_CHANNELS, "$APSCFG_DEBUG_DEF_CHANNELS") -AC_DEFINE_UNQUOTED(APSCFG_INLINE, `expr APSCFG_INLINE != 0 `) +AC_DEFINE_UNQUOTED(APSCFG_INLINE, `expr $APSCFG_INLINE != 0 `) dnl we don't export these right now -dnl AC_DEFINE_UNQUOTED(APSCFG_OPTIMIZE, `expr APSCFG_OPTIMIZE != 0 `) -dnl AC_DEFINE_UNQUOTED(APSCFG_PROFILE, `expr APSCFG_PROFILE != 0 `) +dnl AC_DEFINE_UNQUOTED(APSCFG_OPTIMIZE, `expr $APSCFG_OPTIMIZE != 0 `) +dnl AC_DEFINE_UNQUOTED(APSCFG_PROFILE, `expr $APSCFG_PROFILE != 0 `) dnl config.h: Package information dnl PACKAGE and VERSION symbols exported by AM_INIT_AUTOMAKE line @@ -219,8 +219,8 @@ dnl CFLAGS CFLAGS="-O$APSCFG_OPTIMIZE" -if test $APSCFG_DEBUG -ne 0; then CFLAGS="$CFLAGS -g`expr APSCFG_DEBUG - 1 `"; fi -if test $APSCFG_PROFILE -ne 0; then CFLAGS="$CFLAGS -p"; fi +if test "$APSCFG_DEBUG" -ne 0; then CFLAGS="$CFLAGS -g`expr $APSCFG_DEBUG - 1 `"; fi +if test "$APSCFG_PROFILE" -ne 0; then CFLAGS="$CFLAGS -p"; fi CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" CFLAGS="$CFLAGS -Wmissing-declarations -Wpointer-arith" CXXFLAGS="$CFLAGS -Woverloaded-virtual" @@ -229,13 +229,13 @@ dnl config.h: Compiler tests AC_CHECK_SIZEOF(char, 1) dnl produces SIZEOF_CHAR -if test $ac_cv_sizeof_char -ne 1; then +if test "$ac_cv_sizeof_char" -ne 1; then AC_MSG_WARN([sizeof(char) != 1 -- May cause problems with module trackmem.c. (char *)-based arithmetic is used in trackmem.c for locating structures at negative offsets and for sizing buffers of arbitrary length.]) fi AC_CHECK_SIZEOF(int, 4) dnl produces SIZEOF_INT -if test $ac_cv_sizeof_int -lt 4; then +if test "$ac_cv_sizeof_int" -lt 4; then AC_MSG_WARN([sizeof(int) < 4 -- Most functions expect at least 32 bits. For simplicity, most integers are assumed to be at least 32 bits in size and capable of holding unsigned values of up to 2^32-1.]) @@ -262,25 +262,25 @@ dnl - if not, we will use max(sizeof(int), sizeof(double), sizeof(void *)) dnl and round to nearest multiple of sizeof(int) APSCFG_MALLOC_DATAALIGN=0 - if test $ac_cv_sizeof_double -gt $ac_cv_sizeof_int; then - if test $ac_cv_sizeof_double -gt $ac_cv_sizeof_void_p; then - APSCFG_MALLOC_DATAALIGN=$ac_cv_sizeof_double + if test "$ac_cv_sizeof_double" -gt "$ac_cv_sizeof_int"; then + if test "$ac_cv_sizeof_double" -gt "$ac_cv_sizeof_void_p"; then + APSCFG_MALLOC_DATAALIGN="$ac_cv_sizeof_double" else - APSCFG_MALLOC_DATAALIGN=$ac_cv_sizeof_void_p + APSCFG_MALLOC_DATAALIGN="$ac_cv_sizeof_void_p" fi else - if test $ac_cv_sizeof_int -gt $ac_cv_sizeof_void_p; then - APSCFG_MALLOC_DATAALIGN=$ac_cv_sizeof_int + if test "$ac_cv_sizeof_int" -gt "$ac_cv_sizeof_void_p"; then + APSCFG_MALLOC_DATAALIGN="$ac_cv_sizeof_int" else - APSCFG_MALLOC_DATAALIGN=$ac_cv_sizeof_void_p + APSCFG_MALLOC_DATAALIGN="$ac_cv_sizeof_void_p" fi fi - APSCFG_MALLOC_DATAALIGN=`expr APSCFG_MALLOC_DATAALIGN + ac_cv_sizeof_int - 1 ` - APSCFG_MALLOC_DATAALIGN=`expr APSCFG_MALLOC_DATAALIGN / ac_cv_sizeof_int * ac_cv_sizeof_int ` - if test $APSCFG_MALLOC_DATAALIGN -lt 16; then + APSCFG_MALLOC_DATAALIGN=`expr $APSCFG_MALLOC_DATAALIGN + $ac_cv_sizeof_int - 1 ` + APSCFG_MALLOC_DATAALIGN=`expr $APSCFG_MALLOC_DATAALIGN / $ac_cv_sizeof_int * ac_cv_sizeof_int ` + if test "$APSCFG_MALLOC_DATAALIGN" -lt 16; then APSCFG_MALLOC_USERALIGN=16 else - APSCFG_MALLOC_USERALIGN=$APSCFG_MALLOC_DATAALIGN + APSCFG_MALLOC_USERALIGN="$APSCFG_MALLOC_DATAALIGN" fi ;; esac @@ -305,14 +305,14 @@ if test $APSCFG_LPR_BUILD -ne 0; then APSCFG_TRANSPORTS="${APSCFG_TRANSPORTS} lpr" fi -AC_DEFINE_UNQUOTED(APSCFG_LPR_BUILD, `expr APSCFG_LPR_BUILD != 0 `) +AC_DEFINE_UNQUOTED(APSCFG_LPR_BUILD, `expr $APSCFG_LPR_BUILD != 0 `) AC_ARG_ENABLE(lpr-networks, [ --enable-lpr-networks let LPR daemon manage networks [default=no]], [if test "$enableval" != "no"; then APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS=1; else APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS=0; fi] ) -AC_DEFINE_UNQUOTED(APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS, `expr APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS != 0 `) +AC_DEFINE_UNQUOTED(APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS, `expr $APSCFG_LPR_LET_DAEMON_MANAGE_NETWORKS != 0 `) dnl config.h: CUPS Transport @@ -323,15 +323,15 @@ [if test "$enableval" != "no"; then APSCFG_CUPS_BUILD=1; else APSCFG_CUPS_BUILD=0; fi] ) -if test $APSCFG_CUPS_BUILD -ne 0; then +if test "$APSCFG_CUPS_BUILD" -ne 0; then AC_CHECK_HEADERS(cups/cups.h) - if test $ac_cv_header_cups_cups_h = "no"; then + if test "$ac_cv_header_cups_cups_h" = "no"; then AC_MSG_WARN("CUPS Transport disabled: unable to find cups/cups.h"); APSCFG_CUPS_BUILD=0 fi fi -AC_DEFINE_UNQUOTED(APSCFG_CUPS_BUILD, `expr APSCFG_CUPS_BUILD != 0 `) -if test $APSCFG_CUPS_BUILD -ne 0; then +AC_DEFINE_UNQUOTED(APSCFG_CUPS_BUILD, `expr $APSCFG_CUPS_BUILD != 0 `) +if test "$APSCFG_CUPS_BUILD" -ne 0; then APSCFG_TRANSPORTS="${APSCFG_TRANSPORTS} cups" fi @@ -349,7 +349,7 @@ AC_CHECK_FUNCS(pathconf) APSCFG_MAX_PATH_SIZE=1024 AC_MSG_CHECKING("for max path size using pathconf") -if test $ac_cv_func_pathconf = "yes"; then +if test "$ac_cv_func_pathconf" = "yes"; then AC_TRY_RUN([ #include <stdlib.h> #include <stdio.h> @@ -373,13 +373,13 @@ } ], [ APSCFG_MAX_PATH_SIZE_TEST=`cat ./conftestPathMax` - if test $APSCFG_MAX_PATH_SIZE_TEST -eq -1; then + if test "$APSCFG_MAX_PATH_SIZE_TEST" -eq -1; then AC_MSG_RESULT("infinite"); APSCFG_MAX_PATH_SIZE=-1 - else if test $APSCFG_MAX_PATH_SIZE_TEST -le 0; then + else if test "$APSCFG_MAX_PATH_SIZE_TEST" -le 0; then AC_MSG_RESULT("undefined : assuming $APSCFG_MAX_PATH_SIZE bytes"); else - APSCFG_MAX_PATH_SIZE=$APSCFG_MAX_PATH_SIZE_TEST + APSCFG_MAX_PATH_SIZE="$APSCFG_MAX_PATH_SIZE_TEST" AC_MSG_RESULT("success : got $APSCFG_MAX_PATH_SIZE bytes") fi fi Index: configure.in =================================================================== RCS file: /home/kde/kdesupport/libaps/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- configure.in 2000/06/26 17:45:58 1.3 +++ configure.in 2000/07/19 00:49:13 1.4 @@ -106,9 +106,11 @@ if test "$APSCFG_DEBUG" -eq 0; then AC_MSG_RESULT(no: debugging disabled) else - channels=${value#*:} - classes=${value%%:*} - classes=${classes//,/ } + channels=`echo $value | sed -e 's/[^:]*://'` + classes=`echo $value | sed -e 's/:.*$//'` + IFS=${IFS= } + save_IFS=$IFS + IFS="," for class in $classes; do case $class in all) APSCFG_DEBUG_TRACE=31;; @@ -121,6 +123,7 @@ # *) AC_MSG_WARN("Unrecognized trace class: $class");; esac done + IFS=$save_IFS if test "$channels" = "default"; then channels="all+error,all+fixme" fi @@ -140,7 +143,7 @@ if test "$APSCFG_DEBUG_TRACE" -eq 0; then classes="no" else - classes=${classes%,} + classes=`echo $classes | sed -e 's/,$//'` fi AC_MSG_RESULT(classes: ${classes} channels: ${APSCFG_DEBUG_DEF_CHANNELS}) |