SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
2.99k stars 1.22k forks source link

Run configure outside of source directory #3781

Open flip111 opened 4 years ago

flip111 commented 4 years ago

It would be nice to be able to run configure outside of the source directory. Right now this doesn't seem to be possible, because of:

https://github.com/SynoCommunity/spksrc/blob/master/mk/spksrc.common.mk#L14

https://github.com/SynoCommunity/spksrc/blob/master/mk/spksrc.configure.mk#L50

One package that advises to build outside of the source directory into a separate build directory is gcc https://gcc.gnu.org/install/configure.html

hgy59 commented 4 years ago

The easy way to use a different path to run configure is adjusting the PKG_DIR. And may be you need a custom pre_configure step to create the build directory.

flip111 commented 4 years ago

@hgy59 when cd into a different PKG_DIR how can it find ./configure which is not in the current directory ?

hgy59 commented 4 years ago

A custom configure definition may look like this:

CONFIGURE_TARGET = gcc_custom_configure

.PHONY: gcc_custom_configure
gcc_custom_configure:
   $(RUN) mkdir objdir; cd objdir; $(WORK_DIR)/srcdir/configure $(CONFIGURE_ARGS)
flip111 commented 4 years ago

That looks like a nice command. When i add it it skips downloading the sources and handling the dependencies though .. maybe i've used your code in the wrong way or in the wrong location. I just put in the makefile of the package i'm making ..

th0ma7 commented 4 years ago

I had to do exactly that for libaom as it wouldn't build in source tree directly. A global solution for that would be a nice addition.

flip111 commented 4 years ago

@hgy59 could you please give the code you provided another look? i'm really stuck with this

th0ma7 commented 4 years ago

Have a look at th0ma7/spksrc under the ffmpeg-update-4.2 branch currently pending pull #3778 (discussion on that specifically in the pull details)

It's within the cross/libaom and uses cmake to build the libaom for AV1 codec. Note that this may not be the most elegant solution but ended-up working.

th0ma7 commented 1 year ago

@flip111 for your info, since then I've released a synocli-devel package containing LLVM along with other development tools (now available on synocommunity.com)

Did you ever achieved a sucessful gcc build? As this is something I never got to get working.