lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


THIS THREAD IS MY GUESSES WITHOUT REALLY BUILD AT AIX PLATFORM.

Hi, I am new to lua, and trying to cross-compile it to run at arm-linux.

And i read src/Makefile and find some places to update:

patch:

```diff
lua-5.4.3/src/Makefile
@@ -79,7 +79,7 @@ echo:
        @echo "PLAT= $(PLAT)"
        @echo "CC= $(CC)"
        @echo "CFLAGS= $(CFLAGS)"
-       @echo "LDFLAGS= $(SYSLDFLAGS)"
+       @echo "LDFLAGS= $(LDFLAGS)"
        @echo "LIBS= $(LIBS)"
        @echo "AR= $(AR)"
        @echo "RANLIB= $(RANLIB)"
@@ -99,7 +99,7 @@ guess:
        @$(MAKE) `$(UNAME)`

 AIX aix:
-       $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX
-DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall"
+       $(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_COMPAT_5_3
-DLUA_USE_POSIX -DLUA_USE_DLOPEN $(MYCFLAGS)" SYSLIBS="-ldl"
SYSLDFLAGS="-brtl -bexpall"

 bsd:
        $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN"
SYSLIBS="-Wl,-E"
```

reproduce:

```shell log
MBP2019:lua-5.4.3 $ cd src; make aix ALL=echo MYCFLAGS=-ff1 MYLDFLAGS=-ff2
/Library/Developer/CommandLineTools/usr/bin/make echo CC="xlc"
CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl"
SYSLDFLAGS="-brtl -bexpall"
PLAT= guess
CC= xlc
CFLAGS= -O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN
LDFLAGS= -brtl -bexpall
LIBS= -lm -ldl
AR= ar rcu
RANLIB= ranlib
RM= rm -f
UNAME= uname
```

It should print as below:
```shell log
CFLAGS= -O2 -DLUA_COMPAT_5_3 -DLUA_USE_POSIX -DLUA_USE_DLOPEN -ff1
LDFLAGS= -brtl -bexpall -ff2
```

PS: I wonder whether the reason that somebody doesn't replace CFLAGS
to SYSCFLAGS is that xlc don't support '-Wall -Wextra' args.

THIS THREAD IS MY GUESSES WITHOUT REALLY BUILD AT AIX PLATFORM.

BRs
// tjua