]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Modernize cups-libtool.m4.
authorMichael R Sweet <msweet@msweet.org>
Sat, 6 Mar 2021 22:41:30 +0000 (17:41 -0500)
committerMichael R Sweet <msweet@msweet.org>
Sat, 6 Mar 2021 22:41:36 +0000 (17:41 -0500)
config-scripts/cups-libtool.m4
configure

index 7dfd360ed07d696c94a7eba690b4f85bab5a6fa9..1e57aeae58698647bd41ea09d2f604e1d3727f9c 100644 (file)
@@ -1,60 +1,60 @@
 dnl
 dnl Libtool stuff for CUPS.
 dnl
-dnl Copyright 2007-2018 by Apple Inc.
-dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
+dnl Copyright © 2021 by OpenPrinting.
+dnl Copyright © 2007-2018 by Apple Inc.
+dnl Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 dnl
-dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
+dnl Licensed under Apache License v2.0.  See the file "LICENSE" for more
+dnl information.
 dnl
 
-AC_ARG_ENABLE(libtool_unsupported, [  --enable-libtool-unsupported=/path/to/libtool
-                          build with libtool (UNSUPPORTED!)],
-       [if test x$enable_libtool_unsupported != xno; then
-               if test x$enable_libtool_unsupported == xyes; then
-                       AC_MSG_ERROR([Use --enable-libtool-unsupported=/path/to/libtool.])
-               fi
-               LIBTOOL="$enable_libtool_unsupported"
-               enable_shared=no
-               echo "WARNING: libtool is not supported or endorsed by Apple Inc."
-               echo "         WE DO NOT PROVIDE SUPPORT FOR LIBTOOL PROBLEMS."
-       else
-               LIBTOOL=""
-       fi])
-
-if test x$LIBTOOL != x; then
-       DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
-       DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
-
-       LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
-       LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
-
-       LIBCUPS="libcups.la"
-       LIBCUPSSTATIC="libcups.la"
-       LIBCUPSCGI="libcupscgi.la"
-       LIBCUPSIMAGE="libcupsimage.la"
-       LIBCUPSMIME="libcupsmime.la"
-       LIBCUPSPPDC="libcupsppdc.la"
-
-       LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
-       LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
-       LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
-
-       LINKCUPS="../cups/\$(LIBCUPS)"
-       LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
-
-else
-       LD_CC="\$(CC)"
-       LD_CXX="\$(CXX)"
-
-       LIBTOOL_CC=""
-       LIBTOOL_CXX=""
-       LIBTOOL_INSTALL=""
-fi
-
-AC_SUBST(LD_CC)
-AC_SUBST(LD_CXX)
-
-AC_SUBST(LIBTOOL)
-AC_SUBST(LIBTOOL_CC)
-AC_SUBST(LIBTOOL_CXX)
-AC_SUBST(LIBTOOL_INSTALL)
+AC_ARG_ENABLE([libtool_unsupported], AS_HELP_STRING([--enable-libtool-unsupported=/path/to/libtool], [build with libtool (UNSUPPORTED)]), [
+    AS_IF([test x$enable_libtool_unsupported != xno], [
+       AS_IF([test x$enable_libtool_unsupported = xyes], [
+           AC_MSG_ERROR([Use --enable-libtool-unsupported=/path/to/libtool.])
+       ])
+       LIBTOOL="$enable_libtool_unsupported"
+       enable_shared="no"
+       AC_MSG_WARN([WARNING: libtool is not supported.])
+    ], [
+       LIBTOOL=""
+    ])
+])
+
+AS_IF([test x$LIBTOOL != x], [
+    DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
+    DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+
+    LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
+    LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+
+    LIBCUPS="libcups.la"
+    LIBCUPSSTATIC="libcups.la"
+    LIBCUPSCGI="libcupscgi.la"
+    LIBCUPSIMAGE="libcupsimage.la"
+    LIBCUPSMIME="libcupsmime.la"
+    LIBCUPSPPDC="libcupsppdc.la"
+
+    LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
+    LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
+    LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
+
+    LINKCUPS="../cups/\$(LIBCUPS)"
+    LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
+], [
+    LD_CC="\$(CC)"
+    LD_CXX="\$(CXX)"
+
+    LIBTOOL_CC=""
+    LIBTOOL_CXX=""
+    LIBTOOL_INSTALL=""
+])
+
+AC_SUBST([LD_CC])
+AC_SUBST([LD_CXX])
+
+AC_SUBST([LIBTOOL])
+AC_SUBST([LIBTOOL_CC])
+AC_SUBST([LIBTOOL_CXX])
+AC_SUBST([LIBTOOL_INSTALL])
index 54ad2a1178a71d7766636b06ea1e74ea20208cd1..61bc807ca32e97d4f50cdcc9ddf2d767f65e217c 100755 (executable)
--- a/configure
+++ b/configure
@@ -1583,7 +1583,7 @@ Optional Features:
   --disable-dbus          build without DBUS support
   --disable-shared        do not create shared libraries
   --enable-libtool-unsupported=/path/to/libtool
