diff options
Diffstat (limited to 'adk')
-rw-r--r-- | adk/config/Makefile | 51 | ||||
-rw-r--r-- | adk/config/lxdialog/check-lxdialog.sh | 17 | ||||
-rw-r--r-- | adk/extlinux/extlinux.conf | 0 | ||||
-rw-r--r-- | adk/tools/depmaker.c | 4 | ||||
-rw-r--r-- | adk/tools/pkgmaker.c | 60 |
5 files changed, 61 insertions, 71 deletions
diff --git a/adk/config/Makefile b/adk/config/Makefile index 480c31447..a328fbf59 100644 --- a/adk/config/Makefile +++ b/adk/config/Makefile @@ -8,58 +8,11 @@ include ${ADK_TOPDIR}/rules.mk endif CP=cp -fpR -HOST_CFLAGS+=-DKBUILD_NO_NLS -w +HOST_CFLAGS+= -DKBUILD_NO_NLS -w ${CURSES_CFLAGS} +LIBS= ${CURSES_LIBS} all: ncurses conf mconf -LIBS= -ifeq (/usr/lib/libtinfo.so, $(wildcard /usr/lib/libtinfo.so)) -LIBS= -ltinfo -endif - -ifeq (/usr/include/ncursesw/curses.h, $(wildcard /usr/include/ncursesw/curses.h)) -HOST_CFLAGS+= -I/usr/include/ncursesw -DCURSES_LOC="<curses.h>" -LIBS+= -lncursesw -else -ifeq (/usr/include/ncurses/ncurses.h, $(wildcard /usr/include/ncurses/ncurses.h)) -HOST_CFLAGS+= -I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>" -LIBS+= -lncurses -else -ifeq (/usr/include/ncurses/curses.h, $(wildcard /usr/include/ncurses/curses.h)) -HOST_CFLAGS+= -I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>" -LIBS+= -lncurses -else -ifeq (/usr/include/ncurses.h, $(wildcard /usr/include/ncurses.h)) -HOST_CFLAGS+= -DCURSES_LOC="<ncurses.h>" -LIBS+= -lncurses -else -ifeq (/usr/local/include/ncurses/ncurses.h, $(wildcard /usr/local/include/ncurses/ncurses.h)) -HOST_CFLAGS+= -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses.h>" -LIBS+= -lncurses -else -ifeq (/usr/local/include/ncurses/curses.h, $(wildcard /usr/local/include/ncurses/curses.h)) -HOST_CFLAGS+= -I/usr/local/include/ncurses -DCURSES_LOC="<ncurses/curses.h>" -LIBS+= -lncurses -else -ifeq (/usr/local/opt/ncurses/include/ncursesw/ncurses.h, $(wildcard /usr/local/opt/ncurses/include/ncursesw/ncurses.h)) -HOST_CFLAGS+= -I/usr/local/opt/ncurses/include -DCURSES_LOC="<ncursesw/ncurses.h>" -LIBS+= -L/usr/local/opt/ncurses/lib -Wl,-rpath -Wl,/usr/local/opt/ncurses/lib -lncursesw -else -ifeq (/usr/pkg/include/ncurses.h, $(wildcard /usr/pkg/include/ncurses.h)) -HOST_CFLAGS+= -I/usr/pkg/include -DCURSES_LOC="<ncurses.h>" -LIBS+= -L/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib -lncurses -else -HOST_CFLAGS+= -DCURSES_LOC="<curses.h>" -LIBS= -lcurses -endif -endif -endif -endif -endif -endif -endif -endif - CONF_SRC =conf.c MCONF_SRC =mconf.c $(wildcard lxdialog/*.c) SHARED_SRC=zconf.tab.c diff --git a/adk/config/lxdialog/check-lxdialog.sh b/adk/config/lxdialog/check-lxdialog.sh index fcef0f59d..5075ebf2d 100644 --- a/adk/config/lxdialog/check-lxdialog.sh +++ b/adk/config/lxdialog/check-lxdialog.sh @@ -4,7 +4,9 @@ # What library to link ldflags() { - for ext in so a dylib ; do + pkg-config --libs ncursesw 2>/dev/null && exit + pkg-config --libs ncurses 2>/dev/null && exit + for ext in so a dll.a dylib ; do for lib in ncursesw ncurses curses ; do $cc -print-file-name=lib${lib}.${ext} | grep -q / if [ $? -eq 0 ]; then @@ -19,10 +21,17 @@ ldflags() # Where is ncurses.h? ccflags() { - if [ -f /usr/include/ncurses/ncurses.h ]; then + if pkg-config --cflags ncursesw 2>/dev/null; then + echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1' + elif pkg-config --cflags ncurses 2>/dev/null; then + echo '-DCURSES_LOC="<ncurses.h>"' + elif [ -f /usr/include/ncursesw/curses.h ]; then + echo '-I/usr/include/ncursesw -DCURSES_LOC="<curses.h>"' + echo ' -DNCURSES_WIDECHAR=1' + elif [ -f /usr/include/ncurses/ncurses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' elif [ -f /usr/include/ncurses/curses.h ]; then - echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' + echo '-I/usr/include/ncurses -DCURSES_LOC="<curses.h>"' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC="<ncurses.h>"' else @@ -36,7 +45,7 @@ trap "rm -f $tmp" 0 1 2 3 15 # Check if we can link to ncurses check() { - $cc -xc - -o $tmp 2>/dev/null <<'EOF' + $cc -x c - -o $tmp 2>/dev/null <<'EOF' #include CURSES_LOC main() {} EOF diff --git a/adk/extlinux/extlinux.conf b/adk/extlinux/extlinux.conf new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/adk/extlinux/extlinux.conf diff --git a/adk/tools/depmaker.c b/adk/tools/depmaker.c index 7b04b3781..609d95a6a 100644 --- a/adk/tools/depmaker.c +++ b/adk/tools/depmaker.c @@ -133,7 +133,6 @@ static char *parse_line(char *package, char *pkgvar, char *string, int checksym, } strncat(depvar, dep, strlen(dep)-5); if ((strncmp(depvar, "bc", 2) == 0) || - (strncmp(depvar, "bzip2", 5) == 0) || (strncmp(depvar, "file", 4) == 0) || (strncmp(depvar, "gawk", 4) == 0) || (strncmp(depvar, "grep", 4) == 0) || @@ -277,6 +276,8 @@ int main() { tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 2, &prefix); } else if (strncmp("MUSL", dpkg, 4) == 0) { tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 2, &prefix); + } else if (strncmp("GLIBC", dpkg, 5) == 0) { + tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 2, &prefix); } else { tmp = parse_line(pkgdirp->d_name, dpkg, stringtmp, 1, 0, 1, &prefix); } @@ -339,6 +340,7 @@ int main() { } } } else if (strncmp(buf, "HOST_BUILDDEP", 13) == 0) { + //printf("DEBUG: HOST_BUILDDEP found for %s\n", pkgdirp->d_name); asprintf(&string, "%s-host", pkgdirp->d_name); // check retval; string for NULL tmp = parse_line(string, NULL, buf, 2, 0, 0, &hprefix); diff --git a/adk/tools/pkgmaker.c b/adk/tools/pkgmaker.c index 451300548..30a0d11ca 100644 --- a/adk/tools/pkgmaker.c +++ b/adk/tools/pkgmaker.c @@ -19,6 +19,7 @@ #include <ctype.h> #include <dirent.h> +#include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <stdio.h> @@ -290,22 +291,44 @@ static char *tolowerstr(char *string) { static char *toupperstr(char *string) { + static char *sdup = NULL; + static int sduplen = 0; int i; - char *str; - + + if (!string) { + free(sdup); + sduplen = 0; + return NULL; + } + + if (sduplen <= strlen(string)) { + sduplen = strlen(string) + 1; + sdup = realloc(sdup, sduplen); + if (!sdup) + fatal_error("%s: memory allocation failed: %s\n", + __func__, strerror(errno)); + } + /* transform to uppercase variable name */ - str = strdup(string); - for (i=0; i<(int)strlen(str); i++) { - if (str[i] == '+') - str[i] = 'X'; - if (str[i] == '-') - str[i] = '_'; - /* remove negation here, useful for package host depends */ - if (str[i] == '!') - str[i] = '_'; - str[i] = toupper(str[i]); + for (i = 0; i < strlen(string) + 1; i++) { + switch (string[i]) { + case '+': + sdup[i] = 'X'; + break; + case '-': + sdup[i] = '_'; + break; + case '!': + sdup[i] = '_'; + break; + case '\0': + sdup[i] = '\0'; + break; + default: + sdup[i] = toupper(string[i]); + } } - return(str); + return sdup; } @@ -463,10 +486,12 @@ int main() { icfg = fopen(runtime, "a"); if (icfg == NULL) continue; - if (strncmp("busybox", sname, 7) == 0) - fprintf(icfg, "config ADK_RUNTIME_START_%s_%s\n", toupperstr(sname), toupperstr(sname2)); - else + if (strncmp("busybox", sname, 7) == 0) { + fprintf(icfg, "config ADK_RUNTIME_START_%s", toupperstr(sname)); + fprintf(icfg, "_%s\n", toupperstr(sname2)); + } else { fprintf(icfg, "config ADK_RUNTIME_START_%s\n", toupperstr(sname)); + } fprintf(icfg, "\tprompt \"Start %s on boot\"\n", sname2); fprintf(icfg, "\ttristate\n"); if (strncmp("busybox", sname, 7) == 0) @@ -813,7 +838,7 @@ int main() { if (result == 1) { val = strtok_r(hvalue, " ", &saveptr); while (val != NULL) { - fprintf(cfg, "\tselect ADK_KERNEL_%s\n", toupperstr(val)); + fprintf(cfg, "\tselect ADK_LINUX_KERNEL_%s\n", toupperstr(val)); val = strtok_r(NULL, " ", &saveptr); } } @@ -1282,6 +1307,7 @@ int main() { fatal_error("removing file failed."); } } + toupperstr(NULL); closedir(pkglistdir); return(0); } |