Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
rickard-green committed Jul 13, 2018
1 parent f7ec588 commit 2210e08
Show file tree
Hide file tree
Showing 31 changed files with 667 additions and 7,141 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ IDL-GENERATED
/doc/index.html
/doc/release_notes.html
/doc/notes.html
/doc/notes.xml
/lib/*/doc/html/*.html
/lib/*/doc/html/*.css
/lib/*/doc/html/js
Expand All @@ -70,6 +71,7 @@ IDL-GENERATED
/lib/*/doc/pdf/*.fo
/lib/*/doc/pdf/*.pdf
/lib/*/doc/xml/*.xml
/lib/*/doc/src/notes.xml

/lib/configure
/lib/config.log
Expand Down
95 changes: 69 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,83 @@
# %CopyrightEnd%
#
#

ifeq ($(ERL_TOP),)
$(error ERL_TOP needs to be set)
endif

OTP_CONF := $(shell $(MAKE) -f $(ERL_TOP)/Makefile erlang_inst_libdir_configured 1>/dev/null 2>/dev/null; echo $$?)
ifneq ($(OTP_CONF),0)
$(error Either there is no OTP source tree in $(ERL_TOP), the OTP version is too old, or the OTP source tree has not been configured)
endif

INST_DIR := $(shell $(MAKE) -f $(ERL_TOP)/Makefile erlang_inst_libdir_configured)

TARGET := $(shell $(MAKE) -f $(ERL_TOP)/Makefile target_configured)
include $(ERL_TOP)/make/target.mk
export TARGET
include $(ERL_TOP)/make/$(TARGET)/otp.mk

BOOTSTRAP_ROOT = $(ERL_TOP)
ifeq ($(TARGET),win32)
BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
else
BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
endif

ifneq ($(JAVA),)
HAVE_JAVAC := $(shell rm -f lib/ic/java_src/SKIP; echo true)
else
HAVE_JAVAC := $(shell echo "No Java compiler found" > lib/ic/java_src/SKIP; echo false)
endif

ifneq ($(RELEASE_ROOT),)
TESTROOT=$(RELEASE_ROOT)
endif

# ----------------------------------------------------
# Common Macros
# ----------------------------------------------------

SUB_DIRECTORIES = lib/ic lib/orber lib/cosEvent \
lib/cosTime lib/cosNotification lib/cosEventDomain \
lib/cosProperty lib/cosFileTransfer lib/cosTransactions \
doc
lib/cosProperty lib/cosFileTransfer lib/cosTransactions doc

SPECIAL_TARGETS =

