android.mk LOCAL_MODULE_FILENAME should not contain extensions
Asked Answered
O

2

7

i am trying to build some of the files from libavcodec and libavutil

Following this, i created Android.mk file as below :

jni/Android.mk contains

LOCAL_PATH := $(call my-dir)

FFMPEG_TOP := $(LOCAL_PATH)

include $(CLEAR_VARS)

include $(FFMPEG_TOP)/libavutil/Android.mk
include $(FFMPEG_TOP)/libavcodec/Android.mk



LOCAL_PATH := $(FFMPEG_TOP)
LOCAL_MODULE := mylib
LOCAL_ARM_MODE := arm  # remove this if you want thumb mode
LOCAL_SRC_FILES := myfunc1.c myfunc2.c maincfunction.c 3rdparty1.c 3rdparty2.c

LOCAL_SRC_FILES += libavcodec.a libavutil.a

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

jni/libavcodec/Android.mk contains

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

SOURCE_H264_DECODER += h264.c h264idct.c h264pred.c h264_parser.c cabac.c
SOURCE_H264_ENCODER += h264enc.c h264dspenc.c

SOURCE_HAVE_ARM = \
    arm/dsputil_arm.c        \
    arm/dsputil_arm_s.S        \
    arm/jrevdct_arm.S \
    arm/mpegvideo_arm.c        \
    arm/simple_idct_arm.S

SOURCE_HAVE_ARMV5TE = \
    arm/mpegvideo_armv5te.c \
    arm/mpegvideo_armv5te_s.S \
    arm/simple_idct_armv5te.S

SOURCE_HAVE_ARMVFP = \
    arm/dsputil_vfp.S \
    arm/float_arm_vfp.S

SOURCE_HAVE_ARMV6 = arm/simple_idct_armv6.S

LOCAL_SRC_FILES := \
   allcodecs.c \
   audioconvert.c \
   bitstream.c \
   bitstream_filter.c \
   dsputil.c \
   eval.c \
   faanidct.c \
   imgconvert.c \
   jrevdct.c \
   opt.c \
   options.c \
   parser.c \
   raw.c \
   resample.c \
   resample2.c \
   simple_idct.c \
   utils.c

LOCAL_SRC_FILES += $(SOURCE_H263_ENCODER)                 
LOCAL_SRC_FILES += $(SOURCE_H264_DECODER)

LOCAL_SRC_FILES += $(SOURCE_HAVE_ARM)                
LOCAL_SRC_FILES += $(SOURCE_HAVE_ARMV5TE)                
LOCAL_SRC_FILES += $(SOURCE_HAVE_ARMVFP)

LOCAL_MODULE := libavcodec

LOCAL_PRELINK_MODULE := false


LOCAL_C_INCLUDES :=                           \
    $(FFMPEG_TOP)/                         \
    $(FFMPEG_TOP)/libavutil/                \
    $(LOCAL_PATH)                            \
    $(LOCAL_PATH)/arm/

LOCAL_CFLAGS += -O4 -mno-thumb-interwork -mno-thumb -marm -DHAVE_AV_CONFIG_H

include $(BUILD_STATIC_LIBRARY)    

jni/libavutil/Android.mk contains LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
   adler32.c \
   aes.c \
   avstring.c \
   base64.c \
   crc.c \
   des.c \
   fifo.c \
   intfloat_readwrite.c \
   lfg.c \
   lls.c \
   log.c \
   lzo.c \
   mathematics.c \
   md5.c \
   mem.c \
   random.c \
   random_seed.c \
   rational.c \
   rc4.c \
   sha1.c \
   tree.c \
   utils.c

LOCAL_MODULE := libavutil

LOCAL_PRELINK_MODULE := false

LOCAL_C_INCLUDES :=                                 \
    $(FFMPEG_TOP)/                                \
    $(LOCAL_PATH)                 \
    $(LOCAL_PATH)/arm/

LOCAL_CFLAGS += -O4 -mno-thumb-interwork -mno-thumb -marm -DHAVE_AV_CONFIG_H

include $(BUILD_STATIC_LIBRARY)

The problem addressed here is not relavant to what i am facing, though the error is similar.

The error i got is:

Android NDK: jni/inner/Android.mk:mylib: LOCAL_MODULE_FILENAME should not include file extensions
Android NDK: jni/inner/Android.mk:mylib: LOCAL_MODULE_FILENAME must not contain a file extension

Please help!! [So often i am meeting headless problems!!]

Ott answered 3/1, 2014 at 10:3 Comment(0)
C
12

You need to ensure that you call include $(CLEAR_VARS) after you include the make files which build your static libs. The auto generation of the module file name only works if that variable is empty, and your previous make file includes end up defining it when you call $include ($BUILD_STATIC_LIBRARY)

Cinnamon answered 24/2, 2015 at 23:55 Comment(0)
J
0

Try using LOCAL_MODULE_FILENAME := libavcodec LOCAL_MODULE_FILENAME += libavutil instead of LOCAL_SRC_FILES += libavcodec.a libavutil.a in your jni/Android.mk.

Jerry answered 19/12, 2014 at 5:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.