Skip to content

Android #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ testsuite
testsuite.dir
testsuite.log
vc-diffs
/.vs
26 changes: 26 additions & 0 deletions libltdl/Android/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
LOCAL_PATH := $(call my-dir)

# build the library
include $(CLEAR_VARS)
LOCAL_MODULE := ltdl

LOCAL_SRC_FILES := \
$(LOCAL_PATH)/../../loaders/dlopen.c \
$(LOCAL_PATH)/../../loaders/preopen.c \
$(LOCAL_PATH)/../../lt__alloc.c \
$(LOCAL_PATH)/../../lt__argz.c \
$(LOCAL_PATH)/../../lt__dirent.c \
$(LOCAL_PATH)/../../lt__strl.c \
$(LOCAL_PATH)/../../lt_dlloader.c \
$(LOCAL_PATH)/../../lt_error.c \
$(LOCAL_PATH)/../../ltdl.c \
$(LOCAL_PATH)/../../slist.c

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../.. \
$(LOCAL_PATH)/../../libltdl

LOCAL_CFLAGS := -DHAVE_CONFIG_H -DHAVE_LIBDL -W -Wall -O3 -fPIC -DPIC -DLTDL #-DSTDC_HEADERS
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl

include $(BUILD_SHARED_LIBRARY)
3 changes: 3 additions & 0 deletions libltdl/Android/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
APP_ABI := armeabi-v7a arm64-v8a x86
APP_PLATFORM := android-24
APP_STL := stlport_static
69 changes: 69 additions & 0 deletions libltdl/Android/jni/lt__argz.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* lt__argz.h -- internal argz interface for non-glibc systems

Copyright (C) 2004, 2007-2008, 2011-2019 Free Software Foundation,
Inc.
Written by Gary V. Vaughan, 2004

NOTE: The canonical source of this file is maintained with the
GNU Libtool package. Report bugs to [email protected].

GNU Libltdl is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

As a special exception to the GNU Lesser General Public License,
if you distribute this file as part of a program or library that
is built using GNU Libtool, you may include this file under the
same distribution terms that you use for the rest of that program.

GNU Libltdl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with GNU Libltdl; see the file COPYING.LIB. If not, a
copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
or obtained by writing to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#if !defined LT__ARGZ_H
#define LT__ARGZ_H 1

#include <stdlib.h>
#define __need_error_t
#include <errno.h>
#include <sys/types.h>

#if defined LTDL
# include "lt__glibc.h"
# include "lt_system.h"
#else
# define LT_SCOPE
#endif

#if defined __cplusplus
extern "C" {
#endif

LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len,
const char *buf, size_t buf_len);
LT_SCOPE error_t argz_create_sep(const char *str, int delim,
char **pargz, size_t *pargz_len);
LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len,
char *before, const char *entry);
LT_SCOPE char * argz_next (char *argz, size_t argz_len,
const char *entry);
LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep);

#if defined __cplusplus
}
#endif

#if !defined LTDL
# undef LT_SCOPE
#endif

#endif /*!defined LT__ARGZ_H*/
31 changes: 31 additions & 0 deletions libltdl/README.Android
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Requirements to build libltdl for Android
=========================================
- Android NDK for Windows
or
- Android NDK for Linux

Build steps on Windows
======================
1. Open cmd.exe console

2. Navigate to <libtool_root>\libltdl\Android\jni, for example:
cd "C:\Users\held\source\repos\laheller\libtool\libltdl\Android\jni"

3. Execute build by callink ndk-build.cmd, for example:
"E:\Android\NDK\android-ndk-r15c\ndk-build.cmd"

4. On successful build the output libraries will be located at:
<libtool_root>\libltdl\Android\libs\<ABI>\libltdl.so

Build steps on Linux (Ubuntu)
=============================
1. Open terminal

2. Navigate to <libtool_root>/libltdl/Android/jni, for example:
cd ~/libtool/libltdl/Android/jni

3. Execute build by callink ndk-build.cmd, for example on Ubuntu:
/usr/lib/android-ndk/ndk-build

4. On successful build the output libraries will be located at:
~/libtool/libltdl/Android/libs/<ABI>/libltdl.so