1.android已经自带pppd程序,所以就不用移植pppd了

2.下载rp-pppoe代码
  wget -c http://www.roaringpenguin.com/files/download/rp-pppoe-3.10.tar.gz

3.把rp-pppoe-3.10.tar.gz解压到android的 external目录下

4.cd external/rp-pppoe-3.10/src
  1) ./configure --host=arm-linux
  2) vi config.h
    一、注释掉 #define HAVE_SYS_UIO_H 1 要不然会提示重定义的警告
    二、如果提示 if.c:34:26: error: net/ethernet.h: No such file or directory
       注释掉 #define HAVE_NET_ETHERNET_H 1
    三、我的config.h 内容如下

-------------------- config.h ---------------------------------------------
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated automatically from configure.in by autoheader.  */
/* LIC: GPL */

/* Define to empty if the keyword does not work.  */
/* #undef const */

/* Define if you have that is POSIX.1 compatible.  */
#define HAVE_SYS_WAIT_H 1

/* Define to `int' if doesn't define.  */
/* #undef pid_t */

/* Define as the return type of signal handlers (int or void).  */
#define RETSIGTYPE void

/* Define if the setvbuf function takes the buffering type as its second
   argument and the buffer pointer as the third, as on System V
   before release 3.  */
/* #undef SETVBUF_REVERSED */

/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

/* Define if you can safely include both and .  */
#define TIME_WITH_SYS_TIME 1

/* Define if your declares struct tm.  */
/* #undef TM_IN_SYS_TIME */

#define HAVE_STRUCT_SOCKADDR_LL 1

/* The number of bytes in a unsigned int.  */
#define SIZEOF_UNSIGNED_INT 4

/* The number of bytes in a unsigned long.  */
#define SIZEOF_UNSIGNED_LONG 4

/* The number of bytes in a unsigned short.  */
#define SIZEOF_UNSIGNED_SHORT 2

/* Define if you have the select function.  */
#define HAVE_SELECT 1

/* Define if you have the socket function.  */
#define HAVE_SOCKET 1

/* Define if you have the strerror function.  */
#define HAVE_STRERROR 1

/* Define if you have the strtol function.  */
#define HAVE_STRTOL 1

/* Define if you have the header file.  */
#define HAVE_ASM_TYPES_H 1

/* Define if you have the header file.  */
#define HAVE_FCNTL_H 1

/* Define if you have the header file.  */
#define HAVE_GETOPT_H 1

/* Define if you have the header file.  */
#define HAVE_LINUX_IF_ETHER_H 1

/* Define if you have kernel-mode PPPoE in Linux file.  */
/* #undef HAVE_LINUX_KERNEL_PPPOE */

/* Define if you have the header file.  */
#define HAVE_LINUX_IF_PACKET_H 1

/* Define if you have the header file.  */
#define HAVE_LINUX_IF_PPPOX_H 1

/* Define if you have the header file.  */
/* #undef HAVE_NET_BPF_H */

/* Define if you have the header file.  */
#define HAVE_NET_IF_ARP_H 1

/* Define if you have the header file.  */
//#define HAVE_NET_ETHERNET_H 1

/* Define if you have the header file.  */
#define HAVE_NET_IF_H 1

/* Define if you have the header file.  */
#define HAVE_LINUX_IF_H 1

/* Define if you have the header file.  */
/* #undef HAVE_NET_IF_DL_H */

/* Define if you have the header file.  */
/* #undef HAVE_NET_IF_ETHER_H */

/* Define if you have the header file.  */
/* #undef HAVE_NET_IF_TYPES_H */

/* Define if you have the header file.  */
#define HAVE_NETINET_IF_ETHER_H 1

/* Define if you have the header file.  */
#define HAVE_NETPACKET_PACKET_H 1

/* Define if you have the header file.  */
#define HAVE_SYS_CDEFS_H 1

/* Define if you have the header file.  */
/* #undef HAVE_SYS_DLPI_H */

/* Define if you have the header file.  */
#define HAVE_SYS_IOCTL_H 1

/* Define if you have the header file.  */
#define HAVE_SYS_PARAM_H 1

/* Define if you have the header file.  */
#define HAVE_SYS_SOCKET_H 1

/* Define if you have the header file.  */
#define HAVE_SYS_TIME_H 1

/* Define if you have the header file.  */
//#define HAVE_SYS_UIO_H 1

/* Define if you have the header file.  */
#define HAVE_SYSLOG_H 1

/* Define if you have the header file.  */
#define HAVE_UNISTD_H 1

/* Define if you have the N_HDLC line discipline in linux/termios.h */
/* #undef HAVE_N_HDLC */

/* Define if bitfields are packed in reverse order */
#define PACK_BITFIELDS_REVERSED 1

/* Define to include debugging code */
#define DEBUGGING_ENABLED 1

/* Solaris moans if we don't do this... */
#ifdef __sun
#define __EXTENSIONS__ 1
#endif

-----------------------end of config.h -------------------------------------


5.external/rp-pppoe-3.10下创建Android.mk文件, 内容如下

-------------------- Android.mk --------------------------------------------
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=\
    src/pppoe.c \
    src/if.c \
    src/debug.c \
    src/common.c \
    src/ppp.c \
    src/discovery.c \


LOCAL_STATIC_LIBRARIES :=

LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := pppoe
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
LOCAL_CFLAGS += '-DVERSION="3.10"' \
    '-DPPPD_PATH="/system/bin/pppd"'

include $(BUILD_EXECUTABLE)

include $(call all-makefiles-under,$(LOCAL_PATH))

-------------------- end of Android.mk -------------------------------------



错误及解决方法:
1) /dev/pts/目录为空, pppoe 提示找不到文件 /dev.pts/0
  内核配置添加如下选项
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256


2) 提示 pppoe: read (asyncReadFromPPP): Session 8: I/O error
   把内核中PPPOE的所有选项都支持上就万事大吉了
# CONFIG_WAN is not set
CONFIG_PPP=y
CONFIG_PPP_MULTILINK=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=y
CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPP_MPPE=y
CONFIG_PPPOE=y
CONFIG_PPPOL2TP=y
CONFIG_PPPOLAC=y
CONFIG_PPPOPNS=y
# CONFIG_SLIP is not set
CONFIG_SLHC=y



参考文档:
1. http://blog.csdn.net/linweig/article/details/5481355


更多相关文章

  1. Duplicate jar entry [android/support/design/widget/Coordinat
  2. Android如何调用Google Web Search?
  3. Android如何调用Google Web Search?
  4. Android(安卓)Bundle类
  5. Adnroid单元测试
  6. TabHost随着输入法软键盘出现而上浮的问题
  7. Android(安卓)访问Http被限制解决方法
  8. android应用程序组件之间的通讯
  9. 修改 ActivityManagerService.java 去掉 android 系统报错和程序

随机推荐

  1. android ListView的常用事件
  2. android中wifi,蓝牙等常见设置的控制
  3. Android:指定分辨率和清晰度的图片压缩方
  4. Root权限下修改 Android 系统时间
  5. Android 打印函数调用堆栈调试
  6. android通过json生成视图
  7. Android联系人--群组分组查询
  8. 自制的android多渠道应用打包工具--RyApk
  9. Android Library Project 的使用小结以及
  10. 2013.12.03(9) ——— android ActionbarSh