TEST_SUB_DIRECTORIES = \
$(wildcard lib/*/test)

# ----------------------------------------------------
# Default Subdir Targets
# ----------------------------------------------------
.PHONY: debug opt lcnt release docs release_docs \
clean depend valgrind static_lib
.PHONY: debug opt release docs release_docs \
clean depend valgrind xmllint

opt debug lcnt release docs release_docs clean depend valgrind static_lib xmllint:
release: opt

release_docs: docs

opt debug release docs release_docs clean depend xmllint:
@set -e ; \
if test $(CROSS_COMPILING) = yes; then \
if test "$@" = opt || test "$@" = debug; then \
$(MAKE) -f $(ERL_TOP)/Makefile cross_check_erl; \
fi; \
fi; \
if test "$(TESTROOT)" = "" \
|| test ! -f "$(TESTROOT)/usr/include/erl_nif.h"; then \
is_otp_install=no; \
else \
if test ! -f "$(TESTROOT)/releases/$(SYSTEM_VSN)/OTP_VERSION"; then \
echo "ERROR: Trying to install into an OTP" 1>&2; \
echo " installation of different release" 1>&2; \
echo " than the OTP release used to build" 1>&2; \
echo " with." 1>&2; \
exit 1; \
fi; \
is_otp_install=yes; \
fi; \
for d in $(SUB_DIRECTORIES); do \
if test -f $$d/SKIP ; then \
echo "=== Skipping subdir $$d, reason:" ; \
Expand All @@ -51,35 +104,25 @@ opt debug lcnt release docs release_docs clean depend valgrind static_lib xmllin
if test ! -d $$d ; then \
echo "=== Skipping subdir $$d, it is missing" ; \
else \
(cd $$d && $(MAKE) $@) || exit $$? ; \
(cd $$d && \
PATH="$(BOOT_PREFIX)$${PATH}" $(MAKE) $@ \
TARGET=$(TARGET) ERL_TOP=$(ERL_TOP) \
TESTROOT=$(TESTROOT) \
IS_OTP_INSTALL=$$is_otp_install) || exit $$? ; \
fi ; \
fi ; \
done ;

install install-docs: TESTROOT=$(DESTDIR)$(shell $(MAKE) -f $(ERL_TOP)/Makefile erlang_inst_libdir_configured)

install: release

install-docs: release_docs

.PHONY: tests release_tests

tests release_tests:
@set -e ; \
for d in $(TEST_SUB_DIRECTORIES); do \
(cd $$d && $(MAKE) $@) || exit $$? ; \
done ;

# ----------------------------------------------------
# Configure Targets
# ----------------------------------------------------
autoconf:
@if [ -d "autom4te.cache" ]; then \
echo "=== cleaning autom4te.cache"; \
rm -f autom4te.cache/*; \
fi; \
echo "=== running autoconf"; \
autoconf; \
chmod 755 configure; \
chdr=`cat "configure.in" | sed -n "s|.*\(AC_CONFIG_HEADER\).*|\1|p"`;\
if [ "$chdr" = "AC_CONFIG_HEADER" ]; then \
echo "=== running autoheader"; \
autoheader; \
fi

configure: autoconf
./configure
61 changes: 39 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,46 @@ The following applications are a part of the corba package.
## Build
### Prerequisites

To build the *corba* repository one need a built version of OTP (e.g. erlc) and a
configured OTP source tree because the corba make files uses the OTP make system.
In order to build the `corba` applications, an OTP source tree of at least
version 21.0.3 is needed. This since `corba` utilize the OTP build system.

```
git clone https://github.com/erlang/otp.git
cd otp
./otp_build autoconf
./configure
make # Can be skipped if you have a prebuilt OTP (see below)
```

If you already have an installed OTP installation of the same release, you can
use that one instead of building OTP in the source tree. Note that you still
*need* to `configure` the source tree. Ensure that the already installed OTP
is available in the `PATH`. The recommended approach is however to build the
OTP source tree.

In order to cross compile `corba` the OTP source tree should be configured for
the cross compilation. For more info on cross compilation of Erlang/OTP see
the document [Cross Compiling Erlang/OTP](http://erlang.org/doc/installation_guide/INSTALL-CROSS.html).

### Compiling the source

The environment variable *ERL_TOP* should be set to the OTP source path
The environment variable `ERL_TOP` *need* to be set to the OTP source path
and then it's possible to compile corba from the source with the following
commands. (The configure is only for native build)
commands.

```
export ERL_TOP=<OTP source path>
git clone https://github.com/erlang/corba.git
cd corba
make configure
make
```

To release the applications set the *TESTROOT* to a directory of choice and
the run the following commands.
To release the applications set the `RELEASE_ROOT` to a directory of choice and
the run the following command.

```
export TESTROOT=<install path>
make release
make release RELEASE_ROOT=<install path>
```

And you will get the following structure there so for exmaple the
Expand All @@ -68,22 +76,25 @@ lib/
:
```

You can also install the `corba` applications directly into an existing
OTP installation either by using the `release` target or the `install`
target. When using the `install` target the `corba` installation will
use the same installation directory as configured in the OTP source tree.

### The documentation build

The dokumentation is build with the following commands.
The documentation is build with the following commands.

```
cd corba
make docs
```

To release it set the *TESTROOT* to a directory of choice and
To release it, set the `RELEASE_ROOT` to a directory of choice and
the run the following commands.

```
export TESTROOT=<install path>
make release_docs
make release_docs RELEASE_ROOT=<install path>
```

This gives the following structure on the release path, where
Expand All @@ -102,17 +113,24 @@ lib/
README.md
```

If you want to install the documentation into an existing OTP installation
you first have to build the documentation in the OTP source tree used
for building. After that, you can install the `corba` applications docs directly
into the OTP installation either by using the `release_docs` target or the
`install-docs` target. When using the `install-docs` target the `corba`
installation will use the same installation directory as configured in the
OTP source tree.

## Versions and tags

There is only one version for all applications included in the corba repository.
This means that if one uses the tag *corba-4.5* then all the included applications
have that version, e.g. orber-4.5, cosEvent-4.5 etc.
This means that if one uses the tag `4.5` then all the included applications
have that version, e.g. `orber-4.5`, `cosEvent-4.5` etc.

## Bug Reports

Please visit [bugs.erlang.org](https://bugs.erlang.org/issues/?jql=project%20%3D%20ERL) for
reporting bugs. The instructions for submitting bugs reports [can be found here](https://git
hub.com/erlang/otp/wiki/Bug-reports).
reporting bugs. The instructions for submitting bugs reports [can be found here](https://github.com/erlang/otp/wiki/Bug-reports).

### Security Disclosure

Expand All @@ -128,12 +146,11 @@ We appreciate your help!

## License

Erlang/OTP is released under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE
-2.0).
Erlang/Corba is released under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).

> %CopyrightBegin%
>
> Copyright Ericsson AB 2010-2017. All Rights Reserved.
> Copyright Ericsson AB 2018. All Rights Reserved.
>
> Licensed under the Apache License, Version 2.0 (the "License");
> you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 2210e08

Please sign in to comment.