Adds build files for libcups am: fe987091f8 am: ad908fe6b6
am: fdeadcf705

Change-Id: Ia0514464305a0f6ff090462012a403a1dc1e2e35
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..6c9a23a
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,48 @@
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_ARM_MODE := arm
+
+LOCAL_SRC_FILES := \
+      cups/array.c cups/auth.c cups/backchannel.c cups/backend.c \
+      cups/debug.c cups/dest.c cups/dest-job.c cups/dest-localization.c \
+      cups/dest-options.c cups/dir.c cups/encode.c cups/file.c \
+      cups/getdevices.c cups/getifaddrs.c cups/getputfile.c cups/globals.c \
+      cups/hash.c cups/http.c cups/http-addr.c cups/http-addrlist.c \
+      cups/http-support.c cups/ipp.c cups/ipp-support.c cups/langprintf.c \
+      cups/language.c cups/md5.c cups/md5passwd.c cups/notify.c \
+      cups/options.c cups/ppd.c cups/ppd-attr.c cups/ppd-cache.c \
+      cups/ppd-conflicts.c cups/ppd-custom.c cups/ppd-emit.c \
+      cups/ppd-localize.c cups/ppd-mark.c cups/ppd-page.c cups/ppd-util.c \
+      cups/pwg-media.c cups/request.c cups/sidechannel.c cups/snmp.c \
+      cups/snprintf.c cups/string.c cups/tempfile.c cups/thread.c \
+      cups/transcode.c cups/usersys.c cups/util.c filter/error.c filter/raster.c
+
+LOCAL_CFLAGS += \
+      -D_PPD_DEPRECATED= -Wextra -Wno-unused-parameter \
+      -Wno-sign-compare -Wno-missing-field-initializers -Wno-error \
+      -Wno-implicit-function-declaration
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+      $(LOCAL_PATH)/cups $(LOCAL_PATH)/filters $(LOCAL_PATH)
+
+LOCAL_C_INCLUDES := external/zlib
+
+LOCAL_MODULE := libcups
+LOCAL_MODULE_TAGS := optional
+LOCAL_LDLIBS += -lz -llog
+include $(BUILD_SHARED_LIBRARY)
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..ba24f78
--- /dev/null
+++ b/config.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _CUPS_CONFIG_H_
+#define _CUPS_CONFIG_H_
+
+#define CUPS_SVERSION "CUPS v2.2.1"
+#define CUPS_MINIMAL "CUPS/2.2.1"
+#define CUPS_DEFAULT_PRINTOPERATOR_AUTH "@SYSTEM"
+#define CUPS_DEFAULT_LOG_LEVEL "warn"
+#define CUPS_DEFAULT_BROWSE_LOCAL_PROTOCOLS "dnssd"
+#define CUPS_DEFAULT_IPP_PORT 631
+#define CUPS_DEFAULT_DOMAINSOCKET "/private/var/run/cupsd"
+#define CUPS_DATADIR "/usr/share/cups"
+#define CUPS_LOCALEDIR "/usr/share/locale"
+#define CUPS_SERVERBIN "/usr/lib/cups"
+#define CUPS_SERVERROOT "/etc/cups"
+#define CUPS_STATEDIR "/var/run/cups"
+#define HAVE_LIBZ 1
+#define HAVE_STDINT_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
+#define HAVE_LONG_LONG 1
+#ifdef HAVE_LONG_LONG
+#  define CUPS_LLFMT "%lld"
+#  define CUPS_LLCAST (long long)
+#else
+#  define CUPS_LLFMT "%ld"
+#  define CUPS_LLCAST (long)
+#endif /* HAVE_LONG_LONG */
+#define HAVE_STRDUP 1
+#define HAVE_GETEUID 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_SIGACTION 1
+#define HAVE_SECIDENTITYSEARCHCREATEWITHPOLICY 1
+#define HAVE_CSSMERRORSTRING 1
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETNAMEINFO 1
+#define HAVE_HSTRERROR 1
+#undef HAVE_RES_INIT
+#define HAVE_RESOLV_H 1
+#undef HAVE_PTHREAD_H
+#define CUPS_DEFAULT_GSSSERVICENAME "host"
+#define HAVE_POLL 1
+#define CUPS_RAND() random()
+#define CUPS_SRAND(v) srandom(v)
+
+#endif /* !_CUPS_CONFIG_H_ */
diff --git a/update_libcups.sh b/update_libcups.sh
index d289b61..c8c9118 100755
--- a/update_libcups.sh
+++ b/update_libcups.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-if [ "$1" -eq "" ]; then
+if [ -z "$1" ]; then
    echo "Please provide the source repo"
    exit -1
 else
@@ -52,6 +52,10 @@
        exit 1
     fi
 
+    # update version numbers in config.h
+    sed -i -e "s/^\(#.*CUPS_SVERSION\).*/\1 \"CUPS $NEW_REV\"/g" config.h
+    sed -i -e "s:^\(#.*CUPS_MINIMAL\).*:\1 \"CUPS/${NEW_REV#v}\":g" config.h
+
     git add -A
     git commit -m "Update libcups to $NEW_REV"