Fix the compile issues when no device is defined.
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Sat, 25 Aug 2012 16:57:40 +0000 (18:57 +0200)
committerDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Sat, 25 Aug 2012 17:00:30 +0000 (19:00 +0200)
Without that fix we have:
  prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/crespo/obj/SHARED_LIBRARIES/libhayes-ril_intermediates/hayes-ril.o: in function RIL_Init:hardware/ril/hayes-ril/hayes-ril.c:200: error: undefined reference to 'ril_device_register'

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Android.mk
device/dummy/dummy.c [new file with mode: 0644]

index ad5da7e..3728f87 100644 (file)
@@ -30,16 +30,14 @@ hayes_ril_files := \
 ifeq ($(TARGET_DEVICE),gta04)
        hayes_ril_device_files := device/gta04/gta04.c
        LOCAL_C_INCLUDES += $(LOCAL_PATH)/device/gta04/
-endif
-
-ifeq ($(TARGET_DEVICE),passion)
+elsif ($(TARGET_DEVICE),passion)
        hayes_ril_device_files := device/passion/passion.c
        LOCAL_C_INCLUDES += $(LOCAL_PATH)/device/passion/
-endif
-
-ifeq ($(TARGET_DEVICE),dream_sapphire)
+elsif ($(TARGET_DEVICE),dream_sapphire)
        hayes_ril_device_files := device/dream_sapphire/dream_sapphire.c
        LOCAL_C_INCLUDES += $(LOCAL_PATH)/device/dream_sapphire/
+else
+       hayes_ril_device_files := device/dummy/dummy.c
 endif
 
 LOCAL_SRC_FILES := $(hayes_ril_files) $(hayes_ril_device_files)
diff --git a/device/dummy/dummy.c b/device/dummy/dummy.c
new file mode 100644 (file)
index 0000000..46b6381
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * This file is part of hayes-ril.
+ *
+ * Copyright (C) 2012 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * 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.
+ */
+
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#define LOG_TAG "RIL-DEV"
+#include <utils/Log.h>
+
+#include <hayes-ril.h>
+
+struct ril_device dummy_device = {
+       .name = "Dummy",
+       .tag = "DUMMY",
+       .type = DEV_GSM,
+       .sdata = NULL,
+       .handlers = NULL,
+};
+
+void ril_device_register(struct ril_device **ril_device_p)
+{
+       *ril_device_p = &dummy_device;
+}