-                          build with libtool (UNSUPPORTED!)
+                          build with libtool (UNSUPPORTED)
   --enable-debug          build with debugging symbols
   --enable-debug-guards   build with memory allocation guards
   --enable-debug-printfs  build with CUPS_DEBUG_LOG support
@@ -7694,48 +7694,62 @@ fi
 # Check whether --enable-libtool_unsupported was given.
 if test ${enable_libtool_unsupported+y}
 then :
-  enableval=$enable_libtool_unsupported; if test x$enable_libtool_unsupported != xno; then
-               if test x$enable_libtool_unsupported == xyes; then
-                       as_fn_error $? "Use --enable-libtool-unsupported=/path/to/libtool." "$LINENO" 5
-               fi
-               LIBTOOL="$enable_libtool_unsupported"
-               enable_shared=no
-               echo "WARNING: libtool is not supported or endorsed by Apple Inc."
-               echo "         WE DO NOT PROVIDE SUPPORT FOR LIBTOOL PROBLEMS."
-       else
-               LIBTOOL=""
-       fi
+  enableval=$enable_libtool_unsupported;
+    if test x$enable_libtool_unsupported != xno
+then :
+
+       if test x$enable_libtool_unsupported = xyes
+then :
+
+           as_fn_error $? "Use --enable-libtool-unsupported=/path/to/libtool." "$LINENO" 5
+
 fi
+       LIBTOOL="$enable_libtool_unsupported"
+       enable_shared="no"
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: WARNING: libtool is not supported." >&5
+printf "%s\n" "$as_me: WARNING: WARNING: libtool is not supported." >&2;}
 
+else $as_nop
 
-if test x$LIBTOOL != x; then
-       DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
-       DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+       LIBTOOL=""
 
-       LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
-       LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+fi
 
-       LIBCUPS="libcups.la"
-       LIBCUPSSTATIC="libcups.la"
-       LIBCUPSCGI="libcupscgi.la"
-       LIBCUPSIMAGE="libcupsimage.la"
-       LIBCUPSMIME="libcupsmime.la"
-       LIBCUPSPPDC="libcupsppdc.la"
+fi
 
-       LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
-       LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
-       LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
 
-       LINKCUPS="../cups/\$(LIBCUPS)"
-       LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
+if test x$LIBTOOL != x
+then :
 
-else
-       LD_CC="\$(CC)"
-       LD_CXX="\$(CXX)"
+    DSO="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
+    DSOXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+
+    LD_CC="\$(LIBTOOL) --mode=link --tag=CC ${CC}"
+    LD_CXX="\$(LIBTOOL) --mode=link --tag=CXX ${CXX}"
+
+    LIBCUPS="libcups.la"
+    LIBCUPSSTATIC="libcups.la"
+    LIBCUPSCGI="libcupscgi.la"
+    LIBCUPSIMAGE="libcupsimage.la"
+    LIBCUPSMIME="libcupsmime.la"
+    LIBCUPSPPDC="libcupsppdc.la"
+
+    LIBTOOL_CC="\$(LIBTOOL) --mode=compile --tag=CC"
+    LIBTOOL_CXX="\$(LIBTOOL) --mode=compile --tag=CXX"
+    LIBTOOL_INSTALL="\$(LIBTOOL) --mode=install"
+
+    LINKCUPS="../cups/\$(LIBCUPS)"
+    LINKCUPSIMAGE="../cups/\$(LIBCUPSIMAGE)"
+
+else $as_nop
+
+    LD_CC="\$(CC)"
+    LD_CXX="\$(CXX)"
+
+    LIBTOOL_CC=""
+    LIBTOOL_CXX=""
+    LIBTOOL_INSTALL=""
 
-       LIBTOOL_CC=""
-       LIBTOOL_CXX=""
-       LIBTOOL_INSTALL=""
 fi