Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
Remove projects/sample.
Browse files Browse the repository at this point in the history
As an example that was not actually being used, it suffered from a slow bitrot.

The two main issues with it were that it had no cmake support and
included a copy of the autoconf directory. The reality is that
autoconf is not easily composable. The lack of composabilty is why we
have clang options in llvm's configure. Suggesting that users include
a copy of autoconf/ in their projects seems a bad idea.

We are also in the process of switching to cmake, so pushing autoconf
to new project is probably not what we want.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203728 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
espindola committed Mar 12, 2014
1 parent 1da4b5b commit 9802a6c
Show file tree
Hide file tree
Showing 50 changed files with 7 additions and 27,470 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -37,7 +37,6 @@ compile_commands.json
#==============================================================================#
# External projects that are tracked independently.
projects/*
!projects/sample
!projects/CMakeLists.txt
!projects/Makefile
# Clang, which is tracked independently.
Expand Down
1 change: 0 additions & 1 deletion LICENSE.TXT
Expand Up @@ -63,7 +63,6 @@ Program Directory
------- ---------
Autoconf llvm/autoconf
llvm/projects/ModuleMaker/autoconf
llvm/projects/sample/autoconf
Google Test llvm/utils/unittest/googletest
OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
Expand Down
1 change: 0 additions & 1 deletion autoconf/configure.ac
Expand Up @@ -166,7 +166,6 @@ for i in `ls ${srcdir}/projects`
do
if test -d ${srcdir}/projects/${i} ; then
case ${i} in
sample) AC_CONFIG_SUBDIRS([projects/sample]) ;;
safecode) AC_CONFIG_SUBDIRS([projects/safecode]) ;;
compiler-rt) ;;
test-suite) ;;
Expand Down
3 changes: 0 additions & 3 deletions configure
Expand Up @@ -823,7 +823,6 @@ ac_subdirs_all='projects/test-suite
projects/llvm-test
projects/poolalloc
projects/llvm-poolalloc
projects/sample
projects/safecode
tools/polly'

Expand Down Expand Up @@ -3751,8 +3750,6 @@ for i in `ls ${srcdir}/projects`
do
if test -d ${srcdir}/projects/${i} ; then
case ${i} in
sample) subdirs="$subdirs projects/sample"
;;
safecode) subdirs="$subdirs projects/safecode"
;;
compiler-rt) ;;
Expand Down
3 changes: 1 addition & 2 deletions docs/GarbageCollection.rst
Expand Up @@ -500,8 +500,7 @@ This boilerplate collector does nothing. More specifically:

* The stack map is not compiled into the executable.

Using the LLVM makefiles (like the `sample project
<http://llvm.org/viewvc/llvm-project/llvm/trunk/projects/sample/>`__), this code
Using the LLVM makefiles, this code
can be compiled as a plugin using a simple makefile:

.. code-block:: make
Expand Down
3 changes: 1 addition & 2 deletions docs/GettingStarted.rst
Expand Up @@ -1078,8 +1078,7 @@ different `tools`_.

This directory contains projects that are not strictly part of LLVM but are
shipped with LLVM. This is also the directory where you should create your own
LLVM-based projects. See ``llvm/projects/sample`` for an example of how to set
up your own project.
LLVM-based projects.

``llvm/runtime``
----------------
Expand Down
4 changes: 1 addition & 3 deletions docs/MakefileGuide.rst
Expand Up @@ -47,9 +47,7 @@ quickly by utilizing the built-in features that are used to compile LLVM. LLVM
compiles itself using the same features of the makefile system as used for
projects.

For complete details on setting up your projects configuration, simply mimic the
``llvm/projects/sample`` project. Or for further details, consult the
`Projects <Projects.html>`_ page.
For further details, consult the `Projects <Projects.html>`_ page.

Variable Values
---------------
Expand Down
74 changes: 4 additions & 70 deletions docs/Projects.rst
Expand Up @@ -37,82 +37,16 @@ There are two ways that you can set all of these variables:
of LLVM, and the ability to support multiple object directories from a single
source directory.

This document assumes that you will base your project on the LLVM sample project
found in ``llvm/projects/sample``. If you want to devise your own build system,
studying the sample project and LLVM ``Makefiles`` will probably provide enough
information on how to write your own ``Makefiles``.

Create a Project from the Sample Project
========================================

Follow these simple steps to start your project:

1. Copy the ``llvm/projects/sample`` directory to any place of your choosing.
You can place it anywhere you like. Rename the directory to match the name
of your project.

2. If you downloaded LLVM using Subversion, remove all the directories named
``.svn`` (and all the files therein) from your project's new source tree.
This will keep Subversion from thinking that your project is inside
``llvm/trunk/projects/sample``.

3. Add your source code and Makefiles to your source tree.

4. If you want your project to be configured with the ``configure`` script then
you need to edit ``autoconf/configure.ac`` as follows:

* **AC_INIT** - Place the name of your project, its version number and a
contact email address for your project as the arguments to this macro

* **AC_CONFIG_AUX_DIR** - If your project isn't in the ``llvm/projects``
directory then you might need to adjust this so that it specifies a
relative path to the ``llvm/autoconf`` directory.

* **LLVM_CONFIG_PROJECT** - Just leave this alone.

* **AC_CONFIG_SRCDIR** - Specify a path to a file name that identifies your
project; or just leave it at ``Makefile.common.in``.

* **AC_CONFIG_FILES** - Do not change.

* **AC_CONFIG_MAKEFILE** - Use one of these macros for each Makefile that
your project uses. This macro arranges for your makefiles to be copied from
the source directory, unmodified, to the build directory.

5. After updating ``autoconf/configure.ac``, regenerate the configure script
with these commands. (You must be using ``Autoconf`` version 2.59 or later
and your ``aclocal`` version should be 1.9 or later.)

.. code-block:: bash
% cd autoconf
% ./AutoRegen.sh
6. Run ``configure`` in the directory in which you want to place object code.
Use the following options to tell your project where it can find LLVM:

``--with-llvmsrc=<directory>``
Tell your project where the LLVM source tree is located.

``--with-llvmobj=<directory>``
Tell your project where the LLVM object tree is located.

``--prefix=<directory>``
Tell your project where it should get installed.

That's it! Now all you have to do is type ``gmake`` (or ``make`` if you're on a
GNU/Linux system) in the root of your object directory, and your project should
build.
If you want to devise your own build system, studying other projects and LLVM
``Makefiles`` will probably provide enough information on how to write your own
``Makefiles``.

Source Tree Layout
==================

In order to use the LLVM build system, you will want to organize your source
code so that it can benefit from the build system's features. Mainly, you want
your source tree layout to look similar to the LLVM source tree layout. The
best way to do this is to just copy the project tree from
``llvm/projects/sample`` and modify it to meet your needs, but you can certainly
add to it if you want.
your source tree layout to look similar to the LLVM source tree layout.

Underneath your top level directory, you should have the following directories:

Expand Down
5 changes: 0 additions & 5 deletions projects/Makefile
Expand Up @@ -23,9 +23,4 @@ DIRS := $(filter-out libcxx,$(DIRS))
# DragonEgg may be checked out here but doesn't (yet) build directly.
DIRS := $(filter-out dragonegg,$(DIRS))

# Sparc cannot link shared libraries (libtool problem?)
ifeq ($(ARCH), Sparc)
DIRS := $(filter-out sample, $(DIRS))
endif

include $(PROJ_SRC_ROOT)/Makefile.rules
18 changes: 0 additions & 18 deletions projects/sample/Makefile

This file was deleted.

26 changes: 0 additions & 26 deletions projects/sample/Makefile.common.in

This file was deleted.

0 comments on commit 9802a6c

Please sign in to comment.