1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NAS200: A quick hint to compile pretty much anything

Discussion in 'Cisco/Linksys Network Storage Devices' started by jac_goudsmit, Oct 30, 2010.

  1. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    If you want to build a program to run on the NAS200 under my firmware, and the program has a "configure" script, here's a way to do it by using the prerules.mk file in the tree.

    Simply create a Makefile somewhere with the following text in it (adapted to your needs):

    # Define TOPDIR to be the relative or absolute path to the "source" directory
    # that's part of the Linksys/Sercomm/JacX source distribution
    # Include the file that defines all the paths to the C compiler, linker etc.
    include $(TOPDIR)/prerules.mk
    # Define a default target that runs the configure script of your package.
    # The definitions set by prerules.mk will make sure that the source will be
    # compiled with the correct compiler.
    # If you store this Makefile in your project, replace "/path/to/configure"
    # with "./configure"
    	/path/to/configure --target=i386-unknown-linux
    Next, run make in the directory where you stored the Makefile. This configures the package. After that, you can run make again to build the program.

    Note: if you create the Makefile in the directory of your project, it will probably get overwritten. This is probably okay in most cases because you should only need to run the configure script once.

    For more information, read John Calcote's book "Autotools: a Practitioner's Guide to Autoconf, Automake and Libtool" (also available as PDF and in print).


Share This Page