blob: 3b945934f649a9fd8c97599498f072d7ced552bb [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 172907f31d64da4c3f289a439fd605d2ab51b24a Mon Sep 17 00:00:00 2001
Patrick Williamsb48b7b42016-08-17 15:04:38 -05002From: Lei Maohui <leimaohui@cn.fujitsu.com>
3Date: Wed, 19 Aug 2015 12:17:03 +0900
4Subject: [PATCH] configure in cross
5
6Update the configure script to cross-compiling with OE. This hard-codes
7a few target paths, reworks a few tests to be more friendly for cross
8and drops other tests.
9
10Upstream-Status: Inappropriate [build system specific changes]
11
12---
13 src/configure.in | 66 ++++++++++++++------------------------------------------
14 1 file changed, 16 insertions(+), 50 deletions(-)
15
16diff --git a/src/configure.in b/src/configure.in
Brad Bishop316dfdd2018-06-25 12:45:53 -040017index 90a07df..1d30243 100644
Patrick Williamsb48b7b42016-08-17 15:04:38 -050018--- a/src/configure.in
19+++ b/src/configure.in
20@@ -5,6 +5,13 @@ AC_INIT(pppoe.c)
21 dnl pppd directory for kernel-mode PPPoE
22 PPPD_DIR=ppp-2.4.1.pppoe2
23
24+dnl hard code some paths
25+PPPD=/usr/sbin/pppd
26+ID=/usr/bin/id
27+ECHO=/bin/echo
28+AC_ARG_VAR(PPPD)
29+AC_ARG_VAR(ID)
30+
31 AC_CONFIG_HEADER(config.h)
32
33 AC_PREFIX_DEFAULT(/usr)
34@@ -45,7 +52,7 @@ ac_cv_struct_sockaddr_ll=no)
35 AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
36
37 if test "$ac_cv_struct_sockaddr_ll" = yes ; then
38-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
39+AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL])
40 fi
41
42 dnl Check for N_HDLC line discipline
Brad Bishop316dfdd2018-06-25 12:45:53 -040043@@ -58,7 +65,7 @@ AC_TRY_COMPILE([
Patrick Williamsb48b7b42016-08-17 15:04:38 -050044 ac_cv_n_hdlc=no)
45 AC_MSG_RESULT($ac_cv_n_hdlc)
46 if test "$ac_cv_n_hdlc" = yes ; then
47-AC_DEFINE(HAVE_N_HDLC)
48+AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC])
49 fi
50
51 AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
Brad Bishop316dfdd2018-06-25 12:45:53 -040052@@ -106,7 +113,7 @@ PPPD_INCDIR=""
Patrick Williamsb48b7b42016-08-17 15:04:38 -050053 if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
54 if test "$ac_cv_pluginpath" != no ; then
55 LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
56- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
57+ AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE])
58 PPPD_INCDIR=$ac_cv_pluginpath
59 fi
60 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040061@@ -116,7 +123,7 @@ if test "$PPPD_INCDIR" = "" ; then
Patrick Williamsb48b7b42016-08-17 15:04:38 -050062 fi
63
64 if test "$ac_cv_debugging" = "yes" ; then
65- AC_DEFINE(DEBUGGING_ENABLED)
66+ AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled])
67 fi
68
69 AC_SUBST(LINUX_KERNELMODE_PLUGIN)
Brad Bishop316dfdd2018-06-25 12:45:53 -040070@@ -142,15 +149,8 @@ AC_CHECK_SIZEOF(unsigned short)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050071 AC_CHECK_SIZEOF(unsigned int)
72 AC_CHECK_SIZEOF(unsigned long)
73
74-dnl Check for location of pppd
75-AC_PATH_PROG(PPPD, pppd, NOTFOUND, $PATH:/sbin:/usr/sbin:/usr/local/sbin)
76-AC_PATH_PROG(ECHO, echo, echo)
77-
78-dnl Check for setsid (probably Linux-specific)
79-AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin)
80-
81 dnl Check for an "id" which accepts "-u" option -- hack for Solaris.
82-AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
83+dnl AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
84
85 dnl Check for Linux-specific kernel support for PPPoE
86 AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
Brad Bishop316dfdd2018-06-25 12:45:53 -040087@@ -195,44 +195,8 @@ if test "$GCC" = yes; then
Patrick Williamsb48b7b42016-08-17 15:04:38 -050088 CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes"
89 fi
90
91-dnl If we couldn't find pppd, die
92-if test "$PPPD" = "NOTFOUND"; then
93- AC_MSG_WARN([*** Oops! I couldn't find pppd, the PPP daemon anywhere.])
94- AC_MSG_WARN([*** You must install pppd, version 2.3.10 or later.])
95- AC_MSG_WARN([*** I will keep going, but it may not work.])
96- PPPD=pppd
97-fi
98-
99-dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than
100-dnl 2.3.7 -- stop
101-
102-PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'`
103-
104-case "$PPPD_VERSION" in
105-1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6)
106- AC_MSG_WARN([*** Oops! Your version of pppd is $PPPD_VERSION, which is too old.])
107- AC_MSG_WARN([*** You need at least 2.3.7 (2.3.10 or newer recommended.])
108- AC_MSG_WARN([*** I will keep going, but it may not work.])
109- ;;
110-
111-2.3.7|2.3.8|2.3.9)
112- AC_MSG_WARN([*** Warning. Your version of pppd is $PPPD_VERSION. You will])
113- AC_MSG_WARN([*** not be able to use connect-on-demand. Upgrade to pppd])
114- AC_MSG_WARN([*** 2.3.10 or newer if you need connect-on-demand.])
115- ;;
116-
117-2*|3*|4*|5*|6*|7*|8*|9*)
118- ;;
119-
120-*)
121- AC_MSG_WARN([*** Oops. I cannot figure out what version of pppd you have.])
122- AC_MSG_WARN([*** All I got back was '$PPPD_VERSION'])
123- AC_MSG_WARN([*** I will keep going, but it may not work.])
124- ;;
125-esac
126-
127 dnl Figure out packing order of structures
128-AC_MSG_CHECKING([packing order of bit fields])
129+AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[
130 if test "${rpppoe_cv_pack_bitfields+set}" != set ; then
131 AC_TRY_RUN([
132 union foo {
Brad Bishop316dfdd2018-06-25 12:45:53 -0400133@@ -259,10 +223,11 @@ main(void)
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500134 }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
135 $ECHO "no defaults for cross-compiling"; exit 0)
136 fi
137+])
138
139 if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
140 AC_MSG_RESULT(reversed)
141- AC_DEFINE(PACK_BITFIELDS_REVERSED)
142+ AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields])
143 else
144 AC_MSG_RESULT(normal)
145 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -0400146@@ -326,6 +291,7 @@ AC_SUBST(PPPOE_SERVER_DEPS)
Patrick Williamsb48b7b42016-08-17 15:04:38 -0500147 AC_SUBST(RDYNAMIC)
148 AC_SUBST(LIBEVENT)
149 AC_SUBST(ECHO)
150+AC_SUBST(HAVE_STRUCT_SOCKADDR_LL)
151 AC_SUBST(LDFLAGS)
152
153 datadir_evaluated=`eval echo $datadir`